Click to See Complete Forum and Search --> : return false; for hyperlinks?
LEGO-Mafia
02-28-2009, 07:38 PM
Hi,
Any way to use return false; feature to stop the jumping effect use experiences when clicking on a link..
For example, I tried
<a href="http://www.minifigtimes.com/football/0809/0809-round-31.shtml;return false;" class="link-standard">31</a>
but it is not correct..
rpgfan3233
02-28-2009, 07:46 PM
What do you mean "jumping effect"? You can use onclick="return false", but then the link wouldn't activate (unless scripting is turned off).
Care to elaborate on what "jumping effect" refers to?
LEGO-Mafia
02-28-2009, 07:52 PM
well on this page http://www.minifigtimes.com/football/0809/0809-round-31.shtml
below the table, if you scroll down a bit and click on one of the rounds from the list "Calender by round: 31, 30, 29, 28, 27, 26" it jumps back up to the top of the loaded page.
Is there any way to stop this?
rpgfan3233
02-28-2009, 08:15 PM
Ah, OK. That's normal browser behaviour. However, if you use AJAX, you can load it all dynamically. Make it a link, have the AJAX code load things and include a return false. Those without scripting enabled will go to the actual page. Those with scripting won't load a page; they'll simply see the data changed.
Alternatively, you could set a cookie with the coordinates of the top-left part of the window and use that cookie to scroll back on the next page onload. Of course, you would still have a jumping effect, but it would jump back to where things were. In addition, if your content changes dynamically (e.g. you have advertisements on top and one is larger vertically than another), your script wouldn't adjust to that.
Of course, you could use the links to link to the table name/id on the new page... That would allow all users to get the same content with the same experience.
LEGO-Mafia
03-01-2009, 03:46 AM
I see. Some options there :) Thanks for the tips!!
Major Payne
03-01-2009, 11:44 AM
Opened in a new tab for me as I control all link behavior with my browser's Options. Ergo, I did not experience any "jumping effect". Site's do not control link opening behavior as it should be. User, who know how, will always be in control of how they want links to open.
Some coding errors:
CSS (http://jigsaw.w3.org/css-validator/validator?profile=css21&warning=0&uri=http%3A%2F%2Fwww.minifigtimes.com%2Ffootball%2F0809%2F0809-round-31.shtml)
HTML (http://validator.w3.org/check?verbose=1&uri=http%3A%2F%2Fwww.minifigtimes.com%2Ffootball%2F0809%2F0809-round-31.shtml) 155 errors