Compare commits

...

2 Commits

Author SHA1 Message Date
邹景立
cc8b6ed9e7 Update login.js 2022-04-19 23:38:26 +08:00
邹景立
aee5433838 Update login.js 2022-04-19 23:37:23 +08:00

View File

@ -16,14 +16,15 @@ $(function () {
window.$body = $('body');
/*! 后台界面背景切换 */
$('[data-supersized]').map(function () {
var idx = 0, imgs = [];
window.setInterval(function () {
imgs.length > 0 && $body.css({backgroundImage: 'url(' + (imgs[++idx] || imgs[idx = 0]) + ')'});
}, 5000) && this.dataset.supersized.split(',').forEach(function (url) {
/*! 登录界面背景切换 */
$('[data-supersized]').each(function (i, el) {
el.idx = 0, el.imgs = [], el.state = setInterval(function () {
el.imgs.length > 0 && $body.css({
backgroundImage: 'url(' + (el.imgs[++el.idx] || el.imgs[el.idx = 0]) + ')'
});
}, 5000) && el.dataset.supersized.split(',').forEach(function (url) {
layui.img(url, function () {
imgs.push(url);
el.imgs.push(url);
});
});
});