override overflow:hidden with z-index

前端 未结 6 1429
误落风尘
误落风尘 2021-01-11 13:41

Am using coda_bubble jquery plugin, and i need to make my bubble pop out within an overflow hidden div. here is my sample code.



<         


        
6条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-11 14:15

    I would calculate the offset position from the window, remove it from its parent and attach it to the body.

    Eg:

    var left, top;
    left = jQuery(element).offset().left;
    top = jQuery(element).offset().top;
    jQuery(element)
      .appendTo('body')
      .css({
        'position': 'absolute',
        'left': left + 'px',
        'top': top + 'px'
      });
    

提交回复
热议问题