Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

mootools Fx.Slide

Posted on 2008-10-30
7
Medium Priority
?
2,121 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 2000 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
Technology Partners: 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

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

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

A while back, I ran into a situation where I was trying to use the calculated columns feature in SharePoint 2013 to do some simple math using values in two lists. Between certain data types not being accessible, and also with trying to make a one to…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn how to count occurrences of each item in an array.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

670 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