http://www.flyinweb.com/dzh/dzh.htm
左边的菜单可以折叠,是怎么实现的,是AJAX的工具吗,是什么工具,还可以拖大拖小
左边的菜单可以折叠,是怎么实现的,是AJAX的工具吗,是什么工具,还可以拖大拖小
解决方案 »
- 在线等——asp.net判断字符全为中文的正则
- 在正式发布时候,需要使用Release版本。
- 用select控件怎么触发不了onserverchange事件?
- 如何在单独一个页面修改一条记录
- 求datagrid导出到txt的代码
- 关于asp.net + sql server开发的在线题库系统的问题
- 在ASP.NET(C#)中,如何遍历所有的TextBox控件,并将TextBox的Text置空
- ############如何在datagrid中调用存储过程删除记录
- 如何在代码中调用<INPUT id="inputFileopen" type="file" runat="server" >中的值
- 请问在什么情况下需要使用动态SQL。
- 怎么把数据库中的图片用Image控件显示。
- 还是表单验证的问题?
参考 梅花雪 的js。
http://www.51aspx.com/CV/NetFocus,Web,Utility,TreeView.js.html
做一个T型的框架就可以了.
<div id="main" class=dragclass onselectstart="return false" ondblclick=go() title="展开时:双击折叠 折叠时:单击展开">应用了一个go()js函数.
{
if ($('leftTD').style.display == "")
{
$('leftTD').style.display = "none";
$('cheat').childNodes[0].style.backgroundPosition = 'left';
}
else
{
$('leftTD').style.display = "";
$('cheat').childNodes[0].style.backgroundPosition = 'right';
}
}
JavaScript Document
function $(d){return document.getElementById(d);}function GetOffset(e)
{
var t=e.offsetTop;
var l=e.offsetLeft;
while(e=e.offsetParent)
{
t +=e.offsetTop;
l +=e.offsetLeft;
}
return [t,l];
}function go()
{
if ($('leftTD').style.display == "")
{
$('leftTD').style.display = "none";
$('cheat').childNodes[0].style.backgroundPosition = 'left';
}
else
{
$('leftTD').style.display = "";
$('cheat').childNodes[0].style.backgroundPosition = 'right';
}
}function trygo()
{
if ($('leftTD').style.display == "none") go();
}function tryclose()
{
if ($('leftTD').style.display == "") go();
} if (document.getElementById){
(
function(){
var n = 500;
var dragok = false;
var y,x,d,dy,dx;
function move(e)
{
if (!e) e = window.event;
if (dragok){
var mainstyle=$('main').style;
try{
var left = dx + e.clientX - x; if (left<160||left>750){
mainstyle.border='1px dashed #D0D8D9';
return;
}
else
{
mainstyle.border='';
} mainstyle.left=left;
mainstyle.position="absolute";
$('cheat').style.display='none';
return false;
}
catch(e){}
}
}
var shadowTimer; function down(e){
if (!e) e = window.event;
var temp = (typeof e.target != "undefined")?e.target:e.srcElement;
if (temp.tagName != "HTML"|"BODY" && temp.className != "dragclass"){
temp = (typeof temp.parentNode != "undefined")?temp.parentNode:temp.parentElement;
}
if('TR'==temp.tagName){
temp = (typeof temp.parentNode != "undefined")?temp.parentNode:temp.parentElement;
temp = (typeof temp.parentNode != "undefined")?temp.parentNode:temp.parentElement;
temp = (typeof temp.parentNode != "undefined")?temp.parentNode:temp.parentElement;
}
if (temp.className == "dragclass"){
dragok = true;
temp.style.zIndex = n;
d = temp;
dx = GetOffset(temp)[1];
dy = GetOffset(temp)[0];
x = e.clientX; document.onmousemove = move;
shadowTimer=window.setTimeout(function(){$('shadow').style.zIndex=100},150);
return false;
}
}
function up(){ if (dragok == true)
{
window.clearTimeout(shadowTimer); $('shadow').style.zIndex=-10;
$('cheat').style.display='';
$('main').style.height="100%";
$('main').style.border='';
$('main').style.position="static";
if ($('leftTD').style.display == "none")
{
$('leftTD').style.display = "";
$('cheat').childNodes[0].style.backgroundPositionX = 'right';
}
}
try{
var _$w = parseInt($('main').style.left) + "px";
$('leftTD').style.width = _$w;
$('subjects').style.width = _$w;
}catch(e){}
dragok = false; document.onmousemove = null;
}
document.onmousedown = down;
document.onmouseup = up;
}
)();
}
function Init()
{
BodyAutoFitHeight();
window.onresize = BodyAutoFitHeight;
window.setTimeout(BodyAutoFitHeight,3000); if($('navDirection'))
{
$('navDirection').onclick=function()
{
var cel=$('mainTable').rows[0].cells;
cel[0].swapNode(cel[2]);
this.innerText=(this.innerText.indexOf('右')>0?'导航在左':'导航在右');
}
}
}
function BodyAutoFitHeight()
{
$('subjects').style.height = document.body.clientHeight-120;//205;
$('mainTable').style.height = document.body.clientHeight-60;
}