微件:轮播图:修订间差异
跳转到导航
跳转到搜索
(创建页面,内容为“<includeonly> <script type="text/javascript"> document.addEventListener("DOMContentLoaded", function () { createSlider(images) }); let slider = document.getElementById('slider'); let dotsContainer = document.getElementById('dotsContainer'); let currentSlide = 0; function createSlider(images, links) { images.forEach((obj, index) => { let img = document.createElement('img'); img.src = obj.src; img.style.opacity =…”) |
无编辑摘要 |
||
第2行: | 第2行: | ||
<script type="text/javascript"> | <script type="text/javascript"> | ||
document.addEventListener("DOMContentLoaded", function () { | document.addEventListener("DOMContentLoaded", function () { | ||
const images=[ | |||
{ | |||
src: 'https://heishenhua.wiki/w/images/wiki_bg.png', | |||
link: 'https://www.baidu.com' | |||
}, | |||
{ | |||
src: 'https://inews.gtimg.com/om_bt/O6SG7dHjdG0kWNyWz6WPo2_3v6A6eAC9ThTazwlKPO1qMAA/641', | |||
link: 'https://www.semantic-mediawiki.org/wiki/How_to_write_a_JavaScript_to_display_data_in_a_Semantic_MediaWiki' | |||
} | |||
] | |||
createSlider(images) | createSlider(images) | ||
}); | }); |