473,569 Members | 2,770 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

tab menu - change tabs onmouseover, onmouseout, onclick

oll3i
679 Contributor
i wrote css class for a href but when i add this class to link it doesnt see the image but when i add the inline css it sees it
i m writing javascript tab menu and i want tabs to change on mouse over, on mouse out and on click
Expand|Select|Wrap|Line Numbers
  1. a.menu_on_mouse_over{
  2. width:80px;
  3. height:22px;
  4. float:left;
  5. text-align:center;
  6. margin-top:0;
  7. margin-right:1px;
  8. margin-bottom:0;
  9. margin-left:0;
  10. font-size:100%;
  11. text-decoration:none;
  12. color:#FFF;
  13. font-weight:bold;
  14. background:url(../images/top_menu_hover.gif) left top no-repeat;  
  15. padding:3px 0 0 0;
  16. }
  17.  

the css is in css/menu.css
and images are in folder
images/top_menu_hover. gif
Jul 2 '08 #1
10 17282
oll3i
679 Contributor
in js menu i have
Expand|Select|Wrap|Line Numbers
  1. document.write('<li style="display:inline;"><a href=\'/HRDB/candidates/index.jsp?sortby=name,f=1,switch_f=1,modul=candidates\'  onclick="className=\'menu_on_mouse_over\'" onmouseover="className=\'menu_on_mouse_over\'" onmouseout="className=\'menu_on_mouse_out\'" class="menu_on_mouse_out">');
  2. document.write(this.var1);
  3. document.write('</a></li>');
  4.  
thank You
Jul 2 '08 #2
oll3i
679 Contributor
maybe i should have posted it on javascript forum?
Jul 2 '08 #3
oll3i
679 Contributor
i got back to my jsp project i don't know how to write js tab menu without document.write as You suggested before so I'm stuck

i wrote css class for a href but when i add this class to link it doesnt see the tab background image but when i add the inline css it sees it
i want tabs to change on mouse over, on mouse out and on click

Expand|Select|Wrap|Line Numbers
  1. a.menu_on_mouse_over{
  2. width:80px;
  3. height:22px;
  4. float:left;
  5. text-align:center;
  6. margin-top:0;
  7. margin-right:1px;
  8. margin-bottom:0;
  9. margin-left:0;
  10. font-size:100%;
  11. text-decoration:none;
  12. color:#FFF;
  13. font-weight:bold;
  14. background:url(../images/top_menu_hover.gif) left top no-repeat;  
  15. padding:3px 0 0 0;
  16. }
  17.  
  18.  
and then in menu.js file in display function i have
Expand|Select|Wrap|Line Numbers
  1. document.write('<li style="display:inline;"><a href=\'/HRDB/candidates/index.jsp?sortby=name,f=1,switch_f=1,modul=candidates\'  onclick="className=\'menu_on_mouse_over\'" onmouseover="className=\'menu_on_mouse_over\'" onmouseout="className=\'menu_on_mouse_out\'" class="menu_on_mouse_out">');
  2. document.write(this.var1);
  3. document.write('</a></li>');
  4.  
it doesnt throw any error now

the css is in css/menu.css
and images are in folder
images/top_menu_hover. gif

thank You
Jul 2 '08 #4
acoder
16,027 Recognized Expert Moderator MVP
Rather than just className, you need this.className.

PS. merged threads.
Jul 2 '08 #5
oll3i
679 Contributor
thanks for merging threads
... but even with "this" still doesn't work
Jul 2 '08 #6
acoder
16,027 Recognized Expert Moderator MVP
Where is the display function called?
Jul 2 '08 #7
oll3i
679 Contributor
the display finction is called in my jsp file
Expand|Select|Wrap|Line Numbers
  1. <script>
  2. var menu = new Menu();
  3. menu.display();
  4. </script>
  5.  
look please at the document.write in my 4th post this line is part of display function
Jul 3 '08 #8
acoder
16,027 Recognized Expert Moderator MVP
Is it just the image that it's not finding or none of the CSS rules are being applied?
Jul 3 '08 #9
oll3i
679 Contributor
hmm i forgot to add css file to jsp file hihi it works now :) thank You next time i will know that i have to check if i included the file first before i post something but it happens sometimes
Jul 3 '08 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2478
by: Macamba | last post by:
Hi all, I am currently developing a website for a voluntary organisation. It is my first step in website development. The dynamic menu I developed has some bugs, which I addressed in another post. In this post I want to ask you why my code behaves differently in IE, while it behaves like I expect in Mozilla and Opera. What I would like to...
1
4308
by: ajay | last post by:
I have following code for a slide menu but i twiked it to work for a single level menu. Open it in a Browser to get a clear picture. I have 2 Qs 1) How to make first entry as non-link. i.e i want to make first text as Table Heading/menu category. For examle in the given menu i want to make a heading as "Comp. Languages" which won't be a...
2
5287
by: RWD | last post by:
I am trying to figure out how to change the target frame in my hyperlink on a DHTML menu. The menu is in one frame and the target frame is called "main" The code is below: Thanks in advance RWD <script type='text/javascript'>
10
2016
by: John Ortt | last post by:
Hi Everyone, I have created a Javascript menu for my site which uses frames. The first stage loads fine but I want two drill down menus ("About Me Menu" and "Projects Menu"). The pages load fine, but the images aren't displayed, instead the alt text is shown. The images come up after you "Mouse Over" them but not before......can anybody...
4
5758
by: Yuk Cheng | last post by:
<<<start index.htm>>> <html> <head> <script> function perform(action){ } </script> </head>
2
3868
by: Jackson Yap | last post by:
can someone kind enough to help me look at the attached html and js file? Why is it that the javascript menu could not work at www.apchosting.net but could work at http://home.pacific.net.sg/~jacksony ? (the drop down bar could not work at www.apchosting.net but can drop at home.pacific.net.sg. I suspect it is a server problem but was told it...
3
4196
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - I have window.status="Moomin"; why doesn't the statusbar change? ----------------------------------------------------------------------- When changing the status in an event (e.g. onmouseover) you should return true from the event. Also a number of browsers...
3
4447
by: rsteph | last post by:
I have a javascript drop down menu that I borrowed from a website. It utilizes a little .css to help with formatting. The menu works great, and on all 3 of the browsers I'm concerned about; but I am having one problem. The menu, as designed, is a 1-tier menu (or is it 2-tier). It has the horizontal menu bar, along with the drop downs... but the...
0
7619
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7931
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8139
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
6290
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5515
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5228
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3663
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3655
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1230
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.