<table>
<th id="row-1">
<p>Company</p>
<span class="move_right">Name</span>
<img id="image1"
src="http://i.imgur.com/wO5gsMy.png"
title="Sort by Company Name"
alt="Sort by Company Name"
class="sort-right move-left"
width="25" height="25"/>
</th>
</table>
<script src="http://jqueryrotate.googlecode.com/svn/trunk/jQueryRotate.js">
</script>
<!-- Post Info -->
<div style='position:fixed;bottom:0;left:0;
background:lightgray;width:100%;'>About this SO Question: <a href='http://stackoverflow.com/q/19771004/1366033'>Javascript 180 to -180 rotate</a><br/>
Using jQueryRotate: <a href='https://code.google.com/p/jqueryrotate/'>jQueryRotate plugin page</a>
<br/>
<div>
JavaScript
var value = 0;
$("#row-1").click(function(){
value = value ? 0: 180
$("#image1").rotate({ animateTo:value});
});
Please Whitelist JSFiddle in your content blocker.
Help keep JSFiddle free for always by one of two ways:
Whitelist JSFiddle in your content blocker (two clicks)
Go PRO and get access to additional PRO features →
Join the 4+ million users, and keep the JSFiddle dream alive.
Ad-free
All ads in the editor and listing pages are turned completely off.
Fiddle Pages
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.
Use pre-released features
You get to try and use features (like the Palette Color Generator) months before everyone else.
Fiddle collections
Sort and categorize your Fiddles into multiple collections.
Private collections and fiddles
You can make as many Private Fiddles, and Private Collections as you wish!
Get Fiddle Pages with PRO
Your fiddles accessible under a custom domain and a vanity path - the simplest hosting for your personal project.