PDA

View Full Version : Active page?


llott
10-10-2002, 01:53 PM
Hi!
I have made a website in frames, and I have used a JavaScript-mouseover-effect on my internal navigation buttons (2 buttons with different font-color.)
Can I - somehow - make the up-button stay activated, as long as the page it links to is activated in the main-frame?
And then off course change back to the 'down'-button as soon as the visitor activates another page-link?

I just think it would be a nice way to show the visitors what page in the site they are looking at....

I hope somebody can help me..

Mr J
10-10-2002, 02:35 PM
Take a look at

www.huntingground.freeserve.co.uk/webplus/buttons/textlink.htm


See if this is what you are after.

The script can be customised in a variety of ways from different fonts, colours, sizes, and can be used with images all activated with a mouse event.

llott
10-15-2002, 08:50 AM
Hi -
I am sorry, but I can not use the link you send me. It keeps on reporting "server not found".

Anybody else have a solution to my question?

llott

Mr J
10-15-2002, 06:13 PM
I tried the link just now and it took me there?

Nightfire
10-15-2002, 06:36 PM
I tried it just now, got a timed out page

Mr J
10-15-2002, 07:10 PM
Really weird I just tried again and got there straight away.

Hmmm.... if you want to try again try this way

www.huntingground.net

then webplus section
buttons section
Text links


In the meantime have a play with this. Note this is for IE5+



<script language="JavaScript">
var Images = new Array("on.gif","off.gif","onf.gif") // list images to preload
var preloadImages=new Array() // preloads images
for (i=0;i<=Images.length-1;i++) {
preloadImages[i]=new Image()
preloadImages[i].src=Images[i]
}

LastID = ""

function ON(id){
(LastID != id?document[id].src = "yourimageon.gif":"")
}

function OFF(id){
(LastID != id?document[id].src = "yourimageoff.gif":"")
}

function ACTIVE(id){
document[id].src = "yourimageon.gif"
if (LastID != ""){
(LastID != id?document[LastID].src = "yourimageoff.gif":"")
}
LastID = id
}
// -->
</script>

<a href="yourpage.htm" onMouseOver="ON('image1');" onMouseOut="OFF('image1')" onClick="ACTIVE('image1')"><img src="yourimage.gif" border="0" name="image1">Link One</a>

<a href="yourpage.htm" onMouseOver="ON('image2');" onMouseOut="OFF('image2')" onClick="ACTIVE('image2')"><img src="yourimage.gif" border="0" name="image2">Link Two</a>

<a href="yourpage.htm" onMouseOver="ON('image3');" onMouseOut="OFF('image3')" onClick="ACTIVE('image3')"><img src="yourimage.gif" border="0" name="image3">Link Three</a>

<a href="yourpage.htm" onMouseOver="ON('image4');" onMouseOut="OFF('image4')" onClick="ACTIVE('image4')"><img src="yourimage.gif" border="0" name="image4">Link Four</a>

<a href="yourpage.htm" onMouseOver="ON('image5');" onMouseOut="OFF('image5')" onClick="ACTIVE('image5')"><img src="yourimage.gif" border="0" name="image5">Link Five</a>

<a href="yourpage.htm" onMouseOver="ON('image6');" onMouseOut="OFF('image6')" onClick="ACTIVE('image6')"><img src="yourimage.gif" border="0" name="image6">Link Six</a>

webmarkart
10-15-2002, 07:13 PM
FYI - I had no problem with the link...

llott
10-16-2002, 09:42 AM
Well, I have just tried again - and I just recieve the "page can not be found"-message.
Maybe it is my local net-settings that stops me from seeing some pages for whatever reason......?????

Anyway - thank you for the code!

I will use it monday - and let you know how it works.