function halfCircleSize()
{
this.style.transform = "scale(0.5)";
}
function wholeCircleSize()
{
this.style.transform = "scale(1.0)";
}
var circle_listener = document.getElementById("listenerCheck");
circle_listener.addEventListener("mouseover", function()
{
this.style.backgroundColor = "blue";
});
circle_listener.addEventListener("mouseout", function()
{
this.style.backgroundColor = "lightBlue";
});
circle_listener.addEventListener("mouseover", halfCircleSize);
circle_listener.addEventListener("mouseout", wholeCircleSize);
circle_listener.removeEventListener("mouseover", halfCircleSize);
Funkcja dodająca event na potrzeby IE
function createEvent(obj, eventName, functionToInvoke)
{
if (document.addEventListener)
{
obj.addEventListener(eventName, functionToInvoke);
}
else
{
obj.attachEvent("on" + eventName,functionToInvoke);
}
}
Funkcja usuwająca event na potrzeby IE
function removeEvent(obj, eventName, functionToInvoke)
{
if (document.addEventListener)
{
obj.addEventListener(eventName, functionToInvoke);
}
else
{
obj.detachEvent("on" + eventName,functionToInvoke);
}
}