alvarotrigo / fullPage.js

fullPage plugin by Alvaro Trigo. Create full screen pages fast and simple
http://alvarotrigo.com/fullPage/
GNU General Public License v3.0
35.27k stars 7.3k forks source link

(Question) Creating According FAQ Page #2811

Closed yafoo699 closed 7 years ago

yafoo699 commented 7 years ago

Hi Alvaro,

I'm trying to create FAQ accordion page, and the page refers to https://bootsnipp.com/snippets/QXdqR.

The problem is, when “opened” accordion exceeds the page height, the scrollbar doesn't work properly. (I'm activating "scrollOverflow" option)

So here is my current jquery;

$(document).ready(function() {
 $('.accordion').find('.accordion-toggle').click(function() {
  $(this).next().slideToggle('600');
 $(".accordion-content").not($(this).next()).slideUp('600');
 });
$('.accordion-toggle').on('click', function() {
 $.fn.fullpage.reBuild();
 $(this).toggleClass('active').siblings().removeClass('active');
 });
});

Here I’ve just added $.fn.fullpage.reBuild();, trying to solve the problem.

However, I'm stuck with the problem below;

  1. It works only when the scrollbar is originally shown in the screen. (When "Q" content exceeds the height of screen)
  2. Whole accordion move to upwards after opening & closing answer. (This happens when scrollbar originally isn’t displayed on the screen and then exceeds the height when the accordion opens. (This is hard to explain in words, and I hope the explanation makes sense…))
  3. It seems adding $.fn.fullpage.reBuild(); makes the page slow to load. (especially on mobile). Is there any way to solve this?

Sorry if my explanation is unclear. (I’m not a native English speaker…)

Thanks a lot.

alvarotrigo commented 7 years ago

Closed until an isolated reproduction is provided as detailed in the reporting issues guidelines and the issue skeleton.

Please provide an isolated reproduction if you think there's any issue with fullPage.js behaviour.