Reputation: 153
i'm using sticky.js now i wanna use this when min-width sets to 768px in other words i don't want sticky.js works in mobiles or devices that has max-width 768px .
i use this jquery code to use sticky-js
jQuery(document).ready(function(){
jQuery("#header").sticky({
className : 'sticky-header' ,
topSpacing : -45
});
});
if you need more details let me know
Upvotes: 0
Views: 1615
Reputation: 318182
Use a condition, and check whatever element has the min-width style set
jQuery(function($){
var min_width = parseInt( $('body').css('min-width'), 10 );
if ( min_width > 768 ) {
$("#header").sticky({
className : 'sticky-header' ,
topSpacing : -45
});
}
});
Upvotes: 3