0

私はウェブサイトを開発しており、非常に優れたIsotopeスクリプトを使用して、アイテムでフィルター可能な領域を作成しています。

ホバーするとアイテムの背景が赤くなるように設定しましたが、奇妙なことに、Isotopeはいくつかのフィルタリング後に一部hoverのエフェクトを削除します。

ここで私が意味することのサンプルを見ることができます: http://paragraphe.org/henpier/isotope_test/archive.html

それらをホバーしてみてください。すべて問題ないようです。それからそれらを数回フィルタリングしようとすると、突然いくつかのhover効果が機能しなくなります...

皆さん、なぜこれが起こっているのかを解決するのを手伝ってくれませんか? どうもありがとう、

4

2 に答える 2

1

Isotope will cause bubbling in the script - in reference to your hover effects bind them with using ON. http://api.jquery.com/on/

$("p").on("hover", function(){
alert( $(this).text() );
});

Although - I see you are setting it via the css. - You can loop loop through the isotope element and append the class specifically to ensure it works. Or you could use the above hover function to append or remove the class.

http://isotope.metafizzy.co/docs/extending-isotope.html

$('#container').isotope({
  itemSelector: '.element',
  itemPositionDataEnabled: true
})
// log position of each item
.find('.element').each(function(){
  var position = $(this).data('isotope-item-position');

//APPEND required class here. ensure its on the elements

  console.log('item position is x: ' + position.x + ', y: ' + position.y  );
});

于 2012-11-03T00:25:08.417 に答える
0

Isotope が要求する重要な CSS ルール、特にz-indexフィルタリング部分の一部が完全に欠落していました。

http://isotope.metafizzy.co/docs/introduction.html#css

それを指摘してくれたDavidに感謝します...

于 2012-11-03T11:33:05.207 に答える