使用Javascript跳入框架 [英] Jumping in a frame using Javascript

查看:49
本文介绍了使用Javascript跳入框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我有两个水平框架,一个在另一个上面。


顶部框架是一个图像映射一条带有物业边界的街道

它。


底部框架是一张桌子,桌子的每一行都有详细信息

关于上面图像地图中的特定属性。


用户点击顶部框架中的图像地图和相应的

行桌子在底部框架中突出显示。


桌子非常长,行在可见画布下面继续。


我需要的是一种在突出显示时跳转到该行的方式,无论它在表中的哪个位置显示它都显示




是否可以跳转在一个框架或页面使用Javascript?

Hi,

I have two horizontal frames, one on top of the other.

The top frame is an image map of a street with property boundary''s on
it.

The bottom frame is a table with each row of the table holds details
about a perticular property from the image map above.

The user clicks on the image map in the top frame and the corresponding
row in the table is highlighted in the bottom frame.

The table is very long and the rows continue below the visable canvas.

What i need is a way to jump to the row when it is highlighted so that
it displays no matter where in the table it is located.

Is it possible to jump in a frame or page using Javascript?

推荐答案

这是我正在使用的脚本(只是包住它有助于某人得到一个想法

我的意思)。

" pa SSDATA"是从顶部框架传入的行ID。行id

用于查找和突出显示相应的行。我真正需要

做的是能够使用行ID跳转到框架的特定区域。


< script type =" text / javascript">

<! -

var passdata = 1;

var oldpassdata = 1;


函数Start(){

if(oldpassdata!= passdata)

ShowPass();


id1 = setTimeout(" Start();",100); //每隔.1秒检查一次值。

}


函数ShowPass(){

highlightrow(passdata);

oldpassdata = passdata;

}


函数highlightrow(n){

clearallrows()

document.getElementById(n).style.backgroundColor =''#FFAABB'';

}


function clearallrows(){

if(oldpassdata == 1)

oldpassdata = passdata;


document.getElementById(oldpassdata).style.backgro undColor =''#FFFFFF'';


}

// - >

< / script>

Here is the script I am using (just encase it helps someone get an idea
of what I mean).
"passdata" is the row id being passed in from the top frame. The row id
is used to find and highlight the corresponding row. What I really need
to do is to be able to use the row id to jump to a particular area of
the frame.

<script type="text/javascript">
<!--
var passdata = 1;
var oldpassdata = 1;

function Start() {
if(oldpassdata != passdata)
ShowPass();

id1 = setTimeout("Start();", 100); // check value every .1 sec.
}

function ShowPass() {
highlightrow(passdata);
oldpassdata = passdata;
}

function highlightrow(n){
clearallrows()
document.getElementById(n).style.backgroundColor='' #FFAABB'';
}

function clearallrows(){
if (oldpassdata ==1)
oldpassdata = passdata;

document.getElementById(oldpassdata).style.backgro undColor=''#FFFFFF'';

}
// -->
</script>


使用锚点。对于每一行,都有一个靠近它的锚点,并带有一个唯一的

名称。你可以拥有像rown这样的东西。因此对于每一行,都有一个锚点

文本靠近它,名称/ id = rown。然后你可以通过

跳转到该行,将底部框架的location属性设置为锚名称。

sthg在highlightrow(n)函数中这样:

eval(" bottomFrameName.location =''row" + n +"''");


谢谢


Anand。

Use anchors. For each row, have an anchor close to it with a unique
name. You can have something like rown. So for each row, have an anchor
text near to it with name/id = rown. You can then jump to that row by
setting the location property of the bottom frame to the anchor name.
sthg like this in the highlightrow (n) function :
eval ("bottomFrameName.location=''row" + n + "''");

Thanks

Anand.


谢谢你!这听起来就像我需要的那样。

Thank you for that! That sounds like just what I need.


这篇关于使用Javascript跳入框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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