jQuery Colorbox: Hide background page vertical scroll bar on open


To hide the scroll bar of the background page when the colorbox opens "like facebook for example"   /* make the page scroll dissapear when colorbox is open and retrieved back when colorbox is closed */ var screen_position; $(document).bind('cbox_open', function() { screen_position = $("body").scrollTop(); $('body').css({ overflow: 'hidden' }); $("body").scrollTop(0); }).bind('cbox_closed', function() { $('body').css({ overflow: 'auto' … Continue reading jQuery Colorbox: Hide background page vertical scroll bar on open

How can I check if a jQuery plugin is loaded?


Generally speaking, jQuery plugins are namespaces on the jQuery scope. You could run a simple check to see if the namespace exists: if(jQuery().pluginName) { //run plugin dependent code } ,If we're talking about a proper jQuery plugin (on that extends the fn namespace), then the proper way to detect the plugin would be: if($.fn.pluginname != … Continue reading How can I check if a jQuery plugin is loaded?