Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9057975
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T14:36:13+00:00 2026-06-16T14:36:13+00:00

It will be so great if here, we can code and build a website

  • 0

It will be so great if here, we can code and build a website with sliding left/right pages.

But first, let me explain the concept.
As we know, a website is composed of many pages. To navigate pages to pages we are redirecting the user to the good url and loading a new page. What I want to do, is avoiding this loading time, load all pages, display ones that the user want to see and hide others.

But why do I want to load all pages???
I want to do it to create one of the best website by displaying a page (the active page 80% width/center of the screen), the beginning of the next page on the right side (the next page 10% width/right), the end of the previous page (the previous page 10% width/left).

Did you get it? good =)

What I have done :
– Build an index page where we are loading all differentes pages (currently 5)
– Add classes to all theses page to retrieve id and work with it
– Add my js function with the sliding code effect

Here is my js function.
Everything is working like this without animations:

/* Make the process working first
——————————–*/

// When we are clicking on any element of the parent #navigation (the div)
// We are running this function 
// We are focusing this tag to get a list of all the pages
$('li.menu-item').live('click', function(event){

/* GET THE PAGE ID OF THE CLICKING ELEMENT 
-----------------------------*/
var page_id_target = event.target.id;

console.log("page id: "+page_id_target);

// this <> li.menu-item
var all_pages_menu = $('li.menu-item');
console.log(all_pages_menu);    

var pages_numbers = all_pages_menu.length;
console.log("Sum of pages: "+pages_numbers);    

//get the list of li menu
console.log("target class of the focus element: "+all_pages_menu[page_id_target-1].className);

//get the list of div
console.log($('#content .page'));

// Desactive all li class 
$('.page, .menu-item').removeClass('active').removeClass('next').removeClass('previous');
$('.page').addClass('hidden');

//Define the number id of the next page and the previous 
var next = parseInt(page_id_target)+1;
var previous = parseInt(page_id_target)-1;
    //  console.log("page_id_target: "+page_id_target);
    //  console.log("next: "+next);
    //  console.log("previous: "+previous);
if (page_id_target==1)
{
    //Update Menu
    $('ul#navigation #'+page_id_target).addClass('active');
    $('ul#navigation #'+next).addClass('next');
    $('ul#navigation #'+pages_numbers).addClass('previous');                        

    //Update DOM
    $('#content .'+page_id_target).addClass('active').removeClass('hidden');
    $('#content .'+next).addClass('next').removeClass('hidden');
    $('#content .'+pages_numbers).addClass('previous').removeClass('hidden');               
}

else if (page_id_target==pages_numbers)
{
    //Update Menu           
    $('ul#navigation #'+page_id_target).addClass('active');
    $('ul#navigation #'+1).addClass('next');
    $('ul#navigation #'+previous).addClass('previous');

    //Update DOM
    $('#content .'+page_id_target).addClass('active').removeClass('hidden');
    $('#content .'+1).addClass('next').removeClass('hidden');
    $('#content .'+previous).addClass('previous').removeClass('hidden');        
}

else
{
    //Update Menu
    $('ul#navigation #'+page_id_target).addClass('active');
    $('ul#navigation #'+next).addClass('next');
    $('ul#navigation #'+previous).addClass('previous');

    //Update DOM
    $('#content .'+page_id_target).addClass('active').removeClass('hidden');
    $('#content .'+next).addClass('next').removeClass('hidden');
    $('#content .'+previous).addClass('previous').removeClass('hidden');    
}

But When I’m trying to have some animation in my function for example like this :

            else
            {
                //Update Menu
                $('ul#navigation #'+page_id_target_right).addClass('active');
                $('ul#navigation #'+next_right).addClass('next');
                $('ul#navigation #'+previous_right).addClass('previous');



                /*
                // Update DOM
                // Work without Animations
                $('#content .'+page_id_target_right).addClass('active').removeClass('hidden');
                $('#content .'+next_right).addClass('next').removeClass('hidden');
                $('#content .'+previous_right).addClass('previous').removeClass('hidden');  
                */      

                // Retrieve the id of the previous old page 
                previous_right_old = previous_right-1;
                console.log("previous_right_old: "+previous_right_old);

                                /*  
                                    $('#content .'+page_id_target_right).addClass('hidden');
                                    $('#content .'+next_right).addClass('hidden');
                                    $('#content .'+previous_right).addClass('hidden');
                                    $('#content .'+previous_right_old).removeClass('hidden');

                                */

                // This is the old previous page
                // Set up the page on the left and the background (this is for initialise it, Otherwise the first the background won't follow)
                // Add the animate action to the left 
                // The size of one page is 78%
                // Adding the hiding class to let the page on the left (-151%)
                $('#content .'+previous_right_old).css({ 'left' : '-73%','background-color' : '#EAEAEA'}).animate({'left' : '-151%'}, duration, easing, function(){$('#content .'+previous_right_old).addClass('hidden')});

                // This is the previous page
                // Active to previous
                // Animate it 
                $('#content .'+previous_right).animate({'left' : '-73%', 'margin-right' : '0%', 'margin-left' : '0%', 'backgroundColor' : '#EFF0F1' }, duration, easing, function(){$('#content .'+previous_right).removeClass('hidden').addClass('previous')});                        



                // Add the left/right margin to respect the active class and attribute good classes after
                $('#content .'+page_id_target_right).animate({'left' : '5%', 'margin-right' : '6%', 'margin-left' : '6%', 'backgroundColor' : '#FFFFFF' }, duration, easing, function(){$('#content .'+page_id_target_right).addClass('active').removeClass('hidden')});

                // load the next page on the right of the screen
                // Adding the next class so the page will be correctly displaying
                // Set up the page on the right 
                // Animate it to the left with a page with of 78%
                $('#content .'+next_right).addClass('next').appendTo('#content').css({ 'left' : '173%', 'backgroundColor' : '#EFF0F1'}).animate({'left' : '95%'}, duration);



                            //animate previous to next
                            //$('#content .previous').css({ 'left' : '-73%'}).animate({'left' : '-151%'}, duration, easing, function(){$(this).remove();})
                            //.clone().addClass('next').removeClass('previous').appendTo('#content').css({ 'left' : '173%'}).animate({'left' : '95%'}, duration);               

            }

I do have some bug to fix and I don’t really see where are my errors…

So If there is any good developer who would like to work with me on this awesome template, that could be great.
Thanks for reading and don’t esitate to ask me more code.
Cheers

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T14:36:14+00:00Added an answer on June 16, 2026 at 2:36 pm

    i made a similar plugin, dedicated to flip to a non sequencial way, so it not show prev/next

    it also allow up/down and fade effect

    i write it for this website
    here it is full screen flip but can be done in any container (here it is on the body)

    designed to allow callback at each page state, and dynamic content load

    it also use jquery.queue system to put all move list in fifo list and allow trimming of unusefull movement

    so, not perfect, not what you really want but can maybe give you some inspiration, the code is under creative common 3.0 by-nc-sa

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got an issue which is, in my code,anyone can help will be great.
First things first, here is a little snippet code to help explain my problem:
I need your help if any one can be, it will be great thing
can someone please help me with this code, i'm missing something but can't figure
I think code will explain better than words. Basically the goal is that only
One per post will be great!
For example, how to get the version of /usr/lib/libz.a? It will be great if
imagine if you will the following string: A Great Movie (1999) DVDRip.avi I am
Will the following code cause a ConcurrentModificationException or other side effects? ArrayList<String> newList =
I am trying to learn and build talking puppet iPhone application. The great example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.