如果单击单元格或单击图像本身,我将尝试将箭头翻转 180 度。这是我的代码: 注意:被翻转的图像是第一行中 ID 为 image1 的图像。一旦我得到第一个工作,我将翻转所有图像。
<thead>
<tr>
<th style="text-align:left; padding-top: 20px;" width="10%" title="Sort by Symbol">Symbol <img src="/images/sort-arrow.jpg" title="Sort by Symbol" alt="Sort by Symbol" class="sort-right move-left bottom-image" id="image1"/></th>
<th style="text-align:left;" width="20%" title="Sort by Company Name">Company<br><span class="move_right">Name</span> <img src="/images/sort-arrow.jpg" title="Sort by Company Name" alt="Sort by Company Name" class="sort-right move-left"/></th>
<th style="text-align:center;" width="12%" title="Sort by Buy Date"><span class="center-text">Buy</span><br>Date <img title="Sort by Buy Date" src="/images/sort-arrow.jpg" alt="Sort by Buy Date"/></th>
<th style="text-align:center;" width="10%" title="Sort by Buy Price"><span class="center-text">Buy</span><br>Price <img title="Sort by Buy Price" src="/images/sort-arrow.jpg" alt="Sort by Buy Price"/></th>
<th style="text-align:center;" width="9%" title="Sort by Closed Price"><span class="center-text">Closed</span><br>Price <img title="Sort by Closed Price" src="/images/sort-arrow.jpg" alt="Sort by Closed Price"/></th>
<th style="text-align:center;" width="9%" title="Sort by Closed Date"><span class="center-text">Closed</span><br>Date <img title="Sort by Closed Date" src="/images/sort-arrow.jpg" alt="Sort by Closed Date" /></th>
<th style="text-align:center;" width="10%" title="Sort by Current Return"><span class="center-text">Total</span><br>Return <img title="Sort by Current Return" src="/images/sort-arrow.jpg" alt="Sort by Current Return"/></th>
</thead>
和 Javascript:
$(function(event){
$("table .title a").tooltip({ bodyHandler: function(event) { return $($(this).attr("href")).html(); }, showURL: false, track: true, delay: 0 });
});
var value = 0
$("#image1").rotate({
bind:
{
click: function(){
value +=180;
$(this).rotate({ animateTo:value})
}
}
});
我正在使用jQuery Rotate插件
有什么建议吗?
重申一下:如果单击图像,或者单击图像所在的 CELL,图像应该进行 180 度翻转。