hingis_fans
小狐狸
小狐狸
  • UID140
  • 注册日期2004-11-25
  • 最后登录2005-06-04
  • 发帖数42
  • 经验10枚
  • 威望0点
  • 贡献值0点
  • 好评度0点
阅读:2555回复:1

[问题]关于JavaScript

楼主#
更多 发布于:2004-12-06 23:06
本人对java一窍不通,所以问几个菜鸟平方级的几个问题

一.是否微软和太阳都有JavaScript?太阳的jave什么时候要编译成class?

二.具体问个函数。火狐认为event没有定义。是否能修改?还是完全不符合太阳的规定不能修改?望大侠回答行吗。谢谢。

<script Language="JavaScript">
//***********默认设置定义.*********************
tPopWait=50;//停留tWait豪秒后显示提示。
tPopShow=5000;//显示tShow豪秒后关闭提示
showPopStep=20;
popOpacity=99;

//***************内部变量定义*****************
sPop=null;
curShow=null;
tFadeOut=null;
tFadeIn=null;
tFadeWaiting=null;

document.write("<style type='text/css'id='defaultPopStyle'>");
document.write(".cPopText {  background-color: #F8F8F5; border: 1px #000000 solid;color:#000000; font-size: 9pt; padding-right: 4px; padding-left: 4px; height: 20px; padding-top: 2px; padding-bottom: 2px; filter: Alpha(Opacity=0)}");
document.write("</style>");
document.write("<div id='dypopLayer' style='position:absolute;z-index:10;' class='cPopText'></div>");


function showPopupText(){
var o=event.srcElement;//火狐认为没有定义
MouseX=event.x;
MouseY=event.y;
if(o.alt!=null && o.alt!=""){o.dypop=o.alt;o.alt=""};
        if(o.title!=null && o.title!=""){o.dypop=o.title;o.title=""};
if(o.dypop!=sPop) {
sPop=o.dypop;
clearTimeout(curShow);
clearTimeout(tFadeOut);
clearTimeout(tFadeIn);
clearTimeout(tFadeWaiting);
if(sPop==null || sPop=="") {
dypopLayer.innerHTML="";
dypopLayer.style.filter="Alpha()";
dypopLayer.filters.Alpha.opacity=0;
}
else {
if(o.dyclass!=null) popStyle=o.dyclass
else popStyle="cPopText";
curShow=setTimeout("showIt()",tPopWait);
}

}
}

function showIt(){
dypopLayer.className=popStyle;
dypopLayer.innerHTML=sPop;
popWidth=dypopLayer.clientWidth;
popHeight=dypopLayer.clientHeight;
if(MouseX+12+popWidth>document.body.clientWidth) popLeftAdjust=-popWidth-24
else popLeftAdjust=0;
if(MouseY+12+popHeight>document.body.clientHeight) popTopAdjust=-popHeight-24
else popTopAdjust=0;
dypopLayer.style.left=MouseX+12+document.body.scrollLeft+popLeftAdjust;
dypopLayer.style.top=MouseY+12+document.body.scrollTop+popTopAdjust;
dypopLayer.style.filter="Alpha(Opacity=0)";
fadeOut();
}

function fadeOut(){
if(dypopLayer.filters.Alpha.opacity<popOpacity) {
dypopLayer.filters.Alpha.opacity+=showPopStep;
tFadeOut=setTimeout("fadeOut()",1);
}
else {
dypopLayer.filters.Alpha.opacity=popOpacity;
tFadeWaiting=setTimeout("fadeIn()",tPopShow);
}
}

function fadeIn(){
if(dypopLayer.filters.Alpha.opacity>0) {
dypopLayer.filters.Alpha.opacity-=1;
tFadeIn=setTimeout("fadeIn()",1);
}
}
document.onmouseover=showPopupText;
</script>
nighttalker
千年狐狸
千年狐狸
  • UID43
  • 注册日期2004-11-22
  • 最后登录2015-05-03
  • 发帖数2283
  • 经验40枚
  • 威望0点
  • 贡献值42点
  • 好评度0点
  • 社区居民
  • 忠实会员
1楼#
发布于:2004-12-06 23:06
javascript就一家,Netscape的发明。
太阳和微软都有JAVA,
JAVA和Javascript是两个东西,JAVA有Class一说,Javascript没有。
微软自定义的某些非标准修改的Javascript,其功能标准Javascript都可以实现(我认为)。
你的问题和SUN没有任何关系,你的代码等高人回答,我不太了解。
目前最新版本是:Firefox 37,  请各位注意升级保证安全。
游客

返回顶部