jQuery Plugins » Sessions https://jqueryplugins.info jQuery plugins, tutorials and resources Wed, 19 Oct 2011 13:14:08 +0000 en hourly 1 http://wordpress.org/?v=3.2.1 Getting a nice transition effect with jquery, php sessions and a page refresh? https://jqueryplugins.info/2011/10/getting-a-nice-transition-effect-with-jquery-php-sessions-and-a-page-refresh/ https://jqueryplugins.info/2011/10/getting-a-nice-transition-effect-with-jquery-php-sessions-and-a-page-refresh/#comments Fri, 07 Oct 2011 01:13:59 +0000 Admin https://jqueryplugins.info/2011/10/getting-a-nice-transition-effect-with-jquery-php-sessions-and-a-page-refresh/ Post link: Getting a nice transition effect with jquery, php sessions and a page refresh?

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...

]]>
Post link: Getting a nice transition effect with jquery, php sessions and a page refresh?

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?

newest questions tagged jquery – Stack Overflow

]]>
https://jqueryplugins.info/2011/10/getting-a-nice-transition-effect-with-jquery-php-sessions-and-a-page-refresh/feed/ 0
Ajax Jquery Online Store – Sessions, foreach and live updating https://jqueryplugins.info/2011/08/ajax-jquery-online-store-sessions-foreach-and-live-updating/ https://jqueryplugins.info/2011/08/ajax-jquery-online-store-sessions-foreach-and-live-updating/#comments Wed, 10 Aug 2011 19:07:27 +0000 Admin https://jqueryplugins.info/2011/08/ajax-jquery-online-store-sessions-foreach-and-live-updating/ Post link: Ajax Jquery Online Store – Sessions, foreach and live updating

since everything is stored in the session we make a function that when you keyup from the quantity we call ajax to update the session data and read all the...

]]>
Post link: Ajax Jquery Online Store – Sessions, foreach and live updating

since everything is stored in the session we make a function that when you keyup from the quantity we call ajax to update the session data and read all the other items and give you back the total price we also go over calculating the total, creating US currency with PHP and we go over how to and when to use a triple array
Video Rating: 5 / 5

]]>
https://jqueryplugins.info/2011/08/ajax-jquery-online-store-sessions-foreach-and-live-updating/feed/ 0