欢迎大家来到环行旅舍(克莱因舍)WIKI!本WIKI交流群:587477551
本WIKI正在建设中,欢迎大家一起参与WIKI的建设,可以参考编辑教程BWIKI编辑教程

「人类无知的时代已经过去,一场变革之风将在薰然的曙光里盘旋而上。是扬帆还是止舵,该由你决定了。」

——欢迎来到「克莱因舍」
全站通知:

Widget:Swiper

来自环行旅舍WIKI_BWIKI_哔哩哔哩
跳到导航 跳到搜索

<link rel="stylesheet" href="//wiki-dev-patch-oss.oss-cn-hangzhou.aliyuncs.com/test/swiper-bundle.css"> <script src="//wiki-dev-patch-oss.oss-cn-hangzhou.aliyuncs.com/test/swiper-bundle.min.js"></script> <script> RLQ.push(['jquery', () => { const swipers = []; Object.assign(mw.bwiki = mw.bwiki || {}, {swipers: swipers}); $.each($(".bwiki-swiper-thumbs").get().concat($(".bwiki-swiper:not('.bwiki-swiper-thumbs')").get()), function (i, el) { const attrs = this.attributes; const options = {}; $.each(attrs, function (i, attr) { if (attr.nodeName.indexOf("data-swiper-") === -1 || attr.nodeName === "data-swiper-options") return true; options[attr.nodeName.replace("data-swiper-", "")] = attr.nodeValue; }); try { const optionsTemp = (new Function('el', 'return ' + decodeURIComponent(($(this).attr("data-swiper-options")) || "{}").replace(/\n|\t/g, "").replace(/\+/g, " ")))(el); $.extend(options, optionsTemp); } catch (e) { console.error(e); } console.log("swiper-options", options); swipers.push(new Swiper($.extend({el:this}, options))); }) }]); </script>