Search code examples
javascriptfirefoxfirefox-addon-sdk

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


Solution

  • 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);
    
    }