Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #25054
| From | Philip Herlihy <bounceback@you.com> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: Dynamic CSS adjustments (JavaScript) |
| Message-ID | <MPG.2e16b6ce69e50e579899c2@news.demon.co.uk> (permalink) |
| References | <MPG.2e1662bf95bc0a299899c1@news.demon.co.uk> <XnsA358CD0D1F4FBeejj99@194.109.133.133> |
| Date | 2014-06-27 00:02 +0100 |
In article <XnsA358CD0D1F4FBeejj99@194.109.133.133>,
exxjxw.hannivoort@inter.nl.net says...
>
> Philip Herlihy <bounceback@you.com> wrote on 26 jun 2014 in
> comp.infosystems.www.authoring.stylesheets:
>
> > Hope this isn't off-topic!
>
> It is, you better ask in comp.lang.javascript.
> Follow up set.
>
> > I'd like to be able to provide a button or
> > link which will hide (display:none) all the items on a page of class
> > "done" (Outdoor events, as it happens). I've googled, and even bought a
> > JavaScript book (I'm barely competent in js, but otherwise an
> > experienced, if rusty, programmer).
> >
> > The best option appears to be to have the link:
> > <a href="javascript:toggleStyleSheet()">Hide/Show past walks</a>
> > ... load a further external style sheet. I think this would mean
> > refreshing the page to reverse the 'hiding'.
> >
> > Is there a better way?
>
> Certainly, loading an external script takes time.
>
> Try [this expects only block elements for your class]:
>
> ===============================================
> <script type='text/javascript'>
> var toggleIsDone = false;
> function toggleDone() {
> var t = document.getElementsByClassName('done');
> for (var x=0; x<t.length; x++)
> t[x].style.display = (toggleIsDone)?'block' :'none';
> toggleIsDone = !toggleIsDone;
> };
> </script>
>
> <button onclick='toggleDone()'>toggleDone</button>
> <div class='done'>AAAAAAAAAAAa</div>
> <div class='xyz'>bbbbbbbbbbbbB</div>
> <div class='done'>CCCCCCCCCCCCCc</div>
> ==========================================
Thank you - I'll study this carefully.
Now I just hope the good people in comp.lang.javascript don't deem this
a CSS issue and send me back...
--
Phil, London
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: Dynamic CSS adjustments (JavaScript) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-26 20:09 +0200
Re: Dynamic CSS adjustments (JavaScript) Philip Herlihy <bounceback@you.com> - 2014-06-27 00:02 +0100
Re: Dynamic CSS adjustments (JavaScript) Christoph Michael Becker <cmbecker69@arcor.de> - 2014-06-27 02:34 +0200
Re: Dynamic CSS adjustments (JavaScript) Joao Rodrigues <groups_jr-1@yahoo.com> - 2014-06-26 22:43 -0300
JavaScript and CSS in external files???, was Re: Dynamic CSS adjustments (JavaScript) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-27 09:19 +0200
Re: Dynamic CSS adjustments (JavaScript) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-06-27 10:22 +0200
Re: Dynamic CSS adjustments (JavaScript) Joao Rodrigues <groups_jr-1@yahoo.com.br> - 2014-06-27 17:23 -0300
Re: Dynamic CSS adjustments (JavaScript) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-06-27 23:28 +0200
Re: Dynamic CSS adjustments (JavaScript) Joao Rodrigues <groups_jr-1@yahoo.com> - 2014-06-27 23:45 -0300
Re: Dynamic CSS adjustments (JavaScript) Tim Streater <timstreater@greenbee.net> - 2014-06-28 10:30 +0100
Re: Dynamic CSS adjustments (JavaScript) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-06-27 10:19 +0200
Re: Dynamic CSS adjustments (JavaScript) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-06-27 10:12 +0200
Re: Dynamic CSS adjustments (JavaScript) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-06-27 10:16 +0200
Re: Dynamic CSS adjustments (JavaScript) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-06-27 10:16 +0200
Re: Dynamic CSS adjustments (JavaScript) Philip Herlihy <bounceback@you.com> - 2014-06-30 11:02 +0100
Re: Dynamic CSS adjustments (JavaScript) BootNic <bootnic.bounce@gmail.com> - 2014-06-26 23:18 -0400
Re: Dynamic CSS adjustments (JavaScript) Philip Herlihy <bounceback@you.com> - 2014-06-30 11:31 +0100
Re: Dynamic CSS adjustments (JavaScript) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-30 13:37 +0200
Re: Dynamic CSS adjustments (JavaScript) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-06-30 13:40 +0200
Re: Dynamic CSS adjustments (JavaScript) Philip Herlihy <bounceback@you.com> - 2014-07-01 12:41 +0100
Re: Dynamic CSS adjustments (JavaScript) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-07-01 14:28 +0200
Re: Dynamic CSS adjustments (JavaScript) Philip Herlihy <bounceback@you.com> - 2014-07-01 15:52 +0100
Re: Dynamic CSS adjustments (JavaScript) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-07-01 18:08 +0200
Re: Dynamic CSS adjustments (JavaScript) Scott Sauyet <scott.sauyet@gmail.com> - 2014-06-30 06:22 -0700
Re: Dynamic CSS adjustments (JavaScript) Denis McMahon <denismfmcmahon@gmail.com> - 2014-06-30 14:32 +0000
Re: Dynamic CSS adjustments (JavaScript) Scott Sauyet <scott.sauyet@gmail.com> - 2014-06-30 13:16 -0700
Re: Dynamic CSS adjustments (JavaScript) Denis McMahon <denismfmcmahon@gmail.com> - 2014-06-30 23:14 +0000
Re: Dynamic CSS adjustments (JavaScript) "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2014-07-01 09:02 +0200
csiph-web