"jquery" Hover method

Source: Internet
Author: User

  method Name:hover (over, out)

  Overview: When you move the mouse over a matching element, the first function that you specify is triggered. When the mouse moves out of this element, the specified second function is triggered.

  Parameters:

1) overfunction

Move the mouse over the element to trigger the function

2) outfunction

Move the mouse out of the element to trigger the function

  Example:

1 <!DOCTYPE HTML>2 <HTML>3 <Head>4 <Metahttp-equiv= "Content-type"content= "text/html; charset=utf-8" />5 <title>Mouse slide over effect</title>6 <Scriptsrc= "Http://files.cnblogs.com/ningvsban/jquery1.8.3.min.js"type= "Text/javascript"></Script> 7 <Scripttype= "Text/javascript">8 $ (document). Ready (function() {9     //$ ("#orderedlist tbody tr"). CSS ("text-align", "center");Ten     $("#orderedlist tbody TR"). css ({"text-align":"Center"}); One     $("#orderedlist tbody TR"). Hover (function() { A         $( This). addclass ("Blue"); -     }, function() { -         $( This). Removeclass ("Blue"); the     }); - }); - </Script> - <style> + . Blue{ - background:#bcd4ec;  + cursor:Pointer;         A } at </style> - </Head> - <Body> - <TableID= "Orderedlist"width= "50%"Border= "0"cellspacing= "0"cellpadding= "0">  - <thead> -   <TR> in     <th>Name</th> -     <th>Age</th> to     <th>Qq</th> +     <th>Email</th> -   </TR> the </thead> * <tbody> $   <TR>Panax Notoginseng     <TD>Aaaa</TD> -     <TD>20</TD> the     <TD>1111</TD> +     <TD>[Email protected]</TD> A   </TR> the   <TR> +     <TD>BBBB</TD> -     <TD>21st</TD> $     <TD>2222</TD> $     <TD>[Email protected]</TD> -   </TR> -   <TR> the     <TD>CCCC</TD> -     <TD>22</TD>Wuyi     <TD>333</TD> the     <TD>[Email protected]</TD> -   </TR> Wu </tbody> - </Table> About </Body> $ </HTML> - </HTML>

:

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.