图片切换,带标题文字

简介: 图片切换,带标题文字 #play{width:500px;height:230px; border:#ccc 1px solid;} #playBg{margin-top:200px;z-index:1;filter:alpha(opacity=70);opacity:0.
<!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>
<title>图片切换,带标题文字</title>
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<script type="text/javascript" src="common/jquery-1.2.6.min.js"></script>
<link type="text/css" rel="stylesheet" href="common/common.css" />
<style type="text/css">
#play{width:500px;height:230px; border:#ccc 1px solid;}
#playBg{margin-top:200px;z-index:1;filter:alpha(opacity=70);opacity:0.7;width:500px;position:absolute;height:30px;background:#000;}
#playText{margin-top:200px;z-index:2;padding-left:10px;font-size:14px;font-weight:bold;width:340px;color:#fff;line-height:30px; overflow:hidden;position:absolute;cursor:pointer;}
#playNum{margin:205px 5px 0 350px;z-index:3;width:145px; text-align:right;position:absolute;height:25px;}
#playNum a{margin:0 2px;width:20px;height:20px;font-size:14px; font-weight:bold;line-height:20px;cursor:pointer;color:#000;padding:0 5px;background:#D7D6D7;text-align:center}
#playShow img{width:500px;height:230px;}
</style>
<body>
<div id="play">
 <ul>
        <li id="playBg"></li>
        <li id="playText"></li>
        <li id="playNum"><a>1</a><a>2</a><a>3</a><a>4</a><a>5</a><a>6</a></li>
        <li id="playShow">
            <a href="#" target="_blank"><img src="images/01.jpg" alt="澳大利亚:体验蓝山风光,感受澳洲风情"></a>
            <a href="#" target="_blank"><img src="images/02.jpg" alt="九月抄底旅游,马上行动"></a>
            <a href="#" target="_blank"><img src="images/03.jpg" alt="港澳旅游:超值特价,奢华享受"></a>
            <a href="#" target="_blank"><img src="images/04.jpg" alt="炎炎夏日哪里去,途牛带你海滨游"></a>
            <a href="#" target="_blank"><img src="images/05.jpg" alt="定途牛旅游线路,优惠购买缤纷乐相册"></a>
            <a href="#" target="_blank"><img src="images/03.jpg" alt="三亚自助游"></a>
        </li>
    </ul>
</div>
<script type=text/javascript>
var t = n = 0, count = $("#playShow a").size();
$(function(){
$("#playShow a:not(:first-child)").hide();
$("#playText").html($("#playShow a:first-child").find("img").attr('alt'));
$("#playNum a:first").css({"background":"#FFD116",'color':'#A8471C'});
$("#playText").click(function(){window.open($("#playShow a:first-child").attr('href'), "_blank")});
$("#playNum a").click(function() {
   var i = $(this).text() - 1;
   n = i;
   if (i >= count) return;
   $("#playText").html($("#playShow a").eq(i).find("img").attr('alt'));
   $("#playText").unbind().click(function(){window.open($("#playShow a").eq(i).attr('href'), "_blank")})
   $("#playShow a").filter(":visible").hide().parent().children().eq(i).fadeIn(1200);
   $(this).css({"background":"#FFD116",'color':'#A8471C'}).siblings().css({"background":"#D7D6D7",'color':'#000'});
});
t = setInterval("showAuto()", 5000);
$("#play").hover(function(){clearInterval(t)}, function(){t = setInterval("showAuto()", 5000);});
})
function showAuto()
{
n = n >= (count - 1) ? 0 : ++n;
$("#playNum a").eq(n).trigger('click');
}
</script>
</body>
</html>
相关文章
|
4月前
|
Linux
文字的显示
文字的显示
90 0
|
iOS开发
iOS开发-同一段文字显示不同颜色
iOS开发-同一段文字显示不同颜色
76 0
|
iOS开发
iOS开发 - 同一段文字显示不同颜色和字体
iOS开发 - 同一段文字显示不同颜色和字体
86 0
|
架构师 开发者
图片和文字控件|学习笔记
快速学习图片和文字控件。
72 0
|
开发者
文字控件| 学习笔记
快速学习文字控件。
62 0
文字控件| 学习笔记
|
开发者
文字控件|学习笔记
快速学习文字控件
68 0
文字控件|学习笔记
|
前端开发 iOS开发
文字样式处理总结
文字样式处理总结
文字样式处理总结
|
JavaScript 前端开发
给网站的标题添加点色彩
这16行JavaScript,可能会提升你网站的回头率~
112 0
怎么给文字或图片添加超链接?
一、什么是超链接? 就是点击文字或图片后,进入另外一个网址。请参考样例:今日创业 点击这几个字后会进入今日创业的网站。 二、怎么做超链接? 1、将鼠标移到某个图片或文字的控件上,点右键,再点:属性。
5822 0
|
JavaScript 容器
琴弦文字 - jquery插件
原文:琴弦文字 - jquery插件 这是一个基于jquery的琴弦效果插件。 以前曾经见过这个效果,有过尝试的想法但是当时技能点还不够。 前天在火车上偶然想起这个,认真思索了一下,一气呵成 :D 看来最近技能树点偏的不太远。
1004 0