页面实现代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<div class="zmmddiv" border="0">
<div name="div_val" class="pgcsta" border="0">
<div class="zmdiv,szmlb" border="0">
<label class="zmlab">首字母</label>
</div>
<div class="zmdiv" onclick="func_dw('1','A')" delay="1" border="0">
<label class="zmlab">A</label>
</div>
<div class="zmdiv" onclick="func_dw('2','B')" delay="1" border="0">
<label class="zmlab">A</label>
</div>
<div class="zmdiv" onclick="func_dw('3','C')" delay="1" border="0">
<label class="zmlab">A</label>
</div>
......
</div>
</div>

脚本实现代码

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
function func_dw(ky,yk)
dw_num=ky;
dw=yk;
local divVal = document:getElementsByName("div_val");
local y_top = tostring(dw);
local y_value="0px";
y_value = ert("@"..y_top):css("top");
if y_value == nil then
y_value="0px"
end;
local x_value="0";
emp:divScrollTo(divVal[1],x_value,y_value);
dw="A";
dw_num=0;
end