HTML Help

Started by nathmatt, March 04, 2011, 07:48:47 pm

Previous topic - Next topic

nathmatt

March 04, 2011, 07:48:47 pm Last Edit: March 05, 2011, 01:30:53 pm by nathmatt
ok so i used a website to create a menu for my website but the images wont load until the mouse goes over them

HTML: ShowHide
<HTML>
<HEADER>
<TITLE>Nathmatt-Produtions.com - Home-Page </TITLE>
</HEADER>
<HEAD>
<script src="menuscript.js" language="javascript" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="menustyle.css" media="screen, print" />
</HEAD>
<BODY>
<table border="0" cellpadding="0" cellspacing="0"><tr><td>
<a href="http://nathmatt-productions.net63.net" onmouseover="setOverImg('1','');" onmouseout="setOutImg('1','');" target=""><img src="buttons/button1up.png" border="0" id="button1" vspace="1" hspace="1"></a><a href="http://products.nathmatt-productions.net63.net" onmouseover="setOverImg('2','');" onmouseout="setOutImg('2','');" target=""><img src="buttons/button2up.png" border="0" id="button2" vspace="1" hspace="1"></a><a href="http://forum.nathmatt-productions.net63.net" onmouseover="setOverImg('3','');" onmouseout="setOutImg('3','');" target=""><img src="buttons/button3up.png" border="0" id="button3" vspace="1" hspace="1"></a><a href="http://contact-us.nathmatt-productions.net63.net" onmouseover="setOverImg('4','');" onmouseout="setOutImg('4','');" target=""><img src="buttons/button4up.png" border="0" id="button4" vspace="1" hspace="1"></a><br>
</td></tr></table>
</BODY>
</HTML>


Java i think: ShowHide
/*** SET BUTTON'S FOLDER HERE ***/
var buttonFolder = "images/buttons/";

/*** SET BUTTONS' FILENAMES HERE ***/
upSources = new Array("button1up.png","button2up.png","button3up.png","button4up.png");

overSources = new Array("button1over.png","button2over.png","button3over.png","button4over.png");


//*** NO MORE SETTINGS BEYOND THIS POINT ***//
totalButtons = upSources.length;



//*** MAIN BUTTONS FUNCTIONS ***//
// PRELOAD MAIN MENU BUTTON IMAGES
function preload() {
for ( x=0; x<totalButtons; x++ ) {
buttonUp = new Image();
buttonUp.src = buttonFolder + upSources[x];
buttonOver = new Image();
buttonOver.src = buttonFolder + overSources[x];
}
}

// SET MOUSEOVER BUTTON
function setOverImg(But, ID) {
document.getElementById('button' + But + ID).src = buttonFolder + overSources[But-1];
}

// SET MOUSEOUT BUTTON
function setOutImg(But, ID) {
document.getElementById('button' + But + ID).src = buttonFolder + upSources[But-1];
}


//preload();


.dropmenu {
  position: absolute;
  left: -1500px;
  visibility: visible;
  z-index: 101;
  float: left;
  width: 0px;

  border-width: px;
  border-style: solid;
  border-color: ;
  background-color: ;
}
.dropmenu ul {
  margin: 0;
  padding: 0;
  list-style-type: none;
}
.dropmenu li {
  display: inline;
}
.dropmenu a, .dropmenu a:visited, .dropmenu a:active {
  display: block;
  width: px;

  padding: px;
  margin: px;
  font-family: ;
  font-size: px;
  font-weight: ;
  text-align: ;
  text-decoration: ;

  color: ;
  background-color: ;
}
.dropmenu a:hover {
  padding: px;
  margin: px;
  font-family: ;
  font-size: px;
  font-weight: ;
  text-align: ;
  text-decoration: ;

  color: ;
  background-color: ;
}


fixed i forgot to fix the location in the html


edit i have a question i see the menu uses onmouseout="setOutImg('3',''); to get the images from the java script but i cant get it to send me a url

i tried this in the java code
function web_link(ext){return 'http://'+ext+'nathmatt-productions.net63.net'};

but it wont let me do
href="web_link('')"
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script