Side navigation
#7305 closed bug (worksforme)
Opened October 25, 2010 01:12PM UTC
Closed February 22, 2012 12:56AM UTC
Last modified March 13, 2012 11:53PM UTC
Cant retrive current left and top css when $(obj) is hidden
Reported by: | svcorp77 | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | css | Version: | 1.5 |
Keywords: | top left css | Cc: | |
Blocked by: | Blocking: |
Description
var winObj = $('<div>Left AND Top set to Zero</div>')
.hide()
.appendTo('body')
.css({
width : 100,
height : 100,
left : '100px',
top : '100px',
position : 'absolute',
opacity : 0
}).animate({
width : 420,
height : 150,
opacity : 1,
left : ($(window).width() / 2 - 210) + 'px',
top : Math.round($(window).height() / 5) + 'px'
}, 450, function() {
console.log('animation complete');
console.log(winObj.attr('style'));
console.log(winObj.css('left'));
console.log(winObj.css('top'));
});
console.log(winObj.attr('style'));
console.log(winObj.css('left'));
console.log(winObj.css('top'));
display: none; width: 100px; height: 100px; left: 0px; top: 0px; position: absolute; opacity: 0; overflow: hidden;
0px
0px
animation complete
display: none; width: 420px; height: 150px; left: 741.5px; top: 117px; position: absolute; opacity: 1;
0px
0px
JQuery 1.43Pre display it correctly.
Attachments (0)
Change History (12)
Changed October 25, 2010 01:17PM UTC by comment:1
Changed October 25, 2010 02:50PM UTC by comment:2
component: | unfiled → css |
---|---|
keywords: | → top left css |
priority: | undecided → low |
See http://jsfiddle.net/addyosmani/F9LKa/
The 1.4.2 output of your code is:
display: block; width: 100px; height: 100px; left: 100px; top: 100px; position: absolute; opacity: 0; overflow: hidden;
100px
100px
animation complete
display: block; width: 420px; height: 150px; left: 38px; top: 97px; position: absolute; opacity: 1;
38px
97px
The 1.4.3 output is:
display: none; width: 100px; height: 100px; left: 0px; top: 0px; position: absolute; opacity: 0; overflow: hidden;
0px
0px
animation complete
display: none; width: 420px; height: 150px; left: 38px; top: 97px; position: absolute; opacity: 1;
0px
0px
And the Current Git Version output is:
display: none; width: 100px; height: 100px; left: 0px; top: 0px; position: absolute; opacity: 0; overflow: hidden;
0px
0px
animation complete
display: none; width: 420px; height: 150px; left: 38px; top: 97px; position: absolute; opacity: 1;
0px
0px
On first glances, this may be related to #7225, but as we've closed that as fixed and your code is currently not working using that fix, I'm leaving open for further review.
Changed October 25, 2010 07:55PM UTC by comment:3
status: | new → open |
---|
properly setting to 'open'. tsk tsk addy. ;-)
Changed November 17, 2010 07:35PM UTC by comment:4
Confirmed, this happed to me too. v1.4.4
Changed November 17, 2010 07:39PM UTC by comment:5
$(obj).position() is also reporting incorrectly when $(obj) is hidden.
Changed November 17, 2010 07:41PM UTC by comment:6
And on a final note, a workaround is doable as so, though not optimal.
$(obj).toggle();
var top = $(obj).css("top");
$(obj).toggle();
Changed February 02, 2011 09:22AM UTC by comment:7
Here is solution for:
jQuery JavaScript Library v1.5, string 7610, function jQuery.fx.prototype.update
jQuery version > 1.4.3: the same mods.
// Set display property to block for height/width animations if ( ( this.prop === "height" || this.prop === "width" ) && this.elem.style ) { this.elem.style.display = "block"; }
Please, make this changes next update.
Changed February 03, 2011 06:02PM UTC by comment:8
milestone: | → 1.next |
---|---|
version: | 1.4.3 → 1.5 |
Changed March 30, 2011 05:25PM UTC by comment:10
#8477 is a duplicate of this ticket.
Changed October 18, 2011 12:35PM UTC by comment:11
not seeing this issue in 1.7b2 nor latest git. I'm not sure this bug is still valid.
Changed February 22, 2012 12:56AM UTC by comment:12
resolution: | → worksforme |
---|---|
status: | open → closed |
I can no longer reproduce this bug. Since no new reports have come in, I'm considering this closed. Please reopen with a repro case if you feel this is an error.
JQuery 1.43