0
에서 작동하지 않습니다 왜 라니 크롬, 오페라, mozila에서 작업 ....내 다음 코드는 IE7에서 작동하지 않지만 왜 jQuery를 아코디언 코드는 IE7
자바 스크립트 :
$(function(){
$(".sub").hide();
$("tr#sub1").show();
$(".expandSub a").click(function(){
var relValue = $(this).attr("rel");
$("tr#"+relValue).toggle();
var t = $(this).text();
if(t=="+")$(this).html("-");
else if(t=="-")$(this).html("+");
return false;
});
});
HTML :
<table cellspacing="0">
<tr class="headRow">
<td> </td>
<td> </td>
<td width="350px" align="center">Title</td>
</tr>
<tr class="leadRow">
<td class="expandSub"><a href="" rel="sub1">-</a></td>
<td>1</td>
<td>Cake</td>
</tr>
<tr class="sub" id="sub1">
<td> </td>
<td>1</td>
<td>Red Velvet Cakes</td>
</tr>
<tr class="sub evenRow" id="sub1">
<td> </td>
<td>2</td>
<td>Cupcake Recipes</td>
</tr>
<tr class="sub" id="sub1">
<td> </td>
<td>3</td>
<td>Pineapple Mojo Cake</td>
</tr>
<tr class="sub evenRow" id="sub1">
<td> </td>
<td>2</td>
<td>Carrot Cake Recipes</td>
</tr>
<tr class="sub" id="sub1">
<td> </td>
<td>3</td>
<td>Zucchini Chocolate Chip Cake</td>
</tr>
<tr class="leadRow">
<td class="expandSub"><a href="" rel="sub2">+</a></td>
<td>2</td>
<td>Cookies</td>
</tr>
<tr class="sub" id="sub2">
<td> </td>
<td>1</td>
<td>Chocolate Chip Cookie Recipes</td>
</tr>
<tr class="sub evenRow" id="sub2">
<td> </td>
<td>1</td>
<td>Sugar Cookie Recipes</td>
</tr>
<tr class="sub" id="sub2">
<td> </td>
<td>1</td>
<td>Filled Cookies</td>
</tr>
<tr class="sub evenRow" id="sub2">
<td> </td>
<td>1</td>
<td>Sugared Black Raspberry Tea Cookiess</td>
</tr>
<tr class="leadRow" rel="sub3">
<td class="expandSub"><a href="" rel="sub3">+</a></td>
<td>3</td>
<td>Appetizers</td>
</tr>
<tr class="sub" id="sub3">
<td> </td>
<td>1</td>
<td>Hummus Recipes</td>
</tr>
<tr class="sub evenRow" id="sub3">
<td> </td>
<td>1</td>
<td>Cheese Balls</td>
</tr>
</table>