I am trying the run the following code:
$(document).ready({
$("#menu-nav a").hover(
function () {
$(this).css ( marginRight: '20px' );
},
function () {
$(this).css ( marginRight: '10px' );
}
);
}); //end ready
But, my dreamweaver reports and error on the line $("#menu-nav a").hover(. Is it okay to use the selector as #menu-nav a or should it be something else ?
The problem is instead of this:
You need this:
I am sure you knew that, but it’s easy to overlook since the error is shown to be in the following line.
Another issue:
I think you will also run into problems here:
Per the jQuery docs, you should use this:
An alternative:
Here’s one more thing, just to give a complete answer. As is noted in the comments, you really don’t need jQuery at all for this, if you don’t want to use it. Try this:
You can add whatever styles you want like that.