2012-04-01 2 views
0

私はCodeigniterで動作しているサイトを持っており、リンクを介してページの要素にリンクしようとしていますが、リンクをクリックするとページがリロードされますその要素に移動する代わりに。Codeigniterは新しいページロードなしでID'd要素にリンクできません

<li> 
    <a href="#image-0001"> <img alt="image0001" src="/assets/images/portfolio/photography/thumbs/0001.jpg" /> 
<span>Pointe</span> </a> 
    <div class="lb-overlay" id="image-0001"> 
     <img alt="image01" src="/assets/images/portfolio/photography/full/0001.jpg" /> 
      <div> 
       <h3>pointe <span>/point/</span></h3> 
       <p>Dance performed on the tips of the toes</p> 
      </div> 
     <a class="lb-close" href="#page">x Close</a> 
    </div> 
</li> 

CSSアニメーションをトリガーする代わりに、サイトルート(localhost /#image-0001)に移動します。

これを修正する方法はありますか?

+0

. For example 'image01 'を使用して、目的地にもリンクを作成する必要があります。 – slashingweapon

答えて

0

アンカーを使用してページを移動するには、ターゲットアンカーにhrefではなく名前を付ける必要があります。例:

<a name="top" /> <!-- this is the target --> 
<p>Some really long content</p> 
<a href="#top">Go To Top</a> <!-- this goes to the target --> 

これはCodeIgniter固有のものではなく、基本的なHTMLです。

関連する問題