if .hidden
is hidden after click lt(contain all whatever click on title or icon or space) the .hidden
will show.
then how to make only click .icon
the .hidden
will become hide?
now it is not work, after click .icon
nothing happen ... I guess because .icon
is inside .lt
, when click .icon
the .lt
will trigger click too then after hide execute .lt
click function?
$('.lt').on({'click': function() {
if(!$('.$('.hidden').is(:visible)')){
var src="b";
$('.icon img').attr('src', src);
$('.hidden').show();
}
});
$('.icon').on({'click': function() {
if($('.$('.hidden').is(:visible)')){
var src="a";
$('.icon img').attr('src', src);
$('.hidden').hide();
}
});
<div class="lt">
<div class="title">
</div>
<div class="icon">
<img src="a">
</div>
<div class="hidden">
</div>
</div>
.hidden{display:none;}