I've attached an example that uses this to set the clip property on an element:
When I run this the image isn't clipped, but when I use the setAttribute line instead the image IS clipped.
I expected h.style.clip= to work but it didn't. Is there an issue with trying to set the clip css property through javascript?
function test () {
var h = document.getElementById('header_img');
// h.setAttribute('style', 'clip:rect(0px, 50px, 50px, 0px)');
h.style.clip = '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 h.style.clip= to work but it didn't. Is there an issue with trying to set the clip css property through javascript?