jQuery: div doesn't appear until second click? I want it on the first. =\ -
First click: Blank Flatimaze Developer Click Next and later: Works.
function fltimases (messages) {var box = $ j (". Flatimams") if (box.length == 0) {$ j (' Body '). Attached ("
Your argument in the box was unavailable, if you do not already have it, you can set your variable 'box' to the new device Want to:
if (box.length == 0) {box = $ j ("& lt; div class = 'floatymessage'> "); $ J ('body') enclosed (box). } Forward,
You can use the method of setup, but to prevent this when you use an anchor tag to fire a javascript event Need to add false return to a normal link like processing it
& lt; An id = "mine" href = "#" onclick = "floatymessage ('msg'); returned;" & Gt; Play & lt; / A & gt;
In this case, it is a better practice to force events:
$ j ("# mine"). Click (function () {floatymessage ('msg');});
Instead of an anchor tag, you can get the same effect using the span tag which wants to navigate to the url.
& lt; Span id = "my" onclic = "flags"; "& gt; Play & lt; / Span & gt;
Comments
Post a Comment