Highlighted

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

Explorer ,
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!

Adobe Community Professional
Correct answer by B i r n o u | Adobe Community Professional

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()">

Views

1.8K

Likes

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

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

Explorer ,
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!

Adobe Community Professional
Correct answer by B i r n o u | Adobe Community Professional

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()">

Views

1.8K

Likes

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
Dec 03, 2017 0
Adobe Community Professional ,
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, ACP
Alt-Web Design & Publishing

Likes

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
Reply
Loading...
Dec 03, 2017 0
Explorer ,
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>

Likes

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
Reply
Loading...
Dec 03, 2017 0
Adobe Community Professional ,
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, ACP
Alt-Web Design & Publishing

Likes

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
Reply
Loading...
Dec 03, 2017 1
Explorer ,
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.

Likes

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
Reply
Loading...
Dec 03, 2017 0
Adobe Community Professional ,
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()">

Likes

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
Reply
Loading...
Dec 04, 2017 0
Explorer ,
Dec 04, 2017

Copy link to clipboard

Copied

Ah, that works and its simple to do!

Thanks Birnou!

Likes

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
Reply
Loading...
Dec 04, 2017 0