css| Filter If you use your hand to quickly cross an oil painting that has not yet dried, the picture will become blurred. The blur attribute under CSS will achieve this fuzzy effect.
Let's take a look at the expression of the Blur property:
Filter:blur (Add=add,direction,strength=strength)
We see that the Blur property has three parameters: Add, direction, strength.
The add parameter has two parameter values: True and False. Specifies whether the picture is changed to a blur effect. The direction parameter is used to set the direction of the blur. The blur effect is done in a clockwise direction. where 0 degrees represent vertical upward, every 45 degrees per unit, the default value is 270 degrees to the left. The corresponding relation in the angle direction is shown in the following table:
The strength parameter value can only be specified using an integer, which represents how many pixels the width will be affected by the blur. The default value is 5 pixels.
Let's look at an example.
===================
<title>blur css</title>
<script>
function HandleChange (obj)
{
With (obj.filters (0))
{
if (strength<255)
{
Strength +=2;
Direction +=45;
}
}
}
</script>
<body>
<p>Onfilterchange= "HandleChange (This)" >
</p>
</body>
=====================
Does it look like a kaleidoscope, adding some JavaScript statements in this example, with the following code:
<title>blur css</title>
<script>
function HandleChange (obj)
* Set a loop function HandleChange, the object is obj*//
{with (obj.filters (0))//*obj Filter Property *//
{if (strength<255)//* set the loop condition *//
{Strength +=1;direction +=45;}
* Strength 1,direction plus 45 degrees per cycle *//
}
}
</script>
<body>
<p>Style= "Filter:blur (strength=1)"
Onfilterchange= "HandleChange (This)" >
* Import a picture, the initial blur property strength equals 1, and call onfilterchange Letter
Number *//
</p>
</body>