I am very confused on how to add a button that shows up when you scroll and then onclick takes you to the top of the page again.
Here is an example of such button from the tutorial at w3school using html and css:
https://www.w3schools.com/code/tryit.asp?filename=G6H468JIUSF0
However, if I embed it in google sites with "embed" functionality it will just scroll to the top of the element and not to the top of the page.
I also tried putting html tag and linking it with :
<a name='top'></a> at the top of the page
<a href='#top'>Top</a> at the bottom
But this gives an error and redirects to :
https://524942313-atari-embeds.googleusercontent.com/embeds/16cb204cf3a9d4d223a0a3fd8b0eec5d/inner-frame-minified.html?jsh=m%3B%2F_%2Fscs%2Fapps-static%2F_%2Fjs%2Fk%3Doz.gapi.en.y5hhWjOdu80.O%2Fam%3DwQE%2Fd%3D1%2Frs%3DAGLTcCNsKzxWFhezE2KkFP7auTmVDBiNEQ%2Fm%3D__features__#top
try this
at the top of the page
<a name='top' id="top></a>
at the bottom
<a href='#top'>Top</a>
Related
I have created a responsive website (www.openlabs.ai) and under our product section I have placed a link to open a page in new tab.
The problem I am facing is that the link opens only when the browser window size is full if I make the browser/chrome window smaller and then try to open the link, nothing happens. I tried to see the problem through google chrome developer tool but I could not find any problem.
<li class="has-children">
Our Products
<ul class="dropdown arrow-top">
<li><a href="4cast/" target="_blank" class="nav-link"><span
class="text-primary">Openlabs:4Cast</span></a></li>
</ul>
</li>
When I do developers tools of chrome and try to click the the link while keeping the window smaller than full I get the following error.
main.js:228 Uncaught TypeError: Cannot read property 'top' of undefined
at HTMLAnchorElement.<anonymous> (main.js:228)
at HTMLBodyElement.dispatch (jquery-3.3.1.min.js:2)
at HTMLBodyElement.y.handle (jquery-3.3.1.min.js:2)
Looking for solution as well as interested to know the reason why it does not open if the window size is smaller, let's says half sized or on mobile.
PS: I am not a web developer.
There is a problem with a function in your main.js.
The function OnePageNavigation(); is to animate the scroll to a section when you click an anchor with hash. But, the selectors that you are using .main-menu li a[href^='#'], .smoothscroll[href^='#'], .site-mobile-menu .site-nav-wrap li a include anchors without hash, for that reason the page is not opened.
Try to remove the selector .site-mobile-menu .site-nav-wrap li a.
I just want to add a basic banner at the top of my tumblr website. The code (posted below) is just below the <body> part of the html, however I can't figure out why any img link that I put into the 'imgurlhere' section only shows up as a broken icon (see picture).
<a href=“myurlhere”><center><img src=“imgurlhere” width=“500”></center></a>
broken image icon that's showing up
My idea is to upload a short gif to tumblr, and then copy the code into the html so that it is placed at the top of my website as an advertisement. However, every url I put into the 'imgurlhere' section shows up as broken - regardless of advice I've found online stating that's all one needs to do.
I'm making sure to include the correct link, such as .png etc
And making sure to copy it straight from the 'copy image address'.
Any idea?
Thanks!
I think that setting width="500" in img tag was causing this issue.
-The best way would be to add a class and then set the width of the image.
.image{
width:500px;
}
</center>
Try using your image there and let me know if it works or not.Thank You
I have a menu on my website's homepage that is made of a scrolling div that contains all 50 states and the District of Columbia. Each state is a link to a different page.
My question is: How do I create an anchor link with the link text "Back to Top" at the end of the list of states that will automatically scroll back up to the top of the list, so mobile users don't have to use their finger to slide back up to the top of the menu once they get to the bottom? Is there a way to do this using HTML5 without any javascript?
I tried doing an anchor link inside the div like this:
<p><div id="" style="overflow: scroll; height: 200px; margin-left: 1em;"></p>
<strong id="menutop">Select Your State:</strong>
Alabama
Alaska
.
.
.
Wyoming
Back to Top
</div>
Obviously, I didn't list all the states there, but you get the idea. Anyway, that didn't work. Which is why I'm here now.
I have a named anchor situation that is working in IE but for some reason is not working in Firefox or Chrome. This set of pages is loaded within a Blogger frameset but hosted externally so I can control everything with the page's coding.
The link to the page where the issue resides is here:
http://www.gmvemsc.org/p/vdb-index.html
If you click the first link in the page titled "Main Compartment", the issue is obvious when you click on the third photo down with the tan medication boxes. Here is the code for the link:
<img src="images/pouchmain2.JPG" alt="Main Compartment Contents" width="500" height="254">
The anchor that I have just inside the body tag of the "Epinepherine" page is this:
<a id="pagetop"></a>
If you click on the photo link in IE you are taken to the top of the Epinepherine page where the named anchor resides. If you click on the photo link in Firefox or Chrome the Epinepherine page loads but the frameset stays scrolled about halfway down the page.
Is there a better way to load each page with the browser pointed to the top of the content that resides within this frame?
The problem is that the #pagetop anchor is in another frame. It is scrolled to the top, in its own frame, but the parent frame stays in scroll position.
You should try something like this:
<!-- this goes to the <head> of the <iframe> -->
<script>
// give an ID to the link, so you can do this:
document.getElementById("someID").addEventListener("click", function(e)
{
// stop the link from opening (for now)
e.preventDefault();
// scroll to the top of the page
window.scrollTo(0, 0);
// manually open the link
window.location = e.target.href;
});
</script>
Tell me if it's working!
Good evening!
I am currently developing a website which includes the Facebook Like Button. This button is located at the bottom of the page. When I click the button, the "comment" popup is displayed below the button, which extends my page. I would like to know whether (and, if so, how) it is possible to have the "comment" popup be displayed on top of the button or hide the popup permanently.
The image below depicts my problem (the horizontal white bar is supposed to be at the bottom of the page, notice how the "comment" popup extends the page).
Thank you in advance.
Without seeing the actual website, I imagine you could just use css to select that popup and set it's display property to none. However you might need to use an !important statement to override any css property being set on that popup with javascript.
Example code:
.popup {
display:none!important;
}
You can hide the popup box. Make sure your facebook like button layout type is button i.e. In your code snippet that facebook provides there should be data-layout="button"
and use this css
.fb-like{
overflow: hidden !important;
}