popup slide effect with only javascript

If you want the nice slide animation effect with javascript. you can use following javascript. Here I am not using any third party javascript library for creating the slide effect. Slide effect with popup you can achieve with only javascript.

popup slide effect with only javascript

For In page popup slide effect you can use following JavaScript code.


<div id="popup-container" style="height:200px;weight:200px;overflow: hidden; display: block; position: absolute; z-index: 1027;">

<a href="#" onclick="movead();" ><span>slide</span></a>

</div>

and use the following javscript code in your document.

[viral-lock message=”Solution code is Hidden! It’s Visible for Users who Liked/Shared This article on Facebook or Twitter or Google+. Like or Tweet this article to reveal the content.”]


function movead(){
timerID = setInterval("mocontainer()", 50);
}

function mocontainer(){
 var popup_element = document.getElementById('popup-container');
 animate_moveit(popup_element,0,-5);
}

function animate_moveit(obj, x, y){
obj.style.left = parseInt(obj.style.left) + x +"px"
obj.style.top = parseInt(obj.style.top)+ y + "px"
}

[/viral-lock]

For changing the slide direction change the values in following line and put in to the mocontainer function

animate_moveit(popup-element,-5,0);  – this is for right to left

animate_moveit(popup-element,0,-5);  – bottom to top

You can change that to as per need.

in page popup javascript or modalbox

in page popup javascript or modalbox, we got requirement to create in-page pop up in my project. we got many open source javascripts and CSS libraries.

in page popup javascript or modalbox

I got many open source javascripts and CSS libraries. I found some of them are useful. Here i given the list of libraries:

1.  lightbox2.04

Lightbox is a simple, unobtrusive script used to overlay images on the current page. It’s a snap to setup and works on all modern browsers.

URL: http://www.lokeshdhakar.com/projects/lightbox2/

My comments: useful for image slideshow.  Not useful for custom requirements.

2. modalbox_1.5.5

My comments: Very nice and simple, You can use this JS for multiple requirements.

URL : http://okonet.ru/projects/modalbox/

3. tinybox

My comments: simple and good, really tiny JS, you can modify and create custom events and effects.

URL: http://www.leigeber.com/2009/05/javascript-popup-box/

4. Good URL for Reference

http://www.emanueleferonato.com/2007/08/22/create-a-lightbox-effect-only-with-css-no-javascript-needed/