[jQuery] invalid object initializer. Pls Help
I'm trying to animate a couple of fields in a form. When the focus
lands on field A it grows to 300px and fieldB shrinks to 100px. When
focus lands on field B, it grows to 300 and field A shrinks to 100px.
Here's my code:
function resizeSearchAsk() {
console.log('SearchAsk');
$('#fldA').animate({'width', '100px'}, 'slow');
$('#fldB').animate({'width', '300px'}, 'slow');
}
function resizeAskSearch() {
console.log('AskSearch');
$('#fldA').animate({'width', '300px'}, 'slow');
$('#fldB').animate({'width', '100px'}, 'slow');
}
$(document).ready(function() {
console.log('ready start');
$('#fldA').focus(resizeSearchAsk);
$('#fldB').focus(resizeAskSearch);
console.log('ready end');
});
Just loading the page I get a console error in FireBug: invalid object
initializer
On this line:
$('#fldA').animate({'width', '100px'}, 'slow');
Which is in the first function resizeSearchAsk().
I'm not getting the log msg in the ready function.
Any idea what I'm doing wrong? I can giove you the entire file if you
want (it's not long: a test.)
Thx,
- AAA