Jquery $ (). hover (func1, funct2) Usage

Source: Internet
Author: User

Because hover is not a standard event, you cannot directly use live for processing. Therefore, use the following method instead, with the same effect.
Copy codeThe Code is as follows:
$ ("<SPAN style =" COLOR: # 0000ff "> table tr </SPAN>"). live ({
<SPAN style = "BACKGROUND-COLOR: #99 ccff"> mouseenter: </SPAN>
Function ()
{
<SPAN style = "COLOR: #008000"> // todo </SPAN>
},
<SPAN style = "BACKGROUND-COLOR: #99 ccff"> mouseleave: </SPAN>
Function ()
{
<SPAN style = "COLOR: #008000"> // todo </SPAN>
}
});

In the circular output <div>, you can use $ (this). find () to process only the content in a <div>:
Copy codeThe Code is as follows:
<Body>
<Div class = "<SPAN style =" COLOR: # 0000ff "> water </SPAN>">
<Div class = "<SPAN style =" COLOR: # 0000ff "> action </SPAN>" style = "<SPAN style =" COLOR: # 3366ff "> display: none </SPAN> ">
<A href = "#"> <div class = "left"> {lang user/repick} </div> </a>
<A href = "#"> <div class = "right"> {lang user/reply} </div> </a>
</Div>
</Div>
<Div class = "<SPAN style =" COLOR: # 0000ff "> water </SPAN>">
<Div class = "<SPAN style =" COLOR: # 0000ff "> action </SPAN>" style = "<SPAN style =" COLOR: # 3366ff "> display: none </SPAN> ">
<A href = "#"> <div class = "left"> {lang user/repick} </div> </a>
<A href = "#"> <div class = "right"> {lang user/reply} </div> </a>
</Div>
</Div>
<Div class = "<SPAN style =" COLOR: # 0000ff "> water </SPAN>">
<Div class = "<SPAN style =" COLOR: # 0000ff "> action </SPAN>" style = "<SPAN style =" COLOR: # 3366ff; BACKGROUND-COLOR: # ffffff "> display: none </SPAN>">
<A href = "#"> <div class = "left"> {lang user/repick} </div> </a>
<A href = "#"> <div class = "right"> {lang user/reply} </div> </a>
</Div>
</Div>
<Div class = "<SPAN style =" COLOR: # 0000ff "> water </SPAN>">
<Div class = "<SPAN style =" COLOR: # 0000ff "> action </SPAN>" style = "<SPAN style =" COLOR: # 3366ff "> display: none </SPAN> ">
<A href = "#"> <div class = "left"> {lang user/repick} </div> </a>
<A href = "#"> <div class = "right"> {lang user/reply} </div> </a>
</Div>
</Div>

<Script type = "text/javascript">
$ ("<SPAN style =" COLOR: # 0000ff ">. water </SPAN>"). <SPAN style = "COLOR: #800080"> hover </SPAN> (
Function (){
$ (This ). <SPAN style = "COLOR: #800080"> find </SPAN> ("<SPAN style =" COLOR: # 0000ff ">. action </SPAN> "). show ();
},
Function (){
$ (This ). <SPAN style = "COLOR: #800080"> find </SPAN> ("<SPAN style =" COLOR: # 0000ff ">. action </SPAN> "). hide ();
}
)
</Script>
</Body>

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.