473,378 Members | 1,555 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Accordion Sliding to Screen Top on Open

162 100+
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, Accordion - scrolls up instead of down - MooTools Users | Google Groups 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.
Verschachteltes Mootols-Accordion
Jonathan Molina's CIM Class' Site
Íngesi - IngenierÃ*a eléctrica y electrónica

Any help is much appreciated. Thank you.
Dec 15 '08 #1
3 2524
pronerd
392 Expert 256MB
Since your question is about a specific JavaScript API and not JavaScript it self you would be better off posting it in a forum that covers the API you want details about.
Dec 16 '08 #2
empiresolutions
162 100+
Thanks to Fang @ webdeveloper.com forums.

Solution - Add the following line to the following function.

Expand|Select|Wrap|Line Numbers
  1. el.scrollIntoView(true);
Expand|Select|Wrap|Line Numbers
  1.  
  2. onComplete:function(el){
  3.      if(el.getSize().y>0){
  4.           el.setStyle('height','auto');
  5.      }
  6.      el.scrollIntoView(true);
  7. }
  8.  
Dec 16 '08 #3
acoder
16,027 Expert Mod 8TB
That is a more elegant solution compared to the ones you linked to (one of which had content so small there was no scrollbar).
Dec 17 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: axxon | last post by:
hi, I am having a huge problem here! the scenario is i am trying to create dynamic accordion Panes to a accordion control inside a tab panel in a content page. It works just fine in a regular...
1
by: luispunchy | last post by:
I have an accordion style dropdown list/sublist menu (functions similar to the "today on WebMD video" widget found on http://www.webmd.com/) - it will allow users to click on a headline (from the...
2
by: LayneMitch via WebmasterKB.com | last post by:
Greetings. I'm reading this book that is teaching me the more appropriate way of assigning functions. It has an 'accordian' example that when you click on a link, it expands into other options...
8
by: Tomasz J | last post by:
Hello developers, After migrating my web project application (using the old model) to .Net Framework 3.5 and Ajax Control Toolkit release 20820 the Accordion control no longer works correctly....
3
by: empiresolutions | last post by:
My issue is that I am using nested accordions and the second accordion in my nested list will not push the outer div down. The nested accordion slides beneath the main div container. Another way...
0
by: =?Utf-8?B?Q29kZVJhem9y?= | last post by:
I have an accordion AJAXToolkit control. It works okay. However, I want to work it so that, each pane in the accordion will contain some controls. And those controls will have validation...
0
by: Andy B | last post by:
I am using an accordion for some different views. The datasource for the one below is hooked up to a entity framework datacontext function import and works just fine. The problem is I can't...
6
by: Andy B | last post by:
I am trying to use an accordion control from the ajax control toolkit for ..net3.5 sp1. When I put a link in one of the accordion pannel headerTemplates to open and close the content, I always get...
8
by: quipo | last post by:
Hi, im using an accordion script but it doesnt work if i use it with ajax. example: <div id="accordion"> <dl class="accordion" id="slider"> <dt>click here for the 1st pane</dt> ...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.