THe services page http://testingatenspree.com/elusmock2/service.html has 6 services and it should go to specific service to the slider. I tried anchor tag jump and added slider section with an id. so that on click of specific service that service of the slid should appear first
Asked
Active
Viewed 53 times
-1

pradeep Mishra
- 1
- 2
-
Have done it Thanks to link https://stackoverflow.com/questions/34539058/linking-to-a-certain-bootstrap-carousel-slide-from-another-page – pradeep Mishra Aug 20 '18 at 06:37
1 Answers
0
You can use the carousal index to set on page load which you can pass in anchor tag URL as query string like
<a class="services-ttl-anch" href="all-services.html?slide=2"></a>
and then in all-services page you need to get the query string "slide" value in load the slide with index like below:
$('#myCarousel').carousel(parseInt(getParameterByName('slide',window.location.href)));
To get query string value use below code:
function getParameterByName(name, url) {
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
}

Arun Kumar
- 885
- 5
- 11