The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "SVG" Oct 14 - 6:30 PM Eastern
Get a free trial // Grow your CSS skills // Land your dream job

Conflicting javascripts?

  • # December 23, 2008 at 6:55 am

    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:

    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.

    # December 24, 2008 at 8:07 pm

    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:

    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.

    # December 29, 2008 at 9:08 am

    Thanks a lot, Chris. I’ll have a look at this.
    gr. Bert

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed