Re: Ajax Question
On Mar 20, 2011, at 23:52, Krissy Masters wrote:
> I am loading content into a div so left menu click loads the element into the right side…pretty simple. But how do you prevent the page from always jumping to the top? Layout has header, intro, page title then the content starts but everytime I click a side nav ajax link it loads the content fine but always jumps the page back to the top.
This would be normal behavior, if you have something like:
<a href="#" onclick="somethingAjax()">click</a>
That is, href="#" means "scroll to the top".
If you don't want to scroll to the top when clicked, don't set href to "#". Alternatives include href="javascript:void(0)" or even better just omit the onclick attribute and put that function in the href: href="javascript:somethingAjax()".
--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home