JSObject做到了。 [英] Well JSObject did it.

查看:67
本文介绍了JSObject做到了。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一段时间我一直在尝试使用商业java多维数据集(每个面都是一个

链接)并使其更好地获得
。当我说得更好时,我指的是让立方体提供每个链接的目的地清楚



以前目的地只显示在状态栏(IE5 +)中。

匹配多维数据集的表面与

目的地有点问题。因为很难有一只眼睛

翘起来而另一只眼睛翘起来。


所以我想我会把6个div叠加起来当鼠标悬停在java立方体的一个面上时,立方体的级别和

,相应的div将改变它的颜色,表示鼠标是面部的颜色结束。


绝对不容易。马丁有一个很好的java反编译器叫做Front End

Cowley。他让IDE成为了实际上由其他人制作的
反编译器。事实是,它的工作非常好。

好​​。所以,如果有人对b $ b感兴趣,我就是这样做的。


我反编译了applet。然后我把它放在

状态栏更改位置的代码中。这是一个mousemove

事件。 (这是其中一个缺陷)。


showStatus(cB [cq - 1]); // msgstatus

尝试

{

JSObject jsroot = JSObject.getWindow(this);

JSObject jsdoc = (JSObject)jsroot.getMember(" document");

JSObject jsloc =(JSObject)jsdoc.getMember(" location");

String sLoc =(String )jsloc.getMember(" href");

试试

{

jsroot.eval(" ovrApplet(''" + cB [cq - 1] +"'');");

}

catch(Exception _ev){System.out.println(_ev.getMessage( ));}

}

catch(JSException _js){System.out.println(_js.getMessage());}


接下来我必须将函数ovrApplet放在网页的javscript中:


在< / body>之前:


< script type =" text / javascript">

<! - 开始

