一段指定时间后隐藏层的js代码

法一:
//指定时间隐藏层
function hiddenDiv(layer, sec){
 if(sec < 1) sec = 3;
 sec = (sec<1 ? 3 : sec) * 1000;
 setTimeout(“document.getElementById(‘” + layer + “‘).style.display = ‘none’;”, sec);
}

 

法二:
function hideDiv(id){
 document.getElementById(id).style.display = “none”;
}

function delayedHide(id, time){
 var fn = function(){
  hideDiv.apply(this, [id]); 
 }
 setTimeout(fn, time);
}

delayedHide(“mydiv”, 2000);

第二种方法没有试验过,不知能否成功,大家不仿参考一下

31 thoughts on “一段指定时间后隐藏层的js代码

  1. Pingback: Dentist Anchorage AK

  2. Pingback: rubiks.glove.co.il

  3. Pingback: fun88

  4. Pingback: พนันบอล

  5. Pingback: paragnost

  6. Pingback: cbd oil

  7. Pingback: dang nhap w88

  8. Pingback: estared.net

  9. Pingback: final expense

  10. Pingback: 메이저사이트

  11. Pingback: 안전놀이터

  12. Pingback: satta king 2020

  13. Pingback: 카지노사이트

  14. Pingback: imitation Silver Hunter Pocket Watch

  15. Pingback: porn

  16. Pingback: 조커바카라

  17. Pingback: https://forumbusiness.pl/

  18. Pingback: https://zazyle.pl/

  19. Pingback: replicas used patek philippe calatrava

  20. Pingback: teaching hospitals in uganda

  21. Pingback: Fake watches

  22. Pingback: Study in Uganda

  23. Pingback: satta king

  24. Pingback: 바카라 사이트 무료 쿠폰

  25. Pingback: child porn

  26. Pingback: auto generated contents

  27. Pingback: judi online

  28. Pingback: Cannabis Oil for Sale

  29. Pingback: data keluaran hk

  30. Pingback: aprel inc. replica rolex battery replacement type

  31. Pingback: เงินด่วน ได้จริง ต่างจังหวัด สุรินทร์

Leave a Reply