Hi all, I have some code that looks like this: if(!Control.LightHouse.CONTROL) { Control.LightHouse.CONTROL = {}; // check for DOM node with colorpicker if (!$("colorpicker")) { // build the node here. var control = Builder.node(''div'', {id: ''lightHouse''}); // add some structure to the control control.innerHTML ''<div id="lightHouseBody">'' + ''<img id="gradient" src="'' + this.options.IMAGE_BASE + ''gradient.jpg" alt="">'' + ''</div>''; // append child to DOM document.body.appendChild(control); } } // capture current instance of the lighthouse this.control = Control.LightHouse.CONTROL; Event.observe(this.swatch, "click", this.toggle); }, toggle : function(event) { console.log("event: " + event); this.isOpen = true; Element.show(''lightHouse''); Event.stop(event); console.log("Swatch has been clicked."); } my CSS for lightHouse is this: #lightHouse { display: none; position: absolute; border-top-width: 4px; border-right-width: 4px; border-bottom-width: 4px; border-left-width: 4px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: #e8f6ff; border-right-color: #e8f6ff; border-bottom-color: #e8f6ff; border-left-color: #e8f6ff; background-color: #e8f6ff; padding-top: 4px; padding-right: 4px; padding-bottom: 4px; padding-left: 4px; } Any idea why when I trigger the event, it won''t show? thanks, - sf --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
The CSS display:none overrides the .show()''s inline style removal. You should use an inline style for the the display:none only. Gareth On 10/10/07, Steve Finkelstein <sf-C0mP0LgZqWJbRRN4PJnoQQ@public.gmane.org> wrote:> > > Hi all, > > I have some code that looks like this: > > if(!Control.LightHouse.CONTROL) { > Control.LightHouse.CONTROL = {}; > // check for DOM node with colorpicker > if (!$("colorpicker")) { > // build the node here. > var control = Builder.node(''div'', {id: > ''lightHouse''}); > // add some structure to the control > control.innerHTML > ''<div id="lightHouseBody">'' + ''<img > id="gradient" src="'' + > this.options.IMAGE_BASE + ''gradient.jpg" alt="">'' + > ''</div>''; > // append child to DOM > document.body.appendChild(control); > } > } > > // capture current instance of the lighthouse > this.control = Control.LightHouse.CONTROL; > > Event.observe(this.swatch, "click", this.toggle); > }, > > toggle : function(event) { > console.log("event: " + event); > this.isOpen = true; > Element.show(''lightHouse''); > Event.stop(event); > console.log("Swatch has been clicked."); > } > > my CSS for lightHouse is this: > > #lightHouse > { > display: none; > position: absolute; > border-top-width: 4px; > border-right-width: 4px; > border-bottom-width: 4px; > border-left-width: 4px; > border-top-style: solid; > border-right-style: solid; > border-bottom-style: solid; > border-left-style: solid; > border-top-color: #e8f6ff; > border-right-color: #e8f6ff; > border-bottom-color: #e8f6ff; > border-left-color: #e8f6ff; > background-color: #e8f6ff; > padding-top: 4px; > padding-right: 4px; > padding-bottom: 4px; > padding-left: 4px; > } > > Any idea why when I trigger the event, it won''t show? > > thanks, > > - sf > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
If you are at all concerned about non-scripted visitors missing this content, then you might also consider using Element.hide() in a body load listener. That way if there is no script, everything shows anyway. Walter On Oct 9, 2007, at 3:43 PM, Gareth Evans wrote:> The CSS display:none overrides the .show()''s inline style removal. > You should use an inline style for the the display:none only. > > Gareth--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
that aside, yeah. I dont often think of these things since I primarily stick to intranet apps :) Gareth On 10/10/07, Walter Lee Davis <waltd-HQgmohHLjDZWk0Htik3J/w@public.gmane.org> wrote:> > > If you are at all concerned about non-scripted visitors missing this > content, then you might also consider using Element.hide() in a body > load listener. That way if there is no script, everything shows anyway. > > Walter > > On Oct 9, 2007, at 3:43 PM, Gareth Evans wrote: > > > The CSS display:none overrides the .show()''s inline style removal. > > You should use an inline style for the the display:none only. > > > > Gareth > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---