Dynamic width issue

Dynamic width issue

Hi,

I'm checking for the presence on a page of a class in my code called li.fourthstep (it's a button in a menu bar)

If that class exists, I want the width of a class called .next (it's a button) to have a margin-left of 660px. If li.fourthstep doesn't exist, I want the margin-left to be 785px.

Can't get this to work. Here's my code.

$(document).ready(function() {
if ($('li.fourthstep').length > 0) {
$('.next').css('margin-left','660px');
}
else {
$('.next').css('margin-left','785px');
}
});


Thanks
John