Issue with FullPageJS: scrollOverflow feature not functioning upon click event

I am currently working on a Fullpage.js instance that needs to be initialized with a click event and then destroyed when switching to another page, and vice versa. The scrollOverflow feature works perfectly as long as the #fullpage element is not hidden upon page load.

However, I have encountered an issue where the .fp-scrollable and .fp-scroller elements are not being created when the .fullpage-trigger is clicked and the #fullpage element is displayed and built.

You can see an example of this issue by visiting:

Thank you in advance for your help :)

$('.fullpage-trigger').on('click', function(event) {
    $('#fullpage').fullpage({
        anchors: ['1', '2'],
        navigation: true,
        navigationPosition: 'left',
        navigationTooltips: ['1', '2'],
        scrollOverflow: true
    });
});

$(document).on('click', '.destroy', function(){
    $.fn.fullpage.destroy('all');
    $('#fullpage').removeClass('active');
    $('#fullpage').addClass('hide-page');
});

Answer №1

Consider implementing $.fn.fullpage.reBuild() following your setup process. Another option is to utilize it within the afterRender callback function.

Answer №2

//Triggering a recalculation of dimensions in fullPage.js.
setTimeout(function(){
  fullpage_api.reBuild(); 
}, 500);

This method proved effective in solving my issue.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Unable to apply border radius to the div containing the video

Currently, I am attempting to create a video with rounded corners by wrapping the <video> tag in a div element with rounded corners. This method works perfectly in Chrome and Firefox, but unfortunately does not work in Safari. It seems like this ma ...

Learning the process of connecting functions to events

// param {id:'buttonId', action : function(event[,param1, param2] ){}, behavior:function(event[,param1, param2] ){} } CustomButton = function(parameters) { var buttonElement = document.getElementById(parameters.id); // how c ...

Eliminating the muted attribute does not result in the sound being restored

I am looking to implement a feature where a video loads automatically without sound, but when a user clicks a button labeled "Watch with Sound", the video restarts from the beginning and plays with sound. Below is the JavaScript code: let videoButton = do ...

Adhesive Navigation Bar

Check out this link: JSFIDDLE $('.main-menu').addClass('fixed'); Why does the fixed element flicker when the fixed class is applied? ...

Is it possible to generate an interactive HTML form using JSON information?

When the user clicks the "get Form" button, a request is sent to the form API to retrieve information for rendering the form. Once the form is rendered, the user can then submit the form. This process can be repeated as needed. HTML: <body ng-app="Json ...

Guidance on using AJAX to update select box options based on the selection from another select box

I am currently working on a popup form that includes two drop-down menus. The challenge I am facing is that the options in the second drop-down menu need to change based on the selection made in the first one. This requires me to retrieve information from ...

Should all pages in React be rendered on the server side?

Currently, I rely on Next.js for implementing server-side rendering on my React website. At the moment, I have implemented server-side rendering across almost all pages of the site, including profile information and other content that requires a login to ...

Exploring Javascript parameters with the power of jquery

Is it possible to pass a parameter from PHP into a JavaScript function within HTML? I am currently facing an issue where my code crashes when it reaches a certain condition. This is the code snippet causing the problem: $str="<input type='submit&a ...

Run JavaScript upon the webpage loading without the dependency of jQuery

Is there a way to ensure that JavaScript code is executed only after the entire page has loaded, without relying on jQuery? Take this example... <html> <head> <script type="text/javascript"> var box = document.ge ...

What is the best way to adjust the size of a column when hovering

What I am attempting to achieve is, I would like the column box to have a 100% width, and when it is hovered over, I want it to transition to the left, with the width of the column box being about 60%, revealing a second block that shows up as 20% width o ...

Making an Ajax request from within an iframe using the easyXDM framework

I am currently utilizing easyXDM for enhancing the communication between a website and a shopping cart embedded within an iframe on my domain. Whenever a user adds an item to the shopping cart, I utilize easyXDM.Rpc to transmit the item details to the ifra ...

Struggling to implement CSS variables across different browsers

I'm struggling to make CSS variables function properly, here is what I have so far: :root { --primary-color: #ffcd600; --spacing: 10px; --blur: 10px; } img { padding: var(--spacing); background: var(--primary-color); } When I check the el ...

Automatically navigate through form fields using jQuery when pasting data

Enhancing the form filling experience by allowing users to prepare a text file in advance and simply copy/paste it into the form for quick submission. Integration of a feature that automatically moves to the next input field when a tab or newline character ...

What is the purpose of assigning scope.property to scope.property() in order for the expression to function properly?

I have encountered an interesting situation with the directive below. In order for my expressnum function to work in the template, I had to include the line scope.expressnum = scope.expressnum();. It does what I need it to do, but I'm not entirely sur ...

Adjust the parent container to perfectly accommodate the child element

Is there a way to resize the container box to fit its dynamic content without using JavaScript? Here is the sample code for the problem: <div id="container"> <div id="content"></div> </div> #container { position: relativ ...

Using Vue.js to detect changes in a value and dynamically highlight the text

I am working on a simple script that generates random numbers every few moments. I want to change the background color whenever the random number is not equal to the one before it. Is this possible? For example, if the random numbers generated are 1, 1, an ...

Utilizing React to Style Background Positions

I've been struggling to position a block of rendered jsx on the right side of the first block for hours now. Despite trying various options like marginTop, marginLeft, and even backgroundPosition based on my research, I still haven't been success ...

Why is the axios.get promise not getting resolved?

I am currently working on fetching data from MongoDB atlas within a React app. However, despite using .then and .catch with axios.get(), I am encountering an unresolved promise. Here is the code snippet: const entry = axios.get('http://localhost:3001 ...

JavaScript Variables Lose Their Values

Similar Inquiry: How can I get the response from an AJAX call in a function? I have written a function that fetches numerical data from an online file. Although the file retrieval is successful (verified by the alert message), I encounter an issue whe ...

Is there a way to use CSS animation and transform to create a flip effect on two different divs, flipping them up and then back down with pauses and looping in between?

I have a query about CSS animation and transform. I am looking to create a flipping effect on two divs - one flips up from the bottom, then back down, followed by the second div flipping up and back down. I want this sequence to repeat indefinitely with pa ...