User:DrOwl/23meblog/showhide

this is my first mod of the javascript i got from the blogger help site (used to show hide comments) function showhidediv (divid) { whichpost = document.getElementById(divid); if (whichpost.className=="divhidden") { whichpost.className="divshown"; }   else { whichpost.className="divhidden"; }  }

.divhidden {display:none;} .divshown {display:inline;}

link

text

i still have a major problem with the show hide script... in that when it changes the style to posthidden / postshown it also removes any other styles that were applyed to the element too i need to do some work on the javascript --phedocode : read existing style info (var=whichpost.className) check to see if "posthidden / postshown" are in className (if inStr ??) replace "posthidden / postshown" with "posthidden / postshown" (maybe with regEx or some such string) --User:DrOwl 05:17, 12 Mar 2005 (CET)

javascript showhode problem fixed via a simpler methord then i thourght at first... just set the div to a hidden style, then use the java script to set the style you want to use for it.





function showhidedivnew (divid,divclass) { whichpost = document.getElementById(divid); if (whichpost.className=="divhidden") { whichpost.className=divclass; }   else { whichpost.className="divhidden"; }  }

link

text --DrOwl 05:18, 13 Mar 2005 (CET)

=)