Point in input and show the remaining words when the mouse moves up.

Source: Internet
Author: User

Point in input and show the remaining words when the mouse moves up.

This problem is often encountered in projects. In a content box, because the width of the box is fixed, but there are many content in it, the first requirement is required at this time, extra words should be hidden in the form of dots. Second, when the mouse moves up, all the content in the text box should be displayed in the form of a title prompt. The implementation method is as follows:

Click it. It is written before the text overflows. Add the following style to the text box

Display: inline-block; // This is added according to the situation
White-space: nowrap; // required
Overflow: hidden; // required
Text-overflow: ellipsis; // required. If the title prompt is displayed, add the following code in the input file. In this way, you can use the title to prompt all content in the text box <input onmouseover = "this. title = this. value "> supplement: In ie8, It was just found that the select method could not properly prompt the text, which was too emotional. It was last modified for a long time, if a function call is written, <select onmouseover = "selbox ($ (this)"> </select> <script>

Function selbox (){
Var val = a. val ();
A. attr ("title", val );
}

</Script> doesn't this mean anything like intra-row style? Why can I use this to display ie8? In ie8, input can be normally displayed, but select cannot be normally displayed. You have to call this method. Do you know why?

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.