FloorClick.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. //创建楼层选择器
  2. function creatFloorChoose() {
  3. var floorsign =
  4. `<div id="floorChooseDiv" class="showFloorBtn">
  5. <div value='close' onclick="handleSide()" class ="closeIocn" id='rightSideSwitch'></div>
  6. </div>`;
  7. $('#div2d').append($(floorsign));
  8. var car = app.query(".Floor")
  9. var html = ``
  10. for(let i = 0 ; i < car.length; i++){
  11. html +=
  12. `
  13. <div onclick="floorclick('${car[i].id}')" class = "showFloorBtns" id='${car[i].id}'>${car[i].id}</div>
  14. `
  15. }
  16. $('#floorChooseDiv').append($(html));
  17. $('head').append($(`
  18. <style>
  19. .showFloorBtns{
  20. margin-bottom:6px;
  21. border:1px solid rgb(24,118,208);
  22. border-radius:4px;
  23. text-align:center;
  24. height:28px;
  25. line-height:28px;
  26. width:40px;
  27. color:rgba(255,255,255,0.5);
  28. background-color:rgba(24,144,255,0.3);
  29. // display:inline-block;
  30. }
  31. .showFloorBtn{
  32. position: absolute;
  33. // top:10px;
  34. top:calc(2%);
  35. right:-52px;
  36. // height:800px;
  37. width:50px;
  38. border-radius:0px;
  39. margin-top:0px;
  40. }
  41. .closeIocn{
  42. // margin-bottom:6px;
  43. // border:1px solid rgb(24,118,208);
  44. border-radius:4px;
  45. text-align:center;
  46. height:30px;
  47. line-height:28px;
  48. width:40px;
  49. color:rgba(255,255,255,0.5);
  50. background-image: url(https://s3.ax1x.com/2021/01/29/yCR8dP.png);
  51. background-repeat:no-repeat;
  52. background-position:center center;
  53. position: absolute;
  54. top: calc(50%);
  55. left: -35px;
  56. }
  57. .active{
  58. background-color:red;
  59. }