Bug Tracker

Opened 8 years ago

Closed 6 years ago

#10710 closed bug (fixed)

slidedown() and table issue

Reported by: cbad Owned by: cbad
Priority: low Milestone: None
Component: effects Version: 1.7
Keywords: Cc:
Blocked by: Blocking:

Description

Looks like the height for a <td> is calculated at a pre-determined width when formatting text and used to determine height to slide down. When the slide down occurs, it slides smoothly to the calculated width and then snaps to the real height (can be either up or down depending). Here's a simple example:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script>
$(document).ready( function() {

		
		$('tr td').each(function(index, item) {
			$(item).html($(item).html()+'<p style="display: none;">'+$(item).attr('title'))+'</p>';
			$(item).removeAttr('title');
		});

		$('tr td').click( function(event){
			$this = $(this);

			if ( $this.hasClass('open') ) {$this.children('p').slideUp('slow');} else {$this.children('p').slideDown('slow');}
			$this.toggleClass('open');
		});
});
</script>
  </head>
  <body>

	<table width="800">
		<tr>
			<td title="Now is the time for all good men to come to the aid of their country, Now is the time for all good men to come to the aid of their country, Now is the time for all good men to come to the aid of their country">
				<h4>Click to Expand One</h4>
			</td>
		</tr>
		<tr>
			<td title="Now is the time for all good men to come to the aid of their country">

				<h4>Click to Expand Two</h4>
			</td>
		</tr>
	</table>



  </body>
</html>

In this example, if the browser window is wide enough it slides smoothly. If the width of the window is reduced, it will slide down too far (but smoothly), and then snap up.

Thanks!

Change History (8)

comment:1 Changed 8 years ago by timmywil

Component: unfiledeffects
Owner: set to cbad
Priority: undecidedlow
Status: newpending
Version: 1.7

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket.

Additionally, be sure to test against the jQuery Edge version to ensure the issue still exists. To get you started, use this boilerplate: http://jsfiddle.net/FrKyN/ Open the link and click to "Fork" (in the top menu) to get started.

comment:2 Changed 8 years ago by cbad

Status: pendingnew

I've put the code sample in jsfiddle and tested with jquery edge. Here's the link:

http://jsfiddle.net/3nXvm/

Thanks!

comment:4 Changed 8 years ago by anonymous

Hey timmywil, does this require any action on my part?

comment:5 Changed 8 years ago by timmywil

Nope, we just need to look into it further first. I haven't had time to yet.

comment:6 Changed 7 years ago by sindresorhus

Status: newopen

comment:7 Changed 6 years ago by BrodaNoel

Question: This bug is solved with the latest release. Whats is the next step fot this ticket?

The bug exist in the 1.7.x version (I try with 1.7.2 in jsfiddle).

I'm a newbie. Sorry.

Last edited 6 years ago by BrodaNoel (previous) (diff)

comment:8 Changed 6 years ago by m_gol

Resolution: fixed
Status: openclosed

Seems to work now.

Note: See TracTickets for help on using tickets.