How do you handle JS Conficts?

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

How do you handle JS Conficts?

Post by simonmlewis »

We have several <script> tags on our admin page, that do various things.
I'm adding one for the chainlinks of dropbown <Select> options. But with the other scripts, this is being ignored.

I've read somewhere that you can add something to "cancel out" scripts, or something that will stop it conflicting.

How do you do it, and where does it go?
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: How do you handle JS Conficts?

Post by Celauran »

Have you looked at the scripts to determine where/why they're conflicting? I generally try to keep my JS together in one file, and only keep libraries (ie. jQuery, modernizr) in separate files.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: How do you handle JS Conficts?

Post by simonmlewis »

http://cssdeck.com/labs/css3-image-slider
Is there any way this script, can be made to "auto slide"???
I don't want to use nivo slider, I want this - but can it auto run???
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
simonmlewis
DevNet Master
Posts: 4435
Joined: Wed Oct 08, 2008 3:39 pm
Location: United Kingdom
Contact:

Re: How do you handle JS Conficts?

Post by simonmlewis »

Sorry I don't know what you mean about libraries.
On this particular page, some scripts must be run "locally" while some are in one file.
Nivo Slider is apparently a real sod for causing conflicts.
Love PHP. Love CSS. Love learning new tricks too.
All the best from the United Kingdom.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: How do you handle JS Conficts?

Post by Celauran »

The link you posted above is certainly not causing any conflicts; there's no JS. It's all CSS. You could definitely get it to auto-rotate by having a click event trigger based off a timer.
Post Reply