solick
solick

Reputation: 2345

Firefox Addon SDK - add eventListener for mouseover and mouseout

i just started to create my first addon for firefox. At the moment i´m stuck in adding eventListeners via my addon.

I have a list of elements (ul li) where i want to add for each the mouseover and mouseout event. So far i just want to add an extra border to see that it is working.

But reading the documentation i cannot find an example how to do it. Hope someone can help me.

Thanks and KR

Upvotes: 1

Views: 99

Answers (1)

solick
solick

Reputation: 2345

Finally i found out how to do:

var qlist = document.querySelectorAll('ul#s-results-list-atf li.s-result-item');

for(var i = 0; i < qlist.length; i++) {

    qlist[i].addEventListener('mouseover',hoverEffectOn, false);

    qlist[i].addEventListener('mouseout',hoverEffectOff, false);

    qlist[i].addEventListener('click', showDataAsin, false);

}

Upvotes: 1

Related Questions