Slidedeck for WordPress – linking to slides
You are currently browsing comments. If you would like to return to the full story, you can read the full entry here: “Slidedeck for Wordpress – linking to slides”.
You are currently browsing comments. If you would like to return to the full story, you can read the full entry here: “Slidedeck for Wordpress – linking to slides”.
Shane:
How timely; I have the same problem. I was planning to contact SlideDeck and did a Google search coming across your article. I would not have come up with your idea. I was stalled after trying the traditional <a href… method. Oddly, a couple of weeks ago I was able to use a link to get to the WordPress page and hitting the back key on my mouse brought me back to the slide. The back button on my browser just brought me back to the page where the SlideDeck slider was at. But I can't do it now. Maybe the SlideDeck update took it away; just a guess. Look forward to getting your idea implemented. Thanks, TDR
Shane:
FYI, been working on it but right now I’m brought back to the 1st slide on the page where the SlideDeck is at. Must have something to do with my use of vertical slides (i.e. Welcome slide, a group of 5 verticals, and another group of 5 verticals. Maybe you’ll have a chance to consider how to do it. Maybe I’m missing something; can’t say for sure. Anyway, thanks for the effort, TDR
Hey TDR,
I am busy trying to figure out how to get to vert slides from the menu items so I will let you know here if I get it sorted.
Shane
Ok, so here is what is working for me in the head of header.php:
$(document).ready(function(){
var hash = document.location.hash;
if(hash){
hash = hash.split(‘#’)[1];
var slideIndex = hash.split(‘-’);
if(slideIndex.length > 1){
// horiz & vert
jQuery(‘.slidedeck’).slidedeck().goToVertical(slideIndex[1],slideIndex[0]);
}else{
// horiz only
jQuery(‘.slidedeck’).slidedeck().goTo(slideIndex[0]);
}
}
});
Hope this helps!
hi shane,
i’m trying your fix but not getting anywhere i’m afraid. I’m using the Pro version of Slidedeck and I have the script below in the header:
$(document).ready(function(){
jQuery(‘.slidedeck’).slidedeck().goTo(document.location.hash.replace(“#”,”"));
});
And I have this as the link code..
Go to Slide 2 by clicking slide 3
But nothing happens… i know i’m doing something wrong. Please help!!!
Could you have a look? Would really appreciate it. I have a test link at
http://www.liviah.com/tiger/menus
Hey,
I took a look and I think the problem is 2 fold. Firstly, your link needs to be an absolute link (ie. http://liviah.com/tiger/menus/#3) instead of just the anchor. Also the fix I used doesn’t work when linking from the same page as the slidedeck, only from another page. It’s not ideal, I know. I have been trying to figure out how to get Javascript to reload the page when the link is clicked, but so far I haven’t found a way.
If you just want to go to a slide from the page you are on I think this could help you out – http://www.dtelepathy.com/blog/secrets/extending-slidedeck-controlling-the-slide-deck
Hope that helps!
Hello. Stupid qquestion. Do i have to do something with the code in your example or do i just paste it as it is? That didnt work u see..
Ill be glad for an answer on this.
Cheers
Hey Heidi,
It should just work. Have you added the menu items in the WP custom menu section giving each one an anchor that corresponds to the slide number (ie. http://www.yoursite.com/about/#3)?
Thank you for answer!
Yes – or i tryed it as a link on a different page then the page the slider accures on. I used the link to the page with the slider and and then i added /#3 (example) So i turned op with “www.domain.com/pagewithslider/#3″ as the link
and i added the code bellow in my header of course. (header.php)
$(document).ready(function(){
jQuery(‘.slidedeck’).slidedeck().goTo(document.location.hash.replace(“#”,”"));
});
Any clues?
Hey, I’m not sure what the problem could be then. Have you put the javascript code inside of script tags? –
Can I see your page of code somewhere?
yes, its in script tags
Here is a screendump of the code in header.php: https://skitch.com/heidiskaar/ga22h/dreamweaver
Here is the code i used in the link: http://www.aptumftp.no/wp/nm/?page_id=11/#3
I thought you would have it in script tags, but I thought it was worth asking
Have you tried changing your wordpress permalinks to something like /%postname% so you don’t have the page ID’s etc in the url? I’m not sure if that will help, but it might be worth trying. Also I see the slidedeck is set to auto scroll through the slides. I’m not sure if that has anything to do with it not working?
I will try to take a look at the code when I have a chance.
hello again!
Tryed both and nope. ;/ Wierd.