Bug Tracker

Opened 14 years ago

Closed 13 years ago

#5130 closed bug (fixed)

show() sets "display:block" to inline element.

Reported by: DanTheMan Owned by:
Priority: major Milestone: 1.4
Component: effects Version: 1.4a1
Keywords: Cc:
Blocked by: Blocking:

Description

How to reproduce:

  1. create inline element
  2. hide element
  3. add element to DOM using after()
  4. show element

The element now has style display set to block. Please see test page for a proof of concept.

Workaround: add the element to DOM before hiding it.

  1. create inline element
  2. add element using after()
  3. hide element
  4. show element

But that may lead to a flickering effect.

Attachments (1)

jquery-show.html (945 bytes) - added by DanTheMan 14 years ago.
Testcase: hide() , after(), show() makes inline element to block-level element.

Download all attachments as: .zip

Change History (5)

Changed 14 years ago by DanTheMan

Attachment: jquery-show.html added

Testcase: hide() , after(), show() makes inline element to block-level element.

comment:1 Changed 14 years ago by DanTheMan

Forgot to mention: bug applies to Firefox

Internet explorer does not exhibit this problem.

comment:2 Changed 14 years ago by DanTheMan

Nobody interested?

How can I improve this bug report so developers are happy with it?

comment:3 Changed 14 years ago by petersendidit

The fix for this is to replace:

// Reset the display
this.elem.style.display = this.options.display;

with

var old = jQuery.data(this.elem, "olddisplay");
this.elem.style.display = old ? old : this.options.display;

In fx.js in jQuery.fx.prototype.step

comment:4 Changed 13 years ago by john

Component: unfilledfx
Resolution: fixed
Status: newclosed
Version: 1.3.21.4a1
Note: See TracTickets for help on using tickets.