html - Resizing iframe between two static-width panels - using jQuery -
html - Resizing iframe between two static-width panels - using jQuery -
i have setup 2 side panels, 1 float:left , 1 float:right, , iframe in between them. want 2 side panels have width of 150px, , iframe fill rest of page. attempting using jquery create functions alter iframe width dynamically when window resized, yet not working. here have far:
<body> ... <script src="jquery.js"> function setframesize() { $("#ifrm").width($(window).width() - $("#leftpanel").width() - $("#rightpanel").width()); } $(window).resize(function() { setframesize(); }); $(document).ready(function() { setframesize(); }); </script> ... </body>
can tell me why not working? thanks!
it's much improve css:
http://jsfiddle.net/7pbjb/
html:<div id="left"></div> <div id="center"></div> <div id="right"></div>
css: div{ position:fixed; height:500px;} #left{ background:blue; left:0px; width:150px; } #center{ background:green; right:150px; left:150px; } #right{ background:orange; right:0px; width:150px; }
setting left , right position of center div causes stretch.
jquery html iframe resize
Comments
Post a Comment