0

I have some DIVs, with the classname "teste". On the console, I'm running this code:

$(".teste").mouseover(function(){
  $(this).css("transform", "scale(1.5)");
});

$(".teste").mouseout(function(){
  $(this).css("transform", "scale(1)");
});

It is running so fine, but when I put on my extension, on the content script, it not work.

Maybe I have to do a background script to listen to this event, but I'm having a hard time to find an example compatible with my code.

Can anyone help me please?

Phil
  • 157,677
  • 23
  • 242
  • 245
  • Are you waiting for the document to load before attaching your event listeners? – Phil Nov 29 '21 at 05:58
  • Does this answer your question? [Why does jQuery or a DOM method such as getElementById not find the element?](https://stackoverflow.com/questions/14028959/why-does-jquery-or-a-dom-method-such-as-getelementbyid-not-find-the-element) – Phil Nov 29 '21 at 05:59
  • A simple way to check this is to add your lister code into $(ducment).ready(function(){}); Furthermore, can try setTimeout to see result. – Mingze Li Nov 29 '21 at 06:19

0 Answers0