Couldn't Prototype use calculated styles* to figure out an element's display value?
*http://blog.stchur.com/2006/06/21/css-computed-style/ On Jul 15, 2:38 am, Richard Quadling <[email protected]> wrote: > On 11 July 2010 05:01, Acryte <[email protected]> wrote: > > > > > > > Hi, I'm working on a site where I have it load the page, and then I > > have a content box containing a textfield and customized scrollbar > > (custom images,width, etc) for the field. I have multiple content > > boxes and I used script.aculo.us to basically make them appear or fade > > when the menu pics are clicked etc. This was great but then I wanted > > to make them all hidden when the page loads, and then have them shown > > if you click the link. Like for news, you click it and the content box > > for news shows up. The problem I am having is that when I set the > > display for the div with id ContentBox to display=none since prototype > > uses display for show/hide/appear/fade I thought that would work fine. > > but it doesnt. I'm sure its a simple fix that I'm just not seeing. > > > What happens is, if I say for example: > > > window.onload = function() { > > $$('div.tabcontent').invoke('hide'); > > }; > > > or > > > document.observe("dom:loaded", function() { > > $$('div.tabcontent').invoke('hide'); > > }); > > > then it will hide it to begin with, but later on, even if it's right > > after that, if I tell it to show, and use something like toggle, show, > > appear... etc. what happens is, it shows the content box, but the text > > field and scrollbar inside it are both hidden. > > > if I use the div specifically like: > > $('contentBox').hide() > > > it will still hide but once again it won't show when I tell it to show > > or appear. > > > I know there must be a simple solution because when I say: > > window.onload = function() { > > $$('div.tabcontent').invoke('fade'); > > }; > > it works when later on I tell it to show or appear.... just hide makes > > it not work. > > > Also, I made a temporary solution by using iframes since I was already > > using them for the gallery with my shadowbox. I used it for the > > content box. I put them in an iframe positioned using a div in a > > table. Works good except for 1 thing, when I use my scriptaculous > > custom scrollbar, if my mouse goes outside of the frame/table (one of > > the 2 not sure exactly but) then it no longer is observing when I > > mouseup... so that when I bring the mouse back into the frame, it will > > then act as if I was still mousedown and scroll the scrollbar as I > > move the mouse up and down which is terrible. I don't mind using the > > frames, it would make editing easy because each content window could > > be a separate little html file, but at the same time I can't seem to > > figure out how to fix this either. My attempts at both have failed so > > now I'm asking for some help, thanks :) > > > -- > > You received this message because you are subscribed to the Google Groups > > "Prototype & script.aculo.us" group. > > To post to this group, send email to > > [email protected]. > > To unsubscribe from this group, send email to > > [email protected]. > > For more options, visit this group > > athttp://groups.google.com/group/prototype-scriptaculous?hl=en. > > You have to apply the inline style="display:none;" > > Element.show cannot display elements hidden via CSS stylesheets. Note > that this is not a Prototype limitation but a consequence of how the > CSS display property works. [1] > > Regards, > > Richard. > > [1]http://api.prototypejs.org/dom/element/show/ -- You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en.
