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 ("
"); } Box.html (Message); // center this box.css ("left", ($ j (window) .wide () - box.width ()) / 2 + $ j (window) .scrollLeft () + "px"); Box.fadeIn ('slow'); SetTimeout (function () {$ J ('. Floatymessage') fadeOut ('slow');}}, 3500); }

link:

  & lt;  

CSS for floatmasego:

Background: black; white color; text align: center; filter: alpha (opacity = 75); -moz-ambiguity: 0.75; -khtml-opacity: 0.75; ambiguity: 0.75; box-shadow: 10px 10px 5px # 000; boundary: 1px solid black; border-bottom-left-radius: 5px 5px; border- Bottom-Radius: 5px 5px; Border- Top-left-radius: 5px 5px; border-top right-radius: 5px 5px; line-height: 50px; z-index: 10000; do not display anything;)

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

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -