Solved

mootools Fx.Slide

Posted on 2008-10-30
7
2,088 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
Comment Utility
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
Comment Utility
@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
Comment Utility
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 16

Expert Comment

by:sh0e
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

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.
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
The viewer will learn how to count occurrences of each item in an array.

762 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

10 Experts available now in Live!

Get 1:1 Help Now