PDA

Click to See Complete Forum and Search --> : Simple Stuff?


Ramandeep
Feb 16th, 2001, 12:46 PM
Hi,
I have recently just started learning HTML, I've been able to pick that up easly (well it's not really a difficult language is it), but wish to add some JAVA Script to my code to accomplish some (well 3) tasks as follow:

1. Change one/or more images when user places his her mouse on another image. I have done my site in Photoshop and will cut the images up and format my site layout using tables or so in my web page, I want some off the thumbnails I've done to act as link but I want them to change (go hot) when they are pointed at.

2. Hide scroll bars (both HScroll & VScroll) so that all off my page is visible. At the moment my site fits pretty well but the bottom slightly gets cut off due to the horizontal scrollbar.

3. Is it also possible for my site to start right near the boarder of a browser, at the moment there seems to be a margin.

I haven't done any JAVA Script so far so any descriptions of code would be appreciated.

!!! THANKS IN ADVANCE!!!

sail3005
Feb 16th, 2001, 04:31 PM
to get rid of the margin add these attributes to the body tag



marginheight="0" marginwidth="0" topmargin="0" leftmargin="0"



The marginheight and marginwidth is for NS, the other two are for IE.

Ramandeep
Feb 17th, 2001, 05:19 AM
Thanks sail3005,

Do only those browsers support those attributes or is it an HTML specification standard, if it’s a standard from which version (i.e. HTML 2.0, 3.0 or 4.0)?

Any ideas any one on how I can do some rollovers (with JAVA Script) so that when user moves mouse over a linked thumbnail some other images on the same page change & then change back when user moves mouse off the link.

I have got a site source but because I’m new to Java Script needs some help with which parts off the codes need to be included.

The site I saw this feature is: http://www.designproject.com/

Check it out it’s really excellently designed, notice when you point to the small heading on the side the small icons change to Orange and if you point to the icon the appropriate heading gets highlighted.

This is what I want to achieve, any clues?

What about hiding scroll bars, both the Horizontal & Vertical.

!!! THANKS IN ADVANCE!!!

sail3005
Feb 17th, 2001, 03:36 PM
try this:



<script>
var image1 = new Image();
var image1hover = new Image();
image1.src = "theimage.gif";
image1hover.src = "theimagehover.gif";
</script>

<A onmouseover="document.image1.src=image1hover.src" onmouseout ="document.image1.src=image1.src" href="#"><IMG src="theimage.gif" name="image1"> </a>

N*G*Evangelion
Feb 19th, 2001, 03:15 AM
To following BODY tag code will remove the borders/margins from IE4+ and NS4+ :
<body marginwidth="0" marginheight="0" leftmargin="0" rightmargin="0" topmargin="0" bottommargin="0">

As for the scrollbars - If you design your page so that it doesn't exceed the width of the browser window - you will not get the horizontal scrollbar, although if a different user has a lower resolution than you they are likely to get those scrollbars. I think it is relatively safe to design for an 800x600 resolution.

For the vertical scrollbar - I don't think you can remove that from the main browser, but you can achieve it by popping up a new window using Javascript (I won't go into that in this post).

Hope I helped.

JoshT
Feb 19th, 2001, 07:39 AM
The "correct" way to get rid of the margin is to use CSS:


body {margin: 0; padding:0; }


As none of those margin tags are official HTML. I'm not sure which browsers support this, though - it looks like IE3+, Netscape 4+, and Opera 3.5+ support it.

Also, I've noticed that , in IE5.5, even if the vertical scrollbar is not showing and the margin is set to 0, there is a gap of the right side where the scrollbar would be if it were showing.

Josh