// JavaScript Document
function el(id){
return documentgetElementById(id);
}
function $$(id){
return documentgetElementById(id);
}
/
该方法用于选项卡切换功能
选项卡按钮的ID依次为xxx1、xxx2、xxx3、……
每个滑块对应的内容依次为xxx1_content、xxx2_content、xxx3_content、……
参数说明:
btnID:选项卡按钮的ID,不含后面的数字,如上面的xxx
num:选项卡总数
classOn:当前选项卡的样式表名称
classOff:其他关闭的选项卡的样式表名称
moreUrlID:超链接更多的ID,如果选项卡没有设置一个更多的按钮则填写空字符串
moreUrl:更多的页面地址
/
function change(btnID,num,count,classOn,classOff,moreUrlID,moreUrl)
{
for(i=1; i<=count;i++)
{
if(i==num)
{
$$(btnID+itoString())className=classOn;
$$(btnID+itoString()+"_content")styledisplay="block";
}
else
{
$$(btnID+itoString())className=classOff;
$$(btnID+itoString()+"_content")styledisplay="none";
}
}
if(moreUrlID!="")
$$(moreUrlID)href=moreUrl;
}
//返回元素坐标
var GetCoordinate = function(el,xy)
{
var box = elgetBoundingClientRect(),
doc = elownerDocument,
body = docbody,
html = docdocumentElement,
clientTop = htmlclientTop || bodyclientTop || 0,
clientLeft = htmlclientLeft || bodyclientLeft || 0,
top = boxtop + (selfpageYOffset || htmlscrollTop || bodyscrollTop ) - clientTop,
left = boxleft + (selfpageXOffset || htmlscrollLeft || bodyscrollLeft) - clientLeft
var n;
if(xy=="x") n=parseInt(left);
if(xy=="y") n=parseInt(top);
return parseInt(n);
}
var IsShow=false;
var st;
var mmm=null;
function SetTF(tf){IsShow=tf;}
function ShowMenu(o)
{
if(mmm!=null) mmmstyledisplay='none';
IsShow=true;
var x=GetCoordinate(o,"x");
var y=GetCoordinate(o,"y")+28;
var mm=el(oid+"_item");
if(documentall)
x=x;
else
x=x+1;
mmm=mm;
mmstyledisplay='block';
mmstyletop=ytoString()+"px";
if(x+el(oid+"_item")offsetWidth > GetCoordinate(el("dh"),"x")+766)
mmstyleleft=(x-el(oid+"_item")offsetWidth+ooffsetWidth)+"px";
else
mmstyleleft=xtoString()+"px";
st=setInterval(Hide,500);
mmm=mm;
}
function Hide()
{
if(!IsShow && mmm!=null)
{
mmmstyledisplay='none';
clearInterval(st);
}
}// JavaScript Document
//这样即可,复制过去即可用
scrollTop:
Read-only properties Return the width and height of the element's viewable area that will be exposed by scrolling to the left and to the top, respectively
测试一下如下代码,你就知道是什么意思了:
<script language="JavaScript">
function C1() {
myXinnerHTML = windoweventoffsetX;
myYinnerHTML = windoweventoffsetY;
mySXinnerHTML = windoweventscreenX;
mySYinnerHTML = windoweventscreenY;
mySHinnerHTML = myDivscrollHeight;
mySWinnerHTML = myDivscrollWidth;
}
function B1() {
mySLinnerHTML = myDivscrollLeft;
mySTinnerHTML = myDivscrollTop;
}
</script>
<p><b>X Coordinate:</b> <span id="myX">0</span></p>
<p><b>Y Coordinate:</b> <span id="myY">0</span></p>
<p><b>Screen X:</b> <span id="mySX">0</span></p>
<p><b>Screen Y:</b> <span id="mySY">0</span></p>
<p><b>Scroll Height:</b> <span id="mySH">0</span></p>
<p><b>Scroll Width:</b> <span id="mySW">0</span></p>
<p><b>Scroll Left:</b> <span id="mySL">0</span></p>
<p><b>Scroll Top:</b> <span id="myST">0</span></p>
<div id="myDiv" onmousemove="C1();" onscroll="B1();" style="border:solid;
width:200; height:50; overflow:scroll;">
<img src="yourimagegif"></div>
以上就是关于调用两个js文件发生冲突 一个是jquery.min.js 一个代码如下:全部的内容,包括:调用两个js文件发生冲突 一个是jquery.min.js 一个代码如下:、有一段javascript的代码,this.element是什么意思、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)