Ich habe eine Tabelle mit Zeilen, die ich drehen möchte Pfeil Bild zu -90 Grad für jede Zeile, die angeklickt.Ich schrieb einige Codes, aber die Codes funktionierten für alle Pfeile in meiner Tabelle.nicht für jeder der geklickt hat. wie kann ich das machen? hier ist mein Snippet:Bild drehen, wenn ein Link geklickt wird Mit jQuery
$(function() {
$(".show").on("click", function(e) {
e.preventDefault();
$(this).closest("tr").next().find(".content").slideToggle();
});
});
.subRow {
padding:0;
background-color: #CFCFCF;
}
.content {
background-color: #CFCFCF;
display:none;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<table style="width:50%" border="1">
<caption>Test Table</caption>
<thead>
<tr align="center" class="parentRow">
<th>Column 1</th>
<th>Column 2</th>
<th>Column 3</th>
<th>Column 4</th>
<th>Column 5</th>
</tr>
</thead>
<tbody>
<tr class="parentRow">
<td><a href="#" class="show">SHOW <img src="http://user.efeh.com/images/arrow-left-red.png"/></a>
</td>
<td>test cell</td>
<td>test cell</td>
<td>test cell</td>
<td>test cell</td>
</tr>
<tr class="subRow">
<td colspan="5">
<div class="content"><p>Lorem ipsum dolor sit amet...</p></div>
</td>
</tr>
<tr class="parentRow">
<td><a href="#" class="show">SHOW <img src="http://user.efeh.com/images/arrow-left-red.png"/></a>
</td>
<td>test cell</td>
<td>test cell</td>
<td>test cell</td>
<td>test cell</td>
</tr>
<tr class="subRow">
<td colspan="5">
<div class="content"><p>Lorem ipsum dolor sit amet...</p></div>
</td>
</tr>
</tbody>
</table>
Vielen Dank! – inaz
Gern geschehen, viel Glück auf Ihrer Reise durch HTML/CSS/JS :)! – Nijikokun