How to use the zepto.each function in zepto

To help you get started, we’ve selected a few zepto examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mipengine / mip-extensions-platform / mip-zpm-searchjobs / mip-zpm-searchjobs.js View on Github external
function readSearchLs() {
        var indexSearchHs = cs.get('indexSearchHs');
        var $SearchLsWrap = $('.indexSearchList');
        var dtBool = true;
        if (indexSearchHs == null) {
            indexSearchHs = [];
        } else {
            indexSearchHs = indexSearchHs.split(',');
        }
        if (indexSearchHs.length > 0) {
            $SearchLsWrap.children('dd').remove();
            $.each(indexSearchHs, function (i, v) {
                $('<dd><a>' + v + '</a><span class="add"></span></dd>').prependTo($SearchLsWrap);
            });
            $SearchLsWrap.show().find('dt').show().children('.clear').show();
        } else {
            dtBool = false;
            $SearchLsWrap.hide();
        }
    }
    // 保存最新历史记录方法
github mipengine / mip-extensions / src / mip-wkad-config / mip-wkad-config.js View on Github external
var showPoster = function (key, val) {
        var ggArr = {};
        var string = '';
        $.each(adStore, function (index, value) {
            string = string + '|' + value;
        });
        ggArr['ad_key'] = string.substr(1);
        val !== undefined ? ggArr[key] = val : 0;
        ggArr['charset'] = 'utf8';
        mobileAd.getAd(ggArr);
        // mobileAd.getParseWordInp();
    };
    // build说明: 广告组件,在页面展示,需要尽快加载
