<script src="{$GetInstallDir}web/scripts/jquery-1.3.1.js"></script>

<style>
/*环保首页幻灯*/
.left_hd {width:980px; height: 240px; overflow:hidden;position: relative;}
ul.list_img {position: absolute; width: 3000px;}
ul ,li {list-style: none;}
.list_img li {width: 980px;font-size: 30px;height: 240px;/*~~如果横向切换设置float:left;~~*/}
.list_num { position: absolute; right: 0px; bottom: 0px;}
.list_num li {float: left; width: 20px; height: 20px; background: #eaeaea; list-style: none; text-align: center; cursor: pointer;margin: 2px;}
.list_num li.on {background: #FF0000;}
</style>
<script>
// 首页幻灯
function slideshow(){
var index = ;
var len = $(".list_img li").length;
//自动翻转 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
var MyTime = setInterval(function(){
showimg(index);
index++;
if(index==len){index=;}
},);
//数字跳转 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
$(".list_num li").mouseover(function(){
index = $(".list_num li").index(this);
showimg(index);
});
//鼠标悬停是不翻转 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
$('.left_hd').hover(function(){
if(MyTime){
clearInterval(MyTime);
}
},function(){
MyTime = setInterval(function(){
showimg(index)
index++;
if(index==len){index=;}
} , );
});
}
//翻转效果函数,stop用来解决鼠标滑动过快后多次执行的bug ~~~~~~~~~~~~~~~~~~~~~~~~~~~
function showimg(i){
//渐变切换
$(".list_img li").eq(i).stop(true,true).fadeIn("slow").siblings("li").hide();
//横向切换
//$(".list_img").stop(true,false).animate({left:-500*i},200);
//竖向切换
//$(".list_img").stop(true,false).animate({top:-200*i},200);
$(".list_num li").eq(i).addClass("on").siblings().removeClass("on");
}
//
$(document).ready(function() {
slideshow();
$("#focus_hd a:first").css('display', 'block');
});
</script>
<div class="left_hd" id="focus_hd">
<div style="width: 980px; height: 240px; position: relative;" class="focus_wrap list_img">
<li>
<a target="_blank" href="" title="">
<img width="" height="" src="{$GetInstallDir}web/img/s2.jpg">
</a>
</li>
<li>
<a target="_blank" href="" title="">
<img width="" height="" src="{$GetInstallDir}web/img/s4.jpg">
</a>
</li>
<li>
<a target="_blank" href="" title="">
<img width="" height="" src="{$GetInstallDir}web/img/s3.jpg">
</a>
</li> </div> <div class="focus_page list_num">
<li class="on"></li>
<li class=""></li>
<li class=""></li>
</div>
</div>
<style>
/*首页幻灯*/
.left_hd {width:960px; height: 240px; overflow:hidden;position: relative;}
ul.list_img {position: absolute; width: 3000px;}
ul ,li {list-style: none;}
.list_img li {width: 960px;font-size: 30px;height: 240px;/*~~如果横向切换设置float:left;~~*/}
.list_num { position: absolute; right: 0px; bottom: 0px;}
.list_num li {float: left; width: 20px; height: 20px; background: #eaeaea; list-style: none; text-align: center; cursor: pointer;margin: 2px;}
.list_num li.on {background: #FF0000;}
</style>
<script> // 首页幻灯
function slideshow(){
var index = ;
var len = $(".list_img li").length;
//自动翻转 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
var MyTime = setInterval(function(){
showimg(index);
index++;
if(index==len){index=;}
},);
//数字跳转 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
$(".list_num li").mouseover(function(){
index = $(".list_num li").index(this);
showimg(index);
});
//鼠标悬停是不翻转 ~~~~~~~~~~~~~~~~~~~~~~~~~~~
$('.left_hd').hover(function(){
if(MyTime){
clearInterval(MyTime);
}
},function(){
MyTime = setInterval(function(){
showimg(index)
index++;
if(index==len){index=;}
} , );
});
}
//翻转效果函数,stop用来解决鼠标滑动过快后多次执行的bug ~~~~~~~~~~~~~~~~~~~~~~~~~~~
function showimg(i){
//渐变切换
$(".list_img li").eq(i).stop(true,true).fadeIn("slow").siblings("li").hide();
//横向切换
//$(".list_img").stop(true,false).animate({left:-500*i},200);
//竖向切换
//$(".list_img").stop(true,false).animate({top:-200*i},200);
$(".list_num li").eq(i).addClass("on").siblings().removeClass("on");
}
//
$(document).ready(function() {
slideshow();
$("#focus_hd a:first").css('display', 'block');
});
</script> <div class="left_hd" id="focus_hd">
<div style="width: 960px; height: 240px; position: relative;" class="focus_wrap list_img">
<li>
<a target="_blank" href="" title="">
<img width="" height="" src="{$GetInstallDir}web/img/001.jpg">
</a>
</li>
<li>
<a target="_blank" href="" title="">
<img width="" height="" src="{$GetInstallDir}web/img/002.jpg">
</a>
</li>
<li>
<a target="_blank" href="" title="">
<img width="" height="" src="{$GetInstallDir}web/img/003.jpg">
</a>
</li>
<li>
<a target="_blank" href="" title="">
<img width="" height="" src="{$GetInstallDir}web/img/004.jpg">
</a>
</li>
<li>
<a target="_blank" href="" title="">
<img width="" height="" src="{$GetInstallDir}web/img/005.jpg">
</a>
</li>
<li>
<a target="_blank" href="" title="">
<img width="" height="" src="{$GetInstallDir}web/img/006.jpg">
</a>
</li>
<li>
<a target="_blank" href="" title="">
<img width="" height="" src="{$GetInstallDir}web/img/007.jpg">
</a>
</li> </div> <div class="focus_page list_num">
<li class="on"></li>
<li class=""></li>
<li class=""></li>
<li class=""></li>
<li class=""></li>
<li class=""></li>
<li class=""></li>
</div>
</div>

幻灯片slider的更多相关文章

  1. 【jquery】幻灯片效果

    闲着无聊,用Jquery写了一个幻灯片效果. 我这人喜欢造轮子,除了jquery这种有强大开发团队的框架级别JS,其实的一些小程序都是尽量自己写. 一是因为怕出问题了没人问,二是自己写的改起来也方便. ...

  2. bxSlider 在网页里添加幻灯片效果

    幻灯片效果在网页上很常见,本文介绍用 bxSlider 轻松实现的方法. bxSlider是什么 bxSlider 是用 JQuery 和 CSS 实现网页中幻灯片效果的工具.可在 http://bx ...

  3. css+js 控制幻灯片效果

    <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...

  4. jQuery幻灯片skitter-slider插件学习总结

    @(关键词)[skitter|jquery|网页幻灯片|slider] Skitter 是一个非常酷炫的jQuery网页幻灯片插件,支持非常多种酷炫幻灯片切换方式,下载前往官网,另有参考文档 下面简单 ...

  5. Elastic Image Slider 带缩略图功能的幻灯片

    今天我们要为您展示如何创建一个简单的弹性幻灯片,带有缩略图预览功能.Elastic Image Slider 这款幻灯片能够自动调整以适应到其父容器,我们可以通过幻灯片使用缩略图预览或幻灯片的自动播放 ...

  6. JQuery之滑动幻灯片插件Easy Slider初体验

    Easy Slider 是一个滑动幻灯片插件,支持任何图片或内容,可以实现横向或纵向滑动.它拥有一系列丰富的参数设置,可通过CSS来进行完全的控制.基本上只需要引入这个插件后,设置好内容,然后样式化C ...

  7. WordPress插件:幻灯片Meta Slider

    在wordpress中添加幻灯片的方法很简单,通过使用Meta Slider就可以简单地给wordpress添加幻灯片. 插件下载>> 安装后启用插件,根据提示创建幻灯片: 设置幻灯片样式 ...

  8. jQuery Devrama Slider 幻灯片

    Devrama Slider 是个图像滑块,带有许多非常有趣的特性. 它不仅支持图像还支持 HTML 内容. 响应式 方便 CSS3 转换 转换效果 进度条 高级的预加载和延迟加载 CSS 自定义 用 ...

  9. 【JS/CSS3】实现带预览图幻灯片效果~

    一.前期准备 1.1 案例分析 适用场景:单例布局1.2 方法论 V视图 HTML+CSS+调试C js实现控制流程D数据 优化扩展 二.代码 结构 <div class="slide ...

随机推荐

  1. Shell学习笔记 - 循环语句

    一.for循环 1. 语法格式1 for 变量 in 值1 值2 值3 ... do 程序 done 说明:程序将遍历所有的值,赋值给变量,然后在执行程序.也就是说,后面接多少个值,程序就循环多少次. ...

  2. DNS的递归查询和迭代查询

    百度运维部二面,直接懵逼的节奏 (1)递归查询 递归查询是一种DNS 服务器的查询模式,在该模式下DNS 服务器接收到客户机请求, 必须使用一个准确的查询结果回复客户机. 如果DNS 服务器本地没有存 ...

  3. 转: 58同城高性能移动Push推送平台架构演进之路

    转: http://geek.csdn.net/news/detail/58738 文/孙玄 本文详细讲述58同城高性能移动Push推送平台架构演进的三个阶段,并介绍了什么是移动Push推送,为什么需 ...

  4. 转:MediaCoder H.264格式编码参数设置及详解

    转: http://mediacoder.com.cn/node/81 由于现在大部分视频转码都选择H.264格式进行编码,同时CUDA编码的画质还达不到x264软编码的质量(如果你对画质无要求,可以 ...

  5. python连接字符串的方式

    发现Python连接字符串又是用的不顺手,影响速度 1.数字对字符进行拼接 s=""  #定义这个字符串,方便做连接 print type(s) for i in range(10 ...

  6. TOP 10 BEST LINUX GAMES RELEASED IN 2016

    Gaming on Linux used to be a very rare phrase. But since the arrival of Steam on Linux, the Linux ga ...

  7. git之添加ssh

    1.ssh-keygen 2.cat ~/.ssh/id_rsa.pub 3.git config user.email "huangsy13@gmail.com" 4.git c ...

  8. 编写灵活、稳定、高质量的 HTML 和 CSS 代码的规范

    HTML 语法 HTML5 doctype 语言属性(Language attribute) 字符编码 IE 兼容模式 引入 CSS 和 JavaScript 文件 实用为王 属性顺序 布尔(bool ...

  9. 【Quote】What is Mono

    What is Mono Mono is a software platform designed to allow developers to easily create cross platfor ...

  10. MarkFan的程序员客栈

    历史上的今天:2013-12-27 跨平台移动开发 App-Framework DEMO 演示