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


Groups > comp.lang.javascript > #15753

Re: Altering what a class does

From Dr J R Stockton <reply1236@merlyn.demon.co.uk.invalid>
Newsgroups comp.lang.javascript
Subject Re: Altering what a class does
Date 2012-09-06 23:37 +0100
Organization Home
Message-ID <HVA+8qXwWSSQFwL6@invalid.uk.co.demon.merlyn.invalid> (permalink)
References (1 earlier) <6d02792b-fd42-4d1e-a8ef-723263a280c9@u15g2000yql.googlegroups.com> <msYmy4Olj9PQFw03@invalid.uk.co.demon.merlyn.invalid> <788319d2-8a2c-4a75-af45-73a590669e1c@u15g2000yql.googlegroups.com> <4Z+xfpHCp6QQFw9Z@invalid.uk.co.demon.merlyn.invalid> <ed2c7c60-7990-42ee-a1d3-2c0ba56a4729@gk4g2000vbb.googlegroups.com>

Show all headers | View raw


In comp.lang.javascript message <ed2c7c60-7990-42ee-a1d3-2c0ba56a4729@gk
4g2000vbb.googlegroups.com>, Mon, 3 Sep 2012 15:45:14, Scott Sauyet
<scott.sauyet@gmail.com> posted:

>
>I'm glad it would work for you, even if you choose not to use it.  I
>came to Javascript only after spending a great deal of time with HTML
>and CSS, so I do tend to think of plain CSS solutions first when
>possible, and on simple JS-CSS interactions when I can.  It's
>definitely not cleverness.  I'm fairly certain this is fairly widely
>used; it just happens to be something you hadn't run across before.


I found that, in the same page, I wanted to do the opposite : to hide,
rather than to reveal, and at the end, rather than the beginning.
Slightly reversing your logic worked for that, as soon as I'd typed it
in correctly.  That is good.  It can be seen in the test and real pages,
                <http://www.merlyn.demon.co.uk/p231-jax.htm>
                <http://www.merlyn.demon.co.uk/essai-3c.htm>.
In p231 JavaScript, which works, for the "improved but no good" code,
consider each of three "///xx", and the "///++", to be moved to the line
immediately above.


However, the lines to be hidden are only linked to the MathJax part by
visual adjacency and semantics; there can be no code-level interaction.

Now what I gave initially as an example was not quite true; my elements
were not actually class=JAX, they were style='display:none', and were
switched by replacing display:none with display:block in the
body.innerHTML.  Obviously I could easily do that by using class=JAX and
then removing the class.

But there is a side-effect - the equations are still processed, to judge
by the progress indicator; but they do not actually appear where they
should; and doing the latter step your way does not help with that.

I suspect that the problem is in the MathJax processor, which is
asynchronous - it may take a snapshot of the code at the wrong time, or
neglect the possibility of dynamically redefining in an important way
the meaning of the class of the objects it deals with.

The time has come, I think, to take this to the MathJax user group,
after looking again at the instructions on the MathJax site.  It could
be a common requirement, and may already be handled.

-- 
 (c) John Stockton, nr London UK.  ?@merlyn.demon.co.uk  DOS 3.3 6.20 ; WinXP.
   Web  <http://www.merlyn.demon.co.uk/> - FAQqish topics, acronyms & links.
   PAS EXE TXT ZIP via  <http://www.merlyn.demon.co.uk/programs/00index.htm>
   My DOS  <http://www.merlyn.demon.co.uk/batfiles.htm> - also batprogs.htm.

Back to comp.lang.javascript | Previous | Next — Previous 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