Js achieves YouKu's beautiful search box effect _ javascript skills

Source: Internet
Author: User
This article mainly introduces how to implement the beautiful search box Effect of YouKu in js. It is very practical to use javascript to combine mouse events and page styles to achieve beautiful search box effects, if you need it, refer to the example in this article to describe how js achieves the beautiful search box of YouKu. Share it with you for your reference. The details are as follows:

Shows the running effect:

The Online Demo address is as follows:

Http://demo.jb51.net/js/2015/js-youku-search-style-codes/

The Code is as follows:

 Search entriesScript function drop_mouseover (pos) {try {window. clearTimeout (timer);} catch (e) {}} function drop_mouseout (pos) {var posSel = document. getElementById (pos + "Sel "). style. display; if (posSel = "block") {timer = setTimeout ("drop_hide ('" + pos + "')", 1000) ;}} function drop_hide (pos) {document. getElementById (pos + "Sel "). style. display = "none";} function search_show (pos, searchType, href) {document. getElementById (pos + "Sea RchType "). value = searchType; document. getElementById (pos + "Sel "). style. display = "none"; document. getElementById (pos + "Slected "). innerHTML = href. innerHTML; document. getElementById (pos + 'q '). focus (); var sE = document. getElementById ("searchExtend"); if (sE! = Undefined & searchType = "bar") {sE. style. display = "block";} else if (sE! = Undefined) {sE. style. display = "none";} try {window. clearTimeout (timer) ;}catch (e) {}return false;} script

I hope this article will help you design javascript programs.

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.