$("li").hover(
function () {
// do x
},
function () {
// do y
});
.. thats for hover, how would I do the same for click toggle, i.e do x on click and y on second click?
Manythanks
$("li").hover(
function () {
// do x
},
function () {
// do y
});
.. thats for hover, how would I do the same for click toggle, i.e do x on click and y on second click?
Manythanks
$.toggle()
will take any number of functions. Here it is with two:
$("li").toggle(
function() {
// do x
},
function() {
// do y
}
);