jQuery: The Write Less, Do More JavaScript Library

fadeOut problem

View: New views
1 Messages — Rating Filter:   Alert me  

fadeOut problem

by Bugzilla from jakub.suder@gmail.com :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I've found a minor issue with the fadeOut animation - I'm not sure if
this can be fixed easily, or even if it is a bug at all... this
appears in a case which I suppose is quite rare, when the element's
height is 0, but the element is visible on the screen anyway. When
fadeOut is called on this element, nothing happens and it stays
visible.

Try this code (tested in FF 3.5 and Safari 4.0):

<html>
<head>
  <script type="text/javascript" src="http://jqueryjs.googlecode.com/
files/jquery-1.3.2.js"></script>
</head>
<body>
  <button onclick="$('#box').fadeOut('normal');">Fade out</
button><br><br>
  <div id="box" style="position: absolute; top: 50px; width: 100px;">
    <div style="border: 1px solid black; margin: -1px;" />
  </div>
</body>
</html>

If you press the button, the black line doesn't fade out. It does if
you remove the "margin: -1px" attribute. I've come across this while
using the "searchlight" plugin (http://ryanwilliams.org/2009/jul/28/
search-light-jquery-plugin) - if the search doesn't return any
results, the list div shows up empty with only the box shadow visible,
and then when you click somewhere on the page, the shadow doesn't
disappear, as it does when the list isn't empty.

Regards,
Jakub