Forum How do I...?

Setting in javascript?

I've attached an example that uses this to set the clip property on an element:

        function test () {
            var h = document.getElementById('header_img');
            // h.setAttribute('style', 'clip:rect(0px, 50px, 50px, 0px)');
   = 'rect(0px, 50px, 50px, 0px)';

When I run this the image isn't clipped, but when I use the setAttribute line instead the image IS clipped.

I expected to work but it didn't. Is there an issue with trying to set the clip css property through javascript?
  1. clipex11.html5.9 kB
    clip example
This appears to be a bug in the CSS parser, we will investigate.
This was indeed a bug in the way that values were parsed and serialised, we have fixed it in the latest builds. Thank you for letting us know! :D
Fantastic, thanks for the quick turnaround!