Created
November 20, 2011 12:36
-
-
Save Grassboy/1380228 to your computer and use it in GitHub Desktop.
突破justin 30秒限制的javscript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
window.playerHTML = /*justin flash player 的 html code (<object> tag)*/; | |
jQuery("body").html( | |
'<span style="position:absolute; left:0px; top:20px;" id="player1"></span>' + | |
'<span style="position:absolute; left:0px; top:20px;" id="player2"></span>' | |
); | |
var refreshPlayer = function(current) { | |
var other = (current == "player1" ? "player2": "player1"); | |
jQuery("#" + other).css("z-index", 10); | |
jQuery("#" + current).css("z-index", 1).html(window.playerHTML); | |
}; | |
var resetAll = function() { | |
clearInterval(window.playerTimer1); | |
clearInterval(window.playerTimer2); | |
window.playerTimer1 = setInterval(function() { | |
refreshPlayer("player1"); | |
}, | |
30000); | |
refreshPlayer("player1"); | |
setTimeout(function() { | |
window.playerTimer2 = setInterval(function() { | |
refreshPlayer("player2"); | |
}, | |
30000); | |
refreshPlayer("player2"); | |
}, | |
15000); | |
}; | |
jQuery('<input type="button" style="position:absolute; top:0px; left:0px; width:99%; " value="重新讀取" />').appendTo("body").click(resetAll); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment