html - Jquery Anchor Elements Moving to New-Line on Hide -


I'm new to jQuery (and in general JavaScript / AJAX) and I'm facing a problem with hidden elements I am

When I use the code below the animation works and the element is hidden, but as it is being hidden, it then moves along a new line to everything It also happens with horizontal hide, but not ambiguity.

Is there a way to stop it from happening or am I missing something out of elsewhere? The links appear on a line like this:

Related Tags: Tags 1 Tag2 Tag 3

Code snippet:

HTML

  & lt; Script type = "text / javascript" src = "jquery.js" & gt; & Lt; / Script & gt; & Lt; Script type = "text / javascript" src = "test.js" & gt; & Lt; / Script & gt; & Lt; Strong & gt; Related tags: & lt; / Strong> & Lt; A href = # & gt; Tag 1 & lt; / A & gt; & Lt; A href = # & gt; Tag 2 & lt; / A & gt; & Lt; A href = # & gt; Tag 3 & lt; / A & gt; (Function () {$ ("a"). Click (function (event) {event.preventDefault   (); $ (This). Value ({height: 'hide'}, "fast");});}); Thanks in advance,  

Dave

Why is it happening that you height attribute will show the block view of the height of the settings manually, and this is why you are moving to a new line.

If you have no problem with this, you can switch to fadeOut to hide, and it will probably not cause the same error, otherwise the anchor for the dirty solution Must set to float: left . To get this a clean solution, you have to put them in a container, and clear them (because floating objects do not capture anywhere in their parents, unless they are clean Not)

  & lt; P & gt; & Lt; One style = "float: left;" & Gt; ... & lt; / A & gt; & Lt; One style = "float: left;" & Gt; ... & lt; / A & gt; & Lt; One style = "float: left;" & Gt; ... & lt; / A & gt; & Lt; Div style = "clear: both;" & Gt; & Lt; / Div & gt; & Lt; / P & gt;  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

jquery - SimpleModal Confirm fails to submit form -

php - Multiple Select with Explode: only returns the word "Array" -