Link to home
Start Free TrialLog in
Avatar of Peter Kiers
Peter KiersFlag for Netherlands

asked on

How to put 3 icons in a bar in a website using a javascript

Dear Experts,

I have a bar drawn on my website (see picture) that I have put as attachement. The bar with the date and the word "Contact" is the
bar that I am talking about. The bar is drawn throug a javascript. What I would like in the bar is instead of the word "Contact" I
would like the 3 icons displayed just like experts-exchange has (the mail icon, the notification icon and the suitcase icon). How can
I do that. Does someone knows the answer and is willing to help me.

<!-- Begin

var showdate	= "yes"		// SHOW THE DATE ON THE PAGE
var showbar2	= "yes"		// SHOW THE DATE ON THE PAGE

document.write('<table cellpadding="0" cellspacing="0" border="0" width="100%" class="headerbar"><tr><td align="left" class="printhide">');


// START DATE SCRIPT

   if (showdate == "yes") {

document.write('<div id="date-location">');
var d=new Date();
var weekday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday");
var monthname=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
document.write("<span class=\"date-font\"><nobr>" + weekday[d.getDay()] + ", ");

document.write(monthname[d.getMonth()] + " ");

document.write(d.getDate() + ", ");

document.write(d.getFullYear());
document.write("</nobr><br></span>");
document.write('</div>');
}
else {
document.write('&nbsp;<br>');
}

document.write('</td><td align="right">');

document.write('<div id="contact-location">');

document.write('<a href="contact.htm" class="barlink">Cont@ct</a><br>');

document.write('</div>');

document.write('</td></tr></table>');

if (showbar2 == "yes") {
document.write('<table cellpadding="0" cellspacing="0" border="0" width="100%" class="headerbar2"><tr><td class="printhide">');
document.write('<img src="picts/spacer.gif" height="2" width="2" border="0"><br>');
document.write('</td></tr></table>');
}

//  End -->

Open in new window


Greetings, Peter Kiers
Example.png
Avatar of Greg Alexander
Greg Alexander
Flag of United States of America image

Assuming you are not using an icon pack, and you have the icons as images you could simply change

document.write('<a href="contact.htm" class="barlink">Cont@ct</a><br>');

Open in new window


to

document.write('<img src="the_path_to_image1.jpg" alt="img_name"><img src="the_path_to_image2.jpg" alt="img_name"><img src="the_path_to_image3.jpg" alt="img_name"><br>');

Open in new window

Avatar of Peter Kiers

ASKER

Oke thanks. What's the code when the user clicks on the picture is should load another webpage. What's the code for  that. Grtz, Peter
ASKER CERTIFIED SOLUTION
Avatar of Greg Alexander
Greg Alexander
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks. Peter