Results 1 to 2 of 2

Thread: Need Help. Js Conflict

  1. #1
    Join Date
    Mar 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Need Help. Js Conflict

    1) Script Title: JQuery Accordion and Js LightBox
    2) Script URL (on DD):
    Accordion - http://jqueryui.com/demos/accordion/
    LightBox - http://www.huddletogether.com/projects/lightbox2/
    3) Describe problem:

    To get it done, I just download the sample file that the tuturials usually suply and adapted to my files.

    How the code works:

    Accordion:
    <script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
    <script type="text/javascript" src="js/jquery-ui-1.8.10.custom.min.js"></script>

    <script type="text/javascript">


    $(function(){

    // Accordion
    $("#accordion").accordion({ header: "h3" });

    });

    </script>

    This piece of code makes a function wich will be called in a <div> later:
    <div style="margin:15px 65px" id="accordion">
    here is the accordion id.

    LightBox:
    <script src="js/prototype.js" type="text/javascript"></script>
    <script src="js/scriptaculous.js?load=effects,builder" type="text/javascript"></script>
    <script src="js/lightbox.js" type="text/javascript"></script>

    This piece of code is called later in a <a> tag with an rel="lightbox"
    <a href="images/big_trab01.jpg" rel="lightbox"><img src="images/trab01.jpg" width="538" height="295" alt="" /></a>

    So the problem is that I can't make then work 2gether. If I delete one code the other work, and vice-versa. Pls tell me what I should do :S

  2. #2
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    3,033
    Thanks
    25
    Thanked 599 Times in 575 Posts
    Blog Entries
    40

    Default

    jQuery is probably conflicting with Prototype so try running it in compatiability mode: http://docs.jquery.com/Using_jQuery_...ther_Libraries
    Focus on Function Web Design
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps

Bookmarks

Posting Permissions

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