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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

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

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

Jquery slideshow conflict


Go to End


3 Posts   2227 Views

Avatar
stevanovich

Community Member, 63 Posts

5 July 2010 at 9:06pm

Edited: 05/07/2010 9:06pm

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

Forum Moderator, 5523 Posts

5 July 2010 at 10:08pm

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

Community Member, 1 Post

3 August 2010 at 9:14pm

Edited: 03/08/2010 9:15pm

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