Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS

jquery image gallery


Reply

5 Posts   1641 Views

Avatar
rogerw

17 March 2009 at 7:51am Community Member, 4 Posts

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?

Avatar
UncleCheese

17 March 2009 at 9:39am 4085 Posts

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

Avatar
rogerw

17 March 2009 at 9:42am Community Member, 4 Posts

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

Avatar
UncleCheese

17 March 2009 at 9:44am 4085 Posts

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

Avatar
rogerw

17 March 2009 at 9:54am Community Member, 4 Posts

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