3

When you click on this link, you can see that the stack overflow will selects the answer with light saffron color and it will fade with in a few seconds. The thing i noticed is that how they will selects the corresponding answer by the user. There are a lot of answers but SO will selects the answer which is provided by this user. The screen will be automatically scroll down and we can see his answer.How SO achieve this ?

Can't pass variables of base types as out parameters? - By Eric Lippert (by clicking you can see the answer will selects and there are also other answers by different users).

I got the answer for the first part . Thanks .

EDIT

This will be working if we are using this in url and redirect to it. So how can I achieve this when I am doing postback to the same page. I have a repeater and it contains a lot of items. It contains some buttons so that when i clicks on it, there will be a post back. but the user will see the first item. So i want the clicked one to be highlighted.

Any help is appreciated. Thanks

Community
  • 1
  • 1
kbvishnu
  • 14,760
  • 19
  • 71
  • 101

2 Answers2

2

The URL includes a fragment identifier (#9342563) so the link is pointing to the element with the id 9342563 rather than the document as a whole.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
2

Try to check URL, you will get solution.

Can't pass variables of base types as out parameters?9342563#9342563

Try to open it without #9342563. I think this is user ID that is related to your recent answer.

Community
  • 1
  • 1
Parag Gajjar
  • 700
  • 1
  • 11
  • 25
  • `9342563` is the ID of the post, *not* the userID. – Rob W Feb 22 '12 at 14:49
  • You can pass ID in url, like #9342563. Now from jquery select your answer div (element) which is having ID="9342563". Now you can give background color change effect using jQuery. See this page's code properly. They are having id="answer-9357504" and id="comment-11873176" and url is http://stackoverflow.c-----cks-on-t/9357504#comment12831930_9357504 – Parag Gajjar Apr 06 '12 at 02:36