0
我有5幀的滑塊,並且每個幀具有10層我隨機通過該功能選擇2層隨機選擇元素,並刪除其他
function randomslide(slide){
var divs = $(slide).get().sort(function(){
return Math.round(Math.random())-0.5;}).slice(0,1)
$(divs).show();
};
可以可能的是,該功能除去其它層是不選擇從DOM 中刪除,以防止額外加載8 * 5 = 35層。
謝謝,但沒有奏效 –
不刪除它從索引2層到最後?或者它確實刪除,但刪除不是你所需要的? – vdavid
我希望頁面加載html時不加載未選擇的幻燈片我想要的功能在我的網頁開始獲取圖像之前刪除圖層 –