In an article: Feel pig the bottom left corner of the text scrolling, the effect is good, their own groping a bit, to their own way to achieve!
Have this effect, but the impact is not big. The impact of the demo is big!
People on the internet have seen such a problem look at the following post address:
A problem with Firefox 6 under SetInterval
There were a lot of people in the discussion, but no answers came out.
I don't know what to think!
Today, the sudden epiphany, may be the concept of thread, but the specific reasons still do not understand, I hope someone understand its original should be told, very grateful!
The black div in the Demo is not affected by the browser tab switch
And the red Div will be affected.
Html:
Copy Code code as follows:
<div id= "Move" style= "Position:absolute; width:100px; height:100px; top:0pt; left:0pt; Background:none repeat scroll 0% 0% #000000; z-index:999; Color: #ffffff; > I am not affected by browser tab switching! Hoooo</div>
<div id= "Move2" style= "Position:absolute; width:100px; height:100px; top:0pt; left:0pt; Background:none repeat scroll 0% 0% red; z-index:999; Color: #ffffff; > I am affected by browser tab switching! 5555</div>
Javascript:
Copy Code code as follows:
(function () {
var elem = Meng.getid (' move '),
ELEM2 = Meng.getid (' move2 '),
pos = meng.getelemviewposition (Elem),
view = Meng.getbrowserview (),
Gray Block Motion function
move = function () {
var T1 = meng.animate (Elem,{top:0,left:0},{top:view.height-100,left:view.width-100},3000,function () {
var t2 = meng.animate (Elem,{left:view.width-100},{left:100-view.width},3000,function () {
var t3 = meng.animate (Elem,{top:view.height-100},{top:100-view.height},3000,function () {
Move ()//To make sure that when the T3 is finished, I'll back up the moves () function.
});
});
});
};
Move ();
Red Block motion function
Meng.setstyle (elem2,{top:0,left: (view.width-100) + ' px '});
var move2 = function () {
var T1 = meng.animate (Elem2,{top:0,left:view.width-100},{top:view.height-100,left:100-view.width},3000,function () {
var t2 = meng.animate (Elem2,{top:view.height-100},{top:100-view.height},3000,function () {
var t3 = meng.animate (Elem2,{left:0},{left:view.width-100},3000,function () {
});
});
});
};
Move2 ();
SetInterval (function () {move2 ();},9050);
Red Block motion function
})();