5

I stuck with a problem I can not solve. You may help me.

I have different information pages and at the end is the following link:

"You may find more pictures in our <a href="ga.php#apco">GALLERY</a>"

It jumps to the gallery page and right section, but if all pictures are loaded, it jumps to top. I would like to avoid this jump up!

A part of the gallery php:

 <div class="products-section">
                 <div id="apco">Apartment Concept</div>
            <div class="products-grids">
            <div class="col-md-4 products-grid">
                <div class="gallery">
                        <a class="mask" href="../data/pic/22.jpg"><img src="../data/pic/22.jpg" class="img-responsive zoom-img" alt="/" title="Apartment"></a>
                    </div>  
            </div>

I also use jQuery because of design. Please help me and clarify the problem. I am beginner-intermediate HTML-PHP user and mostly work from templates.

Thank you!

  • You may look at this post and see if that helps: http://stackoverflow.com/questions/2835140/how-do-i-link-to-part-of-a-page-hash – Joshua G Jul 26 '15 at 18:42
  • So I don't have problem neither with the link nor with jumping to the right section. It is working, but after page fully loaded, it jumps to the top. –  Jul 26 '15 at 18:53

2 Answers2

1

I have the habit to use an anchor-tag to refer to when I want this kind of navigation. You can even nest an h1 or something else in it.

i.e.

  a(id="apco")

    h1 someText

Never failed me, I think some teacher hammered it in me a long time ago.

Hopefully it works out for you!

Atomix
  • 13,427
  • 9
  • 38
  • 46
IrateB
  • 29
  • 4
0

Delete #apco on the tag.

So,

"You may find more pictures in our <a href="ga.php">GALLERY</a>"
  • Ok, but I would like to jump to a specific part on the page. The gallery has two sections (Hotel Concept; Apartment Concept) following each-other. It is one page with simple pictures. I have two Info pages, one for hotel, one for apartment, with the link at the end shown above. #hoco and #apco. The link at the end of hotel info site should jump to hotel pictures (#hoco) at the end of apartment info site to apartment pictures (#apco) –  Jul 26 '15 at 18:49