I have a header menu in my web page, inside the menu I have sections and subsections, one of the subsections will jump me to the position where the section is in the home page
for this I am using react router hash
import { HashLink as Link } from 'react-router-hash-link';
<Link to="/#map-section">
Section of home page
</Link>
this works if I am in the current page where the section I want to jump is, but it doesnt work at all when I am in another page and I wanna go to the main page and then jumping to the section.
I am guessing that component where the section is has not finished loading when i am trying to get there. Is there any way to manage this?
Please check below codesandbox.
It worked.
https://codesandbox.io/s/zen-swartz-59rj4
Related
I have two html files; index.html and registrationform.html.
index is the main form having the website navbar that I want fixed at the top as I move to registrationform page or any other page.
how do I go about it in html?
You can do it using the css with position: fixed; the top bar will be reloaded for each page but will stay at the same position.
If you do want to load this top bar only on the first load, you can use ajax to only reload the main content of the page or in a more modern using a JS framework like Vue or React to build a Single Page Application (SPA).
I am building a website and when I click on one of my header's page links, it loads the whole page again, rather than preserving the header and only loading the main content. For example:
When you click on a button on the sidebar of YouTube, it will, for example, load the watch later playlist, and preserve the search bar and sidebar. How would I go about doing this on my website?
Have a look at using aJax. This should resolve your issue.
I've installed mediawiki 1.22.5 and I've tried to change the main page through the Mediawiki:Mainpage url to another page but It doesn't seem to work!
What I do is edit the http://www.mysite.com/en/index.php?title=MediaWiki:MainPage and write in the text window the name of the page I want as the main page (I've even copied/pasted it to make sure it is written correctly!). However when I click on the logo it takes me to the default main page, not the one I wrote in Mediawiki:Mainpage.
I can change the main page link in the side-bar but the problem with the logo remains.
And I don't want to create just a redirect as it is not elegant on the main page.
Any help is appreciated!
MediaWiki:MainPage should change also the target of the logo link. If it doesn't, my first guess would be extensive caching.
Is your wiki public? Can you provide us with an url?
I'm trying to do something that I thought would be really simple but I can't make it work.
My bookmark anchors work fine if I'm on the home page but the same links in the header of my page don't work if the # part refers to the home page:
Some Link Text
It works if I have some sort of page name, but doesn't work for the home page. (i.e. this works: Some Link Text)
Of course if the href is just / it works fine.
So how the heck does one link to a bookmark in the home page from another page?
Thanks!
I have links and tabs on my home page of my portfolio, and links to others sites in my tabs, but the correct frame of the url does not change to the new url.
example page
http://www.mydomain.com/ is the home page, but when I navigate to new links the URL bar shows the home frame still, even though the links take the user to a new site.
How can I fix this in html, php, or javascript
To cause a link to load in the top level frame set the target of the link to "_top"
My Link
See the W3Schools Documentation