WEB/JqueryTreeFlie/demo.js

(开头部分) 1KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

$(document).ready(function(){
	
	// first example
$("#browser").treeview();
	
	// second example
	$("#navigation").treeview({
	persist: "location",
		collapsed: true,
		unique: true
	});
	
	// third example
	$("#red").treeview({
		animated: "fast",
		collapsed: true,
		unique: true,
		persist: "cookie",
		toggle: function() {
			window.console && console.log("%o was toggled", this);
		}
	});
	
	// fourth example
	$("#black, #gray").treeview({
		control: "#treecontrol",
		persist: "cookie",
		cookieId: "treeview-black"
	});

});


/*控件居中
*objID 需要居中的控件 ID名称 
*div中的样式 top: 30%; left: 40%; margin: 5px 0 0 -400px;" 需删除
*isPercent 表示 该控件 定义的高度是百分比(true) 还是数值(fasle)
*必须在控件显示之后调用该方法
*by pdd
*/
function CenterToDocument(objID, isPercent) {
    var obj = document.getElementById(objID);

    /*定义位置*/
    var _top = 0;
    var _left = 0;
    var objWidth = 0, objHeight = 0;

    //获取滚动条滚动的长度
    var scrollLength = getScrollTop();
    /*获取控件尺寸*/
    if (isPercent) {
        objWidth = obj.style.width.replace("px", "") == "" ? 0 : PercentToFloat(obj.style.width);
        //  objHeight=obj.style.height.replace("px","")==""?0:PercentToFloat(obj.style.height); 
    }
    else {
        objWidth = obj.style.width.replace("px", "") == "" ? 0 : obj.style.width.replace("px", "");
    }
    objHeight = obj.offsetHeight == "" ? 0 : obj.offsetHeight;

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。