Useful JQuery Slide Popup
In this demo we'll going to share a new way to show a pop up message. Everyone is getting bored with typical fade in fade out pop up messages. So let’s make it interesting with a pinch of jquery and css.
we are going to make two javascript functions which will be used to slide in and slide out a div.
function openOffersDialog() { $('#overlay').fadeIn('fast', function() { $('#boxpopup').css('display','block'); $('#boxpopup').animate({'left':'30%'},500); }); } function closeOffersDialog(prospectElementID) { $(function($) { $(document).ready(function() { $('#' + prospectElementID).css('position','absolute'); $('#' + prospectElementID).animate({'left':'-100%'}, 500, function() { $('#' + prospectElementID).css('position','fixed'); $('#' + prospectElementID).css('left','100%'); $('#overlay').fadeOut('fast'); }); }); }); }
In the first function we are making a call to a div to fadeIn and in that fade in function we are sliding our popup from right to left.
The next function is used to slide the function from center of the screen to the extreme left side so it appears us to be disappeared. In this function we also set the overlay div to fadeout.
So let’s construct with our HTML part.
<body onload="openOffersDialog();"> <div id="wrapper"> <div id="overlay" class="overlay"></div> <a onclick="openOffersDialog();">Click Here To See The PopUp</a> <div id="boxpopup" class="box"> <a onclick="closeOffersDialog('boxpopup');" class="boxclose"></a> <div id="content"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean commodo ligula eget dolor. Aenean massa. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Donec quam felis, ultricies nec, pellentesque eu, pretium quis, sem. Nulla consequat massa quis enim. Donec pede justo, fringilla vel, aliquet nec, vulputate eget, arcu. In enim justo, rhoncus ut, imperdiet a, venenatis vitae, justo. Nullam dictum felis eu pede mollis pretium. Integer tincidunt. Cras dapibus. Vivamus elementum semper nisi. Aenean vulputate eleifend tellus. Aenean leo ligula, porttitor eu, consequat vitae, eleifend ac, enim. Aliquam lorem ante, dapibus in, viverra quis, feugiat a, tellus. Phasellus viverra nulla ut metus varius laoreet. Quisque rutrum. </div> </div> </div> </body>
The article source:http://www.webstutorial.com/jquery-popup-jquery-slide-popup/jquery
You might also like
Tags
accordion accordion menu animation navigation animation navigation menu carousel checkbox inputs css3 css3 menu css3 navigation date picker dialog drag drop drop down menu drop down navigation menu elastic navigation form form validation gallery glide navigation horizontal navigation menu hover effect image gallery image hover image lightbox image scroller image slideshow multi-level navigation menus rating select dependent select list slide image slider menu stylish form table tabs text effect text scroller tooltips tree menu vertical navigation menu