I've taken code from the MSDN page on Matrix Filters and modified it slightly. The functions all expect an input variable oObj
which gets passed in originally from the onfilterchange
:
<DIV ID="oDiv" STYLE="position:absolute;
filter:progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand')"
onfilterchange="fnSpin(this)" >
What I'm now trying to do is send arbitrary values to the setRotation
function using the onclick
event of a button:
<input type="button" onclick="var theDiv = document.getElementById('oDiv'); setRotation(theDiv,45)" value="Set">
Unfortunately when I click the button I get an Error: Object expected. I've obviously misunderstood what exactly this
refers to in the onfilterchange
- I thought it would be the HTML Element with ID oDiv. As far as I can tell filters should exist on the DIV element. I remember recently reading an excellent description of what this
refers to in different situations in Javascript: The Good Parts, but I don't have access to the print version right now, and searching the Safari edition for "this" hasn't been very productive.
Things I've tried (mostly in the hope that it's an obscure IE bug):
- Having
document.getElementById('oDiv')
as the first argument tosetRotation
- Using
document.all
instead ofgetElementById
- Using different properties such as
styles