![]() |
jquery scrollto and blinking before performing action in firefox
Hy, just registered, I'm a total newby on j.s. having some problem with the plugin as well, you can see code and problem at this page (work in progress), www.silentbreeze-yurt.com , what happens in firefox and some other browsers as well is that when the button up is pressed for a moment it blinks the header of page and then back to the movement ftom bottom up to top page, it's as if the link is followed first and then the plug in enters and perform the task afterwords,
Code:
<script>jQuery(function( $ ){<div id="bottom"> <div id="up" > <a href="#" onclick="$.scrollTo( '#header', 900 );">up</a> </div> </div> <!-- bottom --> |
One of the advantages to using jQuery is you can write unobtrusive Javascript. That is to say, you can get rid of all Javascript in your html markup-- for example, that "onclick=" you are using, you should put that in your jQuery scripting instead of in your html.
This may fix your problem too. |
What you described is caused by the fact that it's still executing the default behavior of a click to avoid this you either use return false or event.preventDefault(); e.g. (assuming the same mark-up)
Code:
$('#up a').click(function(){It's basically the same concept behind the separation of content (HTML) and presentational (CSS) except we're throwing in the behavioral layer (JS). |
solved
thanks both for help, solved
|
| All times are GMT +1. The time now is 10:17 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.