本文介绍了jquery同位素v2.1中的itemPositionDataEnabled的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚将同位素脚本升级到2.1,但现在选项itemPositionDataEnabled似乎不再起作用. data("isotope-item-position")立即返回undefined.

I just upgraded my isotope script to 2.1, but now the option itemPositionDataEnabled seems to not have any effect anymore. The data("isotope-item-position") just returns undefined now.

以下是v1脚本的原始文档: http://isotope. metafizzy.co/v1/docs/options.html#itempositiondataenabled

Here is the original documentation for the v1 script: http://isotope.metafizzy.co/v1/docs/options.html#itempositiondataenabled

有任何想法吗?

推荐答案

,您可以尝试使用 position jQuery方法或偏移量

you can try to get the position with position jquery method or offset

var p = $( "#element" );
var position = p.position();
alert( position.left + "," + position.top);

这篇关于jquery同位素v2.1中的itemPositionDataEnabled的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-31 03:04