stevenwanderski / bxslider-4

Responsive jQuery content slider
Other
4.22k stars 1.85k forks source link

goToSlide from an external link #757

Open mauc opened 9 years ago

mauc commented 9 years ago

Is there a possibility to link to a certain slide from anothe page? Thank you for your help!

mauc commented 9 years ago

My solution for now: in the page where the slider is situated: var startingSlide=document.URL.substring(document.URL.lastIndexOf('?')+1)-1; and make startSlide: startingSlide instead of a slide number.

The link from the other page to a specific slide is like this: <a href="slidersite.html?5">specific slide</a>

Don't know if that's the best way, but it works.

Tidal-Wave commented 9 years ago

This is currently a decent way to do it because the slider needs to be initialized on page load and there isn't any sort of hash features. I will look into doing this in an update.

willfaulds commented 9 years ago

@Tidal-Wave encase of use -

I cam accross this little script which seems mostly unknown https://github.com/yeikos/jquery.history

Alternatives include:

http://benalman.com/projects/jquery-hashchange-plugin/ http://www.asual.com/jquery/address/ https://code.google.com/p/reallysimplehistory/