Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Dec 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    JS Conflict - HELP!

    I have these two JSs that conflict on the same page, can you guys help me out? Thanks in advance!
    Attached Files Attached Files

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,731
    Thanks
    202
    Thanked 2,508 Times in 2,486 Posts
    There are two reasons why multiple scripts in the same page will not work together.

    a) duplicate variable and/or function names (including loop counters etc.)
    b) multiple onload statements.
    Have a look at:-
    http://www.javascriptkit.com/javatut...iplejava.shtml
    http://www.dyn-web.com/tutorials/combine.php

    Using different Javascript frameworks often creates conflicts which are hard to to resolve.


    All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.

    All the code given in this post has been tested and is intended to address the question asked.
    Unless stated otherwise it is not just a demonstration.

  • #3
    The fat guy next door VIPStephan's Avatar
    Join Date
    Jan 2006
    Location
    Halle (Saale), Germany
    Posts
    8,478
    Thanks
    6
    Thanked 981 Times in 954 Posts
    The problem is definitely the use of different JS frameworks. Fancybox is jQuery, picasa viewer is mootools.

    Look into jQuery’s noconflict() function. If that’s all greek to you then you’re just not ready to use these tools yet and I can only recommend to either learn a little more about JavaScript and these frameworks or hire someone savvy to do the task.

  • #4
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,355
    Thanks
    11
    Thanked 558 Times in 551 Posts
    It's jQuery.noConflict()


  •  

    Posting Permissions

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