zoukankan
html css js c++ java
淘宝首页自动切换选项卡变换内容
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<
html
xmlns
="http://www.w3.org/1999/xhtml"
>
<
head
>
<
meta
http-equiv
="Content-Type"
content
="text/html; charset=gb2312"
/>
<
title
>
无标题文档
</
title
>
</
head
>
<
style
type
="text/css"
>
body
{
}
{
margin
:
0
;
padding
:
0
;
border
:
0
;
font-size
:
12px
}
div,ul,li
{
}
{
margin
:
0
;
padding
:
0
;
border
:
0
}
li
{
}
{
list-style
:
none
}
.m
{
}
{
margin
:
20px
;
width
:
338px
}
#rolinTab
{
}
{
float
:
left
;
border-top
:
1px solid #ccc
}
#rolinTab li
{
}
{
margin-top
:
-1px
;
width
:
35px
;
border
:
1px solid #ccc
;
margin-bottom
:
5px
;
line-height
:
22px
;
text-align
:
center
;
border-right
:
none
;
cursor
:
pointer
}
#rolinData
{
}
{
float
:
right
;
width
:
280px
;
border
:
1px solid #ccc
;
height
:
130px
;
margin-left
:
-1px
;
padding
:
10px
}
</
style
>
<
script
type
="text/javascript"
>
var
$
=
function
($)
{
return
document.getElementById($)}
function
getFirstChild(obj)
{
var
result
=
obj.firstChild;
while
(
!
result.tagName)
{
result
=
result.nextSibling;
}
return
result;
}
function
getNextChild(obj)
{
var
result
=
obj.nextSibling;
while
(
!
result.tagName)
{
result
=
result.nextSibling;
}
return
result;
}
function
rolinTab(tab,data,index)
{
var
tabList
=
$(tab).getElementsByTagName(
"
LI
"
);
var
selectItem
=
index
?
index
-
1
:
0
;
var
interval;
var
dataList
=
new
Array();
var
tmp
=
null
;
for
(
var
i
=
0
; i
<
tabList.length; i
++
)
{
tmp
=
i
==
0
?
getFirstChild($(data)):getNextChild(tmp);
dataList.push(tmp);
tabList[i].i
=
i;
tabList[i].onclick
=
function
()
{
if
(selectItem
!=
this
.i)
{
var
oldItem
=
selectItem
selectItem
=
this
.i;
changeItem(oldItem);
}
}
if
(i
!=
selectItem) dataList[i].style.display
=
"
none
"
;
}
$(tab).parentNode.onmouseover
=
function
()
{
clearInterval(interval);
}
$(tab).parentNode.onmouseout
=
function
()
{
interval
=
setInterval(change,
1000
)
}
changeItem();
interval
=
setInterval(change,
1000
)
function
change()
{
var
oldItem
=
selectItem
selectItem
++
;
if
(selectItem
>
tabList.length
-
1
) selectItem
=
0
;
changeItem(oldItem);
}
function
changeItem(old)
{
if
(old
!=
null
)
{
tabList[old].style.borderRight
=
"
none
"
;
tabList[old].style.cursor
=
"
pointer
"
;
tabList[old].style.color
=
"
#000
"
;
dataList[old].style.display
=
"
none
"
;
}
tabList[selectItem].style.borderRight
=
"
1px solid #fff
"
;
tabList[selectItem].style.cursor
=
"
nomorl
"
;
tabList[selectItem].style.color
=
"
#f60
"
;
dataList[selectItem].style.display
=
"
block
"
;
}
}
window.onload
=
function
()
{
rolinTab(
"
rolinTab
"
,
"
rolinData
"
,
1
)
}
</
script
>
<
body
>
<
div
class
="m"
>
<
div
id
="rolinData"
>
<
div
>
美女
</
div
>
<
div
>
美男
</
div
>
<
div
>
美狗
</
div
>
<
div
>
美猫
</
div
>
<
div
>
美猪
</
div
>
</
div
>
<
ul
id
="rolinTab"
>
<
li
>
美女
</
li
>
<
li
>
美男
</
li
>
<
li
>
美狗
</
li
>
<
li
>
美猫
</
li
>
<
li
>
美猪
</
li
>
</
ul
>
</
div
>
</
body
>
</
html
>
查看全文
相关阅读:
Codeforces Round #499 (Div. 2)
Codeforces Round #500 (Div. 2) [based on EJOI]
Codeforces Round #508 (Div. 2)
Codeforces Round #449 (Div. 2)
Willem, Chtholly and Seniorious
【生成树,堆】【CF1095F】 Make It Connected
【乱搞】【CF1095E】 Almost Regular Bracket Sequence
【数学】数论进阶-常见数论函数
【数论】数论进阶-Preknowledge
【cdq分治】【CF1093E】 Intersection of Permutations
原文地址:https://www.cnblogs.com/CB/p/1114230.html
最新文章
JavaScript学习笔记<1>
Oracle学习笔记<3>
Oracle学习笔记<2>
css学习笔记
Oracle上课学习笔记<1>
关于软件IntelliJ IDEA的使用技巧(三)
Web学习笔记
使用IntelliJ IDEA配置Maven(详细操作)
关于软件IntelliJ IDEA的使用技巧(四)
关于软件IntelliJ IDEA的使用技巧(二)
热门文章
python脚本发送电子邮件
linux环境下的python安装过程(含setuptools)
linux 中 virtualenvwrapper的使用
Could not fetch URL https://pypi.org/simple/pip/: There was a problem confir
Python安装setuptools时报Compression requires the (missing) zlib
Educational Codeforces Round 35 (Rated for Div. 2)
Codeforces Round #485 (Div. 2)
Codeforces Round #491 (Div. 2)
Codeforces Round #493 (Div. 2)
Codeforces Round #497 (Div. 2)
Copyright © 2011-2022 走看看