treehouse : what would you like to learn today?
Web Design Web Development iOS Development

Conflicting javascripts?

  • Hi all,

    I am trying to build a website with some fancy stuff. I know, this is asking for trouble....
    Any way, i would like to try.

    I have a fairly simple site with two javascript enabled effects.
    One is an innerfade, the other a horizontal accordion.
    When the accordion works the innerfade doesn't and vice versa.

    I hope you can help me with this.

    My site: http://test.colddesign.nl

    Currently the accordion is working. When you disable the prototype.js, effects.js and the accordion.js the innerfade wil work.

    BTW. Any comments on the design are welcome....

    Greetings Bert.
    Have a nice christmas and a happy newyear.
  • jQuery and Prototype notoriously don't get along because of the common use of the "$" shorthand. One way to get around this is to use the jQuery.noConflict(); function, and then use "jQuery" anywhere you would normally use "$". More on this here:

    http://docs.jquery.com/Core/jQuery.noConflict

    Even better, you should just use a single library for all the effects on your page. They can both pretty much do the same stuff, you just need to learn them in more detail or find similar plugins.
  • Thanks a lot, Chris. I'll have a look at this.
    gr. Bert