Jump to:

23478 Posts in 18941 Topics by 2878 members

General Questions

SilverStripe Forums » General Questions » JQuery Slideshow Woes

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 2055 Views
  • OutrunTheWolf
    Avatar
    Community Member
    34 Posts

    JQuery Slideshow Woes Link to this post

    Hi All,

    I am trying to get JQuery Slideshow working on a website.

    I just can't seem to get it to work, the images are not rotating, merely tile over one another, no effects.

    Here is my code as it is now.

    Homepage.php - Javascript requirements

       function init() {
       parent::init();
       Requirements::Javascript("mysite/javascript/slideshow.js");
       Requirements::Javascript("mysite/javascript/jquery.js");
       Requirements::customScript("
             $(document).ready(function() {
             $('#slideshow').slideshow({
                timeout: 2000,
                type: 'random',
                pauselink: 'pause1',
                pausecallback: function(self){
                   self.html('Play')
                },
                playcallback: function(self){
                   self.html('Pause');
                }
             });
             $('#slideshow2').slideshow({
                timeout: 2000,
                type: 'sequence',
                pauselink: 'pause2'
             });
        });
       ");
       }

    Homepage.ss - The Slideshow HTML

    <div id="slideshow">

    <a href="1"><img src="/../../../assets/darksideofthemoon.jpg" alt="" /></a>
    <a href="2"><img src="/../../../assets/absolution.jpg" alt="" /></a>
    <a href="3"><img src="/../../../assets/acertaintrigger.jpg" alt="" /></a>
    <a href="4"><img src="/../../../assets/liberationtransmission.jpg" alt="" /></a>
    <a href="5"><img src="/../../../assets/americanidiot.jpg" alt="" /></a>

    </div>

    I'm still a little clueless when it come to using Javascript with Silverstripe. Am I doing this right? If not, can anyone show me the exact way to implement this?

    Thanks

  • Taffy
    Avatar
    Community Member
    119 Posts

    Re: JQuery Slideshow Woes Link to this post

  • OutrunTheWolf
    Avatar
    Community Member
    34 Posts

    Re: JQuery Slideshow Woes Link to this post

    Yeah, thats the exact thing I want to do. The problem is I can't get it working.

    I need to know if my code is in the right place....

    Can anyone please help? I'm obviously missing something simple

    2055 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.