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.
 
 
 
 
 

52 lines
1.5 KiB

  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. //alert(1)
  20. $(".productone").on("click",function(ev){
  21. if(ev.target.className=="prhnameb"){
  22. window.scrollTo(0,0);
  23. var H=document.documentElement.clientHeight;
  24. var H=H+300;
  25. detailsone.style.height=H+"px";
  26. detailsone.style.display="block";
  27. detailsone.addEventListener("touchmove",function(e){
  28. e.preventDefault();
  29. },false);
  30. detailcontent.innerHTML="产品1详情";
  31. ev.stopPropagation();
  32. ev.preventDefault();
  33. }
  34. })
  35. pd2.onclick=function (){
  36. console.log(1)
  37. window.scrollTo(0,0);
  38. var H=document.documentElement.clientHeight;
  39. var H=H+300;
  40. detailsone.style.height=H+"px";
  41. detailsone.style.display="block";
  42. detailsone.addEventListener("touchmove",function(e){
  43. e.preventDefault();
  44. },false);
  45. detailcontent.innerHTML="产品2详情";
  46. }
  47. x.onclick=function (){
  48. detailsone.style.display="none";
  49. }