jquery换一批的写法

<pre>
<img src="{$yuming}/images/3/huanyipi.png" alt="" currentindex="1" count="3" class="huanyipi">
</pre>

<pre>
$('.huanyipi').on('click',function () {
var currentindex=parseInt($(this).attr('currentindex'));
var count=parseInt($(this).attr('count'));
currentindex++;
if(currentindex>count){
currentindex=1;
}
$(this).attr('currentindex',currentindex);
$('.bufenlist').css('display','none');
$('.bufen'+currentindex).fadeIn();
})
</pre>
点一次一次currentindex+1 来判断 就行了

jquery换一批的写法的更多相关文章

  1. jQuery的三种写法

    jQuery的三种写法 jQuery一共有三种写法,写法如下: <script type="text/javascript" src="js/jquery-1.9. ...

  2. jQuery validate兼容IE8写法

    最近做项目的时候遇到一个validate插件在IE8下面点击submit按钮没有执行检查的BUG 在chrome和FF,还有IE9以上都可以.百度了好多文章都没有找到解决方法,后面自己测试找到了问题. ...

  3. jquery.validate新的写法(jquery.validate1.13.js)

    <script src="../js/jquery.js"></script> <script src="../js/jquery.vali ...

  4. jquery事件链式写法

    <!DOCTYPE html><html lang="en" xmlns="http://www.w3.org/1999/xhtml"> ...

  5. jquery 的几种写法和常见问题

    为了理解页面初始化事件的编写和执行方式,特此记录下页面加载事件的语句方式: //最简单的加载事件语句 $(function(){ alert("这个提示框最先弹出")//这个用的最 ...

  6. jquery 三种开始写法

    在 jquery 代码中使用 $(document).ready()时,位于其中的所有代码都会在 DOM 加载后立即执行 第一种(推荐)$(document).ready(function(){   ...

  7. jQuery插件使用和写法

    jQuery插件分类3中: 1.封装对象方法的插件. 2.封装全局函数的插件. 3.选择器插件. jQuery插件机制 jQuery提供了两个用于扩展jQuery功能的方法: 1.jQuery.fn. ...

  8. 【JQUERY】插件的写法

    1. jquery插件怎么写 $.extend $.fn 2. 写的时候注意些什么

  9. jquery中ajax的写法

    方法一: $.ajax(url,data,fn); $('#btn').click(function(){ $.ajax({ url:"112.json", type:" ...

随机推荐

  1. The backup set holds a backup of a database other than the existing ‘dbName’ database

     [Solved] System.Data.SqlClient.SqlError: The backup set holds a backup of a database other than t ...

  2. 一个milller_rabin模板

    #include <iostream> #include <cstdlib> #include <stdio.h> #include <algorithm&g ...

  3. linux系列(六):rmdir命令

    1.命令格式: rmdir [选项] 目录名 2.命令功能: 该命令从一个目录中删除一个或多个子目录项,删除某目录时也必须具有对父目录的写权限. 3.命令参数: - p 删除指定目录后,若该目录的上层 ...

  4. Turn Off Windows Firewall Using PowerShell and CMD

    If you want to turn off the Windows Firewall, there are three methods. One is using the GUI which is ...

  5. puppteer的使用

    官方文档:Puppeteer 今天大概介绍一下我项目用到的puppeteer操作: // 启动浏览器 const browser = await puppeteer.launch({ executab ...

  6. GB∕T 35658平台过检 已通过最新的部标JT/T 808-2019, JT/T 809-2019标准检测

    2019年交通部GPS平台检测标准发生了重大变化, 原来的796平台功能标准, 变更为GB/T35658标准, 这个标准其实2017年就公布了, 实际上还是796标准, 但是检测项目,以前是可选的, ...

  7. Jedis API操作redis数据库

    1.配置文件 classpath路径下,新建redis.properties配置文件 配置文件内容 # Redis settings redis.host=127.0.0.1 redis.port=6 ...

  8. Vue自定义日历组件

    今天给大家介绍Vue的日历组件,可自定义样式.日历类型及支持扩展,可自定义事件回调.Props数据传输. 线上demo效果 示例 Template: <Calendar :sundayStart ...

  9. vue项目构建:vue-cli+webpack常用配置

    1,Webpack-dev-server的proxy用法:https://www.jianshu.com/p/f489e7764cb8 2,vue-cli3搭建项目之webpack配置:https:/ ...

  10. python matplotlib(数据可视化)

    吐槽 网上搜了不少matplotlib安装方法(不信,你可以试试.) 我只能说,除了太繁琐,就是没什么用! 如果你是python3.6.5版本 我给你最最最正确的建议: 直接打开cmd,找到pip用命 ...