tags:

views:

70

answers:

2

i have a problem put 2 jquery scripts in one page. only one is working until i remove the second script the other working. here is the code of easy slider

<script type="text/javascript" src="js/jquery.js"></script>
$(document).ready(function(){ $("#slider").easySlider({ auto: true, continuous: true }); });

i put it in the head tags.

and here is pretty photo script i put it before the end of body tag.

<script type="text/javascript" charset="utf-8">

$(document).ready(function(){ $("a[rel^='prettyPhoto']").prettyPhoto(); }); wish anybody can give me answer to make both of them work in same page. here is my website you can check the problem http://www.osmanassem.com/ thank you

A: 

You may want to just put both calls in the same document.ready function:

<script type="text/javascript">
    $(document).ready(function(){   
        $("#slider").easySlider({
            auto: true, 
            continuous: true
        });
        $(".gallery a[rel^='prettyPhoto']").prettyPhoto({theme:'dark_square'});

    }); 
</script>
doctororange
thank you for your help. i just try it but nothing also. the easy slider still working but the pretty photo not working and when i click on pic in open in another page. thank you again.
osman assem
You seem to have two versions of jQuery included too. `<script type='text/javascript' src='jquery-1.4.js'></script>` and 1.3.2 by `google.load`, as well as quite a few other bits and pieces. Try removing any extra libraries to see if it works, and if so, add them back one at a time to find which is conflicting. Basically, tidying the code will make the diagnosis easier :0)
doctororange
i remove one by one and in the 2 times no one work. i explain the problem better. the slider work and the pretty photo not. when i remove the entry of the slider the pretty photo work. but when both exist just the slider work. the slider script in the head tag and the pretty photo tag in the last line before end the body. thank you for your support.
osman assem
A: 

Among other problems (doctororange is completely correct), your jQuery search string is $("a[rel^='prettyPhoto']") - that means you are applying prettyPhoto to all <a> elements with rel="prettyPhoto" (or rel that starts with "prettyPhoto"). As far as I can see, nothing like that exists in your page. What are you trying to use as the activator for the popup boxes?

colinmarc
the pretty photo was working before i ad the easy slider plugin. and now when i remove the easy slider the pretty photo return back working. i know the easy slider is working but i want both to be working. thank you for help.
osman assem
is prettyphoto on a separate page than the one you linked? because there is nothing with `rel="prettyPhoto"` anywhere in the source code of the page, and I can't see anywhere that you create it dynamically.
colinmarc
no both pretty photo and easy slider in same page. and i want to make both of them work in same time in same page. pretty photo was working very good before i put the easy slider. and when i remove the script of easy slider from head tag the pretty photo return back working.
osman assem
can you remove it and upload the result so we can see prettyPhoto running?
colinmarc
i just remove the easy slider from one page. so check the pretty photo in any pic from the bottomhttp://www.osmanassem.com/printed_portfolio.html
osman assem
I see. I was looking at the page you linked. Ok, put the prettyPhoto code in the head below the easyslider code and reupload, and I'll see what errors come up.
colinmarc
the pretty photo script is not in the head tag. its in the end or the body tag before i close the body. in the head just link the css and js.
osman assem