Form JS pop-up prompt

Source: Internet
Author: User
Html

<Form ID = "form1" runat = "server">
<Div>
<Div style = "margin-top: 100px">
<Asp: textbox id = "textbox1" runat = "server" hinttitle = "added content information title" hintinfo = "within 100 words, title text should not be too long. "> </ASP: textbox> </div>
</Div>
</Form>

Style on the page

Style

<Style type = "text/CSS">
. Focus
{
Border: 1px solid # fc0! Important;
Background: URL (admin/images/focus_bg.jpg) Repeat-X! Important;
Color: # 00f! Important;
}
/* Text style */
# Hintmsg
{
Width: 271px;
Position: absolute;
Display: none;
}
# Hintmsg. hinttop
{
Height: 9px;
Background: URL (admin/images/hintbg1.gif) No-Repeat;
Overflow: hidden;
}
# Hintmsg. hintinfo
{
Padding: 0 5px;
Border-left: 1px solid #000;
Border-Right: 1px solid #000;
Background: # ffffe1;
Line-Height: 1.5em;
}
# Hintmsg. hintinfo B
{
Display: block;
Margin-bottom: 6px;
Padding-left: 15px;
Background: URL (admin/images/hint.gif) left center no-Repeat;
Height: 13px;
Line-Height: 16px;
}
# Hintmsg. hintinfo B Span
{
Display: block;
Float: right;
Text-indent:-9999px;
Background: URL (admin/images/close.gif) No-Repeat;
Width: 12px;
Height: 12px;
Cursor: pointer;
}
# Hintmsg. hintfooter
{
Height: 22px;
Background: URL (admin/images/hintbg2.gif) No-Repeat;
}
</Style>

Key JS

$ (Function (){
$ (". Input,. login_input,. textarea"). Focus (function (){
$ (This). addclass ("Focus ");
}). Blur (function (){
$ (This). removeclass ("Focus ");
});

// The input box prompts you to obtain objects with the hinttitle and hintinfo attributes.
$ ("[Hinttitle], [hintinfo]"). Focus (function (event ){
$ ("*"). Stop (); // stop all running animations
$ ("# Hintmsg"). Remove (); // clear first to prevent repeated errors
VaR hinthtml = "<ul id = \" hintmsg \ "> <li class = \" hinttop \ "> </LI> <li class = \" hintinfo \ "> <B> "+ $ (this ). ATTR ("hinttitle") + "</B>" + $ (this ). ATTR ("hintinfo") + "</LI> <li class = \" hintfooter \ "> </LI> </ul>"; // set the displayed content
VaR offset = $ (this). offset (); // get the location of the event object
$ ("Body"). append (hinthtml); // Add a node
$ ("# Hintmsg"). fadeto (0, 0.85); // object transparency
VaR hintheight = $ ("# hintmsg"). Height (); // get the container height
$ ("# Hintmsg" 2.16.css ({"TOP": offset. top-hintheight + "PX", "Left": offset. left + "PX "}). fadein (500 );
}). Blur (function (event ){
$ ("# Hintmsg"). Remove (); // Delete ul
});
});

:

 

The above content is used to download a website. The specific name is missing... for reference only.

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.