Author Topic: Add an image map to the header  (Read 26012 times)

0 Members and 1 Guest are viewing this topic.

Offline CeJay

  • Sr. Member
  • ****
  • Posts: 425
    • View Profile
Re: Add an image map to the header
« Reply #15 on: March 05, 2007, 09:14:01 PM »
great, you should have your template in no time when you guys start working on it!

Offline helvissa

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Add an image map to the header
« Reply #16 on: March 05, 2007, 09:37:24 PM »
Thanks, Manurom. Now I need to work out which bits of the css to change!

The other thing I was going to ask is, can image maps go in css? (I mean in an ordinary webpage, not a 4images gallery css).

Offline helvissa

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Add an image map to the header
« Reply #17 on: March 06, 2007, 09:33:46 PM »
Thanks for the link!  :D

I got a book out the library today ("Web Design in a Nutshell") and it looks like you can't put an image map in CSS. You can make an image map using CSS, but... I dunno... I think my head might explode!

manurom

  • Guest
Re: Add an image map to the header
« Reply #18 on: March 07, 2007, 02:56:52 PM »
Hi, everybody;
@helvissa, I think that thanks to borniol, you could find your own way to custom your site's colours.

I tried to get your imagemap CSS driven, and made this first release in style.css, adding theese lines:
Code: [Select]
/*--Helvissa's image map------------------------------------------------*/
#banner {
background-image: url(images/banner.jpg);
position:relative;
height: 250px;
width: 886px;
}

#menu a {
   position: absolute;
   height: 34px;
   top: 214px;
   text-decoration: none;
   }

#menu a i { visibility: hidden; }

a#home { left: 30px; width: 64px; }
a#music { left: 104px; width: 67px; }
a#podcasts { left: 182px; width: 105px; }
a#info { left: 299px; width: 47px; }
a#gallery { left: 361px; width: 91px; }
a#forum { left: 463px; width: 75px; }
a#links { left: 545px; width: 66px; }
a#contact { left: 621px; width: 89px; }

I also changed the template file header.html like this:
Code: [Select]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html dir="{direction}">
<head>
<title>{site_name}</title>
<meta http-equiv="content-type" content="text/html; charset={charset}" />
<link rel="stylesheet" href="{template_url}/style.css" />
<script language="javascript" type="text/javascript">
<!--

  var captcha_reload_count = 0;
var captcha_image_url = "{url_captcha_image}";
  function new_captcha_image() {
    if (captcha_image_url.indexOf('?') == -1) {
  document.getElementById('captcha_image').src= captcha_image_url+'?c='+captcha_reload_count;
} else {
  document.getElementById('captcha_image').src= captcha_image_url+'&c='+captcha_reload_count;
}

    document.getElementById('captcha_input').value="";
    document.getElementById('captcha_input').focus();
    captcha_reload_count++;
  }

function opendetailwindow() {
    window.open('','detailwindow','toolbar=no,scrollbars=yes,resizable=no,width=680,height=480');
  }
 
  function right(e) {
    if ((document.layers || (document.getElementById && !document.all)) && (e.which == 2 || e.which == 3)) {
      alert("© Copyright by {site_name}");
      return false;
    }
    else if (event.button == 2 || event.button == 3) {
      alert("© Copyright by {site_name}");
      return false;
    }
    return true;
  }

  if (document.layers){
    document.captureEvents(Event.MOUSEDOWN);
    document.onmousedown = right;
  }
  else if (document.all && !document.getElementById){
    document.onmousedown = right;
  }

document.oncontextmenu = new Function("alert('© Copyright by {site_name}');return false");

// -->
</script>
{if has_rss}
<link rel="alternate" type="application/rss+xml" title="{rss_title}" href="{rss_url}" />
{endif has_rss}
</head>
<body bgcolor="#FFFF99" text="#0F5475" link="#0F5475" vlink="#0F5475" alink="#0F5475">
<table width="886" height="250" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td>
      <table width="886" border="0" cellspacing="0" cellpadding="0" class="tablehead">
        <td>
