征集网锐志网络淘途找素材上91
创意在线首页
平面设计交互设计CG动漫工业设计建筑环境数码影像创意搜
 首页大赛征集资讯教程画廊访谈作品集创企同盟设计招聘人才专区竞赛台专题论吧 找素材看酷站设计网址库
教程网 Illustrator、Photoshop、CoreaDreaw、AI教程、PS教程
当前位置:首页 > 教程 > 脚本特效 > 正文
简单实用的图片幻灯切换效果
作者: 来源: 发表时间:2010-7-8 13:56:24 浏览:

<!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>
<title>简单实用的图片幻灯切换效果</title>
<meta http-equiv="content-type" content="text/html;charset=gb2312">
<!--把下面代码加到<head>与</head>之间-->
<style type="text/css教程">
#container{width:422px;height:200px;border:5px #000000 solid;}
#container .left{width:340px;height:200px;float:left;background-color:#999999;overflow:hidden;}
#container .left ul{padding:0;margin:0;}
#container .left ul li{list-style:none;cursor:pointer;text-align:center;}
#container .right{width:80px;height:200px;float:right;background-color:gray;}
#container .right ul{margin:0;padding:0;}
#container .right ul li{list-style:none;width:80px;height:40px;line-height:40px;text-align:center;padding-top:5px;_padding-top:0px;_margin-top:4px;cursor:pointer;}
.on{border:1px white solid;}
#container img{border:none;}
</style>
<script type="text/javascript教程" src="http://www.111cn.net/effect/images/jquery-1.3.2.js"></script>
<script type="text/javascript教程">
$(function(){
  var len=$(".right li").length;
  var index=0;
  var time;
    $(".right li").mousemove(function(){
     index=$(".right li").index(this);
    show(index);
    }).eq(0).mousemove();
    $(".left").hover(function(){
        clearinterval(time);
   },function(){
    time=setinterval(function(){
      show(index)
   index++;
   if(index==len){index=0;}
   },2000);
   }).trigger("mouseleave");
})
function show(index){
  $(".left li").eq(index).fadein(100).siblings().fadeout(100);
  $(".right li").removeclass("on").eq(index).addclass("on");
}
</script>
</head>
<body>
预览效果时左下角会提示错误,而且看不到效果,刷新一下就可以看到效果了;当然,在实际使用中,不会出现这样的问题。<br>
<!--把下面代码加到<body>与</body>之间-->
<div id="container">
  <div class="left">
    <ul>
      <li>图片1<br>图片说明1</li>
      <li>图片2<br>图片说明2</li>
      <li>图片3<br>图片说明3</li>
      <li>图片4<br>图片说明4</li>
    </ul>
  </div>
  <div class="right">
    <ul>
      <li>1</li>
      <li>2</li>
      <li>3</li>
      <li>4</li>
    </ul>
  </div>
</div>
</body>
</html>


在线编辑:angel
本文链接:


推荐阅读:
·2021第十五届“创意中国”设计大奖 征稿章程
·2021第七届“学院派奖”全国艺术与设计大赛征集公告
·青春唯美插画培训网络远程班正在招生
·第八届中国高等院校设计作品大赛启动
·第十二届中国高校美术作品学年展获奖名单公布
·2021第七届“学院派奖”全国艺术与设计大赛征集公告
·第六届“包豪斯奖”国际设计大赛获奖名单揭晓
免责声明:本站刊载此文不代表同意其说法或描述,仅为提供更多信息。对本文有异议,请联络本站!
转载要求:文章作者及来源信息必需保留。转载之图片、文件请不要盗链本站地址,且不准打上各自站点的水印!

近期推荐报道 返回首页更多精彩等着你!

Photoshop| Photoshop调出郁金香图片鲜艳的青摄影佳作| Kate Bellm性感的时尚人体摄影作
网页设计| 2010世界杯最美网站设计Photoshop| Photoshop制作沾满水花的蓝色水晶
网页设计| 德国asphyxia219网站作品欣赏海报设计| 不只水墨-设计大师靳埭强先生作品欣赏
插画艺术| Marleen Weijman 艳丽插画Photoshop| Photoshop制作水晶透明的立体按钮
Photoshop| Photoshop给美女照片加上绚丽的彩网页设计| 巴基斯坦naseemhaider网站作品
关于本站 | 联系方式 | 商业服务 | 合作伙伴 | 站点地图 | 免责声明 | 版权声明 | 在线投稿