1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > jQuery插件实现带圆点的焦点图片轮播切换【jquery】

jQuery插件实现带圆点的焦点图片轮播切换【jquery】

时间:2022-09-17 14:29:41

相关推荐

jQuery插件实现带圆点的焦点图片轮播切换【jquery】

web前端|js教程

jQuery,焦点图片轮播

web前端-js教程

这次分享的代码是jQuery插件,HovertreeImg是一个图片轮播jquery插件,使用方便,可以设置大小,圆点位置等,代码简洁

java抽奖程序源码,vscode一键运行cpp,ubuntu gdb安装,tomcat停止命令报错,java 嵌入sqlite,青岛网页设计公司电话,cn域名idc服务器,smf论坛插件,前端框架内核,爬虫网站文档,php显示中文,seo站长223aaa,周报项目springboot,网站连接数据库失败怎么办,个人信息网页代码,微信编辑器电商模板,网站后台登陆模板,wordpress 页面url重写,oa办公管理系统注册,下载站程序带采集lzw

#img {width:768px;height:66px;overflow:hidden}#img img{width:100%;height:100%;}#img #imgcontent{display:none}a{color:blue}

$("#img").hovertreeimg({"h_circlePosition": "",//left,right,center"h_width": 768,"h_height": 66,"h_borderColor":"silver","h_circleWidth": 14});

jquery.img.js

网站模板跟源码,ubuntu启动不了hive,如何优化爬虫代码,php 欢迎,通州seo引流lzw

/*!* HovertreeImg(jQuery Plugin)* version: 1.0.0* Copyright (c) HoverTree */(function ($) { $.fn.hovertreeimg = function (options) { var settings = $.extend({h_time:"3000",//切换时间h_borderColor: "transparent",//边框颜色h_width: "500",//宽度h_height: "200",//高度h_circleWidth: "18",//方框边长h_circleColor:"silver",//圆点颜色h_currentCircleColor: "red",//当前圆点颜色h_circlePosition:"right"//圆点位置 }, options); var h_hovertreeimg = $(this); if (h_hovertreeimg.length div#hovertreeimgcontent"); h_hovertreeimgcontent.hide(); var h_hovertreeimgcurrent = h_hovertreeimg.find(">a"); h_hovertreeimgcurrent.wrap("

"); h_replaceFrame = h_hovertreeimg.find("#replaceframe").css({ "width": "100%", "height": "100%" }); //构造圆点框 $(

).appendTo(h_hovertreeimg); var h_hovertreeimgpoint = h_hovertreeimg.find(".hovertreeimgpoint"); h_hovertreeimgcontent.prepend(h_hovertreeimgcurrent.clone(true));//复制到总a集合 var h_hovertreeimgitems = h_hovertreeimgcontent.children();//所有a标签集合 var h_hovertreeimglength = h_hovertreeimgitems.length;//所有轮播项数量 var h_isswitch = true;//是否轮播 var h_circleWidth = parseInt(settings.h_circleWidth); //加边框与间隔 var h_circleFrameWidth = (h_circleWidth + 4) * h_hovertreeimglength+2; h_hovertreeimgpoint.css({"height": (h_circleWidth + 4), "position": "absolute", "bottom": "0px","display": "inline-block" }) //设置圆点位置 switch (settings.h_circlePosition) {case ight: h_hovertreeimgpoint.css({"right": "0px" }) break;case left: h_hovertreeimgpoint.css({"left": "0px" }) break;default: h_hovertreeimgpoint.css({"left": "0px","right": "0px","width": h_circleFrameWidth + "px","margin": "0px auto" }) break; } //切换索引 var h_hovertreeimgindex = 1; if (h_hovertreeimglength < 2)h_hovertreeimgindex = 0; //构造圆点 for (var h_i = 0; h_i < h_hovertreeimglength; h_i++) {h_hovertreeimgpoint.append("

"); } h_pointset = h_hovertreeimgpoint.find("div");//圆点集合 h_pointset.css({"background-color": settings.h_circleColor, "width": settings.h_circleWidth, "height": settings.h_circleWidth , "border": "1px solid white", "margin-left": "2px","display": "inline-block","border-radius": "50%" }) h_pointset.eq(0).css({ "background-color": settings.h_currentCircleColor }); //设置当前图片 function imgswitch(imgindex) {h_replaceFrame.html(h_hovertreeimgitems.eq(imgindex));h_pointset.css({ "background-color": settings.h_circleColor });h_pointset.eq(imgindex).css({ "background-color": settings.h_currentCircleColor }); } h_replaceFrame.find("img").css({"width": settings.h_width, "height": settings.h_height }) //圆点操作 h_pointset.hover(function () {h_isswitch = false;//光标悬停到圆点停止切换imgswitch($(this).attr(hovertreeimgdata)); } , function () {h_isswitch = true; } ) //切换 setInterval(function () {if (!h_isswitch) return;imgswitch(h_hovertreeimgindex);h_hovertreeimgindex = (h_hovertreeimgindex + 1) % h_hovertreeimglength; }, settings.h_time) //光标悬停到图片停止切换 h_replaceFrame.hover(function () { h_isswitch = false; }, function () { h_isswitch = true; }) }}(jQuery));

彩虹对接站源码,vscode默认编码格式,ubuntu非常卡,tomcat架构说明,c# sqlite的封装,前端学完框架下一步学什么,爬虫里比较重要的类,php 虚拟空间,南阳seo推广代理,图库 网站 源码,成绩查询网页代码,淘宝收费模板免费使用 博客lzw

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。