|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
DHTML Menu Editing
I made this little DHTML menu with a menu builder tool I have and I was wondering how to change something. Go ahead and take a look at the menu here: www.team696.org I want the menu to be the dark gray color (like when you mouseover) all the time in the cell for the page you are on. Like if you are on the Contact page, I want only the Contact cell in the menu to be dark gray and the rest to be light gray. Could someone please view my source code and tell me what to change? I have the same code for the menu on all the pages of the site. Thanks.
|
|
#2
|
||||
|
||||
|
add this to around line 60-65:
Code:
<script type='text/javascript'>
var this_page = "Home"; // this is added; change this on every page to reflect which page this is; make sure you enter exactly what that page's menu text is (case sensitive and all that)
function Go(){return}
Code:
c=FontSubLowColor;
d=FontSubHighColor}
if (MemVal == this_page) { // this is added
a=HighBgColor; // this is added
} // this is added
this.LoBck=a;
this.LwFntClr=c;
|
|
#3
|
|||
|
|||
|
Wow, thanks for the quick help. I got it working http://team696.org/menutest.html Now, I just need one more thing, for the text to be white in that dark gray cell. Any help?
|
|
#4
|
||||
|
||||
|
sure; around line 520-527 (in your new modified example):
Code:
c=FontSubLowColor;
d=FontSubHighColor}
if (MemVal == this_page) { // this is added
a=HighBgColor; // this is added
c=FontHighColor; // this is added (addition #2)
} // this is added
this.LoBck=a;
this.LwFntClr=c;
|
|
#5
|
|||
|
|||
|
I just got it by myself actually by just tinkering around a bit before I saw your post. I did the exact same thing you just did. Thanks for your help.
![]() |
|
#6
|
||||
|
||||
|
I have a similar question. If you are making a menu, like the one on that website, how would you make the hover, color change effect? It looks like you could use the onMouseOver event, but how would you get it to change back after the mouse leaves it? Is there an event that is the opposite of onMouseOver? If not, then how do you do it?
|
|
#7
|
||||
|
||||
|
yes, the opposite of onmouseover is onmouseout, its used just like onmouseover is
|
|
#8
|
||||
|
||||
|
There are a lot of online tutorials regarding this aspect of Javascript, especially in the area of DHTML menus. I personally try not to use the things (it's all about pure CSS menus, which are structured way better and make up for just about all of JS's shortcomings), but I've read some pretty informative and interesting stuff about JS and they include extensive coverage of event handlers like onMouseOut. I'd recommend reading some of that if you're into Javascript.
|
|
#9
|
|||||
|
|||||
|
Quote:
|
|
#10
|
|||
|
|||
|
Just FYI, that robocards link above has a picture that takes forever to load. Maybe it's because it's 3520x2400
![]() |
|
#11
|
|||||
|
|||||
|
Quote:
|
|
#12
|
||||
|
||||
|
Thanks for all that information, but I think I can figure out how to use onMouseOut. Just one quick question to avoid going through all the tutorials, Does the onMouseOver and onMouseOut have to go on every td tag in the table?
|
|
#13
|
|||||
|
|||||
|
Quote:
|
|
#14
|
||||
|
||||
|
I thought that return flase only applies to onClicks used with hyperlniks, so that it doesn't jump back to the top of the page.
|
|
#15
|
|||||
|
|||||
|
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| DHTML Menu Help | DCA Fan | Website Design/Showcase | 2 | 09-10-2003 02:08 |
| DHTML question, not related to the robot | robot180 | Website Design/Showcase | 4 | 19-04-2003 21:26 |
| DHTML Problem | sanddrag | Website Design/Showcase | 5 | 11-03-2003 20:08 |
| Video Editing Programs...share what you use and why... | Alexander McGee | 3D Animation and Competition | 25 | 09-01-2003 22:27 |
| Can we use editing tools? | Ydnar | 3D Animation and Competition | 2 | 11-03-2002 02:54 |