Good day to all!)

On the page there is a menu:

<script type="text/javascript" src="../js/jq.js"></script"> ... <ul> <li> <a class="ul" href="javascript:ShowOrHide('category1')">1 уровень</a> <div id="category1" style="display:none"> <ul> <li><a href="chernigiv/ch.htm">2 уровень</a></li> <li><a href="chernigiv/val.htm">2 уровень</a></li> ................ <li><a href="chernigiv/val.htm">2 уровень</a></li> </ul> </div> </li> </ul> 

Also on the page is a gallery:

 <link href="../css/jquery.lightbox-0.5.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="../js/jquery-1.4.3.min.js"></script> <script type="text/javascript" src="../js/jquery.lightbox-0.5.js"></script> <!--запуск галереи--> <script type="text/javascript"> jQuery(function(){ jQuery("#gallery a").lightBox(); }); </script> </head> ... <a href="../img/6.jpg"><img src="../img/6m.jpg" height="90px" width="120px" alt=""/></a> <a href="../img/2_2(387).jpg"><img src="../img/2_2m.jpg" height="90px" width="120px" alt=""/></a> ... 

This is the problem: when testing the menu on a separate page, everything is OK, as well as with the gallery, put both on one page - the menu links do not work (

    1 answer 1

    Most likely jquery is redefined. Need to connect in the right order

     <script type="text/javascript" src="../js/jquery-1.4.3.min.js"></script> <script type="text/javascript" src="../js/jquery.lightbox-0.5.js"> <script type="text/javascript" src="../js/jq.js"></script"> 

    If the gallery is on a prototype, then use $.noConflict()
    and so on

    • In this sequence (see below), the gallery works (and there is no menu (<! - the script for the menu is> <script type = "text / javascript" src = "../js / jq.js"> </ script> <! - styles and gallery scripts -> <link href = "../ css / jquery.lightbox-0.5.css" rel = "stylesheet" type = "text / css" /> <script type = "text / javascript" src = "../js / jquery-1.4.3.min.js"> </ script> <script type = "text / javascript" src = "../ js / jquery.lightbox-0.5 .js "> </ script> <! - launch gallery -> <script type =" text / javascript "> jQuery (function () {jQuery (" a "). lightBox ();}); </ script > - Vasiok
    • In this sequence (see below)) - the menu works (and the gallery does not (<! - styles and scripts for the gallery -> <link href = "../ css / jquery.lightbox-0.5.css" rel = "stylesheet" type = "text / css" /> <script type = "text / javascript" src = "../js / jquery-1.4.3.min.js"> </ script> <script type = "text / javascript "src =" ../ js / jquery.lightbox-0.5.js "> </ script> <! - menu script -> <script type =" text / javascript "src =" ../ js /jq.js "> </ script> <! - Gallery launch -> <script type =" text / javascript "> jQuery (function () {jQuery (" a "). lightBox ();}); < / script> - Vasiok
    • I decided this way: <script type = "text / javascript"> jQuery (document). Ready (function () {jQuery.noConflict (); jQuery ("a [href $ =. Jpg], a [href $ =. Png] , a [href $ =. gif] "). lightBox ();}); </ script> - Vasiok