473,396 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

tab menu - change tabs onmouseover, onmouseout, onclick

oll3i
679 512MB
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 17261
oll3i
679 512MB
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 512MB
maybe i should have posted it on javascript forum?
Jul 2 '08 #3
oll3i
679 512MB
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 Expert Mod 8TB
Rather than just className, you need this.className.

PS. merged threads.
Jul 2 '08 #5
oll3i
679 512MB
thanks for merging threads
... but even with "this" still doesn't work
Jul 2 '08 #6
acoder
16,027 Expert Mod 8TB
Where is the display function called?
Jul 2 '08 #7
oll3i
679 512MB
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 Expert Mod 8TB
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 512MB
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
acoder
16,027 Expert Mod 8TB
Barking up the wrong tree all along, eh? As you say, it happens. Glad you've got it sorted.
Jul 3 '08 #11

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

Similar topics

1
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...
1
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...
2
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...
10
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...
4
by: Yuk Cheng | last post by:
<<<start index.htm>>> <html> <head> <script> function perform(action){ } </script> </head>
2
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...
3
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - I have window.status="Moomin"; why doesn't the statusbar change?...
3
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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,...
0
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...

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.