我創建了一個點擊以在我客戶的某個網站上顯示選項。那裏工作完美。 其各自的代碼如下。外部鏈接無法正常工作html/javascript
<style>
a{padding:0;margin:0;color:#009cbb;font-weight:bold;text-decoration:none;}
</style>
<p>
<div><a href="#welcome" onclick="toggle_visibility('welcome');">Welcome</a></div>
<div id="welcome" style="display:none;">This is test</div>
<div><a href="#focus" onclick="toggle_visibility('focus');">Focus</a></div>
<div id="focus" style="display:none;">This is test2
</div>
<div><a href="#cataracts" onclick="toggle_visibility('cataracts');">Cataracts</a></div>
<div id="cataracts" style="display:none;">This is test2
</div>
</p>
<script type="text/javascript">
function toggle_visibility(id) {
var e = document.getElementById(id);
if(e.style.display == 'block')
e.style.display = 'none';
else
e.style.display = 'block';
}
</script>
當我從外部友情鏈接test1的它應該顯示test1的,密切的其他2,但問題是,當我點擊它顯示了它們作爲封閉的鏈接。
的鏈接代碼是
<a href="http://website.com/page.php#welcome" style="color:#009bd9;text-decoration:none;">Read More ></a>
請幫助我,當有人點擊閱讀更多顯示歡迎信息開放和他人關閉。
由於
感謝您的快速反應兄弟,對不起,沒有奏效。 – Bangash
您是否嘗試過我的答案? – Merlin