Need some help with some Javascript code.?
I am trying to add a "random image" Javascript code to this background image HTML code below.
Here is the currrent HTML:
<table width="766" style="height: 391px; background-image: url('images/main.jpg'); background-color: left; background-repeat: no-repeat; background-attachment: scroll; background-position: top 50%">
I would like to add this Javascript code:
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
showImage();
// End -->
</script>
How/Where do I place it into the above HTML?
Thanks.
Public Comments
- I'm assuming you have the complete showImage() function elsewhere on the page? Assuming that you want your code to run continuously from the moment the page loads, you can call the function with onLoad event: <Body onLoad="showImage()"> If you want the user to activate the code, you can use a button or link with an onClick event: <Button onClick="showImage()">Click Me</Button>
- http://www.dougv.com/blog/2007/01/14/display-a-random-image-with-javascript-dom/
- Ask a javascript expert. Check http://k.aplis.net/
Powered by Yahoo! Answers