jquery - Javascript: add onclick attribute DOM -


i've tryed add listeners existing div element

        //prepare div         $(this.div).css("z-index","256");         $(this.div).attr("onmouseover",this.myname+".resize();");         $(this.div).attr("onmousedown",this.myname+".resize();");         $(this.div).attr("onmouseout","if("+this.myname+".sized)"+ this.myname+".resize();"); 

but in ie , chrome event doesn't fired while still gets added elements attributes. firefox works expected.

does know whats wrong it?

thanks

do not set events strings.
instead, should use jquery's bind method:

var me = this;    //inside handlers, element.  $(this.div).bind('mouseenter mousedown mouseleave',  function() {      me.resize();  }); 

Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -