Programming Forums

Programming Forums (http://www.programmingforums.org/forumindex.php)
-   Other Scripting Languages (http://www.programmingforums.org/forum39.html)
-   -   Dreamweaver Navigation bar problems (http://www.programmingforums.org/showthread.php?t=5466)

ksm Aug 19th, 2005 12:29 PM

Dreamweaver Navigation bar problems
 
Hi people,

Am having some problem with the Dreamweaver (version 3, some probs not being able to install a higher ver I have) Navigation bar script...

Basically have made a navigation bar... which works fine on my comp...
But when uploaded to the server (linux) it doesn't work... if move mouse over the images don't change... Also tried inserting m own

<td>
<a href="#" onMouseOver="WhoAreWe.src='images/DaMag_b1.jpg'" onMouseOut="WhoAreWe.src='images/DaMag_b.jpg'">

<img name="WhoAreWe" src="images/DaMag_b.jpg" border="0" onLoad="" width="198" height="25">

</a>
</td>

Again same problem...

But if keep mouse over menu item for 2-3sec (literally) the image changes...
the images are about 4kb
The dreamweaver script preloads images, and even if that isn't working, once have moved mouseover an image (and it is loaded) it should work fine the next time... but doesn't...
Works absolutly fne on me comp...

Please help people... My first post here :o

Ooble Aug 19th, 2005 12:33 PM

You mention it's a Linux server. Are you getting the case of the image filenames right?

ksm Aug 19th, 2005 12:36 PM

Hey thanks for such a prompt reply... Wow!

Think the image filenames are right.. as after a few seconds when it does change the image.. it changes to the correct ones and then onMouseOut back to the old ones + it works fine on my comp... delay only when hosted on server ...

Ooble Aug 19th, 2005 1:06 PM

In that case, it's not preloading the images properly. Nothing I can do about that until I see the script it uses to load 'em.

ksm Aug 19th, 2005 2:03 PM

Hey the complete code is:
 
All the script is written by dreamweaver:

:

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_nbGroup(event, grpName) { //v3.0
  var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : args[i+1];
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) {
      img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } else if (event == "down") {
    if ((nbArr = document[grpName]) != null)
      for (i=0; i < nbArr.length; i++) { img=nbArr[i]; img.src = img.MM_up; img.MM_dn = 0; }
    document[grpName] = nbArr = new Array();
    for (i=2; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = img.MM_dn = args[i+1];
      nbArr[nbArr.length] = img;
  } }
}
//-->
</script>
</head>

<body bgcolor="#FFFFFF" onLoad="MM_preloadImages('images/DaMag_b1.jpg','images/DaMag_d1.jpg','images/DaMag_e1.jpg','images/DaMag_f1.jpg','images/DaMag_c.jpg')" style="margin:0">
<table border="0" cellpadding="0" cellspacing="0" style="margin:0">

  <tr>
    <td><img src="images/DaMag_a.jpg" width="198" height="15"></td>
  </tr>
  <tr>
<td> <a href="#" onClick="MM_nbGroup('down','group1','who are we?','images/DaMag_b1.jpg',1)" onMouseOver="MM_nbGroup('over','who are we?','images/DaMag_b1.jpg','images/DaMag_b1.jpg',1)" onMouseOut="MM_nbGroup('out')"><img name="who are we?" src="images/DaMag_b.jpg" border="0" onLoad="" width="198" height="25"></a></td>
  </tr>
  <tr>
<td> <a href="#" onClick="MM_nbGroup('down','group1','DaMag','images/DaMag_c.jpg',1)" onMouseOver="MM_nbGroup('over','DaMag','images/DaMag_c.jpg','',1)" onMouseOut="MM_nbGroup('out')">
      <img name="DaMag" src="images/DaMag_c.jpg" border="0" onLoad="" align="top" width="198" height="25"></a>
    </td>
  </tr>
  <tr>
<td><a href="#" onClick="MM_nbGroup('down','group1','psynapse@tribe','images/DaMag_d1.jpg',1)" onMouseOver="MM_nbGroup('over','psynapse@tribe','images/DaMag_d1.jpg','images/DaMag_d1.jpg',1)" onMouseOut="MM_nbGroup('out')"><img name="psynapse@tribe" src="images/DaMag_d.jpg" border="0" onLoad="" align="top" width="198" height="25"></a>
    </td>
  </tr>
  <tr>
<td><a href="#" onClick="MM_nbGroup('down','group1','join mailing list','images/DaMag_e1.jpg',1)" onMouseOver="MM_nbGroup('over','join mailing list','images/DaMag_e1.jpg','',1)" onMouseOut="MM_nbGroup('out')"><img name="join mailing list" src="images/DaMag_e.jpg" border="0" onLoad="" align="top" width="198" height="25"></a>
    </td>
  </tr>

  <tr>
 <td> <a href="#" onClick="MM_nbGroup('down','group1','guestbook','images/DaMag_f1.jpg',1)" onMouseOver="MM_nbGroup('over','guestbook','images/DaMag_f1.jpg','',1)" onMouseOut="MM_nbGroup('out')">
      <img name="guestbook" src="images/DaMag_f.jpg" border="0" onLoad="" align="top" width="198" height="25"></a>
    </td>
  </tr>

  <tr>
    <td><img src="images/DaMag_g.jpg" width="198" height="25"></td>
  </tr>
</table>
</body>
</html>


Pizentios Aug 19th, 2005 2:14 PM

Fixed the code tags.

Ooble Aug 19th, 2005 3:14 PM

That is some NASTY code. I suggest reading up on JavaScript and writing it yourself. Click here for a great site.

coldDeath Aug 19th, 2005 3:29 PM

Recommended: http://jennifermadden.com
Others: http://www.programmingforums.org/for...ead.php?t=5405

Ooble Aug 19th, 2005 4:11 PM

Nice site. I'll keep that one bookmarked.

coldDeath Aug 19th, 2005 4:14 PM

Yeah it is, someone else recommended it to me and its pretty good.


All times are GMT -5. The time now is 4:20 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC