模板:轮播图:修订间差异

来自营地百科
(创建页面,内容为“{{Swiper |翻页=箭头 |分页=否 |效果=fade |File:Eotensaplingconcepts.jpg |File:Nightingale eotensapling01.jpg |File:Nightingale eotensapling02.jpg |File:Nightingale eotensapling03.jpg |File:Eotensaplingconcepts.jpg }} <!-- *不需要多个轮播时,从下方开始删除,保留需要的图即可 *banner图推荐尺寸:960*300px *需要更多该轮播图的效果时,请查看页面:帮助:Swiper -->”)
 
无编辑摘要
标签已被回退
第1行: 第1行:
{{Swiper
{{微件:Swiper
|翻页=箭头
|翻页=箭头
|分页=否
|分页=否

2024年2月23日 (五) 15:16的版本

<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>