Hi,
I'm very surprised to constat (a couple of same issue -quiet old in this forum) .css() does not react when trying to use multiple background parameters.
My goal is to dynamically get positioned 1 backgound-image (a gecko) out of the 2 my #container has.
This image must be at the same position whatever the browser window is resized.
So I calculate the left offset to change it, once à page loading, and later using the.resize().
If the calculus is ok (alert) the .css() does not do nothing, neither any errors in Firebg console..?!
here's one of my attempt for the function to be called.
- set_PosLezard = function(){
W_Cin = $('#container-in').width();
W_C = $('#container').width(); Pos_lezard = (W_C - W_Cin) / 2 + 'px'; var back_ground = '"' + Pos_lezard + ' 40px, center 114px' +'"';
var cssObj = { 'background-position' : back_ground };
$('#container').css(cssObj);
//alert ('set_PosLezard : ' + Pos_lezard + ' background-position : ' + back_ground); }
any clues ?
thank you