I hava a JavaScript code (for slideshow) below and also a HTML audio tag. I want my page to load every component of itself before playing the slideshow and also the audio file.
I have no problem with using window.onload to satisfy my need in order to run slideshow. but I don't know how to do it with my HTML tag .
I think I should write my JavaScript inside the body tag and use: body onload="...", but I don't know how!
Here is my JavaScript code :
<script type="text/javascript">
window.onload = a;
function a() {
$(document).ready(function(){
$('#slideshow').cycle({
x:'curtainX',
sync: false,
speed:900,
timeout:10,
delay: 1500,
});
});
setTimeout(plus1,9000);
function plus1() {
$(document).ready(function(){
$('#slideshow').cycle('pause');
});
}
}
</script>
And this is my audio tag :
<audio autoplay loop>
<source src="kooche.mp3">