Rotate Back and Forth

by Kyle Mitofsky

HTML

<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});
});