Jquery tutorial (15th) Java Script tooltip

Source: Internet
Author: User

Cody Lindley, author of thickbox, recently released the jtip-jquery tooltip.

I have never heard of many of these ideas and ideas. I know you have read many similar Tool tipsCode. However, the Cody method has shown a bright spot in my work.

When I checked the HTML code, I found a big problem with accessibility. The link cannot work when Java Script is disabled. I am not inclined to implement comprehensive accessibility, but here I think there are other more friendly ways to implement the same function.

In particular, I personally do not like the way to link another page Link in the prompt box at the sacrifice of availability for accessibility. I like this prompt box-not disrespectful to Cody, but I "need" it to work in various situations.

Today, I want to provide you with a small modification to the Cody tooltip code. If you are not a fan of Cody tooltip, I may not be very concerned about the revision. But if you like his work and want it to work as usual when Java Script is disabled, You may need this.

My changes

What makes me think of modification is the application of his code on Yahoo. I don't like the code he uses:

 
"Yahoo.htm? Width = 175 & Drawing link = http://www.yahoo.com "name ="Before you click ..."Id ="Yahoocopy"Class="Jtip"> Go to Yahoo

So I have rewritten some of his code and it looks like this:

"Http://www.yahoo.com" rel ="Yahoo.htm? Width = 175 & link = Yahoo & name = before % 20% 20you % 20click ..."Id ="Yahoocopy"Class="Jtip"> Go to Yahoo

My example

Improvement: HTML standard verification

My code can be tested through w3.org

Improved: Name

When I modified the Cody code, I found that he used a variable name named "title" to store the Link name, which caused some confusion.

I marked this naming problem, even if I thought it was just a small mistake.

Improvement: Availability

With my code, you can make each prompt box contain a real link address to another document, whether internal or external. Or you just want the prompt box and don't want to worry about availability. You can leave the link blank.

You have the right to choose.

Thanks

Cody provides great code that helps me save a lot of time and effort. My changes are just a slight "adjustment" to the original code, and I hope my friends will like it.

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.