這是有可能在Flash中相當容易完成,但鑑於趨勢正在從閃存中移除,因此在html 5中執行它是有意義的.HTML 5的方式可以做到這一點,這可能很有趣,可以在html 5畫布中實現。
鑑於這些都不感興趣,採取你現在有什麼,它似乎是一個好主意,開始在JavaScript中的一種計時器,計時器將調用一個函數,遍歷李的和移動他們下來...
例如
var t=setTimeout("moveListItems()", 500); // just adjust the time in milliseconds to make
// it faster or slower.
function moveListItems() {
// place move list items code here
//probably a call to update the css "top"
$('#horiz_container li').each(function() {
alert(index + ': ' + $(this).text());
var newtop = $(this).position().top + 250;
$(this).css('top', newtop + 'px');
//check if the top is too low then reset to top to the top of the container
});
}
當心:未測試
您可能需要調整它一下,讓李的絕對因此他們,因爲他們招不搞砸了佈局,但這就是我如何去做的。如果我再做了,那麼我會犯一個違反黑客精神的犯罪行爲。玩的開心!
你面臨什麼問題? – codef0rmer 2012-04-20 06:52:42