Get css properties from string
<p>I am creating a plugin that allows the user to define the notification by typing something like this.</p>

<pre><code>growl-top-left-300px;
</code></pre>

<p>I was using a split to get rid the width, but this still required me to have quite a few if statements because I user had the following choices</p>

<p>for example I had</p>

<pre><code>if (position == "growl-top-left" || position == "growl-left-top") {
    container.css ({
        top: '0px',
        left: '0px'
    });
}else if (position == "growl-top-right" || position == "growl-right-top") {
    container.css ({
        top: '0px',
        right: '0px'
    });
}else if (position == "growl-top-center" || position == "growl-center-top") {
    // apply css // Not done yet
}else if (position == "growl-bottom-left" || position == "growl-left-bottom") {
    container.css ({
        bottom: '0px',
        left: '0px'
    });
}else if (position == "growl-bottom-right" || position == "growl-right-bottom") {
    container.css ({
        bottom: '0px',
        right: '0px'
    });
}else if (position == "growl-bottom-center" || position == "growl-center-bottom") {
    // apply css // not done yet
}
</code></pre>

<p>but as you can imagine that seems like a lot of redundant code, and I just want to know if anyone has a nicer way to clean it up?</p>

<p>I thought it would be nice if I could get the top and left css values so I can write the following code:</p>

<pre><code>container.css ({
    retrivedCSS[0]: '0px',
    retrivedCSS[1]: '0px'
})
</code></pre>

<p>where retrivedCSS[0] would be the first position and the [1] would be the second position</p>
