Domanda

I want to put a big table inside a scrollable div, which is itself is inside a fieldset. Like here http://live.datatables.net/exejuy/2/edit The problem that it is only working correctly in IE. Chrome, Opera and Firefox all do not allow me to scroll Anyone knows why and how to fix it?

È stato utile?

Soluzione

You can use this type of jquery and Css code. and add it to your scroll div

<script type="text/javascript">
$(document).ready(function() {
 var bodyWidth = $(window).width();
 $('.scrolldiv').css('width',bodyWidth);
});
</script>

CSS

.scrolldiv{
    overflow:scroll;
}

You can see jsfiddle

If you want fluid view when resize u can also use this code

 $(document).ready(function() {
getwidth();
});

$(window).resize(function() {
getwidth();
});
function getwidth()
{
 var bodyWidth = $(window).width();
 $('.scrolldiv').css('width',bodyWidth);    
}
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top