Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #15652

Re: Altering what a class does

Newsgroups comp.lang.javascript
Subject Re: Altering what a class does
From "Evertjan." <exxjxw.hannivoort@inter.nl.net>
References <ZbqZfMCjRpMQFwp9@invalid.uk.co.demon.merlyn.invalid> <6d02792b-fd42-4d1e-a8ef-723263a280c9@u15g2000yql.googlegroups.com> <msYmy4Olj9PQFw03@invalid.uk.co.demon.merlyn.invalid> <788319d2-8a2c-4a75-af45-73a590669e1c@u15g2000yql.googlegroups.com>
Message-ID <XnsA0C169B2C5D44eejj99@194.109.133.133> (permalink)
Date 2012-09-01 08:23 +0000

Show all headers | View raw


Scott Sauyet wrote on 01 sep 2012 in comp.lang.javascript:

> Dr J R Stockton wrote:
>> Scott Sauyet posted:
> 
>>>    .JAX {display: none;}
>>>    .visibleJAX .JAX {display: block;}
>>
>>>    yourButtonHandler = function() {

[..]
 
> A simplified version of my suggestion is posted at
> 
>     <http://scott.sauyet.com/Javascript/Test/2012-08-31a/>

[..]

Wow! Good idea.

> A more sophisticated version would note that the body might have other
> tokens in its className and do some more sophisticated pattern
> matching with regular expressions in order to add and remove the
> "visibleJAX" class.

I would give each function it's own <div>, 
perhaps covering the whole document's <body> space:

See and try: <http://hannivoort.org/test/jax.asp>

==========================================
<script type='text/javascript'>

function makeOnClicks(x) {
  document.getElementById('toggle' + x).onclick = function() { 
     document.getElementById('my' + x).className = 
       (document.getElementById('my' + x).className != 'display' + x)
       ? 'display' + x : '';
  };
};

</script>

<body onLoad="makeOnClicks('Div');makeOnClicks('Img');">
<div id='myDiv'><div id='myImg'>

<button id='toggleDiv'>toggle divs</button> | 
<button id='toggleImg'>toggle images</button>
......

</div></div></body>
==========================================


-- 
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Altering what a class does Dr J R Stockton <reply1234@merlyn.demon.co.uk.invalid> - 2012-08-20 20:47 +0100
  Re: Altering what a class does dhtml <dhtmlkitchen@gmail.com> - 2012-08-20 16:12 -0700
    Re: Altering what a class does "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-08-21 07:59 +0000
      Re: Altering what a class does Dr J R Stockton <reply1234@merlyn.demon.co.uk.invalid> - 2012-08-23 19:54 +0100
        Re: Altering what a class does "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-08-23 23:01 +0000
  Re: Altering what a class does Dr.Kral@nyc.rr.com - 2012-08-23 13:16 -0400
  Re: Altering what a class does "Tom de Neef" <tdeneef@qolor.nl> - 2012-08-24 19:18 +0200
  Re: Altering what a class does Scott Sauyet <scott.sauyet@gmail.com> - 2012-08-29 13:33 -0700
    Re: Altering what a class does Dr J R Stockton <reply1235@merlyn.demon.co.uk.invalid> - 2012-08-30 22:19 +0100
      Re: Altering what a class does Scott Sauyet <scott.sauyet@gmail.com> - 2012-08-31 20:39 -0700
        Re: Altering what a class does "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2012-09-01 08:23 +0000
        Re: Altering what a class does Dr J R Stockton <reply1235@merlyn.demon.co.uk.invalid> - 2012-09-02 19:49 +0100
          Re: Altering what a class does Scott Sauyet <scott.sauyet@gmail.com> - 2012-09-03 15:45 -0700
            Re: Altering what a class does Gene Wirchenko <genew@ocis.net> - 2012-09-03 17:13 -0700
            Re: Altering what a class does Dr J R Stockton <reply1236@merlyn.demon.co.uk.invalid> - 2012-09-04 21:10 +0100
            Re: Altering what a class does Dr J R Stockton <reply1236@merlyn.demon.co.uk.invalid> - 2012-09-06 23:37 +0100

csiph-web