⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ddmy.js

📁 原名JSPackager
💻 JS
字号:

/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */

/**
 * @class a ygDDFramed implementation where the frame only moves vertically, and
 * the DOM elements are swapped when one is dropped on another
 *
 * @extends YAHOO.util.DDProxy
 * @constructor
 * @param {String} id the id of the linked element
 * @param {String} sGroup the group of related DragDrop objects
 */
YAHOO.example.DDMy = function(id, sGroup, config) {

    if (id) {
        this.init(id, sGroup, config);
        this.initFrame();
        this.logger = this.logger || YAHOO;
    }

    // The frame should only move vertically...  this makes it so the user can
    // only move content channels up and down within a column
    this.setXConstraint(0, 0);
};

// YAHOO.example.DDMy.prototype = new YAHOO.util.DDProxy();
YAHOO.extend(YAHOO.example.DDMy, YAHOO.util.DDProxy);

YAHOO.example.DDMy.prototype.onDragDrop = function(e, id) {
    this.logger.log(this.id + " onDragDrop");

    var el;

    if ("string" == typeof id) {
        el = YAHOO.util.DDM.getElement(id);
    } else {
        el = YAHOO.util.DDM.getBestMatch(id).getEl();
    }

    YAHOO.util.DDM.swapNode(this.getEl(), el);
};

YAHOO.example.DDMy.prototype.endDrag = function(e) {
    // we default behavior is to move the element to the end point when
    // the drag is ended.  In our case, we only want to move the element
    // when it is dropped on another dd element.  To override the default,
    // we simply need to create an empty endDrag function.
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -