473,238 Members | 1,795 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,238 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 8623
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:...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
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...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...

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.