*Problem with show and hide div on mouse
eventshttp://www.ruby-forum.com/topic/127744#569797
*
Hi,
Friends, I am new to Ruby On Rails, I want to implement show and hide
div on mouseover and mouseout events, I have tried by various ways using
.rjs(Ruby Javascript) and Ajax also but its not working smoothly as I
want.
(I have created some Rss links and on mouseover event I want to show its
related links in the div below and on mouseover event of the div below I
want to hide the div.)
Please Help me give me proper solution, If I got any code it will be the
best solution for me.
Regards,
Kiran P.
[email protected]
I’m using 2 partials and a remote function to do this. I’m sure you
can modify this for what you need.
layout.rhtml
<%= render 'home/hide_menu' %>
------------------------------
_hide_menu.rhtml
<div onMouseover="<%= remote_function :update => ‘menu’, :url =>
{:controller => ‘home’, :action => ‘menu’}, :before =>
“Element.show(‘spinner’)”, :complete => “Element.hide(‘spinner’)” %>"
onClick="<%= remote_function :update => ‘menu’, :url => {:controller
=> ‘home’, :action => ‘menu’}, :before =>
“Element.show(‘spinner’)”, :complete => “Element.hide(‘spinner’)”
%>">Menu
menu.rhtml
"Element.hide('spinner')" %>">
#my menu items go here
__________________
home_controller.rb
def menu
render :layout=>false
end
def hide_menu
render :layout=>false
end
[email protected] wrote:
I’m using 2 partials and a remote function to do this. I’m sure you
can modify this for what you need.
home_controller.rb
def menu
render :layout=>false
end
def hide_menu
render :layout=>false
end
Thanks for the help I think it will definately useful for me…