Solved

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

Posted on 2014-11-18
4
110 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
  • 2
  • 2
4 Comments
 
LVL 18

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 18

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…

706 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now