函数ovrApplet(x){

var MsgA = new Array(6);

var actLink = 0;

if((x!=''empty'')&&(x! = null)){

尝试

{

for(var i = 0;我< 6; i ++)

MsgA [i] =''< div id =" odivMenu''+ i +''">< table class =" track">< tr> < td

id =" oCell''+ i +''"

valign =" middle">''+ document.getElementById(''oBoy '')。 getParameter(''statusmsg''+

(i + 1))+

''& nbsp;& nbsp;& nbsp;& hellip;& ; hellip;& hellip;& hellip;& hellip;& nbsp;& nbsp;& nbsp

;< / td>< td>< img src =" ;''+ document.getElementById(''oBoy'')。getParameter(''imag e''

+(i + 1))。substring(0,document.getElementById(''oAnfy '')。g etParameter(''image''

+(i + 1))。lastIndexOf(''。''))+''_.gif''+''" height =" 48"

width =" 48" />< / td>< / tr>< / table>< / div>'';

Msg = MsgA.join('''');

if((x!=''empty'')&&(x!= null))

更改(x);

}

catch(e)

{

Msg = 等一下......;

提醒(e);

更改(null);

}

}

返回true;

}

< / script>


之前< / head>


< script type =" text / javascript">

<! - 开始
函数更改(y){

var strHtml;

if((Msg == null)||(y == null))

strHtml =''Hello'';

else

strHtml = Msg;

if(y!= null){

document.getElementById(''oNotice'')。innerHTML = strHtml;

switch(y){

case document.getElementById(' 'oBoy'')。getParameter(''stat usm sg1''):

document.getElementById(''odivMenu0'')。style.backgro und =''#00FF00'';

document.getElementById('' oCell0'')。style.color =''#0000FF'';

break;

case document.getElementById(''oBoy'')。getParameter('' stat usmsg2''):

document.getElementById(''odivMenu1'')。style.backgro und =''#00FF00'';

document.getElementById(' 'oCell1'')。style.color =''#0000FF'';

break;

case document.getElementById(''oBoy'')。getParameter(' 'stat usmsg3''):

document.getElementById(''odivMenu2'')。style.backgro und =''#00FF00'';

document.getElementById( ''oCell2'')。style.color =''#0000FF'';

break;

case document.getElementById(''oBoy'')。getParameter( ''stat usmsg4''):

document.getElementById(''odivMenu3'')。style.backgr o und =''#00FF00'';

document.getElementById(''oCell3'')。style.color =''#0000FF'';

break;

case document.getElementById(''oBoy'')。getParameter(''stat usmsg5''):

document.getElementById(''odivMenu4'')。style .backgro und =''#00FF00'';

document.getElementById(''oCell4'')。style.color =''#0000FF'';

break ;

case document.getElementById(''oBoy'')。getParameter(''stat usmsg6''):

document.getElementById(''odivMenu5'')。 style.backgro und =''#00FF00'';

document.getElementById(''oCell5'')。style.color =''#0000FF'';

休息;

默认:

休息;

}

document.getElementById(''floattrack'')。 style.visibi lity =''visible'';

}

}

//结束 - >

< / script>


An d路标在这里:


< div id =" floattrack">

< div class =" track">< span id = " oNotice">< / span>< / div>< / div>


工作得很好。唯一的麻烦是鼠标必须手动

为Active(彩色)div移动到

跟随鼠标。如果有人对JSObject的使用有任何建议

或我保持< div id =" floattrack"

消失的方式我会感激任何反馈。这只是我的第一次尝试

这样的事情

请原谅冗余和臃肿。


谢谢所有这些都帮助了我。


-

George Hester

__________________________________

For awhile I have been trying to take a commercial java cube (each face is a
link) and make it
better. When I say better I''m referring to making the cube provide CLEARLY
the destination of each link.
Previously the destination only showed in the status bar (IE5+) . That
matching up the face of the cube with
the destination was somewhat problematic. For it''s hard to have one eye
cocked up and the other cocked down.

So I thought I would make a stack of 6 divs at the level of the cube and
when the mouse is over a face of the java cube, the appropriate div would
change it''s color signifying the face the mouse is over.

Tweren''t easy. There is a good java decompiler called Front End by Martin
Cowley. He made the IDE the
decompiler is actually made by someone else. Fact is though it works pretty
good. So this is how I did it if anyone
is interested.

I decompiled the applet. Then I put this in the code in the place where the
status bar changes. It was a mousemove
event. (This is one of the flaws).

showStatus(cB[cq - 1]); //msgstatus
try
{
JSObject jsroot = JSObject.getWindow(this);
JSObject jsdoc = (JSObject) jsroot.getMember("document");
JSObject jsloc = (JSObject) jsdoc.getMember("location");
String sLoc = (String) jsloc.getMember("href");
try
{
jsroot.eval("ovrApplet(''"+cB[cq - 1]+"'');");
}
catch (Exception _ev){System.out.println(_ev.getMessage());}
}
catch(JSException _js){System.out.println(_js.getMessage());}

Next I had to put the function ovrApplet in the web page''s javscript:

Before the </body>:

<script type="text/javascript">
<!-- Begin
function ovrApplet(x){
var MsgA = new Array(6);
var actLink = 0;
if ((x != ''empty'') && (x != null)){
try
{
for (var i = 0; i < 6; i++)
MsgA[i] = ''<div id="odivMenu''+i+''"><table class="track"><tr><td
id="oCell''+i+''"
valign="middle">''+document.getElementById(''oBoy''). getParameter(''statusmsg'' +
(i + 1)) +
''&nbsp;&nbsp;&nbsp;&hellip;&hellip;&hellip;&hellip ;&hellip;&nbsp;&nbsp;&nbsp
;</td><td><img src="'' + document.getElementById(''oBoy'').getParameter(''imag e''
+ (i + 1)).substring(0,document.getElementById(''oAnfy'').g etParameter(''image''
+ (i + 1)).lastIndexOf(''.'')) + ''_.gif'' + ''" height="48"
width="48"/></td></tr></table></div>'';
Msg = MsgA.join('''');
if ((x != ''empty'') && (x != null))
change(x);
}
catch (e)
{
Msg = ''Hold on a sec...'';
alert(e);
change(null);
}
}
return true;
}
</script>

and before </head>

