Solved

mootools Fx.Slide

Posted on 2008-10-30
7
2,099 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa‚Ķ
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

813 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

11 Experts available now in Live!

Get 1:1 Help Now