2013-04-23 84 views
0

這是我第一次在這裏發帖。從其他頁面致電Href

我的網站有一個用HTML5編寫的投資組合頁面。在頁面上,我有多個HTML鏈接到不同的畫廊。

<a href="#II">

這大概調用

<article class="col2 pad_left1 tab-content" id="II"> <ul class="gallery">

如何直接調用從另一個頁面的HTML鏈接每家畫廊?

感謝,

格雷森

回答

2

通過前面加上其他頁面的URL到href值:

<a href="http://foo/other-page#middle">Foo</a> 
0

你把A HREF在你的鏈接像你一樣。該網址看起來像:www.example.com#hrefYouPut。在準備好文檔之後,您可以執行if子句:

var hash = window.location.hash; 
    if (hash == "#hrefYouPut") { 
     //my gallery pops up in here 
    }