2017-08-29 75 views

回答

0

您無法操作iframe。如果我處於你的位置,並且改變按鈕樣式是必須的,那麼我會「欺騙」自己的方式,將你想要的樣式放在一個html框中(隱藏它)。然後,您可以將pointer-events:none添加到您的元素,以便下面的iframe按鈕可點擊。

在這裏你有一個例子與你的iframe:

#as-container-150399376720884 { 
 
    position:relative; 
 
} 
 
.myButton { 
 
    height:48px; 
 
    width:126px; 
 
    background-color:red; 
 
    color:#fff; 
 
    text-align:center; 
 
    line-height:48px; 
 
    pointer-events:none; 
 
    position:absolute; 
 
    left: 375px; 
 
    top: 0px; 
 
}
<div id="as-container-150399376720884" style="width: 100%; height: 64px;"> 
 
    <iframe id="as-150399376720884" frameborder="0" scrolling="no" src="https://button.aftership.com/button_widget.html?&amp;size=large&amp;id=150399376720884&amp;slug=&amp;width=500px&amp;hide_tracking_number=false&amp;tracking_number=&amp;responsive=true&amp;origin=https%3A%2F%2Fwww.aftership.com%2Ffeatures%2Ftrack-button&amp;domain=track.aftership.com" 
 
    style="width: 100%; overflow: hidden; border: 0px; max-width: 500px; height: 64px;"></iframe> 
 
    <div class="myButton">MY button</div> 
 
</div>