Back to Top Arrow... - Post ID 280918

User 2889891 Photo


Registered User
42 posts

Good Evening,
I am using this script:

<style>
a.back-to-top {
outline: 0;
display: none;
width: 60px;
height: 60px;
text-indent: -9999px;
position: fixed;
z-index: 999;
right: 20px;
bottom: 20px;
background: #000000 url("up-arrow.png") no-repeat center 43%;
opacity: 1.0;
-webkit-border-radius: 0px;
-moz-border-radius: 0px;
border-radius: 0px;
}
</style>
<script type="text/javascript">
$('body').prepend('<a href='./index-arrow/up-arrow.png' class="back-to-top">Back to Top</a>');
</script>
<a href='./index-arrow/up-arrow.png' class="back-to-top">Back to Top</a>



However,
When I use this <a href> './index-arrow/up-arrow.png' it doesn't work, I just get a black box, nothing else. Any suggestions?

The website URL is www.xtremepaintball.com.au

Thank you, All
Benjamin
Two Coffee Snobs
Benjamin Davis
Developer | Consultant | Marketing

m: 0415 400 416
w: www.twocoffeesnobs.com.au
e: info@twocoffeesnobs.com.au
User 122279 Photo


Senior Advisor
14,547 posts

Does it become visible if you change the 'display: none;' to something else?
Or if you create a folder 'img' and pop it in there? (shouldn't make any difference, but you never know... I tried it, and it worked here.)
If you can't make it work, try adding a font-icon instead. Search for 'arrow-up'. You can change the colour of it to anything you like.
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 244626 Photo


Registered User
811 posts

I do not even see a folder in your structure named index-arrow for the up-arrow.png to be in ? FTP error ?
Bootstrap 5 CSS Grid.
User 283347 Photo


Registered User
388 posts

hhmmmm...try this.... where you have...
background: #000000 url("up-arrow.png") no-repeat center 43%; ....change it to #000000FF

or you could try to change:
opacity: 1.0;...to 0.0;

Try one, if it doesnt work, try the other...then both if needed. Just a thought.

MJ
User 122279 Photo


Senior Advisor
14,547 posts

I overlooked this earlier, but this line:
background: #000000 url("up-arrow.png") no-repeat center 43%;

is telling the browsers that the up-arrow image is in the same folder as the page it is going to be displayed on. You need to be consistent in the path to the image. Find out where it is located, and make the path accordingly.

As you see, we are just making half-qualified guesses here. It would have been much better if you had posted your project file, then we would have found the error within no-time (nearly ;) )
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com


User 187934 Photo


Senior Advisor
20,239 posts

Try this
$('body').prepend('<a href="./index-arrow/up-arrow.png" class="back-to-top">Back to Top</a>');
I can't hear what I'm looking at.
It's easy to overlook something you're not looking for.

This is a site I built for my work.(RSD)
http://esmansgreenhouse.com
This is a site I built for use in my job.(HTML Editor)
https://pestlogbook.com
This is my personal site used for testing and as an easy way to share photos.(RLM imported to RSD)
https://ericrohloff.com

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.