Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extra spaces in front of link to pop-up 1

Status
Not open for further replies.

harrymossman

Technical User
Sep 5, 2002
255
US
I know absolutely nothing about javascript.

I am building a web site for a branch of our office.

The person in charge wants definitions to pop up in small boxes. It seems like javascript is the way to go.

The site has to be accessible.

I got some code from It works perfectly, except that there is extra space in front of links. E.g.,
Code:
focuses on <a href="glossary/anadromous.htm" rel="popup standard 500 400">anadromous fishes</a>

This comes out like "focuses on anadromous fishes." It only happens when javascript is enabled.

Why is this happening? Or, can you give me an alternative? If so, you will need to spell it out, because I don't know anything about javascript.

Harry
 
I'm guessing that you are adding a padding to the anchor because of the script you downloaded and not putting an image where the space is created.
Code:
// add popup indicator
  if (popups[i].rel.indexOf("noicon")==-1)
  //more of the 'no icon' thing in a moment ...
   {
   [!]popups[i].style.backgroundImage = "url(pop-up.gif)";[/!]
   popups[i].style.backgroundPosition = "0 center";
   popups[i].style.backgroundRepeat = "no-repeat";
   [!]popups[i].style.paddingLeft = "15px";[/!]

Are you getting an icon on your screen before each anchor??

[monkey][snake] <.
 
No, I am not using an icon. I removed those 2 lines. Works perfectly.

Thanks,
Harry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top