Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Browsers / Internet Explorer / December 2003



Tip: Looking for answers? Try searching our database.

How do I create a filter in (ECMA) script?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dan Haygood - 24 Dec 2003 02:08 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.