Bug Tracker

Opened 6 years ago

Closed 6 years ago

#13918 closed bug (notabug)

$().resize() was invalid sometimes

Reported by: lijianlin16889@… Owned by: lijianlin16889@…
Priority: undecided Milestone: None
Component: unfiled Version: 2.0.0
Keywords: Cc:
Blocked by: Blocking:

Description

Hi, $().resize() methond is invalid sometimes in the 2.0 version but it is always valid if add "onresize" event to body.

Add I cannot give a test because there have many contents. My code is below:

$(window).resize(function(){
		console.log(2222222222222222);
		ol$.fnReLocateTOMOW("#imgDiv","#preference","#sessionTO");
		var adHeight = $(window).innerHeight()-$("#aslTree").offset().top-30,
			centerH = $("#cmiddle").outerHeight(true),
			cRealH;
		if(centerH < adHeight)
			cRealH = adHeight;
		$("#aslTree").css({height:adHeight});
		console.log($("#aslTree").outerHeight(true)+" === "+adHeight);
		console.log($("#cmiddle").outerHeight(true)+" === "+adHeight);
		$("#cmiddle").css({minHeight:cRealH});
	});

It will be invalid If I refresh page again after loading completely, Any error of my code?

Change History (4)

comment:1 Changed 6 years ago by lijianlin16889@…

Because of there are many ajax calls in my code, and includs many dynamic appends, many things are created dynamically. I do not know why this codes don't works well sometimes, but I tested well use onresize() within dom element. So, Can anybody give me some directions?

Thanks very much!

comment:2 Changed 6 years ago by m_gol

Owner: set to lijianlin16889@…
Status: newpending

Thanks for taking the time to contribute to the jQuery project! Please provide a complete reduced test case on jsFiddle to help us assess your ticket!

Additionally, be sure to test against the "jQuery 1.x (edge)" or "jQuery 2.x (edge)" version to ensure the issue still exists—you may need to change this to a specific version depending on the test case.

For the AJAX-related tests you can create a few fiddles and submit requests to addresses with "/show/light" added to the end of the URL; example: http://jsfiddle.net/m_gol/3hwjC/17/show/light/

To get you started, use the appropriate boilerplate:

Open the link and click to "Fork" (in the top menu) to begin.

Also, please read:

Additional resources:

comment:3 Changed 6 years ago by lijianlin16889@…

Status: pendingnew

Hi, I had resolve it! I am sorry It is not a bug. But thanks very much for Getting feedbacks so quick. I do not find out where I can close this report, So please help me to change its statu.

Thanks again.

comment:4 Changed 6 years ago by dmethvin

Resolution: notabug
Status: newclosed
Note: See TracTickets for help on using tickets.