Jump to:

5542 Posts in 1739 Topics by 1225 members

Customising the CMS

SilverStripe Forums » Customising the CMS » jquery image gallery

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

Page: 1
Go to End
Author Topic: 1630 Views
  • rogerw
    Avatar
    Community Member
    4 Posts

    jquery image gallery Link to this post

    Hi

    I am trying to implement a jquery image gallery like jqgalscroll, but I can't get it to work. If I set it up with a plain html file, it works.

    Here is the required code http://benjaminsterling.com/jquery-jqgalscroll-photo-gallery

    This is what I have tried in SS:

    in /mysite/code/page.php

    Requirements::javascript('mysite/javascript/jqgalscroll.js');
    Requirements::javascript('http://code.jquery.com/jquery-latest.pack.js');
    Requirements::css('mysite/css/jqGalScroll.css');

    then I have put this function in /themes/mytheme/templates/page.ss

    <script type="text/javascript">
    $(document).ready(function() {
    $('#demoOne').jqGalScroll();
    });
    </script>

    and also tried to have it in my /mysite/code/page.php

    Requirements::customScript("
    (function($){
    $(document).ready(function() {
    $('#demoOne').jqGalScroll();
    });
    })(jQuery);
    ");

    Anyone here see what I am doing wrong?

  • UncleCheese
    Avatar
    4085 Posts

    Re: jquery image gallery Link to this post

    You should probably include the jquery framework first if your gallery plugin depends on it.

  • rogerw
    Avatar
    Community Member
    4 Posts

    Re: jquery image gallery Link to this post

    Yes, got it there... Requirements::javascript('http://code.jquery.com/jquery-latest.pack.js');

  • UncleCheese
    Avatar
    4085 Posts

    Re: jquery image gallery Link to this post

    But in your code it's below the jqgalscroll.js... right?

  • rogerw
    Avatar
    Community Member
    4 Posts

    Re: jquery image gallery Link to this post

    That was it, thank you thank you thank you... couldn't see it myself

    1630 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.