The six divs rotate for parity display at intervals of one second. For example, the first 135 seconds and then 246 loops show the following question raised by A Jun in A technical group:
A Jun
The six divs rotate at intervals of one second for parity display. For example, the first 135 seconds and then 246 cycles.
A Jun
The code must be short and concise
B Jun
The Code is as follows:
Var a = document. getElementsByTagName ('P ');
Var B = false;
SetInterval (function (){
For (var I = 0; I <6; I ++)
A [I]. style. display = (I & 1) ^ B )? 'Block': 'none ';
B =! B;
},1000 );
A Jun
D Jun is very efficient.
I am not as concise as abcd.
The Code is as follows:
J ++; for (var I = 0; I <6; I ++) o [I]. style. display = [['block', 'none'], ['none', 'block'] [j & 1] [I & 1];
D Jun
Using arrays also affects Efficiency
The method of D Jun is really good after reading it. If it is true, I cannot think of such an efficient method.