//use vertical view for better experience var wh = 643, allscreens = [], elem = undefined, init = function(x){ wh = $( window ).height(); if(!x) x = 1; elem = $('.ver'); $('.tela').each(function(){ allscreens.push($(this)); }); scrn.change(x); }, scrn = { active : undefined, goTo : function(n){ var previous = $('.active'); }, change : function(n){ n = n-1; var previous = $('.active'); previous.addClass('exiting'); setTimeout(function() { previous.removeClass('exiting'); previous.removeClass('active'); previous.addClass('kicked') allscreens[n].removeClass('kicked'); allscreens[n].addClass('active'); }, 1000); this.goTo(n); this.active = n; elem.attr('data-tela', n); }, }; jQuery(document).ready(function($) { init(); $('.pg-link').on('click', function(event) { event.preventDefault(); /* Act on the event */ var t = $(this), d = t.attr('data-des'); scrn.change(d); }); $('.choose-pw').on('click', 'label', function(event) { $('.check').removeClass('check'); $(this).addClass('check'); /* Act on the event */ }); $('.sth').height(wh); });