Applying inline styles with browser prefixes
<p>I found a little trick that allows me to use jquery to add styles to a class with vendor prefixes:</p>

<pre><code> var myTransform = ($.browser.webkit)  ? '-webkit-transform' :
                       ($.browser.mozilla) ? '-moz-transform' : 
                       ($.browser.msie)    ? '-ms-transform' :
                       ($.browser.opera)   ? '-o-transform' : 'transform';

var myCSSObj = {};

    myCSSObj[myTransform] = 'translate('+centrepos+'px, 0px)';
        $("div.current").css(myCSSObj);
</code></pre>

<p>I'm not entirely sure how this works, so if someone could explain I would be really appreciative.</p>

<p>But, my question is about applying this method and adding it to an inline style to a jquery fragment. Currently I have the following, but it is manually written:</p>

<pre><code>$fragment = $('&lt;div class="preload" style="position: relative; -webkit-transform: translate('+start+'px, 0px);"/&gt;');
</code></pre>

<p>I want to give this container an initial position when it is appended to the dom. How can I add the code without having to manually add each browser's prefix?</p>
