単純な jQuery 折りたたみ可能なテーブルがあります。ヘッダー行は、表示/非表示するデータを切り替えるトリガーです。
私が求めているのは、行自体ではなく、ヘッダー行内に画像を配置し、これをトリガーとして使用することです。
以下に例を示します: http://jsfiddle.net/RDybT/
<!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>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script type='text/javascript'>
$(document).ready(function() {
$('#trigger_1').click(function () {
$('#toggle_1', $(this).parent()).toggle();
});
$('#trigger_2').click(function () {
$('#toggle_2', $(this).parent()).toggle();
});
});
</script>
</head>
<body>
<img src="http://cdn5.iconfinder.com/data/icons/super-mono-reflection/blue/toggle-expand_blue.png" id="trigger_1"/>
<table border="2" cellpadding="2" cellspacing="2">
<tr>
<th>Header </th>
</tr>
<tr id="toggle_1">
<td>Data</td>
</tr>
</table>
<hr>
<table border="2" cellpadding="2" cellspacing="2">
<tr>
<th><img src="http://cdn5.iconfinder.com/data/icons/super-mono-reflection/blue/toggle-expand_blue.png" id="trigger_2"/></th>
</tr>
<tr id="toggle_2">
<td>Data</td>
</tr>
</table>
</body>
</html>
いろいろ調べたのですが、可能かどうかわかりませんか?
どんなアイデアやヒントも素晴らしいでしょう。
ありがとう