Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Mar 2012
    Thanked 1 Time in 1 Post

    Multiple jQuery conflict

    Hi, I've been trying to find an answer to this question but I am having some trouble with it. I know it is probably a simple solution, but I'm pretty low on the Javascript pole.

    The problem I am having is that I have two separate jQuery scripts (or plugins): One for a drop down navigation menu, the other a image slider (or slideshow)

    I have looked at the Javascriptkit's tutorial on adding more than one javascript to a page, but the problem I am coming to is:

    I have one jQuery script (the navigation menu) That runs completely from the script: <script type="text/javascript" src="file name"></script>
    and there is no javascript commands in the actual HTML page.

    The other jQuery script (the Image slider) has its own: <script type="text/javascript" src="file name"></script>. But it also has a command in the HTML:
     <script type="text/javascript">
     $(document).ready(function() {
    	$('#slideshow').coinslider({ width: 900, navigation: false, delay: 5000 });
    Which calls it.

    My main problem that I am having is the tutorials I have seen are working with two scripts in the HTML page, but I only have the one (up above).

    I have the jQuery 1.4.2 file linked in the header, and I have made sure that both of the scripts are working. I put all the code for the navigation menu into my page,then tested it to make sure it works, then I add the code for the image slider, and when I test it again the image slide works while the navigation script does not.

    To be perfectly honest, I have spent a few hours looking for a solution and playing with the code to try and trip over a solution, and I have come up empty. So any help that you could give me would be absolutely awesome! Thanks for your time/help -Chris

    BTW: If I forgot to add something important just tell me I'll be watching for any reply's and I will answer back right away

  • #2
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Halle (Saale), Germany
    Thanked 1,009 Times in 982 Posts
    Quote Originally Posted by chrisf View Post
    BTW: If I forgot to add something important just tell me […]
    Yeah, you forgot to post the complete HTML source code of your page. I suspect you didn’t just include those two scripts on the page but also two versions of the jQuery library which is causing conflicts. Remove one reference to the jQuery core library and look what’s happening.

    But still, I’m just guessing here. It would be much easier if we knew the code.


    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts