To open popup modal based on the box position

前端 未结 1 1574
面向向阳花
面向向阳花 2020-12-07 06:16

I want the popup modal opening where the box is .For the top 2 boxes placed the modal opens correctly , I was trying for the last 2 boxes placed at bottom as well.



        
相关标签:
1条回答
  • 2020-12-07 07:01

    try to use your variable with getBoundingClientRect, little example, change:

    this.modelstyle {
        top: 0 + px;
      ...here other your code...
    }
    

    to

    this.modelStyle {
       top: x.top + window.scrollY + 'px',
    ...here other your code...
    }
    
    0 讨论(0)
提交回复
热议问题