#10201 closed bug (invalid)
slideUp() function not working, but hide() function does work
Reported by: | tcarnell | Owned by: | tcarnell |
---|---|---|---|
Priority: | low | Milestone: | None |
Component: | effects | Version: | 1.6.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Hi there,
I've just encountered a strange bug with the slideUp function. Basically I wire up a change() function for a checkbox. When the checkbox is changed, it should hide or show another div. Immediately after wiring up the change function the code directly calls the checkbox change() function to ensure the page/ui is in the correct state. Consider the following simplified code:
$( document).ready( function(){ $('#my-checkbox').change( function() { if( $('#my-checkbox').is(':checked') ) { $('#my-input').closest('div.input-container').slideUp(); } else { $('#my-input').closest('div.input-container').slideDown(); } return false; }); $('#my-checkbox').change(); });
We should expect on page load that $('#my-input').closeset('div.input-container') slides up to become hidden. But this does not happen. However, subsequent slideUp's do work and also changing the effect from 'slideUp()' to 'hide()' does work correctly first time round.
The code above is a simplification and in my source code a whole of other stuff is also happening on document ready.
Change History (5)
comment:1 Changed 11 years ago by
Component: | unfiled → effects |
---|---|
Owner: | set to tcarnell |
Priority: | undecided → low |
Status: | new → pending |
comment:2 Changed 11 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!
comment:3 Changed 11 years ago by
I full test case can be found here:
http://staging.femtoo.com/jquerytest
If you look at the javascript code in the source of the above page, you will see that upon load, jQuery is asked to check the checkbox, but because the checkbox is not visible, it does not get checked. I believe this to be a bug - the visibility of the checkbox should not affect its ability to be checked.
More detail can be found from here: http://bugs.jqueryui.com/ticket/7943
This is a bug and I have been affected by this numerous times.
comment:5 Changed 11 years ago by
I had the same problem and solved it, by adding "clear: both" to the style of the element, that should slideUp. Seems to be an floating-bug.
Thanks for submitting a ticket to the jQuery bug tracker!. Could you please provide us with a complete reduced test case on jsFiddle.net so that we can evaluate the behaviour mentioned under the same conditions and markup you've been testing under?. Thanks!