<TABLE align='center' BORDER=1 CELLPADDING=4 CELLSPACING=0 CLASS=cTable>
<TR>
<th CLASS=TH1 align='center' valign='top' colspan='15'>Input Summary</th>
<th CLASS=TH1 align='center' valign='top'>
<style type="text/css">
.myLayersClass { position: relative; display:none; }
</style>
<span id='spanHideSummary' class='myLayersClass' style='display:none'>
<a href='javascript:ToggleDisplay("spanSummary", "");javascript:ToggleDisplay("spanPPDates", "TsLinks");'>Hide</a>
</span>
</th>
Asked
Active
Viewed 44 times
0

Viktor S.
- 12,736
- 1
- 27
- 52

user1345246
- 135
- 1
- 9
1 Answers
0
And it should not be shown. According to display:none
in .myLayersClass
and style='display:none'
on span element. In order to fix it you should do something like this:
<th CLASS=TH1 align='center' valign='top'>
<style type="text/css">
.myLayersClass { position: relative; }
</style>
<span id='spanHideSummary' class='myLayersClass'>
<a href='javascript:ToggleDisplay("spanSummary", "");javascript:ToggleDisplay("spanPPDates", "TsLinks");'>Hide</a>
</span>
</th>
Besides, javascript:...
in href is bad idea. There is onclick
event. It is better to do something like this (well, even that is not the best solution):
<a href='#' onclick="ToggleDisplay('spanSummary', ''; ToggleDisplay('spanPPDates', 'TsLinks'); return false;'>Hide</a>
Also, styles are better being located inside header tag. Suppose the main reason will be here that it will force browser to redraw everything just it will find your css in <th>
and it is much easier to support a website which has all css in some predefined location (in <head>
like inline styles or in css files).
-
But then why does it show in IE? – user1345246 Nov 09 '12 at 20:09
-
Suppose IE does not understand something in your code. Let me check how it works in IE. – Viktor S. Nov 09 '12 at 20:12
-
Hm. I'm looking at [this](http://jsfiddle.net/YygM8/) in IE7/8 and I do not see Hide there too. And that IS correct behavior (`display:none`, remember?). Maybe there is something else in your code not reflected in question which breaks IE somehow. Hard to say. – Viktor S. Nov 09 '12 at 20:16
-
Weird. When I removed those 2 items it is now not showing in IE? – user1345246 Nov 09 '12 at 21:04
-
Never mind I got it. There was something else in the code that shows it if it was IE. I removed that check and now it displays for FF – user1345246 Nov 09 '12 at 21:20