Skip to main content

Bug Tracker

Side navigation

#3731 closed bug (duplicate)

Opened December 21, 2008 12:59AM UTC

Closed December 23, 2008 07:15PM UTC

internet explorer issue with "background-position"

Reported by: sanaell Owned by:
Priority: major Milestone: 1.3
Component: core Version: 1.2.6
Keywords: background-position,backgroundPosition,IE Cc: sanaell
Blocked by: Blocking:
Description

If you try to do a

$(this).css("background-position");

you got "undefined" under internet explorer

But

if you do

$(this).css("backgroundPosition");

you got an answer

so it's a little problem easy to fix (but maybe exist a better way)

my solution is to add few line to the attr function

[code]

attr: function( name, value, type ) {

var options = name;

// Look for the case where we're accessing a style value

if ( typeof name === "string" )

if ( value === undefined ) {

var camelCase = name.replace(/\\-(\\w)/g, function(all, letter){

return letter.toUpperCase();

});

return this[0] && jQuery[ type || "attr" ]( this[0], camelCase );

}

else {

options = {};

options[ name ] = value;

}

Check to see if we're setting style values

return this.each(function(i){

Set all the styles

for ( name in options )

jQuery.attr(

type ?

this.style :

this,

name, jQuery.prop( this, options[ name ], type, i, name )

);

});

},

/code

i've tested on one of my website using a lot of jquery & jquery plugin, without bug, and with the good behavior...

if someone have a better solution feel free :)

(added)

line 157 to 163 core.js

if ( value === undefined ) {

var camelCase = name.replace(/\\-(\\w)/g, function(all, letter){

return letter.toUpperCase();

});

return this[0] && jQuery[ type || "attr" ]( this[0], camelCase );

}

Attachments (0)
Change History (1)

Changed December 23, 2008 07:15PM UTC by dmethvin comment:1

cc: → sanaell
resolution: → duplicate
status: newclosed

Duplicate of #3732. Still need a test case there.