Bug Tracker

Modify

Ticket #10710 (open bug)

Opened 19 months ago

Last modified 6 days ago

slidedown() and table issue

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

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

comment:1 Changed 19 months ago by timmywil

  • Owner set to cbad
  • Priority changed from undecided to low
  • Status changed from new to pending
  • Component changed from unfiled to effects
  • Version set to 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 19 months ago by cbad

  • Status changed from pending to new

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 19 months ago by anonymous

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

comment:5 Changed 19 months ago by timmywil

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

comment:6 Changed 12 months ago by sindresorhus

  • Status changed from new to open

comment:7 Changed 6 days 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 days ago by BrodaNoel (previous) (diff)

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as open
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.