Skip to content Skip to sidebar Skip to footer

Javascript Image Scroller Not Working With Doctype

I've been searching the net hard for some javascript code that allows me to automatically scroll images non-stop horizontally on a webpage. After a long time searching, I finally c

Solution 1:

The probable reason is that you don't have quotes around the attributes in the last line of your code:

document.write('<ahref = ' + pic[ii].link + 'target="_blank" ><imgspace=0hspace=0vspace=0border=0height=131style=position:absolute;top:0;left:0' + myLeft[ii]  + '; src=' + pic[ii].name + 'onMouseOver=stop()onMouseOut=go()></a>')

document.write('<ahref="' + pic[ii].link + '"target="_blank"><imgstyle="height:131px;position:absolute;top:0;left:' + myLeft[ii]  + ';"src="' + pic[ii].name + '"onMouseOver="stop()"onMouseOut="go()" /></a>');

Also, I strongly advice you to add semicolons to your Javascript.

Lastly, use a library to do all of this and get more sleep.

Post a Comment for "Javascript Image Scroller Not Working With Doctype"