Visual_effect and change focus

Hello -

I am using a visual_effect like this:

<%= link_to "Question #1", "#", :onclick => visual_effect(:toggle_blind, 'question1') %>

Question #1: Answer

So that when the link to Question #1 is clicked on, it drops down the
answer in the hidden

right below the question. How can I change
the focus, so that the browser window focus doesn’t jump to the top of
the screen, but instead focuses on my hidden div?

Thanks for any help!!

LAB

LAB wrote:

Hello -

I am using a visual_effect like this:

<%= link_to "Question #1", "#", :onclick => visual_effect(:toggle_blind, 'question1') %>

Question #1: Answer

So that when the link to Question #1 is clicked on, it drops down the
answer in the hidden

right below the question. How can I change
the focus, so that the browser window focus doesn’t jump to the top of
the screen, but instead focuses on my hidden div?

Thanks for any help!!

LAB

Well, I guess you could make an href that points to “#question1”…

Lake

Ah, ha! That’s what I was missing … this fixes it …

<%= link_to "Question #1", "#question1", :onclick => visual_effect(:toggle_blind, 'question1') %>

note the addition of “question1” after the #, passed as the 2nd
parameter.

Thanks!!
LAB

On Aug 15, 4:37 pm, Lake D. [email protected]