OZONE Asylum
Forums
XML - XSL - XSLT - XHTML - CSS - DOM
DOM Roll Over?
This page's ID:
10861
Search
QuickChanges
Forums
FAQ
Archives
Register
Edit Post
Who can edit a post?
The poster and administrators may edit a post. The poster can only edit it for a short while after the initial post.
Your User Name:
Your Password:
Login Options:
Remember Me On This Computer
Your Text:
Insert Slimies »
Insert UBB Code »
Close
Last Tag
|
All Tags
UBB Help
I happened upon this little piece of code here and was wondering if this was the new way that mouse overs should be handled? I have the script posted below and have it working on a page: [url=http://www.sinc.sunysb.edu/Stu/dcurran/mouseover/]http://www.sinc.sunysb.edu/Stu/dcurran/mouseover/[/url] The problem is that of course the hsrc attribute is not going to validate as XHTML 1.0, is there a method of adding this element to the doctype? I don't think that this should give huge problems? I have just started looking at this code as of this morning, maybe I will get some more time over the week to modify it so that it can work with a given value. I don't know for sure. If anyone has any ideas please let me know. P.S. I haven't used Javascript in one of my pages in a very long time. I figure it still needs to be commented out using HTML comments, since the for loop did not validate due to the less than sign used. Any thoughts on that one? [code] <script type="text/javascript"> /**************************************************** * DOM Image rollover: * by Chris Poole * [url=http://chrispoole.com]http://chrispoole.com[/url] * Script featured on [url=http://www.dynamicdrive.com]http://www.dynamicdrive.com[/url] * Keep this notice intact to use it :-) ****************************************************/ function init() { if (!document.getElementById) return var imgOriginSrc; var imgTemp = new Array(); var imgarr = document.getElementsByTagName('img'); for (var i = 0; i < imgarr.length; i++) { if (imgarr[i].getAttribute('hsrc')) { imgTemp[i] = new Image(); imgTemp[i].src = imgarr[i].getAttribute('hsrc'); imgarr[i].onmouseover = function() { imgOriginSrc = this.getAttribute('src'); this.setAttribute('src',this.getAttribute('hsrc')) } imgarr[i].onmouseout = function() { this.setAttribute('src',imgOriginSrc) } } } } onload=init; </script> [/code] [url=http://www.gurusnetwork.com] [img]http://www.sinc.stonybrook.edu/Stu/dcurran/siggy_004.gif[/img] [/url]
Loading...
Options:
Enable Slimies
Enable Linkwords
« Backwards
—
Onwards »