Shorthand JS to jQuery
<p><strong>EDIT</strong></p>

<p>In my code I have some shorthand JS that a colleague at work helped me with. I do not entirely understand it and would be much happier changing it back to simple jQuery. I have tried to myself but it keeps breaking.</p>

<p>Here is the shorthand</p>

<pre><code>if (target.length) {
    target.addClass("occupied");
    $(".occupied").parent(".flip-wrapper").addClass("flipped");
    b.clone().addClass(
    b.data("letter") == target.parents('td').data("letter") ? "right-letter" : "wrong-letter").appendTo("table").css({
        background: "transparent",
        position: "absolute",
        top: currentPos.top,
        left: currentPos.left
    }).animate({
        top: targetPos.top,
        left: targetPos.left
    }, "slow", function() {
        $(this).css({
            top: 0,
            left: 0
        }).appendTo(target);
</code></pre>

<p>I have tried to change it like this</p>

<pre><code>    if (target.length) {
    target.addClass("occupied");
    $(".occupied").parent(".flip-wrapper").addClass("flipped");
    b.clone().addClass(
    if $(b.data("letter") == target.parents('td').data("letter")) {
      $(this).addClass("right-letter");
     } else { 
      $(this).addClass("wrong-letter")
      }.appendTo("table").css({
        background: "transparent",
        position: "absolute",
        top: currentPos.top,
        left: currentPos.left
    }).animate({
        top: targetPos.top,
        left: targetPos.left
    }, "slow", function() {
        $(this).css({
            top: 0,
            left: 0
        }).appendTo(target);
</code></pre>

<p>Where am I going wrong?</p>

<p>Fiddle: <a href="http://jsfiddle.net/smilburn/Dxxmh/82/" rel="nofollow">http://jsfiddle.net/smilburn/Dxxmh/82/</a></p>
