Jquyer轮播带数字和提示文字
效果图如下:
代码如下:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <style type="text/css"> #banner { position: relative; width: 478px; height: 286px; border: 1px solid #666; overflow: hidden; } #banner_list img { border: 0px; } #banner_bg { position: absolute; bottom: 0; background-color: #000; height: 30px; filter: Alpha(Opacity=30); opacity: 0.3; z-index: 1000; cursor: pointer; width: 478px; } #banner_info { position: absolute; bottom: 0; left: 5px; height: 22px; color: #fff; z-index: 1001; cursor: pointer } #banner_text { position: absolute; width: 120px; z-index: 1002; right: 3px; bottom: 3px; } #banner ul { position: absolute; list-style-type: none; filter: Alpha(Opacity=80); opacity: 0.8; z-index: 1002; margin: 0; padding: 0; bottom: 3px; right: 5px; } #banner ul li { padding: 0px 8px; float: left; display: block; color: #FFF; background: #6f4f67; cursor: pointer; border: 1px solid #333; } #banner ul li.on { background-color: #000; } #banner_list a { position: absolute; } <!-- 让四张图片都可以重叠在一起--> </style> <script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js"></script> <script type="text/javascript"> var t = n =0, count; $(document).ready(function(){ count=$("#banner_list a").length; $("#banner_list a:not(:first-child)").hide(); $("#banner_info").html($("#banner_list a:first-child").find("img").attr('alt')); $("#banner_info").click(function(){window.open($("#banner_list a:first-child").attr('href'), "_blank")}); $("#banner li").click(function() { var i = $(this).text() -1;//获取Li元素内的值,即1,2,3,4 n = i; if (i >= count) return; $("#banner_info").html($("#banner_list a").eq(i).find("img").attr('alt')); $("#banner_info").unbind().click(function(){window.open($("#banner_list a").eq(i).attr('href'), "_blank")}) $("#banner_list a").filter(":visible").fadeOut(500).parent().children().eq(i).fadeIn(1000); document.getElementById("banner").style.background=""; $(this).toggleClass("on"); $(this).siblings().removeAttr("class"); }); t = setInterval("showAuto()", 4000); $("#banner").hover(function(){clearInterval(t)}, function(){t = setInterval("showAuto()", 4000);}); }) function showAuto() { n = n >=(count -1) ?0 : ++n; $("#banner li").eq(n).trigger('click'); } </script> </head> <body> <div id="banner"> <div id="banner_bg"></div> <!--标题背景--> <div id="banner_info"></div> <!--标题--> <ul> <li class="on">1</li> <li>2</li> <li>3</li> <li>4</li> </ul> <div id="banner_list"> <a href="#" target="_blank"><img src="imgs/p1.jpg" title="jquery插件库1" alt="jquery插件库1"/></a> <a href="#" target="_blank"><img src="imgs/p2.jpg" title="jquery插件库2" alt="jquery插件库2"/></a> <a href="#" target="_blank"><img src="imgs/p3.jpg" title="jquery插件库3" alt="jquery插件库3"/></a> <a href="#" target="_blank"><img src="imgs/p1.jpg" title="jquery插件库4" alt="jquery插件库4"/></a> </div> </div> <script src="http://www.jq22.com/js/jq.js"></script> </body> </html>
文件结构如下:
Jquyer轮播带数字和提示文字的更多相关文章
- Unity3D基础学习 NGUI自带Tooltip制作提示文字
简介 NGUI自带的的例子Character中含有一个Tooltip,可以鼠标悬浮到某对象时显示提示文字.非常方便. 创建UITooltip 首先你需要在场景NGUi相机下建立一个空物体我把它命名为T ...
- 运用CSS和JS写的大图轮播-带箭头
<style type="text/css"> #datu { width:500px; height:400px; position:relative; margin ...
- js原生实现轮播图效果(面向对象编程)
面向对象编程js原生实现轮播图效果 1.先看效果图 2.需要实现的功能: 自动轮播 点击左右箭头按钮无缝轮播 点击数字按钮切换图片 分析:如何实现无缝轮播? 在一个固定大小的相框里有一个ul标签,其长 ...
- 做一个vue轮播图组件
根据huangyi老师的慕课网vue项目跟着做的,下面大概记录了下思路 1.轮播图的图 先不做轮播图逻辑部分,先把数据导进来,看看什么效果.在recommend组件新建一个recommends的数组, ...
- jquery轮播事件效果
今天闲着有时间把轮播事件重新写了一下,发现以前用的很多插件大多支持度不算太友好,很多小问题 自己写了一个,不好地方请指教 先建立文件,css,js,图片,引入jquery <!DOCTYPE h ...
- 基于bootstrap的轮播广告页,带图片和文字
<!DOCTYPE html> <html lang="zh-cn"> <head> <meta charset="utf-8& ...
- 带轮播图、导航栏、商品的简单html,以及轮播图下边数字随轮播图的改变而改变
---恢复内容开始--- 在做这个的时候,最不会的是中间轮播图下边的数字是如何实现转变的,后来加入了jQuery就能实现了. css部分: <style type="text/css& ...
- jquery实现带左右箭头和数字焦点的图片轮播手写代码
以前图片轮播经常用网上的插件,然后想说自己也要认真看看,一步一步弄明白,所以就自己研究写了个图片轮播的代码,我自己觉得还算是挺简单的.如有改进的地方,欢迎你能帮我指出,共同进步. (ps:博客园如何上 ...
- 基于jquery带时间轴的图片轮播切换代码
基于jquery图片标题随小圆点放大切换.这是是一款带时间轴的图片轮播切换代码.效果图如下: 在线预览 源码下载 实现的代码. html代码: <div id="decoroll2 ...
随机推荐
- springboot(十九):SpringBoot+EHcache实现缓存
https://blog.csdn.net/qq_28143647/article/details/79789368
- docker搭建lnmp环境
1.搭建lnmp网站平台 1.创建mysql数据库容器 docker run -it -d --name lnmp_mysql -p 3308:3306 -e MYSQL_ROOT_PASSWORD= ...
- Pre-shared key
Pre-shared key https://en.wikipedia.org/wiki/Pre-shared_key In cryptography, a pre-shared key (PSK) ...
- php时间转换
UNIX时间戳和格式化日期是我们常打交道的两个时间表示形式,Unix时间戳存储.处理方便,但是不直观,格式化日期直观,但是处理起来不如Unix时间戳那么自如,所以有的时候需要互相转换,下面给出互相转换 ...
- springboot使用jpa+mongodb时,xxxRepository不能Autowired的问题
springboot启动类: @SpringBootApplication public class MainApp { public static void main(String[] args) ...
- pycharm使用方法
https://blog.csdn.net/zhaihaifei/article/details/51658425
- influxdb
1.安装Centos# wget https://dl.influxdata.com/influxdb/releases/influxdb-1.1.0.x86_64.rpm# rpm -ivh inf ...
- 关于mirai的一些研究
关于mirai的一些研究 0x01.源码编译: 配置好对应的go开发环境,即可进行编译,生成了主要的文件 badbot为僵尸节点的可执行文件,cnc为主控端的可执行文件,其它一些为辅助工具. 如下图所 ...
- java 通过域名获取ip
1. java InetAddress[] allByName = InetAddress.getAllByName("www.baidu.com"); 2. nslookup
- Flume配置Failover Sink Processor
1 官网内容 2 看一张图一目了然 3 详细配置 source配置文件 #配置文件: a1.sources= r1 a1.sinks= k1 k2 a1.channels= c1 #负载平衡 a1.s ...