javascript - jQuery – jExpand 插件 – 通过图像展开?

标签 javascript jquery html html-table toggle

我在看: 使用 jQuery – jExpand 插件扩展表格行。

http://www.jankoatwarpspeed.com/expand-table-rows-with-jquery-jexpand-plugin/

这是我想要的,但我只想通过箭头图标切换行,而不是单击整行。

我已经尝试更改 $("#report tr.odd").click(function(){ 以获取箭头类,但没有任何效果。

谁能给我指出正确的方向!

最佳答案

你需要做两个改变

CSS 更改:

#report tr.odd td { background:#fff url(row_bkg.png) repeat-x scroll center left; }
.arrow { cursor:pointer;}

JavaScript 变化:

$(".arrow").click(function(){
  $(this).parents("tr").next("tr").toggle();
  $(this).toggleClass("up");
});

http://jsfiddle.net/566aT/3/

关于javascript - jQuery – jExpand 插件 – 通过图像展开?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20709407/

相关文章:

jquery - 通过 ajax 调用将文本加载到 textarea

c# - 文件上传返回null

javascript - 如何删除 div 但防止滚动位置被更改?

javascript - 如何在 javascript RegExp 中获取所有括号捕获

javascript - jquery 从对象创建原型(prototype)

php - 如何将 javascript 值传输到 php 变量?

jquery - 根据 html 元素 ID 的名称执行 JQuery 函数

javascript - 使用 GetDerivedStateFromProps 初始化后将 Prop 转换为状态?

javascript - 输入 jQuery 中 'ä' ,'ö' ,'ü' 的处理

javascript - 如何使菜单行响应?