dcsimg


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Accordion Sliding to Screen Top on Open

  1. #1
    Join Date
    Feb 2007
    Posts
    79

    Accordion Sliding to Screen Top on Open

    http://cesarvillaca.com/temp/accordion_top_scroll/

    I'm using the MooTools v1.2 Accordion script. I have an issue with my accordion data not scrolling properly. If you go to the link posted above you will see that if you scroll down, then hit the Toggle 2 button that the beginning of Toggle 2 data shoots up higher than the screen top forcing you to scroll up again to read the beginning. What I want is for the accordion to open and move to the top of the visible screen.

    I did find a little info on whats happening here, http://groups.google.com/group/mooto...759d09d0?hl=en but there is no solution present.

    I know it can be done as it is kinda on the following pages, but I cant seem to see how they did it.
    http://blog.medianotions.de/assets/d...accordion_1.2/
    http://cim.saddleback.edu/~jmolina10/#
    http://kumalabs.com/ingesi/

    Any help is much appreciated. Thank you.

  2. #2
    Join Date
    Feb 2007
    Posts
    79
    Thanks to Fang @ webdeveloper.com forums.

    Solution - Add the following line to the following function.

    Code:
    el.scrollIntoView(true);
    Code:
     
    onComplete:function(el){
         if(el.getSize().y>0){
              el.setStyle('height','auto');
         }
         el.scrollIntoView(true);
    }

  3. #3
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Thank you for coming back and posting your solution.

    Hopefully it will help someone else with the same or similiar problem.

Similar Threads

  1. function for copying a screen region
    By Amrita in forum C++
    Replies: 2
    Last Post: 07-12-2005, 10:49 AM
  2. ? Characteristics of Me.DesktopBounds with Screen
    By Patrick Ireland in forum .NET
    Replies: 4
    Last Post: 05-28-2002, 09:07 AM
  3. Top fixed screen
    By Cheng in forum Web
    Replies: 1
    Last Post: 11-06-2001, 10:43 AM
  4. How can I split 2 panels horizontally?
    By Patrick Ireland in forum .NET
    Replies: 10
    Last Post: 10-14-2001, 05:55 PM
  5. How to open other screen at the push of a button
    By jayaramreddy in forum Java
    Replies: 0
    Last Post: 10-19-2000, 02:24 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center