Getting rid of code image

  • 1
  • Question
  • Updated 7 years ago
  • Answered
My site:

Go to www.mcran.com and then click on In Transition Archives. You will see an alphabet list with a red dot at the top.

How can I get rid of the Red dot image that appears and only have the text, Back To The Top so that when I click Back to the Top it will bring me to the very top of the page?




<style type="text/css">

#topbar{
position:absolute;
border: 0px solid black;
padding: 2px;
background-color: red
width: 20px;
visibility: hidden;
z-index: 100;
}

</style>

<script type="text/javascript">

/***********************************************
* Floating Top Bar script- © Dynamic Drive (www.dynamicdrive.com)
* Sliding routine by Roy Whittle (http://www.javascript-fx.com/)
* This notice must stay intact for legal use.
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/

var persistclose=0 //set to 0 or 1. 1 means once the bar is manually closed, it will remain closed for browser session
var startX = 90 //set x offset of bar in pixels
var startY = 20 //set y offset of bar in pixels
var verticalpos="fromtop" //enter "fromtop" or "frombottom"

function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function get_cookie(Name) {
var search = Name + "="
var returnvalue = "";
if (document.cookie.length > 0) {
offset = document.cookie.indexOf(search)
if (offset != -1) {
offset += search.length
end = document.cookie.indexOf(";", offset);
if (end == -1) end = document.cookie.length;
returnvalue=unescape(document.cookie.substring(offset, end))
}
}
return returnvalue;
}

function closebar(){
if (persistclose)
document.cookie="remainclosed=1"
document.getElementById("topbar").style.visibility="hidden"
}

function staticbar(){
barheight=document.getElementById("topbar").offsetHeight
var ns = (navigator.appName.indexOf("Netscape") != -1) || window.opera;
var d = document;
function ml(id){
var el=d.getElementById(id);
if (!persistclose || persistclose && get_cookie("remainclosed")=="")
el.style.visibility="visible"
if(d.layers)el.style=el;
el.sP=function(x,y){this.style.left=x+"px";this.style.top=y+"px";};
el.x = startX;
if (verticalpos=="fromtop")
el.y = startY;
else{
el.y = ns ? pageYOffset + innerHeight : iecompattest().scrollTop + iecompattest().clientHeight;
el.y -= startY;
}
return el;
}
window.stayTopLeft=function(){
if (verticalpos=="fromtop"){
var pY = ns ? pageYOffset : iecompattest().scrollTop;
ftlObj.y += (pY + startY - ftlObj.y)/8;
}
else{
var pY = ns ? pageYOffset + innerHeight - barheight: iecompattest().scrollTop + iecompattest().clientHeight - barheight;
ftlObj.y += (pY - startY - ftlObj.y)/8;
}
ftlObj.sP(ftlObj.x, ftlObj.y);
setTimeout("stayTopLeft()", 10);
}
ftlObj = ml("topbar");
stayTopLeft();
}

if (window.addEventListener)
window.addEventListener("load", staticbar, false)
else if (window.attachEvent)
window.attachEvent("onload", staticbar)
else if (document.getElementById)
window.onload=staticbar
</script>

<div id="topbar">
<a href="" onClick="(); return false"><img src="http://sd.mcran.com/assets/pictures/reddot.jpg" />Back to top</a>
<br/><br/>

<a href="#a">A</a><br/>
<a href="#b">B</a><br/>
<a href="#c">C</a><br/>
<a href="#d">D</a><br/>
<a href="#e">E</a><br/>
<a href="#f">F</a><br/>
<a href="#g">G</a><br/>
<a href="#h">H</a><br/>
<a href="#i">I</a><br/>
<a href="#j">J</a><br/>
<a href="#k">K</a><br/>
<a href="#l">L</a><br/>
<a href="#m">M</a><br/>
<a href="#n">N</a><br/>
<a href="#o">O</a><br/>
<a href="#p">P</a><br/>
<a href="#q">Q</a><br/>
<a href="#r">R</a><br/>
<a href="#s">S</a><br/>
<a href="#t">T</a><br/>
<a href="#u">U</a><br/>
<a href="#v">V</a><br/>
<a href="#w">W</a><br/>
<a href="#x">X</a><br/>
<a href="#y">Y</a><br/>
<a href="#z">Z</a><br/>
</div>

Photo of Randy

Randy

  • 643 Posts
  • 8 Reply Likes
  • puzzled

Posted 7 years ago

  • 1
Photo of Randy

Randy

  • 643 Posts
  • 8 Reply Likes
I solved my problem. Now works the way I want it to.
Photo of Brianna

Brianna

  • 2045 Posts
  • 92 Reply Likes
Glad to hear you got it working, Randy!
Photo of Randy

Randy

  • 643 Posts
  • 8 Reply Likes
Actually if you take a look at my In Transition Archives page you will see that I also added a floating menu of my nav bar as well.
Photo of Brianna

Brianna

  • 2045 Posts
  • 92 Reply Likes
Awesome, Randy! That will be so helpful, especially when your customers are looking for an exact artist or want to hop back to the top when they are near the end of your page.
Photo of Randy

Randy

  • 643 Posts
  • 8 Reply Likes
Thanks Brianna!

I am always looking for easier more effective ways for visitors to my site to get around. Sometimes I really have to think things through but once I come across something that I think will make life easier for my visitors, I go with that.