博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
JS 实现3D立体效果的首页轮播图(瞬间让你的网站高大上,逼格满满)
阅读量:7209 次
发布时间:2019-06-29

本文共 9183 字,大约阅读时间需要 30 分钟。

这里写图片描述

还是那句话,废话少说,直接上源代码:

JS 实现3D立体效果的图片幻灯切换

对于使用IE6的同学看到的斑点,我只能表示很无奈。。。

高级扩展

这里写图片描述

            JS 实现3D立体效果的图片幻灯切换        

IE6可能不支持

这里写图片描述

            
全屏图片切换
banner图
 $(window).load(function() { $('.flexslider').flexslider({  animation: "fade",              //String: Select your animation type, "fade" or "slide"                  图片变换方式:淡入淡出或者滑动  slideDirection: "horizontal",   //String: Select the sliding direction, "horizontal" or "vertical"          图片设置为滑动式时的滑动方向:左右或者上下  slideshow: true,                //Boolean: Animate slider automatically                                  载入页面时,是否自动播放  slideshowSpeed: 7000,           //Integer: Set the speed of the slideshow cycling, in milliseconds         自动播放速度毫秒  animationDuration: 600,         //Integer: Set the speed of animations, in milliseconds                  动画淡入淡出效果延时  directionNav: true,             //Boolean: Create navigation for previous/next navigation? (true/false)          是否显示左右控制按钮  controlNav: true,               //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage              是否显示控制菜单  keyboardNav: true,              //Boolean: Allow slider navigating via keyboard left/right keys                       键盘左右方向键控制图片滑动  mousewheel: false,              //Boolean: Allow slider navigating via mousewheel                        鼠标滚轮控制制图片滑动  prevText: "Previous",           //String: Set the text for the "previous" directionNav item              设置文本的字符串:“以前的”directionnav项目  nextText: "Next",               //String: Set the text for the "next" directionNav item                   看过《文本字符串:“下”的directionnav item  pausePlay: false,               //Boolean: Create pause/play dynamic element                              布尔:create暂停/播放动态元素  pauseText: 'Pause',             //String: Set the text for the "pause" pausePlay item                     字符串:设置文字为“暂停”pauseplay项目  playText: 'Play',               //String: Set the text for the "play" pausePlay item                      字符串:在“玩”pauseplay项设置文本  randomize: false,               //Boolean: Randomize slide order                                          是否随即幻灯片  slideToStart: 0,                //Integer: The slide that the slider should start on. Array notation (0 = first slide)初始化第一次显示图片位置  animationLoop: true,            //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end            是否循环滚动  pauseOnAction: true,            //Boolean: Pause the slideshow when interacting with control elements, highly recommended.                              布尔:暂停幻灯片的控制要素互动的时候,强烈推荐。  pauseOnHover: false,            //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering                         布尔:暂停幻灯片演示当鼠标悬停的滑块,然后恢复时不再徘徊  controlsContainer: "",          //Selector: Declare which container the navigation elements should be appended too. Default container is the flexSlider element. Example use would be ".flexslider-container", "#container", etc. If the given element is not found, the default action will be taken.                  该导航元素的容器说,这应该是appended太。默认的容器是flexslider元。实例的使用将是“容器”,# .flexslider“容器”,等等。如果没有发现了元素的默认行为,将被考虑。  manualControls: "",             //Selector: Declare custom control navigation. Example would be ".flex-control-nav li" or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs.自定义控制导航  manualControlEvent:"",          //String:自定义导航控制触发事件:默认是click,可以设定hover  start: function(){},            //Callback: function(slider) - Fires when the slider loads the first slide                                       回调:功能(滑块)-当滑块加载第一个幻灯片时触发  before: function(){},           //Callback: function(slider) - Fires asynchronously with each slider animation                              回调:功能(滑块)-与每个滑块动画异步触发  after: function(){},            //Callback: function(slider) - Fires after each slider animation completes                                  回调:功能(滑块)-每个滑块动画完成后触发  end: function(){}               //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous)                  当滑块到达上一个幻灯片(异步)时发生火灾 });}); 

配置参数

 $(window).load(function() { $('.flexslider').flexslider({  animation: "fade",              //String: Select your animation type, "fade" or "slide"                  图片变换方式:淡入淡出或者滑动  slideDirection: "horizontal",   //String: Select the sliding direction, "horizontal" or "vertical"          图片设置为滑动式时的滑动方向:左右或者上下  slideshow: true,                //Boolean: Animate slider automatically                                  载入页面时,是否自动播放  slideshowSpeed: 7000,           //Integer: Set the speed of the slideshow cycling, in milliseconds         自动播放速度毫秒  animationDuration: 600,         //Integer: Set the speed of animations, in milliseconds                  动画淡入淡出效果延时  directionNav: true,             //Boolean: Create navigation for previous/next navigation? (true/false)          是否显示左右控制按钮  controlNav: true,               //Boolean: Create navigation for paging control of each clide? Note: Leave true for manualControls usage              是否显示控制菜单  keyboardNav: true,              //Boolean: Allow slider navigating via keyboard left/right keys                       键盘左右方向键控制图片滑动  mousewheel: false,              //Boolean: Allow slider navigating via mousewheel                        鼠标滚轮控制制图片滑动  prevText: "Previous",           //String: Set the text for the "previous" directionNav item              设置文本的字符串:“以前的”directionnav项目  nextText: "Next",               //String: Set the text for the "next" directionNav item                   看过《文本字符串:“下”的directionnav item  pausePlay: false,               //Boolean: Create pause/play dynamic element                              布尔:create暂停/播放动态元素  pauseText: 'Pause',             //String: Set the text for the "pause" pausePlay item                     字符串:设置文字为“暂停”pauseplay项目  playText: 'Play',               //String: Set the text for the "play" pausePlay item                      字符串:在“玩”pauseplay项设置文本  randomize: false,               //Boolean: Randomize slide order                                          是否随即幻灯片  slideToStart: 0,                //Integer: The slide that the slider should start on. Array notation (0 = first slide)初始化第一次显示图片位置  animationLoop: true,            //Boolean: Should the animation loop? If false, directionNav will received "disable" classes at either end            是否循环滚动  pauseOnAction: true,            //Boolean: Pause the slideshow when interacting with control elements, highly recommended.                              布尔:暂停幻灯片的控制要素互动的时候,强烈推荐。  pauseOnHover: false,            //Boolean: Pause the slideshow when hovering over slider, then resume when no longer hovering                         布尔:暂停幻灯片演示当鼠标悬停的滑块,然后恢复时不再徘徊  controlsContainer: "",          //Selector: Declare which container the navigation elements should be appended too. Default container is the flexSlider element. Example use would be ".flexslider-container", "#container", etc. If the given element is not found, the default action will be taken.                  该导航元素的容器说,这应该是appended太。默认的容器是flexslider元。实例的使用将是“容器”,# .flexslider“容器”,等等。如果没有发现了元素的默认行为,将被考虑。  manualControls: "",             //Selector: Declare custom control navigation. Example would be ".flex-control-nav li" or "#tabs-nav li img", etc. The number of elements in your controlNav should match the number of slides/tabs.自定义控制导航  manualControlEvent:"",          //String:自定义导航控制触发事件:默认是click,可以设定hover  start: function(){},            //Callback: function(slider) - Fires when the slider loads the first slide                                       回调:功能(滑块)-当滑块加载第一个幻灯片时触发  before: function(){},           //Callback: function(slider) - Fires asynchronously with each slider animation                              回调:功能(滑块)-与每个滑块动画异步触发  after: function(){},            //Callback: function(slider) - Fires after each slider animation completes                                  回调:功能(滑块)-每个滑块动画完成后触发  end: function(){}               //Callback: function(slider) - Fires when the slider reaches the last slide (asynchronous)                  当滑块到达上一个幻灯片(异步)时发生火灾 });}); 
你可能感兴趣的文章
C# 网卡IP(网上资料整理)
查看>>
html网站网址一键打包成App平台-开心App平台
查看>>
使用react的一点提醒17/10/26
查看>>
Java 内部类的阐述
查看>>
redis-大key寻找
查看>>
EF 数据查询(更改默认排序)
查看>>
求连续子数组的最大和
查看>>
SpringMVC最简单配置应用
查看>>
jQuery与Zepto的异同
查看>>
jsp注册页面的省份联动(网上copy别人的,然后自己弄了一下才知道怎么用)
查看>>
CRC检错技术原理
查看>>
读取Ini文件字段
查看>>
asp获取来源Url
查看>>
第一次实验
查看>>
Redis基础操作
查看>>
clob大数据转换为多行数据
查看>>
bootstrap的流式布局
查看>>
如何通过线程池异步调用
查看>>
Squid配置详解
查看>>
070104_微积分:随机变量及其分布(二项分布,均匀分布,正态分布)
查看>>