You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

34 lines
1018 B

  1. var detailsone=document.getElementById('detailsone');
  2. var pd1=document.getElementById('pd1');
  3. var pd2=document.getElementById('pd2');
  4. var x=document.getElementById('x');
  5. var detailcontent=document.getElementById('detailcontent');
  6. // var body=document.getElementsByTagName('body');
  7. pd1.onclick=function (){
  8. console.log(1)
  9. window.scrollTo(0,0);
  10. var H=document.documentElement.clientHeight;
  11. var H=H+300;
  12. detailsone.style.height=H+"px";
  13. detailsone.style.display="block";
  14. detailsone.addEventListener("touchmove",function(e){
  15. e.preventDefault();
  16. },false);
  17. detailcontent.innerHTML="产品1详情";
  18. }
  19. pd2.onclick=function (){
  20. console.log(1)
  21. window.scrollTo(0,0);
  22. var H=document.documentElement.clientHeight;
  23. var H=H+300;
  24. detailsone.style.height=H+"px";
  25. detailsone.style.display="block";
  26. detailsone.addEventListener("touchmove",function(e){
  27. e.preventDefault();
  28. },false);
  29. detailcontent.innerHTML="产品2详情";
  30. }
  31. x.onclick=function (){
  32. detailsone.style.display="none";
  33. }