Solved

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

Posted on 2014-11-18
4
118 Views
Last Modified: 2014-11-18
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
0
Comment
Question by:peterkiers
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 19

Expert Comment

by:Greg Alexander
ID: 40450000
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

0
 
LVL 1

Author Comment

by:peterkiers
ID: 40450078
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
0
 
LVL 19

Accepted Solution

by:
Greg Alexander earned 500 total points
ID: 40450087
Add some link tags around the image like so:

document.write('<a href="http://google.com"><img src="the_path_to_image1.jpg" alt="img_name"></a><a href="http://google.com"><img src="the_path_to_image2.jpg" alt="img_name"></a><a href="http://google.com"><img src="the_path_to_image3.jpg" alt="img_name"></a><br>');
0
 
LVL 1

Author Comment

by:peterkiers
ID: 40450104
Thanks. Peter
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
When crafting your “Why Us” page, there are a plethora of pitfalls to avoid. Follow these five tips, and you’ll be well on your way to creating an effective page.
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question