سؤال

Right now when you click a portfolio item the page scrolls up and then the modal opens how can I adjust it so the page stays in the same place?

I am using bootbox.js and bootstrap 3, you can check out what Im talking about here (just scroll down to portfolio and click one of the images)

هل كانت مفيدة؟

المحلول

In your anchor <a> tags change the href attribute to javascript:void(0);, like this snippet of code.

<a href="javascript:void(0);" id="branding3">
                        <img src="img/projects/thumbs/branding3.jpg" alt="...">
                        <span class="portfolio-hover">
                          <span>
                            <h4>Synex</h4>
                            <em>Branding</em>
                          </span>
                        </span>
                    </a>

Currently you have some pound symbol (#) within your anchor tags' href in which does not point to any id attribute in your tags. That is why the page scrolls directly to the top when you click those links.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top