popup slide effect with only javascript

Sponsors

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.

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


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.


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"
}

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.

Incoming search terms:

You may like following Articles!

This entry was posted in JavaScript, tutorials by Wordpress API. Bookmark the permalink.

About Wordpress API

API means Application Program interface. In Wordpress API we are giving all the information about wordpress API. We worked for many wordpress plugins and themes. We have expertise in PHP, Databases, Graphic Design, Ruby on Rails, Java, Wordpress, Drupal and many CMS. We always give you the best solutions about wordpress and other related topics in This Blog. We will give you always fresh tips and tricks and techniques about wordpress in this blog.

10 thoughts on “popup slide effect with only javascript

  1. Pingback: Tweets that mention popup slide effect with only javascript | Developer Code book -- Topsy.com

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>