html - Link relation query - can I create a javascript relation as well as css? -


i have statement in webpage formats page can view better small netbook screen:

<link rel="stylesheet" media="only screen , (max-height: 750px)" href="netbook.css" /> 

my question is, can same javascript?

i have array of jquery functions change depending on screen size. i'm looking this, suppose:

<link rel="javascript" media="only screen , (max-height: 750px)" href="scripts_netbook.css" /> 

any ideas out there?

many always,

dan

what like:

$(function() {   var script_path = $(window).height() > 750 ? '/path/to/file.js' : '/path/to/otherfile.js';   $.getscript(script_path, function() { $(window).trigger('script_loaded'); });   $(window).on('script_loaded', function() {    //run other code requiring scripts here   }); }); 

edit: comments, seems want do:

$(function() {   if ($(window).height() < 750;) {       $('#footer_index').delay(800).transition({y:-155 }, 1000, 'snap');   } }); 

this won't work media-query far resizing, on page load. if want work resizing,

$(window).on('resize', function() { //do stuff }); 

Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -