2

I'm far from proficient in JS, so please forgive any obvious oversights. I've been trying to use the API of the Supersized background slideshow plugin as part of a regular (element).click(function().

The API is documented here incl. the part seemingly important for my problem:

api.goTo( targetSlide ) Triggers transition to target slide number.

//Goes to slide #5    $(element).click(function(){ api.goTo(5); });

Based on this, I would shoot for the following code in order to have a div with class "button" load slide number 5:

$(document).ready(function(){

$(".button").click(function(){
  api.goTo(5);
});
});

This doesn't work - and the fact that the name of the plugin isn't anywhere in the code makes it obvious that the above code is lacking something. I just have no idea what. I also tried placing it in various locations within the plugin's source and themes - but no luck so far.

This is a related post I've found. However, the problem this person had was solved by modifying the plugin's theme in a manner that doesn't listen for the click event but rather is triggered by a function within the plugin. Still, I'm including it here as background info.

Any help would be greatly appreciated.

Community
  • 1
  • 1
Alexander
  • 21
  • 2
  • From what I can tell going through the documentation, what you typed out should be right. Can you 1) see if you are getting any Javascript errors in the console, and 2) share more of your code. Thanks! – hayesgm Aug 12 '11 at 10:30
  • Same problem here... Have you found a solution yet? – gstercken Aug 21 '11 at 19:37

1 Answers1

5

I stumbled upon the same problem - and then realized that I had downloaded SuperSized version 3.1.3 (the latest from the legacy versions here), and totally overlooked the download link for the current version (3.2.4 as of today). However, the API calls are only supported from 3.2 upward - so maybe you are experiencing the same problem?

After downloading the latest version, the very same code you posted worked just fine on my end.

gstercken
  • 3,223
  • 3
  • 20
  • 15
  • 1
    Oh shit, I just made the exact same error. That green "Download" link just looks like a heading. Thanks for the heads up! – Matt Andrews Sep 10 '11 at 16:38
  • 1
    What's also is strange, is that the latest download has 2 folders: core and slideshow. In the core folder is version 3.2.1 of the script. This has no API functions. In the slideshow folder is the 3.2.6 version of the script which include the api. – Rody Feb 16 '12 at 13:21