jQuery vurgulu() Yöntem
Örnek
Fare işaretçisi üzerine geldiğinde bir <p> öğesinin arka plan rengini değiştirin:
$("p").hover(function(){
$(this).css("background-color", "yellow");
}, function(){
$(this).css("background-color", "pink");
});
Tanım ve Kullanım
hover() yöntemi, fare işaretçisi seçili öğelerin üzerine geldiğinde çalıştırılacak iki işlevi belirtir.
Bu yöntem hem mouseenter hem de mouseleave olaylarını tetikler.
Not: Yalnızca bir işlev belirtilirse, hem mouseenter hem de mouseleave olayları için çalıştırılacaktır.
Sözdizimi
$(selector).hover(inFunction,outFunction)
Parameter | Description |
---|---|
inFunction | Required. Specifies the function to run when the mouseenter event occurs |
outFunction | Optional. Specifies the function to run when the mouseleave event occurs |