当前位置:编程学习 > JAVA >>

js

我的项目中有两行这样的代码
  <script type="text/javascript" src="JS/iutil.js"></script>
  <script type="text/javascript" src="JS/JSForNav.js"></script>
请问当中的iutil.js和JSForNav.js分别是什么js框架 js --------------------编程问答-------------------- 你去你目录的上级目录的js文件夹里面,找到这两个js看下源码就知道了。 --------------------编程问答-------------------- 自己封装的js代码,不是什么框架吧。。 --------------------编程问答-------------------- 自己写的js,光看文件名怎么知道, 要看源码 --------------------编程问答-------------------- 楼主要描述清楚呀! --------------------编程问答-------------------- .       dwr? --------------------编程问答-------------------- 这个。。。 自己项目内部封装的工具类吧。。。。 --------------------编程问答-------------------- 根据文件名猜测
iutil.js是通用的JS方法
JSForNav.js是用于 导航/页面 跳转的方法 --------------------编程问答-------------------- iutil.js的源码如下
/**
 * Interface Elements for jQuery
 * utility function
 * 
 * http://interface.eyecon.ro
 * 
 * Copyright (c) 2006 Stefan Petre
 * Dual licensed under the MIT (MIT-LICENSE.txt) 
 * and GPL (GPL-LICENSE.txt) licenses.
 *   
 *
 */

