Blur Properties of CSS Filters

Source: Internet
Author: User
Tags filter
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>



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.