Home > Web Front-end > JS Tutorial > body text

jquery search box effect implementation method_jquery

WBOY
Release: 2016-05-16 16:19:55
Original
1447 people have browsed it

The example in this article describes how to implement the jquery search box effect. Share it with everyone for your reference. The specific implementation method is as follows:

Copy code The code is as follows:


jquery: search box effect








Supplementary note: It is not perfect. If the search box originally had other styles, when it loses focus, if the code in the example is used, the other styles will be gone, because attr() is to set the style. If you use addClass() to add a style, it is not very suitable. Although it can achieve the effect, the original c2 style is still there, and it is just replaced by the c1 style when displayed (this requires the c1 style to be written after c2). There seems to be no way to replace the style?

After modification, the above problems are solved, and it is a more perfect version (the code can also be optimized to make it simpler)

Copy code The code is as follows:


jquery: search box effect







I hope this article will be helpful to everyone’s jQuery programming.

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!