scroll - How to put multiple style attributes in jquery -
this question has answer here:
$('#header').css('left', 200 - $this.scrollleft());
i need put multiple style attributes in above line. start , end part needs intact.
please help. in advance.
as explained in documentation, can pass object .css()
function set styles multiple properties in single call. key name of property , value value set. example:
$('#header').css({ "left" : 200 - $this.scrollleft(), "top" : 600 });
would set left
value of 200 - $this.scrollleft()
, , top
600.
Comments
Post a Comment