I'm using AnythingSlider. I have a link to a certain page and slide, like this:
<a href='http://sitename.com/pagename/#panel1-1'>Click Me</a>
Updated for clarity: the problem was that when I create a link like this, the direct link to the page & slide works when the link isn't on the page with the slide, but it doesn't work when it's on the same page as the slide. Since I have these links all over my site, and it's dynamic, I needed a way to be able to simply link to a slide, that would work on any page - including the page where the slide is.
I found a solution - I'm linking to the slide just as I was before, and then dynamically updating the action on that link for pages where the link appears on the same page as the slider.
** My solution (the gist I used to my site, edit to suit your purposes): **
//Get anythingslider links, and dynamically update them so that they jump to the slider
$("a").each(function(){
var pathname = window.location.pathname.replace(/^https?:\/\/critter.co/,'');
var link = this.href.replace(/^https?:\/\/critter.co/,'');
if(link.indexOf("/settings/home") == 0 && pathname.indexOf("/settings/home") == 0){
$(this).removeAttr("href");
slidenum = parseInt(link.charAt(link.length-1));
$(this).click(function(){
$("ul#slider").anythingSlider(link.charAt(link.length-1));
});
}
if(link.indexOf("/record/home") == 0 && pathname.indexOf("/record/home") == 0){
$(this).removeAttr("href");
slidenum = parseInt(link.charAt(link.length-1));
$(this).click(function(){
$("ul#slider").anythingSlider(link.charAt(link.length-1));
});
}
})