Skip to main content

Bug Tracker

Side navigation

#2311 closed bug (worksforme)

Opened February 09, 2008 01:05AM UTC

Closed June 16, 2010 02:43AM UTC

$('body').show() doesn't work

Reported by: larmelarme Owned by:
Priority: minor Milestone:
Component: core Version: 1.2.2
Keywords: Cc:
Blocked by: Blocking:
Description

This code doesn't work on 1.2.2 and 1.2.3.

<html>
<head>
<style>
.none { display: none }
</style>
<script type="text/javascript" src="jquery-1.2.2.js"></script>
<script type="text/javascript">
$(function(){
  $('body').show();
});
</script>
</head>
<body class="none">
This isn't show.
</body>
</html>

I made simple patch.

	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 || "";
				if ( jQuery.css(this,"display") == "none" ) {
				  var isbody = /^body$/i.test(this.tagName);
					var elem = (isbody) ? $(this) : jQuery("<" + this.tagName + " />").appendTo("body");
					this.style.display = elem.css("display");
					// handle an edge condition where css is - div { display:none; } or similar
					if (this.style.display == "none")
						this.style.display = "block";
					if (!isbody)
						 elem.remove();
				}
			}).end();
	},
Attachments (0)
Change History (3)

Changed August 13, 2008 10:47AM UTC by Nodashi comment:1

I think you should execute your show statement in the ready function

Changed February 06, 2010 02:38AM UTC by petersendidit comment:2

This is working correctly in 1.4.1

Changed June 16, 2010 02:43AM UTC by dmethvin comment:3

resolution: → worksforme
status: newclosed