Solved

mootools Fx.Slide

Posted on 2008-10-30
7
2,094 Views
Last Modified: 2013-11-11
I'm trying to have my vertical slide ( copied identical to http://demos.mootools.net/Fx.Slide ) start in a closed state. In the demo provided, they all start open.

I tried adding this to the demo.js file:
myVerticalSlide.hide(); but it causes the div to quickly flash then disappear (in ie6/7).

thanks
0
Comment
Question by:level9wizard
  • 4
  • 2
7 Comments
 
LVL 17

Accepted Solution

by:
cem_turk earned 500 total points
ID: 22840734
your div should look like this

    <div id="vertical_slide" style="display:none">
          Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut
          labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris
          nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit
          esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt
          in culpa qui officia deserunt mollit anim id est laborum.
        </div>
0
 
LVL 11

Author Comment

by:level9wizard
ID: 22840836
@cem_turk : I tried that previously (in FF3) and the div stays hidden even using the show or toggle functions.

I'm guessing it should be a more direct solution during the constructor call:?

i.e. somewhere here:?
var myVerticalSlide = new Fx.Slide('vertical_slide');
0
 
LVL 11

Author Comment

by:level9wizard
ID: 22840883
I tried:
 var myVerticalSlide = new Fx.Slide('vertical_slide').hide();

and it works, but there's still a quick flicker in ie6/7

I might have to settle with using css and js to hide the entire page until it's fully loaded...
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 16

Expert Comment

by:sh0e
ID: 22840914
The effect uses negative margins to hide the object, so display: none will not work.
What you could do, is wrap the slide function into your own custom slide, where it hides and shows at the end of the effect.
0
 
LVL 11

Author Comment

by:level9wizard
ID: 22840991
Solution was to add this:
document.getElementById("vertical_slide").style.display="block";

in here:
$('v_toggle').addEvent('click', function(e){
            e.stop();
            document.getElementById("vertical_slide").style.display="block";
            myVerticalSlide.toggle();            
      });

That way the inline display: none; becomes visible again.
0
 
LVL 16

Expert Comment

by:sh0e
ID: 22841076
Actually, you do realize that if you click that while it is hidden, that the effect will malfunction?
0
 
LVL 11

Author Closing Comment

by:level9wizard
ID: 31511644
Full solution was to add this:
document.getElementById("vertical_slide").style.display="block";

in here:
$('v_toggle').addEvent('click', function(e){
            e.stop();
            document.getElementById("vertical_slide").style.display="block";
            myVerticalSlide.toggle();            
      });

That way the inline display: none; becomes visible again.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now