HTML代碼鏈接上負載插件swipebox:消防與包括散列標籤
<a id="image1" href="images/1.jpg" class="swipebox" title="My Caption">
<img src="images/1mini.jpg" alt="image" />
</a>
用於當用戶與鏈接結尾進入「#1」
<script type="text/javascript">
$(document).ready(function(){
if(window.location.hash == "#1") {
$('#image1').swipebox();
}
});
</script>
燒製普金
JS代碼我想出了,js代碼
$('#image1').swipebox();
只有當我點擊圖像。但我在頁面加載期間需要它已經被滿足了。
解釋調試代碼後不起作用。 –
我不知道如何調試。我明白'.swipebox();'調用插件,所以我做到了。當我使用鏈接#1提醒消息時,它顯示,這意味着問題與'$('#1').swipebox();' –
'id =「1」'無效。請檢查此:http://stackoverflow.com/questions/70579/what-are-valid-values-for-the-id-attribute-in-html – vijayP