JavaScript Reference/Javascript Collections/filters

Материал из Web эксперт
Версия от 18:30, 25 мая 2010; (обсуждение)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

"filters" Example

    
<html>
<head>
<script language="JavaScript">
function applyFilter(){
    myDiv.style.filter = "progid:DXImageTransform.Microsoft.shadow() 
    progid:DXImageTransform.Microsoft.motionblur();"
    myDiv.filters.item("DXImageTransform.Microsoft.shadow").direction=4
    myDiv.filters.item("DXImageTransform.Microsoft.motionblur").enabled=true;
    alert(document.all.myDiv.filters.length); 
} 
</script>
</head>
<body>
<img id="myDiv" src="yourimage.gif">
<br>
<br>
<br>
<br>
<button onclick="applyFilter();">Apply Filter</button>
</body>
</html>



"filters" is applied to

+----------------+--------------------------------------------------------------+
| Applied_To     |<bdo>                           <body>                        |
|                |<button>                        <custom>                      |
|                |<div>                           <fieldset>                    |
|                |<img>                           <input type="button">         |
|                |<input type="checkbox">         <input type="file">           |
|                |<input type="image">            <input type="password">       |
|                |<input type="radio">            <input type="reset">          |
|                |<input type="submit">           <input type="text">           |
|                |<marquee>                       <rt>                          |
|                |<ruby>                          <span>                        |
|                |<table>                         <td>                          |
|                |<textarea>                      <th>                          |
+----------------+--------------------------------------------------------------+



"filters" JavaScript properties and JavaScript methods

JavaScript properties and JavaScript methods
 
item(), length, namedItem()



"filters" Syntax Parameters and Note

Note:
Returns an array of all filters that have been added to the element.
    
Syntax:
    
document.all.elementID.filters // returns all filters
document.all.elementID.filters(param1) // returns an individual filter

    param1   Required; zero-based index or 
                       the name of the filter being used.