Solved

mootools Fx.Slide

Posted on 2008-10-30
7
2,109 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 17

Accepted Solution

by:
Cem Türk 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

740 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