zoukankan      html  css  js  c++  java
  • 控制窗口不能拖拉出主窗口 Dialog And Window

    /* 控制窗口不能拖拉出主窗口(覆写) */
    var easyuiPanelOnMove = function(left, top) {
    if ($(this).panel('options').reSizing) return;
    var parentObj = $(this).panel('panel').parent();
    var width = $(this).panel('options').width;
    var height = $(this).panel('options').height;
    if (left < 0) { $(this).panel('move', { left : 0 }); }
    if (top < 0) { $(this).panel('move', { top : 0 }); }
    if (parentObj.css("overflow") == "hidden") {
    var inline = $.data(this, "window").options.inline;
    if (inline == false) { parentObj = $(window); }
    if (left > parentObj.width() - width) { $(this).panel('move', { "left" : parentObj.width() - width }); }
    if (top > parentObj.height() - height) { $(this).panel('move', { "top" : parentObj.height() - height }); }
    }
    };
    $.fn.window.defaults.onMove = easyuiPanelOnMove;
    $.fn.dialog.defaults.onMove = easyuiPanelOnMove;

  • 相关阅读:
    CSS属性之定位
    CSS选择器区别
    HTML属性及其相关区别
    HTML标签区别
    HTML其他概念
    CSS3新特性
    HTML5新标签
    HTML5新特性
    params修饰符的用法
    C#中引用参数ref和输出参数out
  • 原文地址:https://www.cnblogs.com/huangf714/p/5922592.html
Copyright © 2011-2022 走看看