tambc
BlogJava
首頁
新隨筆
聯系
聚合
管理
5 Posts :: 21 Stories :: 5 Comments :: 0 Trackbacks
常用鏈接
我的隨筆
我的評論
我的參與
最新評論
留言簿
(2)
給我留言
查看公開留言
查看私人留言
隨筆檔案
2007年2月 (2)
2006年12月 (3)
文章分類
Ajax
C#(1)
Delphi(3)
Hibernate(1)
Java(14)
JavaScript(7)
Oracle
Spring
SQLServer(1)
Struts
全文檢索(3)
工作流學習
文章檔案
2007年2月 (1)
2007年1月 (1)
2006年12月 (16)
搜索
最新評論
1.?re: textarea控制字符數
收益匪淺
--ljh
2.?re: textarea控制字符數
評論內容較長,點擊標題查看
--fdsa
3.?re: 免費部署 與同時訪問此網頁的網友聊天[未登錄]
股票
--秋風
4.?re: 實現HTTP長連接(服務器推)
yao lianjie
--張偉
5.?re: 近來使用velocity來生成網站靜態頁面
re: 近來使用velocity來生成網站靜態頁面的地址
--gv
閱讀排行榜
1.?近來使用velocity來生成網站靜態頁面(1394)
2.?轉:基于Java的開源 Carrot2 搜索結果聚合聚類引擎 2.0(701)
3.?使用C3P0時一個怪異的事情(471)
4.?用JS讓查看源代碼時什么也看不到(411)
5.?免費部署 與同時訪問此網頁的網友聊天(339)
評論排行榜
1.?免費部署 與同時訪問此網頁的網友聊天(1)
2.?近來使用velocity來生成網站靜態頁面(1)
3.?用JS讓查看源代碼時什么也看不到(0)
4.?轉:基于Java的開源 Carrot2 搜索結果聚合聚類引擎 2.0(0)
5.?使用C3P0時一個怪異的事情(0)
防止Combox浮在最上層的方法
圖片:
<
BODY?
style
=font-size:12
>
?
下拉選擇框:?
<
select?
style
=width:200
>
?
?
<
option
>
經過rebuild的下拉選擇框1
</
option
>
?
?
<
option
>
經過rebuild的下拉選擇框2
</
option
>
?
?
<
option
>
經過rebuild的下拉選擇框3
</
option
>
?
?
<
option
>
經過rebuild的下拉選擇框4
</
option
>
?
?
<
option
>
經過rebuild的下拉選擇框5
</
option
>
?
</
select
>
?
<
div?
align
=center?
style
="position:?absolute;?line-height:?200px;?left:?91;?top:?39;?width:?300;?height:?202;?background-color:?#d4d0c8;?background-repeat:?repeat;?background-attachment:?scroll;?border:?1px?solid?#808080;?background-position:?0%"
>
層模擬的對話框或菜單
</
div
>
?
</
BODY
>
?
<
script
>
?
selRebuild()?
function
?selRebuild()
{?
var
?l,i,j,w,h,ol,sel,tx,bx?
if
(
!
document.all)?
return
?
ol
=
document.getElementsByTagName(
"
select
"
)?
for
(i
=
0
;i
<
ol.length;i
++
)
{?
sel
=
ol[i]?
if
(sel.rebuild
==
1
)?
continue
?
sel.rebuild
=
1
?
sel.w
=
sel.offsetWidth?
sel.style.display
=
"
none
"
?
l
=
"
<input?readonly?onmouseup=this.style.backgroundPositionY=0
"
?
l
+=
"
?style=’width:
"
+
sel.w
+
"
;height:21px;background:url(41.gif)?right?top?no-repeat’>
"
?
l
+=
"
<div?onmousedown=event.cancelBubble=true?style=position:absolute;cursor:default></div>
"
?
sel.insertAdjacentHTML(
"
afterend
"
,l)?
tx
=
sel.nextSibling?
if
(sel.length
>
0
)?
tx.value
=
sel.options[sel.selectedIndex].text?
bx
=
tx.nextSibling?
bx.sel
=
sel?
document.body.previousSibling?
tx.onmousedown
=
function
()
{?
var
?tx
=
this
,sel
=
tx.previousSibling,bx
=
tx.nextSibling?
if
(window.$bxSelectOption
!=
null
)?
window.$bxSelectOption.innerHTML
=
""
?
tx.style.backgroundPositionY
=-
17
?
h
=
bx.sel.options.length
*
15
+
3
?
if
(h
<=
2
||
h
>
167
)?
h
=
167
?
?
l
=
"
<div?style=’position:absolute;left:-
"
+
sel.w
+
"
;top:22;width:
"
+
sel.w
+
"
;height:
"
+
h
+
"
;background:white;border:1px?solid?black;overflow:auto’>
"
?
l
+=
"
<table?onselectstart=return(false)?cellpadding=0?cellspacing=0?style=width:100%;font-size:12>
"
?
for
(j
=
0
;j
<
sel.length;j
++
)
{?
l
+=
"
<tr?height=15?onclick=this.parentNode.parentNode.parentNode.parentNode.optionClick()
"
?
l
+=
"
?onmouseover=this.parentNode.parentNode.parentNode.parentNode.optionMove(this.rowIndex)>
"
?
l
+=
"
<td?valign=bottom?style=padding-left:2>
"
+
sel.options[j].text
+
"
</td></tr>
"
?
}
?
l
+=
"
</table></div>
"
?
bx.innerHTML
=
l?
window.$bxSelectOption
=
bx?
if
(bx.sel.length
>
0
)?
bx.optionMove(bx.sel.selectedIndex)?
event.cancelBubble
=
true
?
}
?
bx.optionMove
=
function
(index)
{?
var
?bx
=
this
,tb?
tb
=
bx.children[
0
].children[
0
]?
if
(tb.selIndex
!=
null
)?
tb.rows[tb.selIndex].style.cssText
=
""
?
tb.selIndex
=
Math.min(index,tb.rows.length
-
1
)?
tb.rows[tb.selIndex].style.cssText
=
"
background:#0A246A;color:white
"
?
}
?
bx.optionClick
=
function
()
{?
var
?bx
=
this
,tx
=
bx.previousSibling,sel
=
tx.previousSibling,tb
=
bx.children[
0
].children[
0
]?
sel.selectedIndex
=
tb.selIndex?
tx.value
=
sel.options[sel.selectedIndex].text?
bx.innerHTML
=
""
?
if
(sel.onchange
!=
null
)?
sel.onchange()?
}
?
}
?
document.body.attachEvent(
"
onmousedown
"
,
function
()
{?
if
(window.$bxSelectOption
!=
null
)?
window.$bxSelectOption.innerHTML
=
""
?
}
)?
}
?
function
?selReset(sel)
{?
if
(
!
document.all)?
return
?
var
?tx
=
sel.nextSibling?
tx.value
=
sel.options[sel.selectedIndex].text?
}
?
</
script
>
posted on 2006-12-21 11:45
tambc
閱讀(347)
評論(0)
編輯
收藏
所屬分類:
JavaScript
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發表評論。
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
相關文章:
Ajax客戶端發起的禁止使用Cache的指令
防止Combox浮在最上層的方法
美化文件上傳界面
在WEB頁中實現表頭表腳和打印分頁
textarea控制字符數
文件上傳前臺控制檢測程序
Powered by:
BlogJava
Copyright © tambc
主站蜘蛛池模板:
颍上县
|
花莲县
|
丹阳市
|
闽清县
|
茌平县
|
嘉禾县
|
大冶市
|
卓资县
|
繁峙县
|
霍城县
|
靖安县
|
冕宁县
|
红桥区
|
西平县
|
浦县
|
平远县
|
隆子县
|
三河市
|
厦门市
|
通许县
|
驻马店市
|
赣州市
|
阳谷县
|
正安县
|
民丰县
|
澳门
|
新平
|
棋牌
|
镇雄县
|
肥城市
|
比如县
|
延津县
|
札达县
|
河北区
|
古田县
|
来宾市
|
成都市
|
吴忠市
|
曲沃县
|
榆社县
|
响水县
|