Py学习  »  Jquery

如何将经典JavaScript中的“for of”转换为jQuery?

Pepe • 3 年前 • 1396 次点击  

我对经典JavaScript不是很熟悉,那么这行代码在jQuery中会是什么样子呢?

const siemas = document.querySelectorAll('.slider');

for(const siema of siemas) {
    new Siema({
    selector: siema
});
}

const siemas = document.querySelectorAll('.slider');

…将只是(如果我是对的):

var siemas = $('.slider');

而这个。。。

for(const siema of siemas)

... 会变成这样:

$.each ???
Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/132794
 
1396 次点击  
文章 [ 3 ]  |  最新文章 3 年前