How do I tell this jquery not to fire on mobile or tablets -
i have bit of jquery want trigger larger screens , avoid mobile , tablet, how?
$(document).ready(function() { //get browser window height var currheight = $(window).height(); //set height of sidebar , content elements $('.fixed-col').css('height', currheight); //on resize of window $(window).resize(function() { //get new height var currheight = $(window).height(); //resize both elements new height $('.fixed-col').css('height', currheight); }); });
your fiddle has multiple syntax errors, plus jquery never loaded.
perhaps meant do:
$(document).ready(function () { if ($(window).width() >= 400) { $(window).resize(function () { var currheight = $(window).height(); $('.fixed-col').css('height', currheight); }).trigger('resize'); // run once right away }; });
Comments
Post a Comment