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); });  }); 

http://jsfiddle.net/tresr/

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     }; }); 

http://jsfiddle.net/mblase75/uxqcl/


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -