我已經嘗試了幾件事情,但在此刻,我想淡出更改背景位置和淡入淡出,但不工作....任何想法?或更好的解決方案?jQuery或CSS更改和褪色懸停的背景位置
$('.collection-hover a').on("mouseenter touchstart", function(event) {
$(this).find('.collection-list-hover-desc').fadeIn(1000);
$(this).animate({backgroundPosition: "-50% 100%"});
});
$('.collection-hover a').on("mouseleave touchend", function(event) {
$(this).find('.collection-list-hover-desc').fadeOut(1000);
$(this).animate({backgroundPosition: "0 0"});
});
HTML
<li class="collection-list-item grid-item first collection-hover">
<a href="/collections/butterfly-sofa" class="position-left" data-image="//cdn.shopify.com/s/files/1/1839/7697/collections/category-panel-butterfly.jpg?v=1491014401" style="background-image: url("//cdn.shopify.com/s/files/1/1839/7697/collections/category-panel-butterfly.jpg?v=1491014401"); height: 108.009px;">
<div class="collection-list-hover-desc">
<p>Dein eigener Ruhepol in einer hektischen Welt. Der durch eine Struktur im Inneren formstabile Sitzsack vereint Komfort und Ästhetik.</p>
</div>
<div class="collection-list-hover-button">
<span class="button" style="
padding: 5px 8px;
">Entdecken</span>
</div>
</a>
</li>
你的html在哪裏? – repzero
你能否提供一些html代碼,如果你可以在html模塊中包含html,css和jQuery,點擊<>它會使其他s更容易協助 – Jpsh
添加html – James