I want to change only one parent when I hang over tags <p>. The code:
$('.hover').each(function () {
$(this).parent().hover(function () {
$('p').parent(this).css('font-size','30px');
}, function () {
$('p').parent(this).css('font-size','10px');
});
});
and HTML:
<ul>
<li>1 <p class='hover'>xxxx</p></li>
<li>2 <p class='hover'>yyyy</p></li>
</ul>
When I am above "xxxx" I want to change "1" and "xxxx", but "2" and "yyyy" do nothing, and when I hang "yyyy" I want to "2" and "yyyy" "change but "1" and "xxxx" do nothing.
I am new to jQuery.
source
share