<script type="text/javascript">
<!-- Begin
function change(y){
var strHtml;
if ((Msg == null) || (y == null))
strHtml = ''Hello'';
else
strHtml = Msg;
if (y != null){
document.getElementById(''oNotice'').innerHTML = strHtml;
switch(y){
case document.getElementById(''oBoy'').getParameter(''stat usmsg1''):
document.getElementById(''odivMenu0'').style.backgro und = ''#00FF00'';
document.getElementById(''oCell0'').style.color = ''#0000FF'';
break;
case document.getElementById(''oBoy'').getParameter(''stat usmsg2''):
document.getElementById(''odivMenu1'').style.backgro und = ''#00FF00'';
document.getElementById(''oCell1'').style.color = ''#0000FF'';
break;
case document.getElementById(''oBoy'').getParameter(''stat usmsg3''):
document.getElementById(''odivMenu2'').style.backgro und = ''#00FF00'';
document.getElementById(''oCell2'').style.color = ''#0000FF'';
break;
case document.getElementById(''oBoy'').getParameter(''stat usmsg4''):
document.getElementById(''odivMenu3'').style.backgro und = ''#00FF00'';
document.getElementById(''oCell3'').style.color = ''#0000FF'';
break;
case document.getElementById(''oBoy'').getParameter(''stat usmsg5''):
document.getElementById(''odivMenu4'').style.backgro und = ''#00FF00'';
document.getElementById(''oCell4'').style.color = ''#0000FF'';
break;
case document.getElementById(''oBoy'').getParameter(''stat usmsg6''):
document.getElementById(''odivMenu5'').style.backgro und = ''#00FF00'';
document.getElementById(''oCell5'').style.color = ''#0000FF'';
break;
default:
break;
}
document.getElementById(''floattrack'').style.visibi lity = ''visible'';
}
}
// End -->
</script>

And the "signpost" is here:

<div id="floattrack">
<div class="track"><span id="oNotice"></span></div></div>

Works pretty good. The only trouble is that the mouse has to be manually
moved for the Active (colored) div to
follow the mouse. If anyone has any suggestions on the use of the JSObject
or the way I keep the <div id="floattrack"
from disappearing I''d appreciate any feedback. It''s just my first attempt
at something like this so
please excuse the redundancy and the bloat.

Thanks all here who helped me with this.

--
George Hester
__________________________________

推荐答案

如果您有兴趣,请转到这里:

http://home.nycap.rr.com/foryorisonly/cube/cube.htm

-

George Hester

__________________________________

" George Hester" <他******** @ hotmail.com>在消息中写道

新闻:sF ******************* @ twister.nyroc.rr.com ...

here you go if you''re interested:

http://home.nycap.rr.com/foryorisonly/cube/cube.htm

--
George Hester
__________________________________
"George Hester" <he********@hotmail.com> wrote in message
news:sF*******************@twister.nyroc.rr.com...


George Hester写道:
George Hester wrote:
如果您有兴趣,请转到这里:

http://home.nycap.rr.com/foryorisonly/cube/cube.htm
here you go if you''re interested:

http://home.nycap.rr.com/foryorisonly/cube/cube.htm




所有我看到有一个破旧的Java图标.......


-

Randy

comp.lang.javascript常见问题 - http: //jibbering.com/faq


2004年8月7日星期六18:22:58 -0400,Randy Webb写道:
On Sat, 07 Aug 2004 18:22:58 -0400, Randy Webb wrote:
George Hester写道:
George Hester wrote:



...


...

http://home.nycap.rr.com/foryorisonly/cube/cube.htm



所有我看到的是一个破旧的Java图标.......



All I see there is a broken Java icon.......




当我读到那个,我怀疑George已经写了一篇MSVM applet,没有优雅的

降级。


我在IE6中检查了applet使用Java

1.5和MSVM,并且两次都看到了''旋转立方体''

的书籍图像..


乔治的注意事项。我离开并返回页面

看到左边的菜单被部分遮挡了

落后于较低的applet ..是你的意图吗?
< br $> b $ b -

Andrew Thompson
http://www.PhySci.org/ 开源软件套件
http://www.PhySci.org/codes/ Web& IT帮助
http://www.1point1C.org/ Science&技术



When I read that, I suspected George had
written a post MSVM applet with no graceful
degradation.

I checked the applet in IE6 using both Java
1.5 and the MSVM and saw the ''rotating cube''
of book images both times..

Note to George. I left and returned to the page
to see that menu at left had been partially obscured
behind the the lower applet.. is that your intent?

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology


这篇关于JSObject做到了。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