2013年10月5日 星期六

div-template scroll-y auto height

<div id="browserInfo" style="overflow:hidden;margin:auto;display:block; border: solid 1px black;  height: 500px; width: 90%;">
<span style="background-color: #4378b6; color: white; float: left; height: 20px; margin-bottom: 0; padding-left:5px ; width: 100%;">Menu Listing</span>
<div id="interDiv" style="margin:0; overflow-y:scroll; border: solid 1px black; float: left; width:100%;height:480px">
</div>
</div>

<script type="text/javascript">
$(window).resize(function () {
resizeElements()      
});
function resizeElements(){
if ($(window).width()<=800) {
$( "#browserInfo" ).css('width','240px');
} else {
$( "#browserInfo" ).css('width','90%'); //set min-width
}
$( "#browserInfo" ).css('height',$(window).height()*0.8+'px');
$( "#interDiv" ).css('height',$(window).height()*0.8-20+'px');
}
$(function () {
resizeElements();})

</script>






Menu Listing

沒有留言:

張貼留言