Bug Tracker

Modify

Ticket #2029 (closed enhancement: wontfix)

Opened 5 years ago

Last modified 3 years ago

.show() ignores .visibility

Reported by: yereth Owned by:
Priority: minor Milestone: 1.2.4
Component: effects Version: 1.2.1
Keywords: show(), visibility Cc: yereth@…
Blocking: Blocked by:

Description

When .show() is called on an element which has 'visibility: hidden', it simply ignores this. I'd say .show() is a way to simply tell the element to show itself! So therefore I suggest the following solution to make .show() also work on invisible elements;

	show: function(speed,callback){
		return speed ?
			this.animate({
				height: "show", width: "show", opacity: "show"
			}, speed, callback) :
			
			this.filter(":hidden").each(function(){
				this.style.display = this.oldblock ? this.oldblock : "";
				if ( jQuery.css(this,"display") == "none" )
					this.style.display = "block";
				if ( jQuery.css(this,"visibility") == "hidden" )
					this.style.visibility = "visible";
			}).end();
	},

Change History

comment:1 Changed 5 years ago by brandon

  • Priority changed from critical to minor
  • Status changed from new to closed
  • Resolution set to wontfix

The show and hide methods deal only with the display property.

comment:2 Changed 5 years ago by yereth

  • Status changed from closed to reopened
  • Resolution wontfix deleted

By now the discussion has continued on the jquery dev group.

Please reconsider. Brandon has already replied. See the following 2 posts for the discussion:  http://groups.google.com/group/jquery-dev/browse_thread/thread/6ca936d7e0ebad3c  http://groups.google.com/group/jquery-dev/browse_thread/thread/b747f9a937ed93d3

comment:3 Changed 5 years ago by flesler

  • need changed from Patch to Review
  • Type changed from bug to enhancement
  • Component changed from core to fx
  • Milestone changed from 1.2.2 to 1.2.4

comment:4 Changed 4 years ago by dmethvin

Elements can be hidden by changing display, visibility, opacity, or by positioning them out of the viewport (e.g., large negative margin). Up to this point hide/show have only dealt with display. Has there been a problem with that interpretation?

comment:5 Changed 3 years ago by dmethvin

  • Status changed from reopened to closed
  • Resolution set to wontfix

Since this is long-documented behavior that would likely break existing code if changed, I'll close this ticket.

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.