Bug Tracker

Modify

Ticket #11303 (closed bug: invalid)

Opened 16 months ago

Last modified 13 days ago

FadeIn doesn't keep block format

Reported by: ryannaddy Owned by:
Priority: low Milestone: None
Component: effects Version: 1.7.1
Keywords: Cc:
Blocking: Blocked by:

Description

While using fadeIn() on an <a> tag with a css "block" display type, it removes the block format when it fades in. It seems to do the same on other inline elements as well. It works fine on the <div> tag though.

Example:  http://jsfiddle.net/NZ3eF/1/

Change History

comment:1 Changed 16 months ago by sindresorhus

  • Priority changed from undecided to low
  • Resolution set to invalid
  • Status changed from new to closed
  • Component changed from unfiled to effects

Simplified testcase:  http://jsfiddle.net/mofle/NZ3eF/3/

The problem is that you have a rule "display: none" after "display: block" which overwrites it. Since the display value is none, jQuery will instead use the default display value of the a-tag, which is "inline".

You can work around this by doing something like this instead:

$('.nav-link').fadeIn().css('display', 'block');

comment:2 Changed 13 days ago by Sagan Internet Marketing

Thanks for the idea to use

.css('display', 'block');

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 closed
Author


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

 
Note: See TracTickets for help on using tickets.