| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 491 人关注过本帖
标题:请教jquery插件参数如何传出?是传出哦!
只看楼主 加入收藏
dkp88
Rank: 1
等 级:新手上路
帖 子:235
专家分:5
注 册:2004-10-18
结帖率:33.33%
收藏
 问题点数:0 回复次数:0 
请教jquery插件参数如何传出?是传出哦!
程序代码:

<html xmlns="http://www. http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script src="http://code.(function($){
  $.fn.mycj1=function(cs){
    var def={
      current:function(i){}
    }
    var cs=$.extend({},def,cs);
    $(this).click(function(){
      //alert($(this).index());
      /*请教这里如何将$(this).index()值回调传出去给current的function(index),然后用户通过判断index的状态来执行其它自定义函数*/
    })
  }
})(jQuery);

$(function(){
  $('div').mycj1({
    current:function(index){
      alert(index);
      if (index==1) alert('点了第2个');
    }
  });
})
</script>
</head>

<body>
<div>点我1</div>
<div>点击2</div>
</body>
</html>



请教各路大神,就如fullPage回调函数时这样!

图片附件: 游客没有浏览图片的权限,请 登录注册
搜索更多相关主题的帖子: title color jquery current content 
2015-01-02 23:42
快速回复:请教jquery插件参数如何传出?是传出哦!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015444 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved