MediaWiki:Common.js:修订间差异
外观
小无编辑摘要 标签:手工回退 已被回退 |
小无编辑摘要 标签:手工回退 已被回退 |
||
| 第8行: | 第8行: | ||
history.replaceState({}, document.title, 'Index'); | history.replaceState({}, document.title, 'Index'); | ||
} | } | ||
//轮播图滚动 | |||
$(function () { | |||
var $carousels = $('.carousel'); | |||
var startX,endX; | |||
var offset = 50; | |||
$carousels.on('touchstart',function (e) { | |||
startX = e.originalEvent.touches[0].clientX; | |||
}); | |||
$carousels.on('touchmove',function (e) { | |||
endX = e.originalEvent.touches[0].clientX; | |||
}); | |||
$carousels.on('touchend',function (e) { | |||
var distance = Math.abs(startX - endX); | |||
if (distance > offset){ | |||
$(this).carousel(startX >endX ? 'next':'prev'); | |||
} | |||
}) | |||
}); | |||
2023年3月27日 (一) 11:02的版本
/* 这里的任何JavaScript将为所有用户在每次页面载入时加载。 */
/* UTC时钟使用本地时区。 */
window.LiveClockTimeZone = 'Asia/Shanghai';
/* 优化 */
if (location.pathname === '/') {
history.replaceState({}, document.title, 'Index');
}
//轮播图滚动
$(function () {
var $carousels = $('.carousel');
var startX,endX;
var offset = 50;
$carousels.on('touchstart',function (e) {
startX = e.originalEvent.touches[0].clientX;
});
$carousels.on('touchmove',function (e) {
endX = e.originalEvent.touches[0].clientX;
});
$carousels.on('touchend',function (e) {
var distance = Math.abs(startX - endX);
if (distance > offset){
$(this).carousel(startX >endX ? 'next':'prev');
}
})
});