viewport - jQuery elements (images and divs) are not resizing, when browser windows is resized -


i facing small problem when browser window resized. able viewport's width , height , can set image size per browser window. when resize browser window, image or div not getting resized.

here have tried viewport's width , height , applied same respective image (element).

<script type="text/javascript"> // global vars $(document).ready (function (){   var winwidth = $ (window).innerwidth();   var winheight = $ (window).innerheight();   // set initial div height / width   $('div.background img').css({     'min-width': winwidth,     'height': winheight   });   $('.leftstatbar').css({     'width': '200px',     'min-height': winheight   });   $(' #firstmenu').css({     'width': '150px',     'min-height': winheight   });   $(window).resize(function(){     $('div.background img').css({       'min-width': winwidth,       'height': winheight});     });   }); </script> 

please resolve issue. many thanks.

use below code.to resize function

$(window).resize(function(){       var winwidth = $ (window).innerwidth();       var winheight = $ (window).innerheight();     $('div.background img').css({       'min-width': winwidth,       'height': winheight});     }); 

in code problem is... on re sizing using values calculated @ time of page load.. not after re size...

see http://jsfiddle.net/sl573/


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -