幻灯片效果案例
时间:2024年02月09日
/来源:网络
/编辑:佚名
这个效果在很多的网站上都用到了,可以收藏起来
HTML代码:
复制代码
<div id="kinSlideShow">
<a href="" target="_blank"><img src="images/1.jpg" class ="photo" alt="images/1.jpg"/></a>
<a href="" target="_blank"><img src="images/2.jpg" class ="photo" alt="images/2.jpg"/></a>
<a href="" target="_blank"><img src="images/3.jpg" class ="photo" alt="images/3.jpg"/></a>
<a href="" target="_blank"><img src="images/4.jpg" class ="photo" alt="images/4.jpg"/></a>
<a href="" target="_blank"><img src="images/5.jpg" class ="photo" alt="images/5.jpg"/></a>
<a href="" target="_blank"><img src="images/6.jpg" class ="photo" alt="images/6.jpg"/></a>
</div>
CSS代码:
复制代码
#kinSlideShow
{
visibility:hidden;/*防止页面加载时看到所有的图片*/
}
.photo
{
width:600px;
height:300px;
}
JS代码:
复制代码
$(document).ready(function() {
//$("#kinSlideShow").KinSlideshow(); //默认设置效果,默认是向左切换,切换时间间隔为8s,鼠标点击按钮式切换
//自定义切换参数
/******************************************************
$("#kinSlideShow").KinSlideshow({
moveStyle:"down",//切换样式
interverTime:8,//切换间隔时间
mouseEvent:"mouseover",//鼠标事件
titleFont:{TitleFont_size:14,TitleFont_color:"#FF0000"}//标题样式
});
*******************************************************/
//自定义外观参数
/******************************************************
$("#kinSlideShow").KinSlideshow({
moveStyle: "right", //切换样式
interverTime: 8, //切换间隔时间
titleBar: { titleBar_height: 30, titleBar_bgColor: "#08355c", titleBar_alpha: 0.5 },
mouseEvent: "mouseover", //鼠标事件
titleFont: { TitleFont_size: 12, TitleFont_color: "#FFFFFF", TitleFont_weight: "normal"},//标题样式
btn:{ btn_bgColor:"#FFFFFF",btn_bgHoverColor:"#1072aa",btn_fontColor:"#000000",
btn_fontHoverColor:"#FFFFFF",btn_borderColor:"#cccccc",
btn_borderHoverColor:"#1188c0",btn_borderWidth:1}
});
*******************************************************/
//每次打开页面随机选择切换效果
var moveStyle;
var rand = parseInt(Math.random() * 4);
switch (rand) {
case 0: moveStyle = "left"; break;
case 1: moveStyle = "right"; break;
case 2: moveStyle = "up"; break;
case 3: moveStyle = "down"; break;
}
$("#kinSlideShow").KinSlideshow({
moveStyle:moveStyle,
interverTime:8
});
});
HTML代码:
复制代码
<div id="kinSlideShow">
<a href="" target="_blank"><img src="images/1.jpg" class ="photo" alt="images/1.jpg"/></a>
<a href="" target="_blank"><img src="images/2.jpg" class ="photo" alt="images/2.jpg"/></a>
<a href="" target="_blank"><img src="images/3.jpg" class ="photo" alt="images/3.jpg"/></a>
<a href="" target="_blank"><img src="images/4.jpg" class ="photo" alt="images/4.jpg"/></a>
<a href="" target="_blank"><img src="images/5.jpg" class ="photo" alt="images/5.jpg"/></a>
<a href="" target="_blank"><img src="images/6.jpg" class ="photo" alt="images/6.jpg"/></a>
</div>
CSS代码:
复制代码
#kinSlideShow
{
visibility:hidden;/*防止页面加载时看到所有的图片*/
}
.photo
{
width:600px;
height:300px;
}
JS代码:
复制代码
$(document).ready(function() {
//$("#kinSlideShow").KinSlideshow(); //默认设置效果,默认是向左切换,切换时间间隔为8s,鼠标点击按钮式切换
//自定义切换参数
/******************************************************
$("#kinSlideShow").KinSlideshow({
moveStyle:"down",//切换样式
interverTime:8,//切换间隔时间
mouseEvent:"mouseover",//鼠标事件
titleFont:{TitleFont_size:14,TitleFont_color:"#FF0000"}//标题样式
});
*******************************************************/
//自定义外观参数
/******************************************************
$("#kinSlideShow").KinSlideshow({
moveStyle: "right", //切换样式
interverTime: 8, //切换间隔时间
titleBar: { titleBar_height: 30, titleBar_bgColor: "#08355c", titleBar_alpha: 0.5 },
mouseEvent: "mouseover", //鼠标事件
titleFont: { TitleFont_size: 12, TitleFont_color: "#FFFFFF", TitleFont_weight: "normal"},//标题样式
btn:{ btn_bgColor:"#FFFFFF",btn_bgHoverColor:"#1072aa",btn_fontColor:"#000000",
btn_fontHoverColor:"#FFFFFF",btn_borderColor:"#cccccc",
btn_borderHoverColor:"#1188c0",btn_borderWidth:1}
});
*******************************************************/
//每次打开页面随机选择切换效果
var moveStyle;
var rand = parseInt(Math.random() * 4);
switch (rand) {
case 0: moveStyle = "left"; break;
case 1: moveStyle = "right"; break;
case 2: moveStyle = "up"; break;
case 3: moveStyle = "down"; break;
}
$("#kinSlideShow").KinSlideshow({
moveStyle:moveStyle,
interverTime:8
});
});
新闻资讯 更多
- 【建站知识】查询nginx日志状态码大于400的请求并打印整行04-03
- 【建站知识】Python中的logger和handler到底是个什么?04-03
- 【建站知识】python3拉勾网爬虫之(您操作太频繁,请稍后访问)04-03
- 【建站知识】xpath 获取meta里的keywords及description的方法04-03
- 【建站知识】python向上取整以50为界04-03
- 【建站知识】scrapy xpath遇见乱码解决04-03
- 【建站知识】scrapy爬取后中文乱码,解决word转为html 时cp1252编码问题04-03
- 【建站知识】scrapy采集—爬取中文乱码,gb2312转为utf-804-03