javascript - jquery mouseenter is not working on img -


i trying drag image jquery text editor (jqte) , resize in editor. resizing function works in firefox. think provide w , h textbox on mouseenter change size. mouseenter not working on img element.

     <div class="jqte_editor" contenteditable="true"><pre style="font-family:consolas;">       <br>         &nbsp;&nbsp;&nbsp;&nbsp;          <img style="border-left-width: 1px; border-left-style:   solid; border-left-color: rgb(255, 255, 255); border-bottom-width: 1px; border-bottom-style: solid; border-bottom-color: rgb(255, 255, 255);" src="http://localhost:65380/articles/articleimagestore/cf82c9c8-3ea0-4c7f- 9272-7b2fd48a9eed/79825f3f-965f-4e34-ad45-3fa7430e6837.jpeg" width="64" height="64" id="img6">               </pre>      <p><br></p>      <pre style="font-family:consolas;">&nbsp;&nbsp;&nbsp;</pre>  <p></p>                               </div>  

jquery code snippet

         $('.jqte_editor img').on('mouseenter', function() {               alert("hello");              $(this).before("<div style='position:absolute'><input type='textbox'></input></div>");           }); 

your code working fine : http://jsfiddle.net/annh2/

if didn't wrap code in .ready function, check once :

$(document).ready(function(){     $('.jqte_editor img').on('mouseenter', function() {         alert("hello");         $(this).before("<div style='position:absolute'><input type='textbox'></input></div>");      });  }); 

Comments