Hi there I have recently tried to learn javascript but am now stuck.
I have the following javascript in the head:
- Code: Select all
<SCRIPT LANGUAGE="JavaScript">
var theImages = new Array()
theImages[0] = 'clip1.wmv'
theImages[1] = 'clip2.wmv'
theImages[2] = 'clip3.wmv'
theImages[3] = 'clip4.wmv'
var j = 0
var p = theImages.length;
var preBuffer = new Array()
for (i = 0; i < p; i++){
preBuffer[i] = new Image()
preBuffer[i].src = theImages[i]
}
var whichImage = Math.round(Math.random()*(p-1));
function showImage(){
document.write('<embed src="'+theImages[whichImage]+'">');
}
</script>
and then the following in the body:
- Code: Select all
<script type="text/javascript">
showImage();
</script>
What i want to know is how to position the showImage(); in an absolute position on the page. Currently it is in the top left corner but i want in 200px from the left and 500px from the top.
Can anyone show me what code I would have to change to get this to work?
Many Thanks,
Fodder