How do I create my own Filter object in script? And add it to an image's
filters array?
It's easy enough to use an existing filter in script:
var image = document["theImage"];
image.filters[0].duration = 2;
image.filters[0].apply();
image.src = "C:\AnotherImage.jpg";
image.filters[0].play();
but this presupposes that the image already has a filter:
<img name="theImage"
style="filter:revealTrans(Duration=3.0,Transition=1)"
src="C:\AnImage.jpg">
How do I create my own, if the image tag doesn't already specify a filter
style? I've made some ill-fated attempts at a revealTrans, transition 8.
image.filter = "DXImageTransform.Microsoft.Blinds";
// Works for div styles, according to docs.
// Some other thoughts:
image.filters.item(0).progid = "DXImageTransform.Microsoft.Blinds"
var filt = CreateObject("DXImageTransform.Microsoft.Blinds");
I want to end up with something that just plops into the image's filters[]
array, like
image.filters[0] = filt; // Just chuck the old element to garbage
collection.
or
image.filters = new Array(1); // Chuck the entire existing filters to
garbage collection.
image.filters[0] = filt; // ...and set the first one.
I want to be able to change from a "revealTrans(transition=8)" to a
"blendTrans()", or DXImageTransform.Microsoft.Blinds to
DXImageTransform.Microsoft.BasicImage, or put either one on an image that
didn't have one, before.
Thanks,
- Dan
Dan Haygood - 27 Dec 2003 05:51 GMT
Nevermind. Figured it out.
> How do I create my own Filter object in script? And add it to an image's
> filters array?
[quoted text clipped - 40 lines]
> Thanks,
> - Dan