github mipengine / mip-extensions-platform / mip-wkfun-medicine / mip-wkfun-medicine.js View on Github external
success: function (data) {
                var length = data.list.length;
                var con = '<div class="cost-list"><ul>';
                $.each(data.list, function (i, t) {
                    if (i &gt;= 5) {
                        con += '<li class="none">\
                        <a href="' + t.href + '" class="dis-box">\
                        <p class="box-flex-1 cost-name">' + t.store_name + '</p><p class="pr10">\
                        <b class="cost-num"><em>¥</em>' + t.shop_price + '</b>\
                        <span class="cost-icon"><b></b></span></p></a></li>';
                    }
                    else {
                        con += '<li><a href="' + t.href + '" class="dis-box">\
                         <p class="box-flex-1 cost-name">' + t.store_name + '</p><p class="pr10">\
                         <b class="cost-num"><em>¥</em>' + t.shop_price + '</b>\
                         <span class="cost-icon"><b></b></span></p></a></li>';
                    }
                });
                con += '</ul>';
                if (length &gt; 5) {</div>
github mipengine / mip-extensions-platform / mip-jt-quote-realtime / mip-jt-quote-realtime.js View on Github external
$.each(data, function (index, val) {
                    var quote = val.quote;
                    var digits = 2;
                    var time = quote.q59;
                    if (typeof (time) !== 'undefined') {
                        if (new Date(time).getTime() > newTime) {
                            newTime = time;
                        }
                    }
                    digits = quote.digits;
                    if (isNaN(digits)) {
                        digits = 2;
                    }
                    index += 1;
                    $.each(idsArry, function (idsIndex, val) {
                        var textColor = undefined;
                        var valueStr = undefined;
                        if (colorSet[val]) {
                            textColor = getColor(val, 'q2', quote);
                        } else if (specalColorMap[val] !== undefined) {
                            textColor = getColor('q63', 'q2', quote);
                        }

                        if (colorSet[val]) {
                            valueStr = format(quote[val], digits);
                        } else if (val === 'q70') {
                            valueStr = format(quote[val], digits);
                        } else if (val === 'q80') {
                            valueStr = format(quote[val], 2) + '%';
                        } else {
                            valueStr = quote[val];
github mipengine / mip-extensions-platform / mip-times-xz / mip-times-xz.js View on Github external
success: function (area) {
                    $.each(area, function (i, item) {
                        $(element).find('#dd_car').append($('<optgroup></optgroup>').attr('label', item.name));
                        $.each(item.data, function (i, data) {
                            $(element).find('#dd_car').append($('<option></option>').val(data.id).html(data.name));
                        });
                    });
                }
            });
github mipengine / mip-extensions-platform / mip-times-xz / mip-times-xz.js View on Github external
$.each(area, function (i, item) {
                        $(element).find('#dd_series').append($('<optgroup></optgroup>').attr('label', item.name));
                        $.each(item.data, function (i, data) {
                            $(element).find('#dd_series').append($('<option></option>').val(data.id).html(data.name));
                        });
                    });
                }
github mipengine / mip-extensions / mip-news-recommend / mip-news-recommend.js View on Github external
htmlNews += [
                    '<div class="mip-news-recommend-item">',
                        '<a data-click="\''" data-url="' + item.url
                                + '" href="' + href + '" class="mip-news-recommend-href">',
                            '<div class="mip-news-recommend-title">' + item.title + '</div>',
                            '<div class="mip-news-recommend-info">',
                                '<span>' + formatTime(item.time) + '</span>',
                                '<span class="mip-news-recommend-provider">' + item.provider + '</span>',
                            '</div>',
                        '</a>',
                    '</div>'
                ].join('');
            });

            $.each(data.hot_card, function (i, item) {
                var dataClick = self.handleData(item, i, 'hotpoint');
                var href = isIframe ? 'javascript:void(0);' : item.url;

                if (i % 2 === 0) {
                    htmlHots += '<div class="mip-news-recommend-row">';
                }

                htmlHots += [
                    '<div class="mip-news-recommend-hot-item">',
                        '<a data-click="\''" data-url="' + item.url
                                + '" href="' + href + '" class="mip-news-recommend-hot-href">',
                            item.query,
                        '</a>',
                    '</div>'
                ].join('');
</div>
github mipengine / mip-extensions / mip-wkad-config / mip-wkad-config.js View on Github external
loadJs(elem, 'https://a.xywy.com/mobile_v3.js', function () {
                            var ggArr = {};
                            var string = '';
                            $.each(adStore, function (index, value) {
                                string = string + '|' + value;
                            });
                            ggArr['ad_key'] = string.substr(1);
                            ggArr['department'] = department;
                            ggArr['charset'] = 'utf8';
                            mobileAd.getAd(ggArr);
                        });
                    }
github fluid-notion / minimal-web-clipper / src / js / Clipper.js View on Github external
async visitNode($el) {
        if ($el.length === 0) return;
        if ($el.hasClass('ios-overlay')) return;
        const el = $el[0];
        debug('Visiting Node', el);
        const tag = el.tagName.toLowerCase();
        if (IGNORED_TAG_TYPES.indexOf(tag) >= 0) return null;
        const $clone = $(document.createElement(tag));
        $.each($el[0].attributes, (index, attribute) => {
            if (attribute.name === 'class') {
                return;
            } else if (attribute.name === 'src' || attribute.name === 'href') {
                $clone.attr(attribute.name, resolveURL(attribute.value))
            } else {
                $clone.attr(attribute.name, attribute.value);
            }
        });
        if (tag === 'img') {
            $clone.attr('src', await safeDownloadImage($clone.attr('src')));
        }
        const style = window.getComputedStyle(el);
        const decl = {};
        for (let i = style.length; i--;) {
            const prop = style[i];
            let val = style.getPropertyValue(prop);
github mipengine / mip-extensions-platform / mip-zpm-searchjobs / mip-zpm-searchjobs.js View on Github external
success: function (data, textStatus, jqxhr) {
                            $SearchLsWrap.show().children('dd').remove();
                            var sw = SearchInput.val();
                            var lw = $SearchLsWrap;
                            if (data.HotWords.length &gt; 0) {
                                $.each(data.HotWords, function (i, v) {
                                    v.Word = v.Word.replace(sw, '<span class="gl">' + sw + '</span>');
                                    $('<dd><a>' + v.Word + '</a><span class="add"></span></dd>').prependTo(lw);
                                });
                                $SearchLsWrap.find('.clear').hide();
                            } else {
                                $SearchLsWrap.find('dt').hide();
                            }
                        }
                    });

zepto

Zepto is a minimalist JavaScript library for modern browsers with a largely jQuery-compatible API. If you use jQuery, you already know how to use Zepto.

MIT
Latest version published 8 years ago

Package Health Score

67 / 100
Full package analysis