[jQuery] Re: slideDown trouble in Safari/Chrome
On 4 Jan, 16:35, Paul Hutson wrote: > > Any ideas? Many thanks in advance. > > Without looking into it too much I can't see the cause of the > problem... > > ... however, site design wise, would it not be better to have the > buttons expand an area on the page to show the information? You could > have the divs all created prior to the page loading (much like you do > now [as a side note here, hiding the divs in the definition would be a > good idea as when it loads up slowly it shows them before hiding > them]) then just using the $("#divid").show("slow"); when clicking on > them (and hiding the currently open one). You mean, having the content divs completely separate from the buttons? That's one solution I guess, but it would change the design into something else. It is perhaps more conventional, but I am not convinced that it is "better" by definition. As for hiding the divs in the definition (I assume you mean the css), I wanted to avoid that so as to assure graceful degradation. My reasoning goes, if Javascript is used to display the divs, it should also be used to hide the divs. > document.getElementById("NAMEOFDIV").style.width = 10; > > I can't remember how to do it in a more jquery like way at the moment. Without consulting the documentation I believe that corresponds to $ ("#NAMEOFDIV").css("width", "10"); in jQuerian :) . Yours, Måns
Re: [jQuery] Re: slideDown trouble in Safari/Chrome
On 04/01/2010 15:35, Paul Hutson wrote: Any ideas? Many thanks in advance. Without looking into it too much I can't see the cause of the problem... ... however, site design wise, would it not be better to have the buttons expand an area on the page to show the information? You could have the divs all created prior to the page loading (much like you do now [as a side note here, hiding the divs in the definition would be a good idea as when it loads up slowly it shows them before hiding them]) then just using the $("#divid").show("slow"); when clicking on them (and hiding the currently open one). I know that isn't exactly the answer you were looking for - but it should help out. For reference, you can change CSS type properties directly with a call like this : document.getElementById("NAMEOFDIV").style.width = 10; I can't remember how to do it in a more jquery like way at the moment. HTHs, Paul Hutson that would be $("#NAMEOFDIV").width('10');
[jQuery] Re: slideDown trouble in Safari/Chrome
> Any ideas? Many thanks in advance. Without looking into it too much I can't see the cause of the problem... ... however, site design wise, would it not be better to have the buttons expand an area on the page to show the information? You could have the divs all created prior to the page loading (much like you do now [as a side note here, hiding the divs in the definition would be a good idea as when it loads up slowly it shows them before hiding them]) then just using the $("#divid").show("slow"); when clicking on them (and hiding the currently open one). I know that isn't exactly the answer you were looking for - but it should help out. For reference, you can change CSS type properties directly with a call like this : document.getElementById("NAMEOFDIV").style.width = 10; I can't remember how to do it in a more jquery like way at the moment. HTHs, Paul Hutson