jQuery.iUtil = {
getPos : function (e, s)
{
var l = 0;
var t  = 0;
var sl = 0;
var st  = 0;
var w = jQuery.css(e,'width');
var h = jQuery.css(e,'height');
var wb = e.offsetWidth;
var hb = e.offsetHeight;
while (e.offsetParent){
l += e.offsetLeft + (e.currentStyle?parseInt(e.currentStyle.borderLeftWidth)||0:0);
t += e.offsetTop  + (e.currentStyle?parseInt(e.currentStyle.borderTopWidth)||0:0);
if (s) {
sl += e.parentNode.scrollLeft||0;
st += e.parentNode.scrollTop||0;
}
e = e.offsetParent;
}
l += e.offsetLeft + (e.currentStyle?parseInt(e.currentStyle.borderLeftWidth)||0:0);
t += e.offsetTop  + (e.currentStyle?parseInt(e.currentStyle.borderTopWidth)||0:0);
st = t - st;
sl = l - sl;
return {x:l, y:t, sx:sl, sy:st, w:w, h:h, wb:wb, hb:hb};
},
getPosition : function(e)
{
var x = 0;
var y = 0;
var restoreStyle = false;
es = e.style;
if (jQuery(e).css('display') == 'none') {
oldVisibility = es.visibility;
oldPosition = es.position;
es.visibility = 'hidden';
es.display = 'block';
es.position = 'absolute';
restoreStyle = true;
}
el = e;
while (el){
x += el.offsetLeft + (el.currentStyle && !jQuery.browser.opera ?parseInt(el.currentStyle.borderLeftWidth)||0:0);
y += el.offsetTop + (el.currentStyle && !jQuery.browser.opera ?parseInt(el.currentStyle.borderTopWidth)||0:0);
el = el.offsetParent;
}
el = e;
while (el && el.tagName.toLowerCase() != 'body')
{
x -= el.scrollLeft||0;
y -= el.scrollTop||0;
el = el.parentNode;
}
if (restoreStyle) {
es.display = 'none';
es.position = oldPosition;
es.visibility = oldVisibility;
}
return {x:x, y:y};
},
getSize : function(e)
{
var w = jQuery.css(e,'width');
var h = jQuery.css(e,'height');
var wb = 0;
var hb = 0;
es = e.style;
if (jQuery(e).css('display') != 'none') {
wb = e.offsetWidth;
hb = e.offsetHeight;
} else {
oldVisibility = es.visibility;
oldPosition = es.position;
es.visibility = 'hidden';
es.display = 'block';
es.position = 'absolute';
wb = e.offsetWidth;
hb = e.offsetHeight;
es.display = 'none';
es.position = oldPosition;
es.visibility = oldVisibility;
}
return {w:w, h:h, wb:wb, hb:hb};
},
getClient : function(e)
{
if (e) {
w = e.clientWidth;
h = e.clientHeight;
} else {
de = document.documentElement;
w = window.innerWidth || self.innerWidth || (de&&de.clientWidth) || document.body.clientWidth;
h = window.innerHeight || self.innerHeight || (de&&de.clientHeight) || document.body.clientHeight;
}
return {w:w,h:h};
},
getScroll : function (e) 
{
if (e) {
t = e.scrollTop;
l = e.scrollLeft;
w = e.scrollWidth;
h = e.scrollHeight;
iw = 0;
ih = 0;
} else  {
if (document.documentElement && document.documentElement.scrollTop) {
t = document.documentElement.scrollTop;
l = document.documentElement.scrollLeft;
w = document.documentElement.scrollWidth;
h = document.documentElement.scrollHeight;
} else if (document.body) {
t = document.body.scrollTop;
l = document.body.scrollLeft;
w = document.body.scrollWidth;
h = document.body.scrollHeight;
}
iw = self.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||0;
ih = self.innerHeight||document.documentElement.clientHeight||document.body.clientHeight||0;
}
return { t: t, l: l, w: w, h: h, iw: iw, ih: ih };
},
getMargins : function(e, toInteger)
{
el = jQuery(e);
t = el.css('marginTop') || '';
r = el.css('marginRight') || '';
b = el.css('marginBottom') || '';
l = el.css('marginLeft') || '';
if (toInteger)
return {
t: parseInt(t)||0, 
r: parseInt(r)||0,
b: parseInt(b)||0,
l: parseInt(l)
};
else
return {t: t, r: r, b: b, l: l};
},
getPadding : function(e, toInteger)
{
el = jQuery(e);
t = el.css('paddingTop') || '';
r = el.css('paddingRight') || '';
b = el.css('paddingBottom') || '';
l = el.css('paddingLeft') || '';
if (toInteger)
return {
t: parseInt(t)||0, 
r: parseInt(r)||0,
b: parseInt(b)||0,
l: parseInt(l)
};
else
return {t: t, r: r, b: b, l: l};
},
getBorder : function(e, toInteger)
{
el = jQuery(e);
t = el.css('borderTopWidth') || '';
r = el.css('borderRightWidth') || '';
b = el.css('borderBottomWidth') || '';
l = el.css('borderLeftWidth') || '';
if (toInteger)
return {
t: parseInt(t)||0, 
r: parseInt(r)||0,
b: parseInt(b)||0,
l: parseInt(l)||0
};
else
return {t: t, r: r, b: b, l: l};
},
getPointer : function(event)
{
x = event.pageX || (event.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft)) || 0;
y = event.pageY || (event.clientY + (document.documentElement.scrollTop || document.body.scrollTop)) || 0;
return {x:x, y:y};
}
}; --------------------编程问答-------------------- JSForNav.js的源码是
// JScript 文件
//Jquery based
function ChangeView(obj)
{
    var MyUl = $(obj).next("li");
    if(MyUl.css("display")=="none")
    {
        MyUl.slideDown("fast");
    }
    else
    {
        MyUl.slideUp("fast");
    }
}
--------------------编程问答-------------------- 谢谢,请多多指教。 --------------------编程问答-------------------- 如果是标准三方的,你可以百度,如果是自己写的,到路径下打开JS自己看 --------------------编程问答-------------------- iutil.js:应该是一个页面初始化的时候调整CSS用的
JSForNav.js:是一个调整视图用的工具
这两个都不是什么框架吧!!
--------------------编程问答-------------------- 这两个可能是别人封装的通用方法吧? --------------------编程问答-------------------- 和框架  没有半毛钱关系  
补充:Java ,  Web 开发
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,