These are the snippets of code I am working with:
var topPix = $('#cc').css('top');
var leftPix = $('#cc').css('left');
$('#testFrame').css('top', topPix).css('left', leftPix);
After applying some styles to the 'testFrame', such as 'position: absolute;', everything seems to be functioning properly.
However, I encountered an issue where I needed to adjust the 'top' property by 5px. So, I tried the following code:
$('#testFrame').css('top', topPix+'+=5px').css('left', leftPix);
or:
$('#testFrame').css('top', topPix+'+=5').css('left', leftPix);
Unfortunately, this did not work as expected. Additionally, the 'top' value seemed to be subtracting a certain number of pixels rather than adding.
I am encountering this issue in IE8. Can anyone shed light on why this might be happening? I have considered alternative solutions like adjusting the margin or padding properties.