snailface Posted May 1, 2006 Share Posted May 1, 2006 I'm working on a project where pieces of content will be contained within "tabbed" containers.In one of the containers, each tab contains a list of links, and for some reason, on all of the tabs, except for the first one, the first link in the list is not clickable in IE 6, and I can't figure out why, though I'm sure it's something super simple.It's almost as though some invisible element is covering it, preventing the user from clicking on it.I put together a sample page to illustrate. The code is below.<html><head><title>HTML Template Test Page</title><link rel="stylesheet" href="./css/newCSS.css" type="text/css"><style type="text/css">/************* Begin Testing Declarations *************/.testShellCenter {width: 50%;border: solid 1px #999999; }.testShellRight {width: 25%;border: solid 1px #999999; }/************* End Testing Declarations *************//************* HTML ELEMENTS *************/body {margin: 0px;padding: 0px;font-size: 62.5%;color: #000000;font-family: verdana, arial, helvetica, sans-serif; }table {font-size: 1em;}ul {position: relative;clear: both;margin: 0 5px 1em 5px;padding: 0;list-style: none; }li {margin: 0px 0px 0.4em 0px;padding: 2px 0px 2px 22px;background: url(../images/bullet.gif) 0px 1px no-repeat; }a {font-size: 1em;font-weight: bold;color: #006699;text-decoration: none; }a:link {font-size: 1em;font-weight: bold;color: #006699;text-decoration: none; }a:visited {font-size: 1em;font-weight: bold;color: #808080;text-decoration: none; }a:hover {font-size: 1em;font-weight: bold;color: #006699;text-decoration: underline; }/************* CLASSES *************/div.htmlPortlet {position: relative;width: 100%;font-size: 1.1em;margin: 5px 0px 5px 0px; }div.hiddenContent {display: none; }div.shownContent {display: block; }/************* TABBED PORTLET SPECIFIC STYLES *************/div.tabbedPortlet {margin: 0px 0px 0px 0px; }div.tabbedPortlet table.portletTabs {margin: 0px; }div.tabbedPortlet table.portletTabs td {background:#B8D1EB;border:1px solid #B8D1EB;font-weight: bold;text-align: center;padding: 5px 0px 5px 0px;margin: 20px; }div.tabbedPortlet table.portletTabs td.tabOn {background:#FFFFFF; }div.tabbedPortlet div.tabbedContentWrapper {overflow: auto;height: 240px;padding: 5px 0px 5px 0px; }</style><script language="javascript">function showTabbedContent(clicked){tab = clicked;tabToShow = tab.id;tabNav = tab.parentNode;for(i=0; i<tabNav.childNodes.length; i++){navTab = tabNav.childNodes;if(navTab.nodeName == "TD" && tabToShow == navTab.id){navTab.className = "tabOn";}else if(navTab.nodeName == "TD" || tabToShow != navTab.id){navTab.className = "tabOff";}}contentToShow = tab.id + "Content";tabNav = tab.parentNode;while(tabNav.className != "portletTabs"){tabNav = tabNav.parentNode;}tabWrapper = tabNav.nextSibling;while(tabWrapper.nodeName != "DIV" || tabWrapper.className != "tabbedContentWrapper"){tabWrapper = tabWrapper.nextSibling;}for(i=0; i<tabWrapper.childNodes.length; i++){content = tabWrapper.childNodes;if(content.nodeName == "DIV" && contentToShow == content.id){content.className = "shownContent";}else if(content.nodeName == "DIV" && contentToShow != content.id){content.className = "hiddenContent";}}return false;}</script></head><body><div class="testShellCenter"><div class="tabbedPortlet"><table class="portletTabs" width="100%" border="0" cellpadding="0" cellspacing="1"><tr><td id="FirstTab" class="tabOn"><a href="#" onclick="java script:showTabbedContent(this.parentNode);">First</a></td><td id="SecondTab" class="tabOff"><a href="#" onclick="java script:showTabbedContent(this.parentNode);">Second</a></td><td id="ThirdTab" class="tabOff"><a href="#" onclick="java script:showTabbedContent(this.parentNode);">Third</a></td></tr></table><div class="tabbedContentWrapper"><div id="FirstTabContent" class="shownContent"><ul><li><a href="#">test1</a></li><li><a href="#">test2</a></li></ul></div><div id="SecondTabContent" class="hiddenContent"><ul><li><a href="#">test2</a></li><li><a href="#">test3</a></li></ul></div><div id="ThirdTabContent" class="hiddenContent"><ul><li><a href="#">test4</a></li></ul></div></div></div></div></body></html> Link to comment Share on other sites More sharing options...
htmlkid Posted May 1, 2006 Share Posted May 1, 2006 first, next time put the code into Code tags(next to quote on advanced reply) or use the following [code] insert code here [/code] secondly what version of IE are you using to view the page the code you are using may be ignored if your using a low version Link to comment Share on other sites More sharing options...
justsomeguy Posted May 2, 2006 Share Posted May 2, 2006 And mark in the code somewhere which links work and which don't. Link to comment Share on other sites More sharing options...
snailface Posted May 2, 2006 Author Share Posted May 2, 2006 My apologies.Here is the code again. <html><head><title>HTML Template Test Page</title><link rel="stylesheet" href="./css/newCSS.css" type="text/css"><style type="text/css">/************* Begin Testing Declarations *************/.testShellCenter { width: 50%; border: solid 1px #999999; }.testShellRight { width: 25%; border: solid 1px #999999; }/************* End Testing Declarations *************//************* HTML ELEMENTS *************/body { margin: 0px; padding: 0px; font-size: 62.5%; color: #000000; font-family: verdana, arial, helvetica, sans-serif; }table { font-size: 1em;}ul { position: relative; clear: both; margin: 0 5px 1em 5px; padding: 0; list-style: none; }li { margin: 0px 0px 0.4em 0px; padding: 2px 0px 2px 22px; background: url(../images/bullet.gif) 0px 1px no-repeat; }a { font-size: 1em; font-weight: bold; color: #006699; text-decoration: none; }a:link { font-size: 1em; font-weight: bold; color: #006699; text-decoration: none; }a:visited { font-size: 1em; font-weight: bold; color: #808080; text-decoration: none; }a:hover { font-size: 1em; font-weight: bold; color: #006699; text-decoration: underline; }/************* CLASSES *************/div.htmlPortlet { position: relative; width: 100%; font-size: 1.1em; margin: 5px 0px 5px 0px; }div.hiddenContent { display: none; }div.shownContent { display: block; }/************* TABBED PORTLET SPECIFIC STYLES *************/div.tabbedPortlet { margin: 0px 0px 0px 0px; }div.tabbedPortlet table.portletTabs { margin: 0px; }div.tabbedPortlet table.portletTabs td { background:#B8D1EB; border:1px solid #B8D1EB; font-weight: bold; text-align: center; padding: 5px 0px 5px 0px; margin: 20px; }div.tabbedPortlet table.portletTabs td.tabOn { background:#FFFFFF; }div.tabbedPortlet div.tabbedContentWrapper { overflow: auto; height: 240px; padding: 5px 0px 5px 0px; }</style><script language="javascript">function showTabbedContent(clicked){ tab = clicked; tabToShow = tab.id; tabNav = tab.parentNode; for(i=0; i<tabNav.childNodes.length; i++){ Â navTab = tabNav.childNodes[i]; Â if(navTab.nodeName == "TD" && tabToShow == navTab.id){ Â navTab.className = "tabOn"; Â }else if(navTab.nodeName == "TD" || tabToShow != navTab.id){ Â navTab.className = "tabOff"; Â } } contentToShow = tab.id + "Content"; tabNav = tab.parentNode; while(tabNav.className != "portletTabs"){ Â tabNav = tabNav.parentNode; } tabWrapper = tabNav.nextSibling; while(tabWrapper.nodeName != "DIV" || tabWrapper.className != "tabbedContentWrapper"){ Â tabWrapper = tabWrapper.nextSibling; } for(i=0; i<tabWrapper.childNodes.length; i++){ Â content = tabWrapper.childNodes[i]; Â if(content.nodeName == "DIV" && contentToShow == content.id){ Â content.className = "shownContent"; Â }else if(content.nodeName == "DIV" && contentToShow != content.id){ Â content.className = "hiddenContent"; Â } } return false;}</script></head><body><div class="testShellCenter"> Â <div class="tabbedPortlet"> Â Â <table class="portletTabs" width="100%" border="0" cellpadding="0" cellspacing="1"> Â Â Â <tr> Â Â Â Â <td id="FirstTab" class="tabOn"><a href="#" onclick="javascript:showTabbedContent(this.parentNode);">First</a></td> Â Â Â Â <td id="SecondTab" class="tabOff"><a href="#" onclick="javascript:showTabbedContent(this.parentNode);">Second</a></td> Â Â Â Â <td id="ThirdTab" class="tabOff"><a href="#" onclick="javascript:showTabbedContent(this.parentNode);">Third</a></td> Â Â Â </tr> Â Â </table> Â Â <div class="tabbedContentWrapper"> Â Â Â <div id="FirstTabContent" class="shownContent"> Â Â Â Â <ul> Â Â Â Â Â <li><a href="#">test1</a></li> Â Â Â Â Â <li><a href="#">test2</a></li> Â Â Â Â </ul> Â Â Â </div> Â Â Â <div id="SecondTabContent" class="hiddenContent"> Â Â Â Â <ul> Â Â Â Â Â <li><a href="#">test2</a><!--link not clickable in IE6--></li> Â Â Â Â Â <li><a href="#">test3</a></li> Â Â Â Â </ul> Â Â Â </div> Â Â Â <div id="ThirdTabContent" class="hiddenContent"> Â Â Â Â <ul> Â Â Â Â Â <li><a href="#">test4</a><!--link not clickable in IE6--></li> Â Â Â Â </ul> Â Â Â </div> Â Â </div> Â </div></div></body></html> The links that don't appear clickable are marked with comments.The version of IE in which I found this is 6.Also, I found that the links are not entirely unclickable. There appears to be about a 1px wide space at the beginning of the link that is clickable.Thanks in advance for the help. Link to comment Share on other sites More sharing options...
htmlkid Posted May 3, 2006 Share Posted May 3, 2006 Its ok we all make mistakes Link to comment Share on other sites More sharing options...
snailface Posted May 10, 2006 Author Share Posted May 10, 2006 Can anyone out there help me with this? It's driving me crazy. Link to comment Share on other sites More sharing options...
Jack McKalling Posted May 10, 2006 Share Posted May 10, 2006 Actually, IE makes a link clickable if it has an HREF attribute specified correctly. Having one with value "#" is not properly defined, you should also give the name of the anchor you are linking to, or, give the relative address of the file you are targetting. :)Else, use eg. "java script:void()" or "http://nothing"Else2, replace the anchors by spans, like this: <span onclick='location.href="somewhere"; '>test</span> Link to comment Share on other sites More sharing options...
snailface Posted May 11, 2006 Author Share Posted May 11, 2006 I'm afraid that adding a valid link does not correct the issue.Here is code with URLs in the HREF attribute. I still get the same issue. <html><head><title>HTML Template Test Page</title><link rel="stylesheet" href="./css/newCSS.css" type="text/css"><style type="text/css">/************* Begin Testing Declarations *************/.testShellCenter {width: 50%;border: solid 1px #999999; }.testShellRight {width: 25%;border: solid 1px #999999; }/************* End Testing Declarations *************//************* HTML ELEMENTS *************/body {margin: 0px;padding: 0px;font-size: 62.5%;color: #000000;font-family: verdana, arial, helvetica, sans-serif; }table {font-size: 1em;}ul {position: relative;clear: both;margin: 0 5px 1em 5px;padding: 0;list-style: none; }li {margin: 0px 0px 0.4em 0px;padding: 2px 0px 2px 22px;background: url(../images/bullet.gif) 0px 1px no-repeat; }a {font-size: 1em;font-weight: bold;color: #006699;text-decoration: none; }a:link {font-size: 1em;font-weight: bold;color: #006699;text-decoration: none; }a:visited {font-size: 1em;font-weight: bold;color: #808080;text-decoration: none; }a:hover {font-size: 1em;font-weight: bold;color: #006699;text-decoration: underline; }/************* CLASSES *************/div.htmlPortlet {position: relative;width: 100%;font-size: 1.1em;margin: 5px 0px 5px 0px; }div.hiddenContent {display: none; }div.shownContent {display: block; }/************* TABBED PORTLET SPECIFIC STYLES *************/div.tabbedPortlet {margin: 0px 0px 0px 0px; }div.tabbedPortlet table.portletTabs {margin: 0px; }div.tabbedPortlet table.portletTabs td {background:#B8D1EB;border:1px solid #B8D1EB;font-weight: bold;text-align: center;padding: 5px 0px 5px 0px;margin: 20px; }div.tabbedPortlet table.portletTabs td.tabOn {background:#FFFFFF; }div.tabbedPortlet div.tabbedContentWrapper {overflow: auto;height: 240px;padding: 5px 0px 5px 0px; }</style><script language="javascript">function showTabbedContent(clicked){tab = clicked;tabToShow = tab.id;tabNav = tab.parentNode;for(i=0; i<tabNav.childNodes.length; i++){ navTab = tabNav.childNodes[i]; if(navTab.nodeName == "TD" && tabToShow == navTab.id){ Â navTab.className = "tabOn"; }else if(navTab.nodeName == "TD" || tabToShow != navTab.id){ Â navTab.className = "tabOff"; }}contentToShow = tab.id + "Content";tabNav = tab.parentNode;while(tabNav.className != "portletTabs"){ tabNav = tabNav.parentNode;}tabWrapper = tabNav.nextSibling;while(tabWrapper.nodeName != "DIV" || tabWrapper.className != "tabbedContentWrapper"){ tabWrapper = tabWrapper.nextSibling;}for(i=0; i<tabWrapper.childNodes.length; i++){ content = tabWrapper.childNodes[i]; if(content.nodeName == "DIV" && contentToShow == content.id){ Â content.className = "shownContent"; }else if(content.nodeName == "DIV" && contentToShow != content.id){ Â content.className = "hiddenContent"; }}return false;}</script></head><body><div class="testShellCenter"> <div class="tabbedPortlet"> Â <table class="portletTabs" width="100%" border="0" cellpadding="0" cellspacing="1"> Â Â <tr> Â Â Â <td id="FirstTab" class="tabOn"><a href="#" onclick="javascript:showTabbedContent(this.parentNode);">First</a></td> Â Â Â <td id="SecondTab" class="tabOff"><a href="#" onclick="javascript:showTabbedContent(this.parentNode);">Second</a></td> Â Â Â <td id="ThirdTab" class="tabOff"><a href="#" onclick="javascript:showTabbedContent(this.parentNode);">Third</a></td> Â Â </tr> Â </table> Â <div class="tabbedContentWrapper"> Â Â <div id="FirstTabContent" class="shownContent"> Â Â Â <ul> Â Â Â Â <li><a href="http://www.google.com">test1</a></li> Â Â Â Â <li><a href="http://www.google.com">test2</a></li> Â Â Â </ul> Â Â </div> Â Â <div id="SecondTabContent" class="hiddenContent"> Â Â Â <ul> Â Â Â Â <li><a href="http://www.google.com">test2</a><!--link not clickable in IE6--></li> Â Â Â Â <li><a href="http://www.google.com">test3</a></li> Â Â Â </ul> Â Â </div> Â Â <div id="ThirdTabContent" class="hiddenContent"> Â Â Â <ul> Â Â Â Â <li><a href="http://www.google.com">test4</a><!--link not clickable in IE6--></li> Â Â Â </ul> Â Â </div> Â </div> </div></div></body></html> Link to comment Share on other sites More sharing options...
Little Goat Posted May 14, 2006 Share Posted May 14, 2006 hey, what is in the external css?LG Link to comment Share on other sites More sharing options...
Tony Posted May 14, 2006 Share Posted May 14, 2006 That's odd...When I put the code you provided in the Tryit Editor, all the links work fine. Is by what you mean "clickable" different than what I understand? Link to comment Share on other sites More sharing options...
snailface Posted May 15, 2006 Author Share Posted May 15, 2006 Little Goat -There is nothing in the external CSS, I just forgot to take it our when I created the stripped down set of code for this topic. Sorry.Tony -I took a look at everything in the Try It editor, and I still see the problem. The problematic links are the first ones that appear in the white portion of the module after clicking on the Tabs labled "Second" and "Third".Also, are you using IE6? That is the browser where I am finding the issue. Link to comment Share on other sites More sharing options...
justsomeguy Posted May 15, 2006 Share Posted May 15, 2006 Maybe try removing the background property from the li tag. There are better ways to specify what the bullet looks like.But it looks like you are dealing with a bug in IE. This should work, the fact that you have 2 links, where one works and one doesn't, tells you that the software (IE) has a bug. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now