| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Baskin'
Join Date: Feb 2005
Posts: 5,619
|
Javascript help (mootools fx)
Hi - anyone help here? In the the code example below I have some nice things working, but IE 6/7 renders the hidden sliders for a fraction of a second before the mootools library is applied. This jumbles the page and looks awful. So I was hoping to change the CSS so that the divs had the property visibility:hidden; or display:none; so when JS then applies the property visibility:visible; or display:block; when the triggering link is clicked... Javascript Code:
Sample HTML Code:
One suggestion is to "add display: none, then set it to display:block onDomReady" I'm so shit at this clever stuff, just about cope with CSS, but JS looks like nonsense to me! Last edited by Limbo : 14-05-2008 at 12:48. |
|
|
|
|
|
#2 (permalink) | |
|
fucksocks™
Join Date: Jun 2005
Location: in the boosh
Posts: 1,622
|
Quote:
Doesn't that fix it? p.s. You're not closing your slider <p> tags |
|
|
|
|
#5 (permalink) |
|
Senior Member
Join Date: Jan 2005
Posts: 12,340
|
Check out DOM Scripting by Jeremy Keith. Great place to start. As for your problem, assuming you've added "display:none;" for #slider1 and #slider2 in your CSS... I'm not familiar with mootools, but you would probably add it after "slides.each(function(slide, idx) { //For each element in slides do..." since that is looping through "each" element in the "slides" array. In jQuery it'd be something like: $(this).show(); Or whatever mechanism mootools uses for displaying an object. "This" being the current object in the "each" loop. |
|
![]() |