Currently, helper "link_to_remote" generates html code like ''<a href="#"....'' "#" is used for the link of "next" page. So there comes a problem. "#" stands of the the starting point of current page. which means, if the ajax link is at the bottom part of the page, where scroll bar needs to be moved to see it, when the ajax link is cliked, the page will return to the place for anchor "#", which means, scrolled to top. Is there an easy way to keep the page not scrolling? Thanks! -Tony -- Posted via http://www.ruby-forum.com/.
Jonathan Viney
2006-May-13 03:01 UTC
[Rails] the "#" in code generated by "link_to_remote"
It shouldn''t do anything as long as the onclick handler returns false: <a href="#" onclick="return false;">Try this</a> -Jonathan. On 5/13/06, Tony Jin <jerommy@gmail.com> wrote:> Currently, helper "link_to_remote" generates html code like ''<a > href="#"....'' > "#" is used for the link of "next" page. > > So there comes a problem. "#" stands of the the starting point of > current page. > which means, if the ajax link is at the bottom part of the page, where > scroll bar > needs to be moved to see it, when the ajax link is cliked, the page will > return to > the place for anchor "#", which means, scrolled to top. > > Is there an easy way to keep the page not scrolling? > > Thanks! > > -Tony > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >