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.

General Questions

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

Jquery slideshow conflict


Reply

3 Posts   1724 Views

Avatar
stevanovich

5 July 2010 at 9:06pm (Last edited: 5 July 2010 9:06pm), Community Member, 60 Posts

I have set up a slide show on all pages which takes images from special offers pages and lets them click through to the offer. All works fine apart from the userform contact page.

I am using hard links at the moment to js docs and the function below before I download and set up on live server.

The I notice the userform uses jquery, is this conflicting with the jquery in the slideshow. How do I get around this issue?

<!-- include jQuery library -->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<!-- include Cycle plugin -->
<script type="text/javascript" src="http://cloud.github.com/downloads/malsup/cycle/jquery.cycle.all.latest.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('.slideshow').cycle({
      fx: 'scrollUp' // choose your transition type, ex: fade, scrollUp, shuffle, etc...
   });
});
</script>

Avatar
Willr

5 July 2010 at 10:08pm Forum Moderator, 5511 Posts

You should use the <% require %> syntax to require files to prevent duplication. UDF will include the jquery from sapphire so for your slideshow you can do

<% require javascript(sapphire/thirdparty/jquery/jquery.js %>

Which will prevent duplication of the library inclusion. Or you can block the one UDF uses and Require the one off the google api

http://doc.silverstripe.org/requirements

Avatar
Kimbonz

3 August 2010 at 9:14pm (Last edited: 3 August 2010 9:15pm), Community Member, 1 Post

I am having a similar problems with a Jquery slideshow, I would like to know Will where your solution above is positioned? Should this be in the Page.ss file? I have tried this file location without success. My slide show works well on all pages except pages that have a form.

Frustrating