two Jquery plugin not working on same page [Resolved]

Posted by donraza007-15388 under jQuery on 6/29/2012 | Points: 10 | Views : 2133 | Status : [Member] | Replies : 3
I have to use 2 jquery plug in in same page but only one plug in is working at a time
Here is my script code
<script type="text/javascript" >
$(document).ready( function()
{
$('pre.loadme').lazyLoad();
$('pre.morestuff').lazyLoad();
} );
</script>

<script>
$(document).ready(function(){

// hide #back-top first
$("#back-top").hide();

// fade in #back-top
$(function () {
$(window).scroll(function () {
if ($(this).scrollTop() > 100) {
$('#back-top').fadeIn();
} else {
$('#back-top').fadeOut();
}
});

// scroll body to 0px on click
$('#back-top a').click(function () {
$('body,html').animate({
scrollTop: 0
}, 800);
return false;
});
});

});
</script>




Responses

Posted by: saficreator-10970 on: 7/4/2012 [Member] Starter | Points: 50

Up
0
Down

Resolved
Instead of use $ symbol use Jquery as like below

jquery(document).ready( function()
instead of
$(document).ready( function()

Regards,
Mohamed Shafee M

donraza007-15388, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: perfectchourasia-9163 on: 7/4/2012 [Member] Starter | Points: 25

Up
0
Down
http://api.jquery.com/jQuery.noConflict/

ER sandeep chourasia
sandeepchrs@yahoo.com (on facebook)
http://www.aspnetcodes.com/

donraza007-15388, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Patel28rajendra on: 7/5/2012 [Member] Starter | Points: 25

Up
0
Down
Hi

Replace $ with Jquery as Mohamed Shafee said

I had face this problem once and replacing with Jquery solved my Problem


Thanks
RaJeNDRA PaTeL



R D Patel

donraza007-15388, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response