h5-intercom 样式调整问题

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

<script>
function addNewStyle(newStyle) {
var styleElement = document.getElementById('styles_js');
if (!styleElement) {
styleElement = document.createElement('style');
styleElement.type = 'text/css';
styleElement.id = 'styles_js';
document.getElementsByTagName('head')[0].appendChild(styleElement);
}
styleElement.appendChild(document.createTextNode(newStyle));
}
addNewStyle('#intercom-container .intercom-messenger-frame>iframe{top:10% !important;}')
addNewStyle('#intercom-container .intercom-messenger-frame>iframe{position:absolute !important;}')
addNewStyle('#intercom-container .intercom-app div.intercom-messenger-frame iframe{height:90% !important;}')

</script>

其实很简单 就是找到合适的class 给他赋予样式
ps:一定要写在layout里面 才能全局通用