◆少前百科是非盈利性、非官方的少女前线维基百科。
◆如果您发现某些内容错误/空缺,请勇于修正/添加!参与进来其实很容易!点这里 加入少前百科
◆有任何意见、建议、纠错,欢迎在 GFwiki:反馈与建议 提出和讨论。编辑事务讨论QQ群:597764980,微博@GFwiki少前百科
◆To foreigners,You can use twitter to contact us.
Icon Nyto Silver.png

“Widget:SkinQuery/js”的版本间的差异

来自少前百科GFwiki
跳转至: 导航搜索
(fix routine)
第8行: 第8行:
 
creat_click();
 
creat_click();
 
creat_album();
 
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(){
 
function creat_select(){
第443行: 第479行:
 
     console.log(album_width, pic_width);
 
     console.log(album_width, pic_width);
  
     $("#mw-content-text").append(html_text);
+
     $("body").append(html_text);
  
 
     $("#skinalbum").attr("the_width", the_width);
 
     $("#skinalbum").attr("the_width", the_width);
第489行: 第525行:
 
     });
 
     });
 
}
 
}
 +
 +
dragFn ("#skinalbum","body")
  
 
})
 
})
 
</script></includeonly>
 
</script></includeonly>

2021年7月18日 (日) 23:42的版本