I have defined this (update) which I am trying to do, but basically I think it There is a situation in the event bubbling I am trying to find a tool (in the tool tip), which will change the value of the input when the button is clicked, which is triggered on the tool tip. The problem I see is the button 'click' event is never firing. How to do this work but any thoughts?
Here's a simple code (it's using jQuery 1.7.2 and Pepsi 1.0.0a):
& lt; Input type = "text" title = "& lt; button class = 'action' & gt; add balance & lt; / button & gt; Name = "left" /> & Lt; Button class = 'action' & gt; Add another balance & lt; / Button & gt; $ (Document) .ready (function () {$ ('input [name =' balance ']'). The victim ({trigger: 'focus, gravity:' n ', html: true}); $ (' button. Action () {$ ('input [name = "balance"]'). Val ($ (this) .html ());});});
The problem is due to the click input on the button element in the tooltip to emit a 'focusout' event. Which is being caught by pressure and its removal - and its children - before the event is clicked bubble from the DOM Here's a demo, but due to the removal of it the parent element is delayed:
& lt; Input title = "& lt; Button class = 'action' & gt; Add Balance & lt; / Button & gt; Name = "left" /> & Lt; Button class = 'action' & gt; Add another balance & lt; / Button & gt; js:
$ (document) .ready (function () {$ (this) .on ('click', '.action', ($ ('Input [name = balance]'). Val ($ (this) .html ());}) $ $ ('input [name = balance]'). Sufferers ({trigger: 'focus', gravity : 'N', HTML: True, Delay: Allow to 'click' to delay 1000 /}}}}});) (I have the freedom to generalize your classmates Has taken)
Comments
Post a Comment