We are making a advert div, and we have this function on mouse over and mouse out an effect takes place. The issue is I cannot run more than one of these functions on same page, I suppose because it does not possess an ID.
Code is
Function mouseOver ()
{
document.getelementbyid("flashdiv").classname="flash-abg";
}
Function mouseOut ()
{
document.getelementbyid("flashdiv").classname="flash-I";
}
So how would I. Run two of these on one page, I am on iPad so difficult to set styling on here, etc. So apologies.
Basically the above code accompanies HTML and CSS to display hover effect on a advert div, we have all divs working correctly individually but because we have no I’d for the functions, they don’t work together correctly when we have more than one on a page. As you can see I am crap at js.
If you want the same function to be binded to different elements, if correclty binded this is a reference to the source of the event (the div to which the event is attached). That should allow you to bind the same function to different elements. In your code just replace document.getelementbyid(“flashdiv”) for this.