This topic contains 15 replies, has 2 voices, and was last updated by  Kharis Sulistiyono 3 years, 1 month ago.

href to a bookmark in another page

  • Hi,

    How can I href to a bookmark from the current active page (let’s say Research) to another page (let’s say a bookmark in Publications) in the one-page format? it doesn’t work if the bookmark is another page. I wish the destination page to pop to front and the focus goes to the bookmark.

    Thanks!
    Mehrtash

    Hello there,

    Thank you for getting in touch.

    I’m sorry I can’t catch your point.

    I would be happy to take care of this for you. Could you please post a screenshot which represents your explanation? Please also post your URL here.

    Regards,
    Kharis

    Dear Kharis,

    Thanks for your reply. I haven’t uploaded my page yet and I’m afraid the screenshot is of no help. Let me give it another try:

    Suppose you put my projects somewhere in the About Me page. You would expect the browser to bring up the projects page when you click on the link in the same way that clicking on Projects on the navigation menu does. However, this doesn’t happen and in fact, it completely ruins the layout. I don’t know enough bootstrap to fix this myself, but one wants to basically replicate the behavior of clicking on the menu items.

    Cheers,
    Mehrtash

    Hello there,

    Thank you for the very detailed explanation. It helped me a lot.

    In order to achieve that objective, could you please try to do the following?

    1. Replace custom.js with the attached one
    2. Use the following link format to make it behaves like left navigation

    < a class="inline-nav" href="#publications">Publications< / a >
    

    Let me know how it goes. I’ll wait to hear back from you regarding your stats.

    Regards,
    Kharis

    Attachments:
    You must be logged in to view attached files.

    Fantastic! it works! :) however, I still can not get it to do one other thing: what if I wanted to navigate to a reference inside the target page? Let’s say, I want to give a reference to one of my papers which in Publications, but the current page is Research. Is it easily doable?

    Thank you very much for your time!

    Cheers,
    Mehrtash

    ps> one way to do this is to take a secondary argument:


    Publications which="paper10"

    … and update $(‘#navigation li:not(.external) a, a.inline-nav’).click(function(e){… accordingly to scroll to #paper10. I don’t know enough .js to do that though :-/

    ps> I also tried adding “window.location.hash = ‘#’+$li.attr(‘which’);” after your “switch (currentPosition){…}”. In principle it should work but the layout gets screwed up again. I think it doesn’t wait enough for the page sliding animation to finis.

    Hello there,

    Could you please try to update custom.js with the attached one?

    Then add stays-in-current class name to your link

    < a class="inline-nav stays-in-current" href="#teaching">Teaching < /a >
    

    Make sure there’s no nav menu item has the same href target as above.

    I hope this is what you’re looking for. Otherwise, I’ll wait to hear back from you regarding your stats.

    Regards,
    Kharis

    Attachments:
    You must be logged in to view attached files.

    Dear Kharis,

    Thanks a lot for your time, but I’m afraid this doesn’t do what I wanted. Let me try to explain again:

    Assume we have a bookmark in the Publications page, let’s say to one of my papers:


    <h4 class="pubtitle" id=”paper10″>Title of the paper</h4>

    I want to be able to href to that bookmark from the Research page. The expected behavior would be:

    1. Bring the Publications page to the front.
    2. Scroll down to the paper in question.

    Thank you!
    Mehrtash

    Dear Mehrtash,

    Thank you for your report and explanation.

    Could you please try to use the following link format in publication section?

    < a href="#paper10">Go to Paper 10</ a>
    

    Let me know how it works for you.

    Regards,
    Kharis

The topic ‘href to a bookmark in another page’ is closed to new replies.