Skip to content Skip to sidebar Skip to footer

Link To A Particular Slide Of A Jquery Slider

So I'm using a very basic jquery slider (see a sample in action on this JSFiddle). I can click on links ('Slide A,' 'Slide B,' 'Slide C') on the page with the content slider to sl

Solution 1:

$(document).ready(function (){
  ...
  your old code
  ...

  if(window.location.hash) {
    // Fragment existsvar myhash = window.location.hash.substring(1);
    $("a[rel='" + myhash + "']").click();
  }
});

Then use fragments to link to a slide: http://yourhost.com/path/to/page.html#2

Update: Removed # from fragment before using it in the selector.

Post a Comment for "Link To A Particular Slide Of A Jquery Slider"