Good day.

I use jQuery to animate the buttons, and the lightbox to display the selected images.

alt text

But only one thing works, in this case the lightbox. Code:

<script type="text/javascript" src="jquery-1.5.1.min.js"></script> <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> <link rel="stylesheet" href="styles/lightbox.css" type="text/css" media="screen" /> 

I apply to the picture like this:

 <a href="blg.jpg" rel="lightbox" title="News Blog" target="_blank";/> <img src="http://my.jetscreenshot.com/10682/20120401-qcva-4kb.jpg" style="width:50px; height:50px;"/></a> 

If you leave only:

 <script type="text/javascript" src="jquery-1.5.1.min.js"></script> 

Then only jQuery works.

How to make both scripts work?

    1 answer 1

     <script type="text/javascript" src="jquery-1.5.1.min.js"></script> <script type="text/javascript">jQuery.noConflict();</script> <script type="text/javascript" src="js/prototype.js"></script> 

    PS By the way why jquery 1.5.1? It's time to crawl on 1.7 ...

    • yes, well after that. all calls to $ will need to be changed to jQuery. cm api.jquery.com/jQuery.noConflict - Yura Ivanov
    • A sense of creep on 1.7, etc. it is 5 times more than let's say 1.2 or 1.3, because there are a lot of unnecessary functions, for example, 1.2.6 for my eyes is enough, for example, to animate something) - armenka
    • Corrected his two lines, three of yours. Only the lightbox works, the buttons do not react .. Can the library version be a problem? - Val
    • Reversing $ Changed to jQuery? - Yura Ivanov
    • one
      Yes, it is necessary to change everywhere. Just jQuery and prototype both use the $ alias. Accordingly, jQuery.noConflict () frees $ for use by other libraries. accordingly, instead of $ you need to write jQuery, everything will work. Swap where jQuery is used. those. in your screen 1,2,4,5 underlined functions. where you have your own variables of type $ span do not need to change. - Yura Ivanov