I am parsing some elements of an HTML document to add onmouseover and
onmouseout actions to them dynamically. However, if they already have
actions, I want to include them those as well...
I can get the code inside the applied mouseover function with something
like:
if(typeof(obj.onmouseover)=='function'){
// make the function definition a string.
funcOverDefn = "" + obj.onmouseover;
// find the positions of the openeing and closing
// curly braces
firstBrace = funcOverDefn.indexOf('{');
lastBrace = funcOverDefn.lastIndexOf('}');
// get everything between the braces
funcOverDefn=funcOverDefn.substring(firstBrace+1,l astBrace);
}
Then if the element needs something applied (for instance, changing the
display style), I use:
obj.onmouseover=function(){
// display the child element
this.lastChild.style.display="block";
}
However, I want to also apply the code found in the previously found
funcOverDefn variable. Can this be accomplished?
Any pointers/references greatly appreciated.
TIA
--
Justin Koivisto - ju****@koivi.com
http://koivi.com