夢幻之旅
DEBUG - 天道酬勤
::
首頁
::
新隨筆
::
聯系
::
聚合
::
管理
::
671 隨筆 :: 6 文章 :: 256 評論 :: 0 Trackbacks
<
2010年8月
>
日
一
二
三
四
五
六
25
26
27
28
29
30
31
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
公告
本博客中未注原創的文章均為轉載,對轉載內容可能做了些修改和增加圖片注釋,如果侵犯了您的版權,或沒有注明原作者,請諒解
常用鏈接
我的隨筆
我的評論
我的參與
最新評論
留言簿
(21)
給我留言
查看公開留言
查看私人留言
隨筆分類
(644)
Android(10)
(rss)
ANT(4)
(rss)
C#(10)
(rss)
C/C++(16)
(rss)
CSS(3)
(rss)
DataBase(119)
(rss)
DB-DailyMmaintenance(16)
(rss)
Design Patterns(27)
(rss)
english
(rss)
Exceptions(7)
(rss)
EXT(39)
(rss)
FLASH(9)
(rss)
Hardware(20)
(rss)
Hibernate(13)
(rss)
Html(23)
(rss)
Java(143)
(rss)
java Net(10)
(rss)
JavaScript(39)
(rss)
Linux(26)
(rss)
php(5)
(rss)
Regular Exp(3)
(rss)
Spring(17)
(rss)
Struts(12)
(rss)
TOOL(43)
(rss)
VB/VBA/VBS(5)
(rss)
webservice(9)
(rss)
XML(2)
(rss)
我的夢幻旅途(14)
(rss)
隨筆檔案
(669)
2017年9月 (4)
2016年10月 (1)
2015年6月 (1)
2015年4月 (2)
2015年1月 (1)
2014年8月 (2)
2014年7月 (9)
2014年6月 (1)
2014年5月 (2)
2014年4月 (3)
2014年3月 (3)
2013年10月 (4)
2013年9月 (8)
2013年8月 (4)
2013年6月 (3)
2013年5月 (4)
2013年4月 (7)
2013年3月 (1)
2013年1月 (3)
2012年12月 (4)
2012年11月 (1)
2012年10月 (1)
2012年9月 (4)
2012年8月 (1)
2012年7月 (2)
2012年6月 (1)
2012年5月 (4)
2012年4月 (2)
2012年3月 (1)
2012年2月 (4)
2012年1月 (6)
2011年12月 (10)
2011年11月 (7)
2011年10月 (6)
2011年9月 (37)
2011年8月 (34)
2011年7月 (44)
2011年6月 (10)
2011年5月 (5)
2011年4月 (3)
2011年3月 (1)
2011年2月 (1)
2011年1月 (18)
2010年12月 (9)
2010年11月 (13)
2010年10月 (17)
2010年9月 (2)
2010年8月 (10)
2010年7月 (10)
2010年6月 (5)
2010年5月 (8)
2010年4月 (9)
2010年3月 (11)
2010年2月 (3)
2010年1月 (8)
2009年12月 (6)
2009年11月 (10)
2009年10月 (5)
2009年9月 (1)
2009年8月 (18)
2009年7月 (6)
2009年6月 (2)
2009年5月 (1)
2009年4月 (4)
2009年3月 (6)
2009年2月 (5)
2009年1月 (3)
2008年12月 (13)
2008年11月 (13)
2008年10月 (30)
2008年9月 (9)
2008年8月 (24)
2008年7月 (17)
2008年6月 (15)
2008年5月 (16)
2008年4月 (15)
2008年3月 (19)
2008年2月 (3)
2008年1月 (20)
2007年12月 (24)
2007年11月 (9)
文章檔案
(6)
2008年4月 (1)
2008年3月 (1)
2008年1月 (2)
2007年11月 (2)
最新隨筆
1.?PP代碼生成器(四) 使用解決方案生成代碼
2.? PP代碼生成器(三) 設計freemarker模板, 創建解決方案
3.? PP代碼生成器(二) 解決方案, 生成任務, 輔助設計面板
4.? PP代碼生成器(一) 簡介, 下載, 運行
5.?PP持久層代碼生成器
6.?比較好的博客
7.?系統集成項目管理工程師
8.?軟件公司項目經理崗位職責
9.?聯想筆記本 顯示屏 鍵盤失靈 釋放靜電
10.?eclipse maven
積分與排名
積分 - 961180
排名 - 37
最新評論
1.?re: Myeclipse 快捷鍵大全(絕對全)
crl+向右箭頭(輸入法有問題打不出來)移到下一個參數的位置,然后crl+shift+向右箭頭 選中該位置的參數即可
--紅領巾
2.?re: Log4j基本使用方法
555
--555
3.?re: Myeclipse 快捷鍵大全(絕對全)[未登錄]
很不錯,謝謝
--銀狐
4.?re: Flex 表單
是誰這么無聊~嗚~~~
--HUIKK
5.?re: Spring AfterReturning 異常
具體是什么意思啊
--dingli
閱讀排行榜
1.?Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/LineInputStream(70034)
2.?log4j.properties 使用說明(42086)
3.?Myeclipse 快捷鍵大全(絕對全)(32737)
4.?TNSNAMES.ORA 配置(24400)
5.?oracle 樹狀查詢(21367)
評論排行榜
1.?Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/mail/util/LineInputStream(53)
2.?JMail 異常: java.lang.NoClassDefFoundError: javax/activation/DataSource(21)
3.?javax.mail.MessagingException: 530 5.7.0 Must issue a STARTTLS command first(14)
4.?java 讀取 excel 2003 或 excel 2007(14)
5.?java.lang.UnsupportedClassVersionError: Bad version number in .class file(8)
select 美化
css
/**/
/*
* 惠萬鵬(2010-8-13)
*/
ul, ol, li
{
}
{
list-style
:
none
;
}
ul, ol, li, img, dl, dt, dd
{
}
{
margin
:
0
;
padding
:
0
;
border
:
0
;
}
div.selectbox-wrapper
{
}
{
border-right
:
#bfbfbf 1px solid
;
border-top
:
#bfbfbf 0px solid
;
margin-top
:
-3px
;
border-left
:
#bfbfbf 1px solid
;
width
:
107px
;
border-bottom
:
#bfbfbf 1px solid
;
position
:
absolute
;
background-color
:
#fff
;
text-align
:
left
}
div.selectbox-wrapper ul li.selected
{
}
{
background-color
:
#bfbfbf
;
}
div.selectbox-wrapper ul li.current
{
}
{
color
:
#fff
;
background-color
:
#9a9a9a
}
div.selectbox-wrapper ul li
{
}
{
padding-right
:
3px
;
padding-left
:
3px
;
padding-bottom
:
3px
;
width
:
102px
;
cursor
:
pointer
;
line-height
:
20px
;
padding-top
:
3px
}
.selectbox
{
}
{
border
:
none
;
display
:
block
;
padding-left
:
4px
;
width
:
130px
;
cursor
:
pointer
;
padding-top
:
5px
;
height
:
19px
;
background
:
url(/js/select/select.gif) no-repeat
;
}
js
jQuery.fn.extend(
{
selectbox:
function
(options)
{
return
this
.each(
function
()
{
new
jQuery.SelectBox(
this
, options);
}
);
}
}
);
/**/
/*
pawel maziarz: work around for ie logging
*/
if
(
!
window.console)
{
var
console
=
{
log:
function
(msg)
{
}
}
}
/**/
/*
*/
jQuery.SelectBox
=
function
(selectobj, options)
{
var
opt
=
options
||
{}
;
opt.inputClass
=
opt.inputClass
||
"
selectbox
"
;
opt.containerClass
=
opt.containerClass
||
"
selectbox-wrapper
"
;
opt.hoverClass
=
opt.hoverClass
||
"
current
"
;
opt.currentClass
=
opt.selectedClass
||
"
selected
"
opt.debug
=
opt.debug
||
false
;
var
elm_id
=
selectobj.id;
var
active
=
0
;
var
inFocus
=
false
;
var
hasfocus
=
0
;
//
jquery object for select element
var
$select
=
$(selectobj);
//
jquery container object
var
$container
=
setupContainer(opt);
//
jquery input object
var
$input
=
setupInput(opt);
//
hide select and append newly created elements
$select.hide().before($input).before($container);
init();
$input
.click(
function
()
{
if
(
!
inFocus)
{
$container.toggle();
}
}
)
.focus(
function
()
{
if
($container.not(':visible'))
{
inFocus
=
true
;
$container.show();
}
}
)
.keydown(
function
(event)
{
switch
(event.keyCode)
{
case
38
:
//
up
event.preventDefault();
moveSelect(
-
1
);
break
;
case
40
:
//
down
event.preventDefault();
moveSelect(
1
);
break
;
//
case 9: // tab
case
13
:
//
return
event.preventDefault();
//
seems not working in mac !
$('li.'
+
opt.hoverClass).trigger('click');
break
;
case
27
:
//
escape
hideMe();
break
;
}
}
)
.blur(
function
()
{
if
($container.is(':visible')
&&
hasfocus
>
0
)
{
if
(opt.debug) console.log('container visible and has focus')
}
else
{
//
Workaround for ie scroll - thanks to Bernd Matzner
if
($.browser.msie
||
$.browser.safari)
{
//
check for safari too - workaround for webkit
if
(document.activeElement.getAttribute('id').indexOf('_container')
==-
1
)
{
hideMe();
}
else
{
$input.focus();
}
}
else
{
hideMe();
}
}
}
);
function
hideMe()
{
hasfocus
=
0
;
$container.hide();
}
function
init()
{
$container.append(getSelectOptions($input.attr('id'))).hide();
var
width
=
$input.css('width');
}
function
setupContainer(options)
{
var
container
=
document.createElement(
"
div
"
);
$container
=
$(container);
$container.attr('id', elm_id
+
'_container');
$container.addClass(options.containerClass);
return
$container;
}
function
setupInput(options)
{
var
input
=
document.createElement(
"
input
"
);
var
$input
=
$(input);
$input.attr(
"
id
"
, elm_id
+
"
_input
"
);
$input.attr(
"
type
"
,
"
text
"
);
$input.addClass(options.inputClass);
$input.attr(
"
autocomplete
"
,
"
off
"
);
$input.attr(
"
readonly
"
,
"
readonly
"
);
$input.attr(
"
tabIndex
"
, $select.attr(
"
tabindex
"
));
//
"I" capital is important for ie
return
$input;
}
function
moveSelect(step)
{
var
lis
=
$(
"
li
"
, $container);
if
(
!
lis
||
lis.length
==
0
)
return
false
;
active
+=
step;
//
loop through list
if
(active
<
0
)
{
active
=
lis.size();
}
else
if
(active
>
lis.size())
{
active
=
0
;
}
scroll(lis, active);
lis.removeClass(opt.hoverClass);
$(lis[active]).addClass(opt.hoverClass);
}
function
scroll(list, active)
{
var
el
=
$(list[active]).get(
0
);
var
list
=
$container.get(
0
);
if
(el.offsetTop
+
el.offsetHeight
>
list.scrollTop
+
list.clientHeight)
{
list.scrollTop
=
el.offsetTop
+
el.offsetHeight
-
list.clientHeight;
}
else
if
(el.offsetTop
<
list.scrollTop)
{
list.scrollTop
=
el.offsetTop;
}
}
function
setCurrent()
{
var
li
=
$(
"
li.
"
+
opt.currentClass, $container).get(
0
);
var
ar
=
(''
+
li.id).split('_');
var
el
=
ar[ar.length
-
1
];
$select.val(el);
$input.val($(li).html());
return
true
;
}
//
select value
function
getCurrentSelected()
{
return
$select.val();
}
//
input value
function
getCurrentValue()
{
return
$input.val();
}
function
getSelectOptions(parentid)
{
var
select_options
=
new
Array();
var
ul
=
document.createElement('ul');
$select.children('option').each(
function
()
{
var
li
=
document.createElement('li');
li.setAttribute('id', parentid
+
'_'
+
$(
this
).val());
li.innerHTML
=
$(
this
).html();
if
($(
this
).is(':selected'))
{
$input.val($(
this
).html());
$(li).addClass(opt.currentClass);
}
ul.appendChild(li);
$(li)
.mouseover(
function
(event)
{
hasfocus
=
1
;
if
(opt.debug) console.log('over on : '
+
this
.id);
jQuery(event.target, $container).addClass(opt.hoverClass);
}
)
.mouseout(
function
(event)
{
hasfocus
=
-
1
;
if
(opt.debug) console.log('out on : '
+
this
.id);
jQuery(event.target, $container).removeClass(opt.hoverClass);
}
)
.click(
function
(event)
{
var
fl
=
$('li.'
+
opt.hoverClass, $container).get(
0
);
if
(opt.debug) console.log('click on :'
+
this
.id);
$('#'
+
elm_id
+
'_container'
+
' li.'
+
opt.currentClass).removeClass(opt.currentClass);
$(
this
).addClass(opt.currentClass);
setCurrent();
//
$select.change();
$select.get(
0
).blur();
hideMe();
}
);
}
);
return
ul;
}
}
;
demo
<!
DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd"
>
<
HTML
xmlns
="http://www.w3.org/1999/xhtml"
>
<
HEAD
>
<
META
http-equiv
=Content-Type
content
="text/html; charset=utf-8"
/>
<
link
href
="/js/select/mySelect.css"
rel
="stylesheet"
type
="text/css"
/>
<
SCRIPT
src
="/js/jquery/jquery.js"
type
=text/javascript
></
SCRIPT
>
<
SCRIPT
src
="/js/select/mySelect.js"
type
=text/javascript
></
SCRIPT
>
</
HEAD
>
<
BODY
>
<
select
id
="c"
style
="display: none;width:200px;"
name
="c"
>
<
option
value
="1"
>
生活信息
</
option
>
<
option
value
="2"
>
店鋪商家
</
option
>
<
option
value
="3"
selected
>
新聞資訊
</
option
>
<
option
value
="4"
>
團購活動
</
option
>
<
option
value
="5"
>
招聘信息
</
option
>
</
select
>
<
select
id
="d"
style
="display: none;width:200px;"
name
="c"
>
<
option
value
="1"
>
生活信息
</
option
>
<
option
value
="2"
>
店鋪商家
</
option
>
<
option
value
="3"
selected
>
新聞資訊
</
option
>
<
option
value
="4"
>
團購活動
</
option
>
<
option
value
="5"
>
招聘信息
</
option
>
</
select
>
<
SCRIPT
src
="js/jQselect.js"
type
=text/javascript
></
SCRIPT
>
<
SCRIPT
type
=text/javascript
>
$(document).ready(
function
()
{
$(
"
#c
"
).selectbox();
$(
"
#d
"
).selectbox();
}
);
</
SCRIPT
>
</
BODY
>
</
HTML
>
posted on 2010-08-13 14:07
HUIKK
閱讀(1706)
評論(0)
編輯
收藏
所屬分類:
Html
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發表評論。
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
相關文章:
dream html代碼 縮進
關于td的最小高度
網上找的關于http-equiv的知識,以前總是忽視
html播放視頻
iFrame 自適應高度
select 美化
文本 自適應 表格
浮動DIV
input file 只讀
關于gif進度條的問題
Powered by:
BlogJava
Copyright © HUIKK
主站蜘蛛池模板:
永新县
|
松桃
|
新巴尔虎右旗
|
镶黄旗
|
卢龙县
|
阳山县
|
额济纳旗
|
柞水县
|
柳河县
|
九龙城区
|
福清市
|
长丰县
|
洱源县
|
屏东市
|
灯塔市
|
石林
|
蓬莱市
|
阿拉善右旗
|
琼海市
|
若尔盖县
|
宜良县
|
华蓥市
|
嘉善县
|
祥云县
|
昆山市
|
新和县
|
崇仁县
|
黔西
|
青阳县
|
依安县
|
两当县
|
全椒县
|
大关县
|
商南县
|
湖州市
|
永新县
|
绍兴县
|
上栗县
|
黑龙江省
|
滁州市
|
肥城市
|