Skip to main content

Bug Tracker

Side navigation

#10201 closed bug (invalid)

Opened September 04, 2011 06:22PM UTC

Closed September 19, 2011 08:01AM UTC

Last modified July 25, 2012 08:53AM UTC

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.

Attachments (0)
Change History (5)

Changed September 04, 2011 07:13PM UTC by addyosmani comment:1

component: unfiledeffects
owner: → tcarnell
priority: undecidedlow
status: newpending

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!

Changed September 19, 2011 08:01AM UTC by trac-o-bot comment:2

resolution: → invalid
status: pendingclosed

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!

Changed February 01, 2012 12:49PM UTC by tcarnell comment:3

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.

Changed February 01, 2012 12:52PM UTC by tcarnell comment:4

Please re-open this bug!

Changed July 25, 2012 08:53AM UTC by anonymous comment:5

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.