10389 Posts in 2200 Topics by 1712 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 661 Views |
-
UserForms: Javascript Conflict

13 August 2011 at 8:18am
So I am using a variety of jquery scripts/plugins on my site. On most of the pages these work with no problem. But on my Contact page, all of these scripts break. I am assuming it has something to do with the Form's javascript.
On a related note, if I login to the SS admin interface and the Site Navigator appears on the front end, all of my scripts also break, on every page.
So is there anything that UserForm and SiteNavigator have in common that might cause all of my scripts to break?
Any ideas would be great.
Thanks!
-
Re: UserForms: Javascript Conflict

13 August 2011 at 3:05pm
Have you wrapped your javascript in closures? http://doc.silverstripe.org/sapphire/en/topics/javascript#custom-jquery-code. Normally that prevents most conflict errors.
-
Re: UserForms: Javascript Conflict

13 August 2011 at 11:48pm
It looks like I had one script that wasn't wrapped. That did the trick. Thank you!!
-
Re: UserForms: Javascript Conflict

14 August 2011 at 12:18am
Actually I am using one script, that when wrapped, still has a conflict with the SiteNavigator.
I am using this plugin: http://sorgalla.com/jcarousel/
And the script in my header looks something like this:
<script type="text/javascript">
(function($) {
$(document).ready(function(){
jQuery('#mycarousel01').jcarousel({
// Configuration goes here
});
jQuery('#mycarousel02').jcarousel({
// Configuration goes here
});
jQuery('#mycarousel03').jcarousel({
// Configuration goes here
});
jQuery('#mycarousel04').jcarousel({
// Configuration goes here
});
jQuery('#mycarousel05').jcarousel({
// Configuration goes here
});
jQuery('#mycarousel06').jcarousel({
// Configuration goes here
});
})
})(jQuery);
</script>It works fine when the SiteNavigator isn't present but displays as a list (as opposed to a slider) when you're logged into the admin.
Any suggestions would be great. Thanks!
| 661 Views | ||
|
Page:
1
|
Go to Top |


