Bug Tracker

Opened 12 years ago

Closed 9 years ago

#2029 closed enhancement (wontfix)

.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@…
Blocked by: Blocking:

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 (5)

comment:1 Changed 12 years ago by brandon

Priority: criticalminor
Resolution: wontfix
Status: newclosed

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

comment:2 Changed 12 years ago by yereth

Resolution: wontfix
Status: closedreopened

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 11 years ago by flesler

Component: corefx
Milestone: 1.2.21.2.4
need: PatchReview
Type: bugenhancement

comment:4 Changed 11 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 9 years ago by dmethvin

Resolution: wontfix
Status: reopenedclosed

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

Note: See TracTickets for help on using tickets.