Home > Features > Graphical Enter Links & Beyond • Bookmark   • Newsletters   • Register Search Options

FEATURE

Graphical Enter Links & Beyond

Graphical Enter Links & Beyond

April 29, 2002
Text size: 
Get XBIZ News
XBIZ Research
Will virtual reality boost the paysite market?
Yes, it will soon
  39.66%
Yes, but in a few years
  36.87%
No
  23.46%
Out of 179 votes. Results based on votes submitted by members of XBIZ.net social network.

" After all, 'happy' buttons enhance a Web page's appearance, and also provide positive feedback to the user. "

Having a graphical rather than text-based 'enter' link provides several benefits for free and AVS site owners. These diverse benefits include everything from much wider acceptance by premium AVS services who tend to prefer 'graphically enhanced' sites for inclusion on their link lists, to free site 'warning' pages that strive to divert surfers to a sponsor's site — and stand a much better chance of doing so if their sponsor's banners have a chance to load before the surfer sees that plain text 'enter' link; which is displayed well before any of the page's graphics (including your advertisements) load.

While it's a very simple matter to make a straightforward 'enter' graphic, and indeed, there are many online graphics resources that offer these standard icons as a free download for those who are seriously artistically challenged, today I want to show you an effective technique for making a graphical 'enter' button, complete with a cross-browser JavaScript to provide a 'rollover' effect.

This is one of my favorite techniques; after all, 'happy' buttons enhance a Web page's appearance, and also provide positive feedback to the user. While most JavaScript 'rollover' solutions are simply code-based, and therefore will not work on non-JavaScript enabled browsers, this method will work across all browsers, and is the epitome of 'graceful degradation.' Browsers incapable of rendering the JavaScript will simply display the basic graphic, and as an added bonus, the inclusion of 'alt' tags allows text readers and search engines to parse the link as well. Here's how it's done:

Building the Buttons
The concept behind this technique is really quite simple: we will create two nearly-identical images, altering only the text (foreground) color for this example. For this method to work properly, the images must be the same size, and precisely aligned. While you can accomplish this process with just about any 'paint' program, the following is the procedure with my Web graphics software of choice; Micrografx Picture Publisher 8:

1.) Create a new image by selecting File > New: or by clicking the 'new image' button. I chose to make this 'enter' link 250x50 pixels (a reasonable, and readable, size) and gave it a plain black background — although you could use the Texture tool to fill the blank image with your site's background pattern.

2.) I then used the Text tool to create the 'ENTER' text, selecting a bold, anti-aliased 60pt white Arial font for the primary image. This filled the graphic space completely, leaving a slight border top and bottom that may be cropped to further reduce the file size, but is an 'unnecessary' step for this example. To complete the image, click the 'GIF' button on the main toolbar. The 'GIF Options' dialog box will appear. It is really unnecessary for this to be a transparent image, so I left the default settings intact, ensuring that 'Interlaced GIF' was selected, and then saved this image as 'enter_a.gif'

Any number of other colors or effects such as gradients, glows, or textures could have easily been used, but I wished to keep this simple.

3.) Next, I chose 'Yellow' (255,255,0) from the 'Color Palette' dialog box, and use the 216-color 'MS Internet Explorer' palette to ensure a web-safe color selection. I then used the 'paint bucket' Fill tool to change the text color to the chosen shade of yellow. Any number of other colors or effects such as gradients, glows, or textures could have easily been used, but I wished to keep this all very simple. A repeat of saving the image by hitting the 'GIF' button, with the only change being the file name ('enter_b.gif') completed the building of our buttons.

Adding the Script
Once the graphics are prepared, the magic begins! After building the Web page and uploading the graphics, the script then needs to be added. For a 'before and after' look, check out the HTML:

HTML HEAD TITLE Graphical Enter Link /TITLE /HEAD>
BODY bgcolor="000000" CENTER>

A href="http://xbiz.com/articles/webmastering/0402/29.html" IMG border="0" src="http://xbiz.com/articles/images/pp8-1/enter_a.gif" alt="ENTER" width="250" height="50" /A>

/CENTER /BODY /HTML>

This basic page code is modified to include the 'rollover' image swap plus a status bar mask. You can see the effect in action by clicking here:

HTML HEAD TITLE Graphical Enter Link /TITLE>

SCRIPT LANGUAGE="JavaScript">

!-- ROLLOVER

var NN3 = false;
image1= new Image();
image1.src = "http://xbiz.com/articles/images/pp8-1/enter_a.gif";
image1on = new Image();
image1on.src = "http://xbiz.com/articles/images/pp8-1/enter_b.gif";

function on3(name) {
document[name].src = eval(name + "on.src");
}
function off3(name) {
document[name].src = eval(name + ".src");
}
NN3 = true;

function on(name) {
if (NN3) on3(name);
}
function off(name) {
if (NN3) off3(name);
}

function a(txt) {
self.status = txt
}
function b() {
self.status = ""
}

// ROLLOVER -->

/SCRIPT /HEAD>

BODY bgcolor="000000" CENTER>

A href="http://xbiz.com/articles/mainstream/0402/29.html" onmouseover="on('image1'); a('ENTER');return true;" onmouseout="off('image1'); b();" IMG src="http://xbiz.com/articles/images/pp8-1/enter_a.gif" alt="ENTER" width="250" height="50" border="0" name="image1" /A>

/CENTER /BODY /HTML>

This is a really simple use of a very powerful script. Additional images can be added to use this script for generating site-wide navigational bars and for other times when a good cross-browser, gracefully degradeable image changing script is needed. Have fun, and good luck! ~ Stephen


OPINIONS & VIEWS

Data Privacy Is Tightening Up in the E.U.

Have you begun preparing for GDPR? If you are like most, you haven’t even heard of GDPR, but also if you are like most, it is going to affect your business, starting May 25, 2018. The GDPR, or General... More »

Could Adult Content Be Banned?

Earlier this month, I met with the Free Speech Coalition’s board of directors for our annual review. Despite the headwinds our industry faces, politically and economically, we are, as an organization,... More »

Cutting Costs in the Spirit of Entrepreneurship

Adult website owners are comprised of two groups: One is comfortable giving up 30-50 percent of their site’s gross sales revenue (aka profit) in exchange for software, hosting and services despite... More »
XBIZ NEWSLETTERS
Stay informed of the latest industry developments. Get XBIZ newsletters delivered to your inbox. Subscribe today!
Enter email address:

* To manage existing subscriptions click here.






POPULAR PRODUCTS & SERVICES
Submit your press release to
multiple news outlets with 1 click.
Subscribe to RSS news feeds or
add free content to your website.
Access XBIZ news and articles
with your mobile device.
Access the latest issues of the industry's leading trade publications in digital form. View online or download for offline viewing.

UPCOMING EVENTS

XBIZ Retreat

May 30 - Jun 03
Miami, Florida

XBIZ Miami 2017

May 30 - Jun 02
Miami, Florida

XShow 18+ 2017

Jun 01 - Jun 03
Moscow, Russia

Cam Summit

Jun 02 - Jun 04
Lloret de Mar, Spain
Everyday thousands of business professionals browse XBIZ's industry directory for quality products and services. Not listed yet? Your company could be losing potential new business. Submit your company today!
Use XBIZ RSS feeds to stay informed of the latest industry developments or as a content syndication tool for your website!