DotnetSparrow
DotnetSparrow

Reputation: 27996

panel.style.left in JQuery

I want to do this using jquery :

 panel.style.left = '150px'

How can I do this ?

I tried this:

  var panel = $('#Panel1');
  panel.position().left = 150;

but It didn't work

Upvotes: 2

Views: 5782

Answers (2)

pimvdb
pimvdb

Reputation: 154918

This is the way:

panel.css("left", 150);

Upvotes: 4

Try: panel.css('left', '150px');

Check the docs on the .css() method.

Upvotes: 3

Related Questions