I am trying to apply a jquery scrollbar to a div that is populated with content from another local jquery call. My problem is that IE does not seem to wait for the content in the div to load, before calling the script for the scrollbar...hence, the scrollbar does not work correctly.
- All other browsers work fine, IE (ver. 8, 9 ) is the only one not working.
- when the div contains static html code, IE works fine
- the call to the scroll function is inside a window.load
The strange thing: IF i stick an alert() call before calling the scroll code, it will work.
I have tried adding a setTimeout() function, but that did not work.
The code looks like this
<head>
<script>
$(document).ready(function() {
// ajax call to populate scrollable div with html content
});
</script>
</head>
<body>
<div class="scrollableDiv">
// content populated by script call above
</div>
<...... lots more html here .....>
<!-- very bottom of page -->
<script>
$(window).load(function(){
// alert ("IF I ADD THIS ALERT, EVERYTHING WORKS FINE IN IE");
$('.scrollableDiv').ClassyScroll();
});
</script>
</body>
Any ideas???