I have this cart that has many items, everyone of this is a <li>
element set thru PHP:
<li class="cart-product" data-id="<?= $product->id ?>" data-rowid="" data-ison="0">
<span class="product-lightup"><img src="<?= base_url('img/site_basics/product_lightup.png') ?>" /></span>
<img src="<?= base_url('img/products/'.$product->image) ?>" class="product-img"/>
<!-- PLUS/MINUS -->
<div class="text-center product-click"><br>
<span class="cart-plus"><img src="<?= base_url('img/site_basics/plus_sign.png') ?>" /><br>Aggiungi</span>
<span class="cart-minus"><img src="<?= base_url('img/site_basics/minus_sign.png') ?>" /><br>Rimuovi</span>
</div>
<!-- Findout button -->
<div class="text-center product-findout">
<span class="badge">Scopri più</span>
</div>
</li>
I use this jQuery to select an item:
$('.cart-product').click(function(){
if($(this).attr('data-ison') === '1'){
$(this).itemOff();
}else{
$(this).itemOn();
}
});
I want to remove the click event from the li > div.product-findout
.
I tried changing the evet this way but doesn't work:
$('.cart-product:not(.product-findout)').click(function(){
[...]
});
[Edit]
The code classes and sub-classes are important to be kept the same, as the jQuery gets and sets attribute to it.
I need to make the li
item clickable AND GIVE THE .product-findout
another link/event.
Any other way or idea?