自定义图标/幻灯片导航控制按钮的图像像viber.com

编程入门 行业动态 更新时间:2024-10-08 08:32:03
本文介绍了自定义图标/幻灯片导航控制按钮的图像像viber的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我使用flexslider,我想更改。 。 。幻灯片导航控制到我自己的图标或每个幻灯片的图像。像幻灯片上的

I am using flexslider and i want to change the . . . slide navigation control to my own icons or image for each slide. like the slide on viber if not possible on flexslider in which plugin can i do that.

解决方案

I think you can try this approach by tweaking with some css and js:

First, hide the default navigation bullets of flexslider using css:

.flex-control-nav.flex-control-paging { display:none; }

Second, add your custom navigation html and design it in whatever way you want. But make sure that the number of slides and custom navigation anchors are same. I used icon images for custom navigation:

<div class="custom"> <img src="cdn0.iconfinder/data/icons/small-n-flat/24/678131-money-16.png" /> <img src="cdn0.iconfinder/data/icons/small-n-flat/24/678131-money-16.png" /> <img src="cdn0.iconfinder/data/icons/small-n-flat/24/678131-money-16.png" /> <img src="cdn0.iconfinder/data/icons/small-n-flat/24/678131-money-16.png" /> <img src="cdn0.iconfinder/data/icons/small-n-flat/24/678131-money-16.png" /> </div>

Now, bind the click event on these custom navigation elements which in turn triggers the click on the default navigation of flexslider which are hidden.

$(document).on('click', '.custom img', function () { var index = $('.custom img').index($(this)); //Get the index of clicked navigation element var nav = $('.flex-control-nav a')[index]; //Get the navigation element of corresponding index from flexslider. $(nav).trigger('click'); //Finally, trigger click });

Demo : jsfiddle/lotusgodkk/VC4L3/2/

更多推荐

自定义图标/幻灯片导航控制按钮的图像像viber.com

本文发布于:2023-10-31 10:27:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1545810.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:自定义   幻灯片   图标   按钮   图像

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!