</td><div align="center"><div id="banner">
 <div id="menu">
  <a href="http://www.helvissa.com/home.htm" id="home"><i>Home</i></a>
  <a href="http://www.helvissa.com/music.htm" id="music"><i>Music</i></a>
  <a href="http://www.helvissa.com/podcasts.htm" id="podcasts"><i>Podcasts</i></a>
  <a href="http://www.helvissa.com/info.htm" id="info"><i>Info</i></a>
  <a href="http://www.helvissa.com/gallery.htm" id="gallery"><i>Gallery</i></a>
  <a href="http://www.helvissa.com/forum" id="forum"><i>Forum</i></a>
  <a href="http://www.helvissa.com/links.htm" id="links"><i>Links</i></a>
  <a href="http://www.helvissa.com/contact.htm" id="contact"><i>Contact</i></a>
 </div>
</div></div>
        </tr>
      </table>
    </td>
  </tr>
</table>

As I am a Firefox user, I din't encounter any problem, until I tried it in MS Internet Explorer... what a mess!

The only way I found to solve my IE problems was to add theese non-sense lines in style.css:
Code: [Select]
/*--code below is to keep compatible with that boring MS IE-----------*/
a#home:hover,
a#music:hover,
a#podcasts:hover,
a#info:hover,
a#gallery:hover,   
a#forum:hover,
a#links:hover,
a#contact:hover { border: none; }

Since there, it works for me both in IE and in FF. I did not try it in Opera browser.
BTW, the whole template had to be rewritten and has to be downloaded again entirely (sorry for this inconvenience).
As usual, live site result can be seen and downloaded here: http://amissc.free.fr/4_2006/details.php?image_id=32

Please test with your own browsers and feel free to post your impressions.
If it works for you, you only will have to change your links' urls once in the template file "header.html", to be shown in each template page.

@borniol: I had your pictures and began to work on it. Will tell you as soon as possible.
@helvissa, try to change the name of your image called "banner", as many adblock softwares block theese images. Simply call it "helvissa.jpg"...
@ all, regards.
« Last Edit: March 07, 2007, 03:14:18 PM by manurom »

Offline helvissa

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Add an image map to the header
« Reply #19 on: March 14, 2007, 03:36:23 PM »
Oh no!!! I better change it!

thanks for doing that, anyway. ;)

Can I add an image map to all my site's pages using CSS, then? Other than the gallery, that is? I thought it might be neater that way having it in CSS instead of having all that code stuff before the content of the pages.

(I hope it doesn't sound like an extraordinarily dense question to ask! And yes, I know it's a general html/css question....)

Offline helvissa

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Add an image map to the header
« Reply #20 on: March 14, 2007, 03:40:55 PM »
Hang on, I am being very dense. I think I can work out from those codes you've posted how to have css driving the image map on the rest of my site.

I'm quite excited as I've been reading about how to set out a webpage using css so it has different layout sections and you don't need to use a <table>! (see, I'm a nerd, I get excited by these things!) And then I read about the difference between jpg and gif and png and realised why some of the text imagey things I've been up to have gone awry. You do literally learn something new every day!

Offline helvissa

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Add an image map to the header
« Reply #21 on: March 14, 2007, 08:19:03 PM »
i've changed the colours as well now...

I used this: www.siteprocentral.com/html_color_code.html

Quite a handy little tool! All I did was type in the colour of the background and it came back with a palette of colours that go with each other.

Offline CeJay

  • Sr. Member
  • ****
  • Posts: 425
    • View Profile
Re: Add an image map to the header
« Reply #22 on: March 14, 2007, 08:27:32 PM »
I used this: www.siteprocentral.com/html_color_code.html

Quite a handy little tool! All I did was type in the colour of the background and it came back with a palette of colours that go with each other.
That is a nice little tool. I have used that several times before when building websites.

Quote
see, I'm a nerd, I get excited by these things!
Actually a lot of designers get this way when they start something new  :wink:

Offline Jenn

  • Full Member
  • ***
  • Posts: 105
    • View Profile
Re: Add an image map to the header
« Reply #23 on: March 14, 2007, 08:47:48 PM »
i've changed the colours as well now...

I used this: www.siteprocentral.com/html_color_code.html

Quite a handy little tool! All I did was type in the colour of the background and it came back with a palette of colours that go with each other.

Hehe, I have had that saved in my favorites for awhile. It is a GREAT tool and have used many times. :)

Offline helvissa

  • Newbie
  • *
  • Posts: 11
    • View Profile
Re: Add an image map to the header
« Reply #24 on: March 14, 2007, 08:53:39 PM »
Cool! It certainly did the job!