473,327 Members | 1,936 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,327 software developers and data experts.

href="#" onclick="func(); return false;" and css class problem

Hello,
I have the following page:

...
Expand|Select|Wrap|Line Numbers
  1. <style type="text/css">
  2. body {
  3.     font-family: Verdana, Arial, Helvetica, sans-serif;
  4.     font-size: 12px;
  5. }
  6.  
  7. #form-tabs {
  8.     background-color: #7F8A81;
  9. }
  10. #form-tabs ul {
  11.     padding: 20px 0 3px 0;
  12.     margin-left: 0;
  13.     border-bottom: 1px solid #778;
  14.     list-style: none;
  15.     margin: 0;
  16. }
  17. #form-tabs ul li {
  18.     display: inline;
  19. }
  20. #form-tabs ul li a {
  21.     padding: 3px 10px;
  22.     margin-left: 5px;
  23.     margin-top: 10px;
  24.     border: 1px solid #CED2B6;
  25.     border-bottom: none;
  26.     background-color: #E8E9E2;
  27.     text-decoration: none;
  28. }
  29. #form-tabs ul li a:link, #form-tabs ul li a:visited { 
  30.     color: #474F49; 
  31. }
  32. #form-tabs ul li a:hover {
  33.     color: #E8E9E2;
  34.     background-color: #717A73;
  35.     border-color: #586159;
  36. }
  37. #form-tabs ul li.current a:link {
  38.     color: #474F49;
  39.     background-color: #FFFFFF;
  40.     border-color: #586159;
  41. }
  42. </style>
  43. <script src="js/jquery-1.2.6.min.js" language="javascript"></script>
  44. <script language="javascript">
  45. <!-- Begin
  46. function move_form_tab(index) {
  47.     $("#form-tabs ul li").removeClass("current");
  48.     $("#form-tabs ul li").eq(index).addClass("current");
  49.     $("#partial-forms div").css("display", "none");
  50.     switch(index) {
  51.         case 0:
  52.             $("#datos-personales").css("display", "block");
  53.             break;
  54.         case 1:
  55.             $("#datos-vivienda").css("display", "block");
  56.             break;
  57.         case 2:
  58.             $("#datos-laborales").css("display", "block");
  59.             break;
  60.         case 3:
  61.             $("#datos-financieros").css("display", "block");
  62.             break;
  63.         case 4:
  64.             $("#referencias-bancarias").css("display", "block");
  65.             break;
  66.         case 5:
  67.             $("#referencias-personales").css("display", "block");
  68.             break;
  69.         case 6:
  70.             $("#datos-conyugue").css("display", "block");
  71.             break;
  72.     }
  73. }
  74. // End -->
  75. </script>
  76. </head>
  77. <body>
  78. <div id="form-tabs">
  79.   <ul>
  80.     <li class="current"><a href="#" onclick="javascript:move_form_tab(0); return false;">Datos Personales</a></li>
  81.     <li><a href="#" onclick="javascript:move_form_tab(1); return false;">Datos de Vivienda</a></li>
  82.     <li><a href="#" onclick="javascript:move_form_tab(2); return false;">Datos Laborales</a></li>
  83.     <li><a href="#" onclick="javascript:move_form_tab(3); return false;">Datos Financieros</a></li>
  84.     <li><a href="#" onclick="javascript:move_form_tab(4); return false;">Referencias Bancarias</a></li>
  85.     <li><a href="#" onclick="javascript:move_form_tab(5); return false;">Referencias Personales</a></li>
  86.     <li><a href="#" onclick="javascript:move_form_tab(6); return false;">Datos del C&oacute;nyugue</a></li>
  87.   </ul>
  88. </div>
  89. <div id="partial-forms">
  90.   <div id="datos-personales">datos-personales</div>
  91.   <div id="datos-vivienda">datos-vivienda</div>
  92.   <div id="datos-laborales">datos-laborales</div>
  93.   <div id="datos-financieros">datos-financieros</div>
  94.   <div id="referencias-bancarias">referencias-bancarias</div>
  95.   <div id="referencias-personales">referencias-personales</div>
  96.   <div id="datos-conyugue">datos-conyugue</div>
...

The problem that I'm having is that the .current styles are not rendering well in browsers other than IE7.

Any help will be very apreciated!
Dec 20 '08 #1
5 8634
phvfl
173 Expert 100+
Have you tried validating the page using the W3C validator? Validation errors can often cause pages to render differently where different browsers make different assumptions to correct for the errors. Another issue is that IEs non-conformance to web standards cause styles to look differently in IE to other browsers. Have you included a valid DOCTYPE to force IE into standards mode instead of quirks mode?

Is the style change being applied and not looking correct or is the style change not being applied at all in any browser other than IE? Is the page visible anywhere that people can access to investigate further?
Dec 20 '08 #2
Thanks, I looked into the w3c validator and showed me that I had an error on the script tag atritues for the javascript. So it should be:

<script src="js/jquery-1.2.6.min.js" type="text/javascript"></script>
<script type="text/javascript">

instead of:

<script src="js/jquery-1.2.6.min.js" language="javascript"></script>
<script language="javascript">
Dec 20 '08 #3
acoder
16,027 Expert Mod 8TB
Rather than just setting a:link, set all pseudo-classes or just a:
Expand|Select|Wrap|Line Numbers
  1. #form-tabs ul li.current a
Dec 23 '08 #4
Thanks... that solved the problem in Firefox.

Other browsers (Safari, Opera and IE7) rendered the page well.

Thanks again!
Dec 23 '08 #5
acoder
16,027 Expert Mod 8TB
You're welcome. Glad to help :)
Dec 23 '08 #6

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

Similar topics

6
by: Jez | last post by:
Hi, I've created a function which opens a popup window containing a calendar. When a day is clicked, the date is entered into a text box on the parent page and the popup is closed. The link...
1
by: Alan | last post by:
I post this message here because I have post in js.group before, but onone answer, thus i guess this is ASP issue. <A HREF="http://SomeWebSite" OnClick="return confirm('Are you sure?')">Click...
0
by: Danny Patricia | last post by:
Hi How I can change this tag in order to works in NET? <a href="#" onclick="MyFolderProfile('<% =sFolder%>'); return false;" onmouseover="return ImageDown ('imgProfile', '<%if...
10
by: Gernot Frisch | last post by:
Hi, I'm currently writing: <span onclick="window.open(...);">Klick Here</span> but I want to use the <a href> for this, since it is defined in the css script the way I want my link to open....
2
by: Vincent van Beveren | last post by:
Hey everyone, I've looked for this and I wouldn't know what the best practice would be for solving the following problem. We use a BASE tag in our HTML pages. Now we have some links that use...
6
by: kelvlam | last post by:
Hello, I'm a new begininer with JavaScript. I'm trying to figure out which is the best approach, and to understand the differences between them. I have a <Aelement that's suppose to either...
13
by: alvin.yk | last post by:
Hi, Normally, a piece of code such as <a href="http://www.yahoo.com" onclick="alert('hello');return false;">link</a> will stop the browser from actually going to href's destination....
4
by: jodleren | last post by:
Hi all I have a file I open in a smaller window, like this: <a href="#" onclick="window.open.... but it also causes the main window to jump to the top. What have people done to avoid that?...
5
by: Ben | last post by:
Hi; I use ain asp.net the CreateUserWizard control for new users. When it's done, i want to redirect them to another page (modifyprofile.aspx). This works with the code below. My question is:...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.