I see two ways to implement this. 

First without javascript. You cat check URL of HttpRequest and if it is without 
#anchor element, then send redirect to the same URL with #anchor.

Second using javascript. For example in jquery you can include something like 
this in your head tag:

<html>
<head>
...
    <script type="text/javascript" 
src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"; ></script>
    <script type="text/javascript">
      $(document).ready(function() {
        var offset = $('#anchor').offset().top;
        $('html, body').animate({scrollTop: offset});
      });
    </script>
...
</head>
<body>
...
<div id="anchor"></div>
...
</body>
</html>




On Jul 15, 2010, at 7:56 AM, Chris Seberino wrote:

> 
> How can a view tweak the response object so that client sees a
> specific anchor  instead of the top of the page?
> 
> Chris
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to