Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

Having to click twice on links to places within the same page

 
Greenhorn
Posts: 9
PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!

For some reason, I have to click twice per link in order to get to another place within the same page (at least when I preview the page using Brackets and Chrome). Here's an example of my code:

<body>
       <a name="top"></a>
...

<tr>
    <td colspan="2">
          <h2><a href="#top">Back to top</a></h2>
    </td>
</tr>

Does anyone know why this is happening and/or how to fix it? There is CSS linked to this page, too, by the way.

Thanks!
 
Sheriff
Posts: 67389
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Brackets?

Does the page have focus before you click the first time? If not, the first click moves focus to the page, the second actually performs the click.
 
B. Jonsson
Greenhorn
Posts: 9
PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, Bear,

Yes! That is exactly what is happening on my page: first it seems to focus, then it actually takes the user to the location. Is there a way to skip the focus part?

Brackets is just the text editor I'm using: brackets.io.

Thank you,
Brenda
 
Ranch Foreman
Posts: 97
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Brenda Anne wrote:Is there a way to skip the focus part?


Using a proper editor not also running in your browser but on its own. Then, when you switch from your editor to your browser you already do the context and focus switch.
Keep in mind that when ever you develop websites everytime you changed something you have to refresh the page to get the new version.
 
Bear Bibeault
Sheriff
Posts: 67389
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Brenda Anne wrote:Is there a way to skip the focus part?


No. And remember that this is the way it works for everyone, so not sure why you think that this is a problem. Just like you need to focus to the page before you can start typing into it.
 
B. Jonsson
Greenhorn
Posts: 9
PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, if it's standard for everyone, I guess it's not a big deal. Thanks!
 
You would be much easier to understand if you took that bucket off of your head. And that goes for the tiny ad too!
Two software engineers solve most of the world's problems in one K&R sized book
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic