• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to stop jumping to top of page after clicking a link

Participant ,
Dec 03, 2017 Dec 03, 2017

Copy link to clipboard

Copied

As my head says how can I stop this annoying behavior?

An example of my code:

<a href="#" onClick="MM_openBrWindow('winning_moves_stts/groot.html','','width=320px,height=200px')" onMouseOver="MM_swapImage('Groot','','images/stts/draxback.gif',1)" onMouseOut="MM_swapImgRestore()"><img id="Groot" src="images/stts/groot.gif" alt="Groot"></a>

Thank you in advance!

Views

4.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 04, 2017 Dec 04, 2017

Have you try adding a return false, at the end of the click listener... ?

that way

<a href="#" onClick="MM_openBrWindow('winning_moves_stts/groot.html','','width=320px,height=200px'); return false;" onMouseOver="MM_swapImage('Groot','','images/stts/draxback.gif',1)" onMouseOut="MM_swapImgRestore()">

Votes

Translate

Translate
Community Expert ,
Dec 03, 2017 Dec 03, 2017

Copy link to clipboard

Copied

<a href="#"

You could give your href a valid URL and ID on the target page.

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 03, 2017 Dec 03, 2017

Copy link to clipboard

Copied

Nancy, do you mean like link it to itself?

<a href="http://www.ultimate-top-trumps.co.uk/'webpage'#groot" onClick="MM_openBrWindow('winning_moves_stts/groot.html','','width=320px,height=200px')" onMouseOver="MM_swapImage('Groot','','images/stts/draxback.gif',1)" onMouseOut="MM_swapImgRestore()"><img id="Groot" src="images/stts/groot.gif" alt="Groot"></a>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 03, 2017 Dec 03, 2017

Copy link to clipboard

Copied

I'm not sure what your goal is.  A link usually takes people to some destination, either on the same page, a new page or an external link.

3 LINKS EXAMPLE:

<a href="#uniqueID">Same Page</a>

  |

<a href="some_page.html#uniqueID">New Page & ID</a>   |

<a href="https://example.com">External link</a>

<div id="uniqueID">This is a division with a unique ID.</div>

Nancy O'Shea— Product User, Community Expert & Moderator
Alt-Web Design & Publishing ~ Web : Print : Graphics : Media

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 03, 2017 Dec 03, 2017

Copy link to clipboard

Copied

The links take you to another page so I am thinking that the second link is the one I need.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 04, 2017 Dec 04, 2017

Copy link to clipboard

Copied

Have you try adding a return false, at the end of the click listener... ?

that way

<a href="#" onClick="MM_openBrWindow('winning_moves_stts/groot.html','','width=320px,height=200px'); return false;" onMouseOver="MM_swapImage('Groot','','images/stts/draxback.gif',1)" onMouseOut="MM_swapImgRestore()">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 04, 2017 Dec 04, 2017

Copy link to clipboard

Copied

LATEST

Ah, that works and its simple to do!

Thanks Birnou!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines