打开主菜单

少前百科GFwiki β

更改

Widget:SkinQuery/js

添加1,085字节2021年7月18日 (日) 23:42
无编辑摘要
creat_click();
creat_album();
 
function dragFn (dragObj,parent) {
$(dragObj).mousedown(function (e) {
var _this = $(this)
var parent_h = $(parent)[0].offsetHeight
parent_w = $(parent)[0].offsetWidth
drag_h = $(this)[0].offsetHeight
drag_w = $(this)[0].offsetWidth
var dragX = e.clientX - $(this)[0].offsetLeft
var dragY = e.clientY - $(this)[0].offsetTop
$(dragObj).addClass("mousedown")
 
$(document).mousemove(function (e) {
var l = e.clientX - dragX
var t = e.clientY - dragY
if (l < 0) {
l = 0
} else if (l > parent_w - drag_w) {
l = parent_w - drag_w
}
if (t < 0) {
t = 0
} else if (t > parent_h - drag_h) {
t = parent_h - drag_h
}
_this.css({
left: l + 'px',
top: t + 'px',
})
})
})
$(document).mouseup(function () {
$(this).off('mousemove');$(dragObj).removeClass("mousedown")
})
}
function creat_select(){
console.log(album_width, pic_width);
$("#mw-content-textbody").append(html_text);
$("#skinalbum").attr("the_width", the_width);
});
}
 
dragFn ("#skinalbum","body")
})
</script></includeonly>
14,357
个编辑