how do i know the translate process finished

123 views
Skip to first unread message

lindaz...@gmail.com

unread,
Apr 7, 2017, 3:24:46 AM4/7/17
to MathJax Users
hi, i am from china, now i meet a problem, i need call a function after the  translate process finished(i mean the equation was translated finished), then i find answer on google, it provide two methods, one is 

MathJax.Hub.Register.StartupHook("MathMenu Ready",function () {
               console.log(1);
           });

and other is 
MathJax.Hub.Queue(function (End) {
    console.log(1);
 });

but it not useful.......
so, can you help me? my english is poor, thank you reading my email.

Peter Krautzberger

unread,
Apr 7, 2017, 3:47:58 AM4/7/17
to mathja...@googlegroups.com
Hi,

The first piece of code will run `console.log(1)` after the MathJax Menu extension has loaded.

The second piece of code will run `console.log(1)` once the MathJax queue is empty -- that's what you probably want. For a live example see https://codepen.io/pkra/pen/LWowOq?editors=1111..

Regards,
Peter

--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

linda zhang

unread,
Apr 7, 2017, 4:12:13 AM4/7/17
to MathJax Users
thank you, i guess that  i express imcorrectly , when i use mathjax.js, i translate the data that server end passed to me first, like this (they are processed by me)


then mathjax dynamicly translate, but now users can see the translation, i don't hope they see it, so i add a loading spinner, when the formula translated finished, the loading spinner will disapper , so which event can do this?? 

To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.

Peter Krautzberger

unread,
Apr 7, 2017, 4:16:57 AM4/7/17
to mathja...@googlegroups.com
You can build this kind of logic using the queue. I've updated the example with some simple hide/unhide code.

Peter.

To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-users+unsubscribe@googlegroups.com.

linda zhang

unread,
Apr 7, 2017, 4:18:48 AM4/7/17
to MathJax Users
my web page have much formulas in one page, the translation is from top to bottom, when the user open the page, he see that the formula that half is good and half is bad, i hope they see the page after all formulas translated . this is my problem.

linda zhang

unread,
Apr 7, 2017, 5:26:38 AM4/7/17
to MathJax Users
thank you Peter, i solved my problem, thank you !!!
Reply all
Reply to author
Forward
0 new messages