I have a Javascript code for div preloading, but i need preloadin with jQuery.
this is my code:
<script type="text/javascript">
window.onload=function(){
document.getElementById('preload').style.display = 'block';
document.getElementById('ajax-loader').style.display = 'none';
}
</script>
<style type="text/css">
div#preload{
display:none;
margin:0 auto;
}
</style>
<img src="/images/ajax.gif" id="ajax-loader" />
<div id="preload">Some text</div>
How i can make a preload with fadeout for a DIV with jquery?
thank u
This is not the exact equivalent to the javascript but it looks like it will do what you want:
Working demo: http://jsfiddle.net/lucuma/84j5S/
The equivalent is:
Working Demo:http://jsfiddle.net/lucuma/84j5S/2/
These jquery solutions are the same as doing this via css:
Although unless you are going to be adding jquery to your project there is no reason to include the library just to do this.