+ -
当前位置:首页 → 问答吧 → js中树形菜单前的加号是什么??

js中树形菜单前的加号是什么??

时间:2011-08-08

来源:互联网

js中树形菜单前的加号是张图片么?还是某个标签产生的? 还是什么呢???

作者: yun90   发布时间: 2011-08-08

嗯 1 是图片 展开 和 收缩 会有两张图片
  2 是在js文件里面定义好的
给你看下dtree.js的部分代码 或者自己去下载个dtree看看就知道了
JScript code

function Node(id, pid, name, url, title, target, icon, iconOpen, open) {

    this.id = id;

    this.pid = pid;

    this.name = name;

    this.url = url;

    this.title = title;

    this.target = target;

    this.icon = icon;

    this.iconOpen = iconOpen;

    this._io = open || false;

    this._is = false;

    this._ls = false;

    this._hc = false;

    this._ai = 0;

    this._p;

};



// Tree object

function dTree(objName) {

    this.config = {

        target                    : null,

        folderLinks            : true,

        useSelection        : true,

        useCookies            : true,

        useLines                : true,

        useIcons                : true,

        useStatusText        : false,

        closeSameLevel    : false,

        inOrder                    : false

    }

    this.icon = {

        root                : 'img/base.gif', // 图片路径

        folder            : 'img/folder.gif',

        folderOpen    : 'img/folderopen.gif',

        node                : 'img/page.gif',

        empty                : 'img/empty.gif',

        line                : 'img/line.gif',

        join                : 'img/join.gif',

        joinBottom    : 'img/joinbottom.gif',

        plus                : 'img/plus.gif',

        plusBottom    : 'img/plusbottom.gif',

        minus                : 'img/minus.gif',

        minusBottom    : 'img/minusbottom.gif',

        nlPlus            : 'img/nolines_plus.gif',

        nlMinus            : 'img/nolines_minus.gif'

    };

    this.obj = objName;

    this.aNodes = [];

    this.aIndent = [];

    this.root = new Node(-1);

    this.selectedNode = null;

    this.selectedFound = false;

    this.completed = false;

};

作者: Epiphone   发布时间: 2011-08-08

热门下载

更多