有高手知道吗?
Javascript源码如下:
//----------------------------------------------------------------------------
// Code to determine the browser and version.
//----------------------------------------------------------------------------function Browser() {
var ua, s, i; this.isIE = false; // Internet Explorer
this.isOP = false; // Opera
this.isNS = false; // Netscape
this.version = null; ua = navigator.userAgent; s = "Opera";
if ((i = ua.indexOf(s)) >= 0) {
this.isOP = true;
this.version = parseFloat(ua.substr(i + s.length));
return;
} s = "Netscape6/";
if ((i = ua.indexOf(s)) >= 0) {
this.isNS = true;
this.version = parseFloat(ua.substr(i + s.length));
return;
} // Treat any other "Gecko" browser as Netscape 6.1. s = "Gecko";
if ((i = ua.indexOf(s)) >= 0) {
this.isNS = true;
this.version = 6.1;
return;
} s = "MSIE";
if ((i = ua.indexOf(s))) {
this.isIE = true;
this.version = parseFloat(ua.substr(i + s.length));
return;
}
}var browser = new Browser();//----------------------------------------------------------------------------
// Code for handling the menu bar and active button.
//----------------------------------------------------------------------------var activeButton = null;/* [MODIFIED] This code commented out, not needed for activate/deactivate
on mouseover.// Capture mouse clicks on the page so any active button can be
// deactivated.if (browser.isIE)
document.onmousedown = pageMousedown;
else
document.addEventListener("mousedown", pageMousedown, true);function pageMousedown(event) { var el; // If there is no active button, exit. if (activeButton == null)
return; // Find the element that was clicked on. if (browser.isIE)
el = window.event.srcElement;
else
el = (event.target.tagName ? event.target : event.target.parentNode); // If the active button was clicked on, exit. if (el == activeButton)
return; // If the element is not part of a menu, reset and clear the active
// button. if (getContainerWith(el, "DIV", "menu") == null) {
resetButton(activeButton);
activeButton = null;
}
}[END MODIFIED] */
Javascript源码如下:
//----------------------------------------------------------------------------
// Code to determine the browser and version.
//----------------------------------------------------------------------------function Browser() {
var ua, s, i; this.isIE = false; // Internet Explorer
this.isOP = false; // Opera
this.isNS = false; // Netscape
this.version = null; ua = navigator.userAgent; s = "Opera";
if ((i = ua.indexOf(s)) >= 0) {
this.isOP = true;
this.version = parseFloat(ua.substr(i + s.length));
return;
} s = "Netscape6/";
if ((i = ua.indexOf(s)) >= 0) {
this.isNS = true;
this.version = parseFloat(ua.substr(i + s.length));
return;
} // Treat any other "Gecko" browser as Netscape 6.1. s = "Gecko";
if ((i = ua.indexOf(s)) >= 0) {
this.isNS = true;
this.version = 6.1;
return;
} s = "MSIE";
if ((i = ua.indexOf(s))) {
this.isIE = true;
this.version = parseFloat(ua.substr(i + s.length));
return;
}
}var browser = new Browser();//----------------------------------------------------------------------------
// Code for handling the menu bar and active button.
//----------------------------------------------------------------------------var activeButton = null;/* [MODIFIED] This code commented out, not needed for activate/deactivate
on mouseover.// Capture mouse clicks on the page so any active button can be
// deactivated.if (browser.isIE)
document.onmousedown = pageMousedown;
else
document.addEventListener("mousedown", pageMousedown, true);function pageMousedown(event) { var el; // If there is no active button, exit. if (activeButton == null)
return; // Find the element that was clicked on. if (browser.isIE)
el = window.event.srcElement;
else
el = (event.target.tagName ? event.target : event.target.parentNode); // If the active button was clicked on, exit. if (el == activeButton)
return; // If the element is not part of a menu, reset and clear the active
// button. if (getContainerWith(el, "DIV", "menu") == null) {
resetButton(activeButton);
activeButton = null;
}
}[END MODIFIED] */
解决方案 »
- 知道TR里元素的ID,如何知道或删除TR
- 一个客户端验证请各位帮忙
- 怎么取得在datagrid里用checkbox选中的任意一个值,用js能不能实现阿???
- 遇到一个奇葩问题,必须在弹出框之后才能显示自定义消息框 --火狐、IE、谷歌
- 根据屏幕分辨率判断包不包含文件的问题.高手帮忙!!
- 新手提问,在线等,谢
- 请问:怎样当一个checkbox被点击的时候,使这个checkbox的value存储这个checkbox所在的表格的行的行号?谢谢!
- 怎样实现用连接控制<iframe>中的页面上下翻动?80分!!!!!!!!!!!!!!!
- 如何做到在一个图片上点击鼠标右键而不会出现IE的右键菜单????
- 求助求助!!!
- 网页方面的问题
- 大家看看这个透明层的效果是js做的么?
button = window.event.srcElement;
else
button = event.currentTarget; // Blur focus from the link to remove that annoying outline. button.blur(); // Associate the named menu to this button if not already done.
// Additionally, initialize menu display. if (button.menu == null) {
button.menu = document.getElementById(menuId);
if (button.menu.isInitialized == null)
menuInit(button.menu);
} // [MODIFIED] Added for activate/deactivate on mouseover. // Set mouseout event handler for the button, if not already done. if (button.onmouseout == null)
button.onmouseout = buttonOrMenuMouseout; // Exit if this button is the currently active one. if (button == activeButton)
return false; // [END MODIFIED] // Reset the currently active button, if any. if (activeButton != null)
resetButton(activeButton); // Activate this button, unless it was the currently active one. if (button != activeButton) {
depressButton(button);
activeButton = button;
}
else
activeButton = null; return false;
}