Click to See Complete Forum and Search --> : onMouseOver


Max^Power
12-30-2002, 03:01 AM
when using rollovers, is it possible to create a function that passes two parameters one for the 'name' and one for the 'url' so that each time I will use the onmouseover event instead of typing onMouseOver="document.name.src= ......." I will just type onMouseOver="functionname(name, url)"

gil davis
12-30-2002, 05:41 AM
Did you try it?

alcodes
12-30-2002, 07:00 AM
I think he wanted code

Max^Power
12-31-2002, 01:29 AM
actually, i tried to experiment a bit but without success, that's why i asked my question here. actually, what i didn't managed to do in the function was what shall i have to put between the { } to make it ... ="onMouseOver ...

gil davis
12-31-2002, 08:33 AM
Perhaps if you give a more complete example, someone can give you a more complete answer. Show two separate complete instances of the kind of onmouseover you want to reduce.

spoontacular
12-31-2002, 02:39 PM
// JavaScript
function mOver(id) {
id = document.getElementById(id);
/*
Stuff you want to do
*/
}

<!-- HTML -->
<a onmouseover="mOver('aid')" id="aid">link</a>