Hi: I''m using this CSS menu http://www.cssplay.co.uk/menus/drop_line.html But I want everytime you left a submenu (grey horizontal bar when you put mouse over one tab), it takes about 2 seconds to do it... That''s to say, to create a 2s delay when "on sub menu closes" or "onunhover". I know with prototype is easy, but I do not know how... Any idea ? :) Thank you --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
You need to capture the onmouseout event of the element, then start a timeout, then fire the action to hide the item. On Sep 23, 8:25 am, woofer <dant...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi: > > I''m using this CSS menuhttp://www.cssplay.co.uk/menus/drop_line.html > But I want everytime you left a submenu (grey horizontal bar when you > put mouse over one tab), it takes about 2 seconds to do it... > > That''s to say, to create a 2s delay when "on sub menu closes" or > "onunhover". > > I know with prototype is easy, but I do not know how... Any idea ? :) > > Thank you--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
eeee... yes !!!... and how ? :D On Sep 24, 10:14 pm, Diodeus <diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> You need to capture the onmouseout event of the element, then start a > timeout, then fire the action to hide the item. > > On Sep 23, 8:25 am, woofer <dant...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Hi: > > > I''m using this CSS menuhttp://www.cssplay.co.uk/menus/drop_line.html > > But I want everytime you left a submenu (grey horizontal bar when you > > put mouse over one tab), it takes about 2 seconds to do it... > > > That''s to say, to create a 2s delay when "on sub menu closes" or > > "onunhover". > > > I know with prototype is easy, but I do not know how... Any idea ? :) > > > Thank you--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Listener:
mte = document.getElementById("divmenutop");
mte.addEventListener("mouseout",listener,true);
function listener() {
// and now what ? :)
// how can i put a setTimeOut on the "css" ?
}
On Sep 24, 10:14 pm, Diodeus
<diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> You need to capture the onmouseout event of the element, then start a
> timeout, then fire the action to hide the item.
>
> On Sep 23, 8:25 am, woofer
<dant...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > Hi:
>
> > I''m using this CSS
menuhttp://www.cssplay.co.uk/menus/drop_line.html
> > But I want everytime you left a submenu (grey horizontal bar when you
> > put mouse over one tab), it takes about 2 seconds to do it...
>
> > That''s to say, to create a 2s delay when "on sub menu
closes" or
> > "onunhover".
>
> > I know with prototype is easy, but I do not know how... Any idea ? :)
>
> > Thank you
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
Event.observe(''divmenutop'', ''onmouseout'',
hideMe);
function hideMe() {
}
On Sep 25, 4:33 am, woofer
<dant...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Listener:
> mte = document.getElementById("divmenutop");
> mte.addEventListener("mouseout",listener,true);
>
> function listener() {
> // and now what ? :)
> // how can i put a setTimeOut on the "css" ?
>
> }
>
> On Sep 24, 10:14 pm, Diodeus
<diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > You need to capture the onmouseout event of the element, then start a
> > timeout, then fire the action to hide the item.
>
> > On Sep 23, 8:25 am, woofer
<dant...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > > Hi:
>
> > > I''m using this CSS
menuhttp://www.cssplay.co.uk/menus/drop_line.html
> > > But I want everytime you left a submenu (grey horizontal bar when
you
> > > put mouse over one tab), it takes about 2 seconds to do it...
>
> > > That''s to say, to create a 2s delay when "on sub
menu closes" or
> > > "onunhover".
>
> > > I know with prototype is easy, but I do not know how... Any idea
? :)
>
> > > Thank you
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
Event.observe(''divmenutop'', ''onmouseout'',
hideMe);
function hideMe() {
}
On Sep 24, 7:22 pm, woofer
<dant...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> eeee... yes !!!... and how ? :D
>
> On Sep 24, 10:14 pm, Diodeus
<diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > You need to capture the onmouseout event of the element, then start a
> > timeout, then fire the action to hide the item.
>
> > On Sep 23, 8:25 am, woofer
<dant...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > > Hi:
>
> > > I''m using this CSS
menuhttp://www.cssplay.co.uk/menus/drop_line.html
> > > But I want everytime you left a submenu (grey horizontal bar when
you
> > > put mouse over one tab), it takes about 2 seconds to do it...
>
> > > That''s to say, to create a 2s delay when "on sub
menu closes" or
> > > "onunhover".
>
> > > I know with prototype is easy, but I do not know how... Any idea
? :)
>
> > > Thank you
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
Event.observe(''divmenutop'', ''mouseout'',
hideMe);
function hideMe() {
x = setTimeout("Element.hide(''divmenutop'')",2000)
}
On Sep 24, 7:22 pm, woofer
<dant...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> eeee... yes !!!... and how ? :D
>
> On Sep 24, 10:14 pm, Diodeus
<diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > You need to capture the onmouseout event of the element, then start a
> > timeout, then fire the action to hide the item.
>
> > On Sep 23, 8:25 am, woofer
<dant...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
> > > Hi:
>
> > > I''m using this CSS
menuhttp://www.cssplay.co.uk/menus/drop_line.html
> > > But I want everytime you left a submenu (grey horizontal bar when
you
> > > put mouse over one tab), it takes about 2 seconds to do it...
>
> > > That''s to say, to create a 2s delay when "on sub
menu closes" or
> > > "onunhover".
>
> > > I know with prototype is easy, but I do not know how... Any idea
? :)
>
> > > Thank you
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
Actually, it''s not going to work the "proper" way : )
First of all, currently menu hiding is done via CSS (visibility:
hidden on bottom container). This means that once you mouseout, even
though "hideMe" will get triggered, menu will still disappear right
away (due to hover rule declared in a stylesheet).
Second, simple timeout is not quite enough. If you mouseout and them
mouseover before timeout triggers, menu will suddenly disappear right
under your mouse. This is not cool - we have to check if mouse is over
container or not (simple flag is one of the solutions).
Third, to be completely unobtrusive, the best solution would be to
have CSS driven behaviour and replace it with JS one if JS is
available.
Something like this should clear current css styles:
$$(''head'')[0].insert(''<style
type="text/css">.menu ul ul {visibility:
visible}</style>'');
and then just hack away all you want
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
Hmmm, that give me some light...
Anyway I have checked
$$(''head'')[0].insert(''<style
type="text/css">.menu ul ul
{visibility:visible}</style>'');
but does not work...
Can you please HELP me in the example given above ?
http://www.cssplay.co.uk/menus/drop_line.html
:)
THANK YOU !
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
Try this -
<script>
Event.observe(window, ''load'', function(){
var flag = false;
$$("div.menu ul").each(function(item){
if(!flag){
item.immediateDescendants().each(function(item2){
Event.observe(item2, "mouseover", function(){
item.immediateDescendants().each(function(item3){
item3.immediateDescendants()[1].style.visibility = "";
});
item2.immediateDescendants()[1].style.visibility
"visible";
});
Event.observe(item2, "mouseout", function(){
var flag = true;
new PeriodicalExecuter(function(pe){
if(!flag)item2.immediateDescendants()
[1].style.visibility
= "";
if(!flag) pe.stop();
if(flag) flag=false;
}, 1);
});
});
}
flag = true;
});
});
</script>
Also -
.menu ul li:hover ul,
.menu ul a:hover ul{
//Remove visibility:visible; from here
display:block;
top:2em;
margin-top:1px;
}
On Sep 23, 5:25 pm, woofer
<dant...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> Hi:
>
> I''m using this CSS
menuhttp://www.cssplay.co.uk/menus/drop_line.html
> But I want everytime you left a submenu (grey horizontal bar when you
> put mouse over one tab), it takes about 2 seconds to do it...
>
> That''s to say, to create a 2s delay when "on sub menu
closes" or
> "onunhover".
>
> I know with prototype is easy, but I do not know how... Any idea ? :)
>
> Thank you
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Spinoffs" group.
To post to this group, send email to
rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---
Error: Event.observe is not a function Archivo fuente: http://86400.es/test/index.html#nogo Línea: 213 You can see it at http://86400.es/test --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
>You need to capture the onmouseout event of the element, then start a >timeout, then fire the action to hide the item.var timer Event.observe(''divmenutop'', ''mouseout'', function(){ timer = setTimeout(''function that dose the hiding'', 2000 ); })>Second, simple timeout is not quite enough. If you mouseout and them >mouseover before timeout triggers, menu will suddenly disappear right >under your mouse. This is not cool - we have to check if mouse is over >container or not (simple flag is one of the solutions).Event.observe(''divmenutop'', ''mouseover'', function(){ clearTimeout( timer ); }) Try this. this is what I do in a similar situation. -- Edward Grant themasternone-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org RPGA #342155 CAMARILLA #US2002022579 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
no results... http://86400.es/test/index.html --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
you forget to include prototype ;-) after it will work -----Message d''origine----- De : rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org [mailto:rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org] De la part de woofer Envoyé : jeudi 27 septembre 2007 09:22 À : Ruby on Rails: Spinoffs Objet : [Rails-spinoffs] Re: Prototype challenge with CSS menu and javascript no results... http://86400.es/test/index.html --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Yeah, seems to work now... But it do a strange thing... when you mouse over, the CSS styles of the grey bar are disabled (at least now it closes after 2 seconds correctly :) they''re shown with no class... :( why ? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
And it''s now working... the timeout stats when you leave the tabs, instead when you leave the submenu... it you go from the tab to the submenu (grey bar) , this dissapears in 2 seconds... the timeout should be onmouseover the submenu, not the tab :P --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---