Make jQuery colorbox plugin responsive

Use jQuery colorbox lightbox plugin in responsive design with some native colorbox options


    jQuery(document).ready(function(){
        
	jQuery(".inline-sales").colorbox({
            inline:true,
	    maxWidth: "90%",
            onComplete : function() {
                jQuery(this).colorbox.resize();
            }
        });
 
        // resize colorbox on screen rotate in mobile devices and set to cover 90% of screen
        jQuery(window).resize(function() {
            jQuery.colorbox.resize({width:"90%"});
        });
    });


Posted

in

by

Tags: