473,545 Members | 529 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

3 New Member
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 8667
phvfl
173 Recognized Expert New Member
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
dangt85
3 New Member
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="javas cript"></script>
<script language="javas cript">
Dec 20 '08 #3
acoder
16,027 Recognized Expert Moderator MVP
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
dangt85
3 New Member
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 Recognized Expert Moderator MVP
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
167406
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 I'm using on the parent page is ... <a href="#" onClick="popupcal()">choose date</a>
1
6159
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 me</A> or <A HREF="http://SomeWebSite" OnClick="return confirm('Are you
0
2231
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 Mid(gsPageName,1,2) <> "ed" then Response.Write("My User Profile") else Response.Write("My Folder Setup") end if%>');" onmouseout="return ImageUp
10
3714
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. Now, if I use a href, the href will be executed as well. What can I du in order to make the href not execute if javascript is enabled?
2
5141
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 the <A HREF="#" onclick="...">Hello</Amethod to invoke a JavaScript. However, because of the BASE tag, when clicking a link containing only a # as...
6
4665
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 launch a popup window, or it will link you to some dynamic created page. I have declared a global JavaScript function
13
38533
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. However, this is not the case with the IE7 I am using. What has changed?
4
23260
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? BR
5
3877
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: if i suppress the line "return false" in the javascript function profile(), the user is created but not redirected to the other aspx page. Can...
0
7465
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7656
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. ...
1
7416
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5969
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
5325
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
4944
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
3449
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
3441
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
701
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.