X
document X ; document
the environmental background of the problems and what methods you have tried
I have tried these methods:
a. Turn it off wherever you click:
$(document).mouseup(function(e){
var _con = $(".show-item"); //
var _son = $(".coming-soon-warp");
if(!_con.is(e.target) && _con.has(e.target).length === 0){
$(".show-item").removeClass("show");
$(".pro-contet").removeClass("scale-one");
};
if(!_son.is(e.target) && _son.has(e.target).length === 0){
$(".coming-soon-warp").removeClass("show");
$(".pro-contet").removeClass("scale-one");
};
});
b. As long as this method exists, none of the other methods in this range will work
$(document).click(function (e) {
var target = $(e.target);
console.log(target);
if (!target.hasClass("show-item") && target.closest(".show-item").length <= 0) {
$(".show-item").removeClass("show");
}
});
what result do you expect? What is the error message actually seen?
1. .show-item
2. .show-item X
3. .show-item
4. .show-item learn more
:
<body>
<div class="locksys">
<div class="house">
//
<a class="hight-light lever" data-item="Lever" data-name="UL3" style="left:24%;top:43%;"></a>
...
//
<!--hight-light -->
<div class="show-item" data-pro="UL3">
<b class="close"></b>
<div class="pro-contet">
<img src="<?php echo Yii::app()->baseUrl;?>/images/home/ul3.png" alt="" class="item-pic" />
<div class="more">
<div class="discirption">
<h4>Ultraloq UL3 BT</h4>
5-in-1 Smart Lever Lock
<div class="icon-list">
<span class="icon-utec-ul1-fingerprint house-icon"></span>
<span class="icon-utec-app house-icon"></span>
<span class="icon-utec-key house-icon"></span>
<span class="icon-utec-code house-icon"></span>
</div>
<a href="<?php echo Yii::app()->createUrl("lock/ul3/bt");?>" class="button home-btn">Learn more</a>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
is there any good way to achieve points 3 and 4?