I have a line in which the user has been cached by the web as it is implemented:
Markup:
& lt; Table & gt; & Lt; TR & gt; & Lt; TD & gt; & Lt; Table style = "margin-left: automatic; text-line: true;" & Gt; & Lt; TR & gt; & Lt; Td class = "stats-hide" & gt; & Lt; A href = "#" onclick = "Hide ();" & Gt; Hide & lt; / A & gt; & Lt; / TD & gt; & Lt; Td square = "stats-show" style = "display: none;" & Gt; & Lt; A href = "#" onclick = "showstats ();" & Gt; Show & lt; / A & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; Tr class = "stats-hide" & gt; & Lt; TD & gt; & Lt ;! - Data - & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt;
and jQuery code:
& lt; Script type = "text / javascript" language = "javascript" & gt; Hide work (hidden, $ ('. Stats-hide')); Hide Control (wrong, $ ('. Stats-show'));} function showstats (hidden) control (false, $ ( Hide 'control' (true, $ ('. Show stats'));} Hide function control (value, ARM) {$ (arr) .each (function () {if (value) { $ (This) .hide ();} else {$ (this) .show ();}})}}
one, one link and One, perhaps, how to implement the same behavior with the CSS class?
My idea - somewhere a boolean variable and What's more for this variable in Tor visibility?
What IE hides work properly on IE What's the problem with JQuery version and browser?
I've used Toggle as suggested by Glenn and it works on Chrome, Firefox, and Safari. I have access to IE
Here is the code:
HTML
& lt; Table & gt; & lt; tr & gt; & lt; td & Gt; & lt; table class = "date "& Gt; & Lt; TR & gt; & Lt; Td class = "stats-hide" & gt; & Lt; A href = "#" class = "toggle-statistics" & gt; Hide & lt; / A & gt; & Lt; / TD & gt; & Lt; Td square = "statistics-show" & gt; & Lt; A href = "#" class = "toggle-statistics" & gt; Show & lt; / A & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; / Table & gt; & Lt; / TD & gt; & Lt; / TR & gt; & Lt; Tr class = "stats-hide" & gt; & Lt; TD & gt; Some data & lt; / Td> & Lt; / TR & gt; & Lt; / Table & gt;
javascript
$ ("toggle-stats"). Click (function () {$ (". Stats-hide, .stats-show") Toggle ();});
Comments
Post a Comment