PDA

View Full Version : javascript conflict for menu and slideshow



herbyderby
08-10-2010, 09:09 PM
Greetings,

I am trying to implement two different "features" on a page using two scripts at DD:

1. Flex Level Drop Down Menu 1.1 (
http://www.dynamicdrive.com/dynamicindex1/flexdropdown.htm)


2. Ultimate Fade-in slideshow (v2.4) (
http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm

The menu all by itself works fine. When I add the slideshow feature, *bam* the menu ceases to function.

Here is the link to the attempt at using both simultaneously:
http://www.stillwaterdwellings.com/secret-squirrel/

I know it's a conflict of some kind. I am simply not versed enough in .js to figure this out.

Any help is appreciated, and thanks for your time.

herbyderby

azoomer
08-10-2010, 09:46 PM
What happens if you reverse the order of the links to these scripts ?
This is what you have now:

<script type="text/javascript" src="flexdropdown.js"></script>
<script type="text/javascript" src="fadeslideshow.js"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

Try to put jquery on top like this

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript" src="flexdropdown.js"></script>
<script type="text/javascript" src="fadeslideshow.js"></script>

herbyderby
08-10-2010, 10:45 PM
Fabulous! That did the trick.

I had no idea (obviously) there was a hierarchy of scripts when loading a page. I thought it just loaded them all.

I appreciate your time!

jscheuer1
08-11-2010, 03:01 AM
It's not a hierarchy exactly. There are various considerations, depending upon the situation. In this case both the menu and the slide show require jQuery, so it must be available (loaded) to them before they run (are loaded).