It seems like there might be something I'm overlooking.
I am attempting to retrieve the current background information for an element (div
) that has multiple backgrounds set using the longhand properties background-repeat
, background-position
, and background-image
.
Using jQuery, I have tried
var bPos = $('#element').css('background-position')
to see the current positions, which should give me something like '0 0, 100px 100px, left bottom'
in Firefox and Chromium. However, Safari (version 5 on OS-X) only returns the first value pair ('0 0'
). These CSS values are defined in a separate stylesheet.
Any thoughts on why this discrepancy exists? Is there a way to obtain the full set of value pairs in Safari (even using the shorthand background
property does not work)?
Edit:
Below is the CSS code from the external stylesheet used:
#page{
background-repeat: repeat-x, repeat-x, repeat-x, repeat-x, repeat-x;
background-image: url('../images/line.png'), url('../images/line.png'), url('../images/line.png'), url('../images/line.png'), url('../images/line.png');
background-position: 0 798px, 0 653px, 0 125px, 0 88px, 0 78px;
}
Edit:
I have created a test scenario for this issue on jsFiddle and have filed it as a jQuery bug report since it seems to be reproducible behavior. Although it could potentially be a browser implementation issue rather than strictly a jQuery bug.
Any suggestions are welcome...
Edit:
The jQuery bug report has been closed - indicating it may be a Safari bug. Unsure how to proceed further, but I have submitted a bug report to Apple.
Edit:
According to Sindre Sorhus, this issue appears to have been resolved in Safari 5.1.