Ok this is the very last complicated thing I am doing for the website I am building, after this its just text and image content.
I have two scripts - One floating image script and one random image script. I am wondering if the two can be combined to display a random image that floats on the bottom left of the screen. I have tried them both and have them working, but now I want to try and put them together (with absolutely NO knowledge whatsoever). Would someone be able to combine these for me? (I know it may be asking a lot)
These are the two scripts:
Floating Image -
<script>
if (!document.layers)
document.write('<div id="divStayTopLeft" style="position:absolute">')
</script>
<layer id="divStayTopLeft">
<!--EDIT BELOW CODE TO YOUR OWN MENU-->
<!-- Facebook Badge START -->
<a href="http://www.facebook.com/candykissragdolls" title="CandyKiss Ragdolls" target="_TOP"><img src="http://badge.facebook.com/badge/111402725544388.1533.1737808258.png" width="120" height="86" style="border: 0px;" /></a><!-- Facebook Badge END -->
<!--END OF EDIT-->
function random_imglink(){
var myimages=new Array()
//specify random images below. You can have as many as you wish
myimages[1]="img1.gif"
myimages[2]="img2.gif"
myimages[3]="img3.gif"
//specify corresponding links below
var imagelinks=new Array()
imagelinks[1]="http://www.wsabstract.com"
imagelinks[2]="http://www.dynamicdrive.com"
imagelinks[3]="http://www.java-scripts.net"
var ry=Math.floor(Math.random()*myimages.length)
if (ry==0)
ry=1
document.write('<a href='+'"'+imagelinks[ry]+'"'+'><img src="'+myimages[ry]+'" border=0></a>')
}
Ok I finally got to try and after a few goes, I discovered that you MUST use .gifs like the example says. Using .png wont work, which sucks because now it doesnt look as good.
Got to fix the rest now - for some reason it mucked up the rest of the content.
Sorry SparoHawk, but I have one more question (and I cant see an edit button anywhere so I have to post after my other two posts )
I have it all working now except for one little hitch. I have this script in a framed page and currently the links are opening up the desired page in the same frame it is in. Would you know how to modify it so that the pictured link opens another webpage in a new browser window?
Thanks for your help so far. Once this is solved I am truely done .. honest
I am previewing it regularly in both Firefox and IE, both latest versions. What Im doing is working quite well across both browsers. Im not too sure about Chrome though.
Bookmarks