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

  • SEARCH
  • Home
  • 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 6663681
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:31:33+00:00 2026-05-26T02:31:33+00:00

I am looking to make a nice transition effect for a dynamic user layout

  • 0

I am looking to make a nice transition effect for a dynamic user layout system I have created.

My layout relies on a session being either the value of 1 or 2, I then call the layout using a switch statement.

switch ($_SESSION['layout']) {

    case 1: break;
    case 2: break;
}

I have also created a button that they can click to change the layout using ajax. The jquery for this is like so:

$('#changeLayout').click(function() {

    $.ajax({data: {changeLayout: 'mainLayout'}});
    $('#fluidWrap').fadeOut();
    setTimeout(function() {
        window.location = 'http://www.example.com/preferences';
    }, 1000);
return false;
});

The ajax is as follows:

if ($_SESSION['layout'] == 1) {

    $q = $dbc -> prepare("UPDATE layout SET layout = 2 WHERE id = ?");
    $q -> execute(array($_SESSION['id']));
    $_SESSION['layout'] = '2';
}
else {
    $q = $dbc -> prepare("UPDATE layout SET layout = 1 WHERE id = ?");
    $q -> execute(array($_SESSION['id']));
    $_SESSION['layout'] = '1';
}

Now at the minute when the user clicks the button to change the layout the div #fluidWrap fades out, the ajax request has 1 second to change the session data and add it to the database, and the page reloads. All works well.

I was wondering how I can improve on this to maybe make a transition effect where the page slides out and slides back in again, how would I go about doing this?

I can’t add an effect with jquery for the div #fluidWrap to fade in, as on every load of the page it will of course fade in. How can I tell jquery to only fade in the body if the button was clicked after a page load?

  • 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-05-26T02:31:34+00:00Added an answer on May 26, 2026 at 2:31 am

    Your question inspired me to code this up in Agile Toolkit:

    http://codepad.agiletoolkit.org/layoutswitch

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

Sidebar

Related Questions

I am trying to make nice looking user input buttons for my app. Just
I'm looking for a good graphic framework to make a nice 2D game in
I want to make a nice, modern-looking transitions between pages. I've found this tutorial:
I have a CSS class that makes my links look like nice looking buttons.
I'm trying to make a nice looking UIButton. I'm not exactly sure what I
I'm wasting hours here with .htaccess to make those nice looking URLs possible and
I'm trying to make an Android layout like the one below. I have a
Menu are looking very nice in all website so i want to make such
I am looking to make a nice demo of the problem I mentioned in
I'm trying to make a nice-looking CSS menu, for this website . (The domain

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.