View Full Version : Problems with javascript interfering with other javascript

08-11-2010, 04:17 PM
:confused: I have this home page with drop down menu at the top and I recently incorporated a slideshow and a scroll image gallery underneath.

The gallery and the slideshow work fine but the dropdown menu stop working (it doesn't show the submenus)

I found out that there is a javascript that some how ended up in the file and is interacting with all of the other javascripts. The slideshow is using 2 js which are: <script type="text/javascript" src="http://www.southsunbeads.com/website/slideshow/jquery-1.2.6.pack.js"></script>
<script type="text/javascript" src="http://www.southsunbeads.com/website/slideshow/simplegallery.js">

This one is used by the scroll image gallery: <script type="text/javascript" src="http://www.southsunbeads.com/website/carousel/stepcarousel.js">

There is a 3rd script that I don't remember calling, but it seems that is putting everything together and is the one that is affecting the menu of the home page: <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

Here is the url of the page: http://www.southsunbeads.com

Can someone help with this?

Thank you

08-11-2010, 05:27 PM
This may be difficult to deal with because it looks like you are using one or more server side includes to set this page up. However, the order of the scripts and styles needs to be changed, and extra markup that doesn't belong needs to be removed. The includes will need to be changed to achieve that. You may have to split one or more (I really cannot tell how many includes there are) includes into two or more to get the code to end up in the correct places. You may perhaps even need to rethink how and what you are including when and where.

You also need to ditch:

<script type="text/javascript" src="http://www.southsunbeads.com/website/slideshow/jquery-1.2.6.pack.js"></script>

and modify the simplegallery.js file. I will attach a demo .zip file. In it will be a workable page, with the scripts and styles ordered as they need to be, the one script that needs to be ditched removed. It also contains the modified version of the simplegallery.js file:


08-12-2010, 12:15 AM
Thanks a lot for your help. I'm using Magento as a CMS which I'm still not very familiar with, so I'm not sure of the includes we are using since this site was all designed by someone else.

I'll try to make the changes you've suggested. I'll hope it works.

Thank you