So...using your code (without actually having tested it) you should be able to replace:
if(document.documentElemen
// What can I put in here. I don't want to delete the old event.
}else{
document.documentElement.o
}
with this:
var oldMouseMove = document.documentElement.o
document.documentElement.o
if (oldMouseMove) oldMouseMove();
this.me();
}
Main Topics
Browse All Topics





by: TedInAKPosted on 2006-08-28 at 02:37:10ID: 17402579
Just assign the old event to a variable and then create a new event incorporating the old event, like so:
<html>
<head>
<script type="text/javascript">
window.onload = function() { alert("This is the original 'onload'") }
var newOnload = window.onload; // if there is not an "onload" already assigned, it doesn't matter, we'll check for it in a moment
window.onload = function() {
if(newOnload) newOnload();
alert("This is the added 'onload'")
}
</script>
</head>
<body>
</body>
</html>