2014-01-08 208 views
0

我想調整下面的代碼片段的高度。目前,當彈出窗口出現在下面的JS代碼中時,它被我們網站上的另一個元素隱藏,所以我想增加下面的代碼元素的高度,以便它高於其他元素。調整JS元素的高度

該代碼目前位於outpostmagazine.com上,您可以看到人們無法單擊提交,因爲彈出窗口位於共享欄後面。

<!-- Qualaroo for outpostmagazine.com --> 
<!-- Paste this code right after the <body> tag on every page of your site. --> 
<script type="text/javascript"> 
    var _kiq = _kiq || []; 
    (function(){ 
    setTimeout(function(){ 
    var d = document, f = d.getElementsByTagName('script')[0], s = d.createElement('script'); s.type = 'text/javascript'; 
    s.async = true; s.src = '//s3.amazonaws.com/ki.js/51645/a-r.js'; f.parentNode.insertBefore(s, f); 
    }, 1); 
    })(); 
</script> 

回答

0

調整該元素下邊距與CSS似乎是一個不錯的選擇,但如果用戶點擊側邊欄的箭頭,使其垂直,這樣http://cl.ly/TFqL

你有一定的差距嘗試在js代碼之前添加這個:

<style type="text/css"> 
    html div#ki_container { 
     margin-bottom: 35px; 
    } 
</style> 
+0

好了,所以它看起來像我應該插入; _kiq.push(['options',{bottom:20}]); 但我不知道在哪裏插入它? – user3175043

+0

您需要將其直接添加到CSS中,而不是作爲選項。讓我再看看這個網站,很快就會回覆你。 –

+0

檢查我編輯的答案。 –

0

我認爲這不是一個JS問題。這是一個CSS問題。我使用Chrome檢查了您的網頁。

只要你只是這個屬性添加到您的CSS的DIV#ki_container:

html div#ki_container { 
margin-bottom: 40px; 
(...) 
} 

如果您可以訪問此工具欄的CSS(如果你是Qualaroo)添加它直接出現。如果沒有,你可以在你自己的css文件中覆蓋它。 它會解決你的問題,並顯示你的容器上方的其他共享按鈕,你將能夠點擊「發送」按鈕。

+0

好的,所以它看起來像我應該插入: _kiq.push(['options',{bottom:20}]); 但我不知道在哪裏插入它,你能指示我在哪裏插入這個? – user3175043

+0

檢查兩個答案,使用js函數或css部分設置保證金底部值。 –

+0

這兩個似乎都沒有工作? – user3175043

0

好,加上這部分腳本:

(function addMarginBottom() { 
    var container = document.getElementById('ki_container'); 
    container.style.marginBottom = '40px'; 
})(); 

事情是這樣的:

<!-- Qualaroo for outpostmagazine.com --> 
<!-- Paste this code right after the <body> tag on every page of your site. --> 
<script type="text/javascript"> 
    var _kiq = _kiq || []; 
    (function(){ 
    setTimeout(function(){ 
    var d = document, f = d.getElementsByTagName('script')[0], s = d.createElement('script'); s.type = 'text/javascript'; 
s.async = true; s.src = '//s3.amazonaws.com/ki.js/51645/a-r.js'; f.parentNode.insertBefore(s, f); 
    }, 1); 
})(); 



(function addMarginBottom() { 
    var container = document.getElementById('ki_container'); 
    container.style.marginBottom = '40px'; 
})(); 

</script> 
+0

謝謝,我試過上面的修改,它似乎沒有工作。 – user3175043

+0

問Qualaroo的傢伙爲你添加該css屬性值。 html div#ki_container { margin-bottom:40px;} –

+0

我真的不能這樣做,因爲它是一個免費服務,他們向我提供了初始代碼 - 他們告訴我答案是插入 _kiq。 push(['options',{bottom:20}]); 代碼,但我不知道在最初的代碼插入它的哪一點。 – user3175043

相關問題