Text Tips for Websites

Programmer

OK, one more computer post, then I promise I’ll change categories 😇. This post is about adding tips to your text on your webpage. If you don’t create webpages and don’t care to know about this, quit reading now and enjoy the rest of your day. You can always come back and read my next post, please!

🆗, all sniveling aside. Let’s get serious now! I’ve added another function to my expressive websites javascript library – x_press.js. These functions are all designed for the purpose of making your website more expressive. This latest function makes it easier to write tips for your text. x_tip_w(x_tip_text,x_tip,[x_tip_text_display]). That’s. Pass the tip text, and the tip. Optionally pass alternate text to display. The tip is displayed through both the title and alt attributes of a span. You can set the style for the span before calling x_tip_w.

It may be quicker for you to write <span title=”tip” alt=”tip” style=”style”>text</span> than <script>x_tip_style=’style’;x_tip_w(‘text’,’tip’)</script>;and if you only want to display one text tip on your website, go ahead and write the span. But, you can set x_tip_style once, so you don’t have to repeat the style attribute.

Also, I set up this function to include all the countries and states by ISO 2 character code. Countries include the three character ISO code, name, population, area, currency, and major languages. States include the name, population and area. Since population and area are provided, x_tip_w will also write density and area in either sq mi or sq km. x_tip_w will also display flags either as emoji or images. Emoji flags don’t really work in Windows, so you may want to use the image version. (The function doesn’t come with the images, you’ll have to find those, but it provides an easy way to use the images.)

If there are several (or a handful) of words that you want to write a tip for on multiple webpages, x_tip_w allows you to load an array with values. Then x_tip_w can use that array to write the text and the tip. Just as with countries, you can store multiple tips for each text value.

Read More …