Hi. I have this question: I have a page with more ugual "GIF" (say
?/Help
gif). When I click on one of this giv a "DIV" is showed (one for each
gif).
And when a div is showed the last div "showed" there must
"hide". Ok, no
problem. I have do it. My problem is that the div that is showed in this
moment must to "hide" when I clink into the document (is not important
where). Onto firefox I have resolved in this way with the use of Event:
mostraDivHelp(div) {
//If is there a div "open" I hide it.
if (SHEEBOO_scambio[''divHelp''] !== undefined &&
SHEEBOO_scambio[''divHelp''] != null) {
$(SHEEBOO_scambio[''divHelp'']).hide();
Event.stopObserving(document,''click'',function(e) {if (
e.target.attributes !== undefined) return false;nascondiDivHelp(div);});
}
SHEEBOO_scambio[''divHelp''] = div;
$(div).setStyle({display:''block''});
SHEEBOO_scambio[''primoClick''] = 0;
Event.observe(document,''click'',function(e) {if
(e.target.attributes.alt!== undefined) return
false;nascondiDivHelp(div);});
}
function nascondiDivHelp(div) {
Event.stopObserving(document,''click'',function(e) {if (
e.target.attributes !== undefined) return
false;SHEEBOO_nascondiDivHelp(div);});
SHEEBOO_scambio[''divHelp''] = null;
$(div).hide();
}
It works in FF, but not in IE. In IE the event "e" is always
"empty".
Where is my error ? Is there a more beautifull solution ?
Tnx.
Michel.
--
Michel ''ZioBudda'' Morelli
michel-0oFb7YEmpcLk1uMJSBkQmQ@public.gmane.org
Consulenza sistemistica in ambito OpenSource.
Sviluppo applicazioni web dinamiche (LAMP+Ajax)
Telefono: +39-3939890025 -- Fax: +39-0291390660
http://www.ziobudda.net ICQ: 58351764
http://www.ziobuddalabs.it Skype: zio_budda
http://www.ajaxblog.it MSN:
michel-0oFb7YEmpcIlQMARD/awdg@public.gmane.org
--~--~---------~--~----~------------~-------~--~----~
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 should use the Event.element(e) instead if e.target to make it work in all browsers. On 4/17/07, zio budda <ziobudda-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi. I have this question: I have a page with more ugual "GIF" (say ?/Help > gif). When I click on one of this giv a "DIV" is showed (one for each gif). > And when a div is showed the last div "showed" there must "hide". Ok, no > problem. I have do it. My problem is that the div that is showed in this > moment must to "hide" when I clink into the document (is not important > where). Onto firefox I have resolved in this way with the use of Event: > > mostraDivHelp(div) { > //If is there a div "open" I hide it. > if (SHEEBOO_scambio[''divHelp''] !== undefined && > SHEEBOO_scambio[''divHelp''] != null) { > $(SHEEBOO_scambio[''divHelp'']).hide(); > Event.stopObserving(document,''click'',function(e) {if > (e.target.attributes !== undefined) return false;nascondiDivHelp(div);}); > } > > SHEEBOO_scambio[''divHelp''] = div; > $(div).setStyle({display:''block''}); > SHEEBOO_scambio[''primoClick''] = 0; > Event.observe(document,''click'',function(e) {if (e.target.attributes.alt > !== undefined) return false;nascondiDivHelp(div);}); > } > > function nascondiDivHelp(div) { > Event.stopObserving(document,''click'',function(e) {if > (e.target.attributes !== undefined) return > false;SHEEBOO_nascondiDivHelp(div);}); > SHEEBOO_scambio[''divHelp''] = null; > $(div).hide(); > } > > It works in FF, but not in IE. In IE the event "e" is always "empty". > > Where is my error ? Is there a more beautifull solution ? > > Tnx. > > Michel. > -- > Michel ''ZioBudda'' Morelli michel-0oFb7YEmpcLk1uMJSBkQmQ@public.gmane.org > Consulenza sistemistica in ambito OpenSource. > Sviluppo applicazioni web dinamiche (LAMP+Ajax) > Telefono: +39-3939890025 -- Fax: +39-0291390660 > > http://www.ziobudda.net ICQ: 58351764 > http://www.ziobuddalabs.it Skype: zio_budda > http://www.ajaxblog.it MSN: michel-0oFb7YEmpcIlQMARD/awdg@public.gmane.org > > >-- burnfield.com/martin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
2007/4/17, Martin Ström <martinstromlists-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> > > You should use the Event.element(e) instead if e.target to make it > work in all browsers.Tnx. It works. M. -- Michel ''ZioBudda'' Morelli michel-0oFb7YEmpcLk1uMJSBkQmQ@public.gmane.org Consulenza sistemistica in ambito OpenSource. Sviluppo applicazioni web dinamiche (LAMP+Ajax) Telefono: +39-3939890025 -- Fax: +39-0291390660 http://www.ziobudda.net ICQ: 58351764 http://www.ziobuddalabs.it Skype: zio_budda http://www.ajaxblog.it MSN: michel-0oFb7YEmpcIlQMARD/awdg@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hello, This should be an easy one, but I can''t figure it out. How do I get the x, y coordinates of the viewport? I want to position something relative to the viewport. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi, Peter-Paul Koch has (more than) a few things to say on the subject! I recommend starting here: http://www.quirksmode.org/viewport/ On 4/18/07, ben lieb <red-2zkBS/BNfO7XOH51mAaJLw@public.gmane.org> wrote:> > Hello, > > This should be an easy one, but I can''t figure it out. How do I get the > x, y coordinates of the viewport? > > I want to position something relative to the viewport. > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---