Search code examples
jqueryprototypejsscriptaculouseasysliderlightwindow

two javascript files that hate each other


I have recently been working on a site and have implemented both light window and easyslider. They both work fine on their own but if you combine the two of them then either easy slider works or light window. I have come to the conclusion that they are both trying to use a function with the same name but with different declarations...

The address for the site is http://semaphoredesign.com/web-devel/oceanair/

Just fixed the missing prototype.js file


Solution

  • To use Prototype and jQuery together:

    <script type="text/javascript" src="scripts/easyslider/js/jquery.js"></script>
    <script type="text/javascript">
        // declare a global variable set to jQuery.noConflict();
        var jq = jQuery.noConflict();
        // in all jQuery scripts, use jq (or whatever you call the global) instead of $.
    </script>