Wednesday, 15 January 2014

javascript - Jquery no conflict not working -



javascript - Jquery no conflict not working -

this sort of 2 question one. i'm trying utilize jquery no conflict don't think i'm doing correctly.

this wat have:

// **************** plugins ****************

jquery.noconflict() // homecoming `$` it's previous "owner" (function($){ // in here you're assured `$ == jquery` $(document).ready(function() { $(".fancybox").fancybox(); /*lightbox*/ }); $(window).scroll(function(){ /*scroll top*/ if ($(this).scrolltop() > 100) { $('.scrollup').fadein(); } else { $('.scrollup').fadeout(); } }); $('.scrollup').click(function(){ $("html, body").animate({ scrolltop: 0 }, 600); homecoming false; }); $('.bxslider').bxslider(); });

am not doing right?

*

also, when add together makes stop working why think i'n not adding no conflict correctly:

*

// **************** header shadow ****************

$(window).scroll(function() { if ($(this).scrolltop() == 0) { $('header').css({ 'box-shadow': 'none', '-moz-box-shadow' : 'none', '-webkit-box-shadow' : 'none' }); } else { $('header').css({ 'box-shadow': '0px 10px 10px #888', '-moz-box-shadow' : '0px 10px 10px #888', '-webkit-box-shadow' : '0px 10px 10px #888' }); } });

thank in advance.

you have pass jquery in function:

jquery.noconflict() // homecoming `$` it's previous "owner" (function($){ // in here you're assured `$ == jquery` // code })(jquery); //do mean pass jquery perhaps?

javascript jquery

No comments:

Post a Comment