Friday 10, February 2012
Welcome Guest, Register | Login  
      Home    |    Tutorials    |    Free Ebooks    |    Free Scripts    |    Articles    |    Blog     |    Forum    |    About Us    |    Contact Us

  JavaScript Sequential fly-in text script

This script flies in multiple text from the left edge of the window, one at a time in sequential order similar to a PowerPoint effect. It's versatile enough to handle any number of text (or other rich HTML like images!), and you can customize both the animation speed and pause between each message. A nice effect to highlight important points on your page!
Cut & Paste Script
<style type="text/css">

.glidetext{
position: relative;
/*Set initial position of your text. Make it just enough to hide the text from view:*/
left: -500px;
}

</style>

<script type="text/javascript">

//Sequential fly-in text script- by JavaScriptKit.com
//For this script and 400+ more, visit http://www.javascriptkit.com
//This notice must stay intact for use

var pausebetweenmsg=10 //customize pause in miliseconds between each message showing up (3000=3 seconds)
var glidespeed=50 //customize glide speed in pixels per frame.

var curobjindex=0

function actualstyle(el, cssproperty){
if (el.currentStyle)
return el.currentStyle[cssproperty]
else if (window.getComputedStyle){
var elstyle=window.getComputedStyle(el, "")
return elstyle.getPropertyValue(cssproperty)
}
}

function collectElementbyClass(){
var classname="glidetext"
glidearray=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
glidearray[inc++]=alltags[i]
}
if (glidearray.length>0)
onebyoneglide()
}

function onebyoneglide(){
if (curobjindex<glidearray.length)
glidetimer=setInterval("glideroutine()",50)
}

function glideroutine(){
if (parseInt(actualstyle(glidearray[curobjindex], "left"))<0)
glidearray[curobjindex].style.left=parseInt(actualstyle(glidearray[curobjindex], "left"))+50+"px"
else{
glidearray[curobjindex].style.left=0
curobjindex++
clearInterval(glidetimer)
setTimeout("onebyoneglide()", pausebetweenmsg)
}
}

if (window.addEventListener)
window.addEventListener("load", collectElementbyClass, false)
else if (window.attachEvent)
window.attachEvent("onload", collectElementbyClass)
else if (document.getElementById)
window.onload=collectElementbyClass

</script>

 
<div class="glidetext">This is text 1</div>
<p class="glidetext">Another text (or image) <img src="test2.gif"></p>
<div class="glidetext">This is text 3</div>
<div class="glidetext">This is text 4</div>
 
   
     RELATED SCRIPTS
 
Dynamically Add and Remove HTML Controlls using JavaScript
this script can be used to add HTML controls to your forms dynamically.
...more »
Category : JavaScript Examples Hits : 581
   
A sample JSON definition
JavaScript Object Notation, has become a popular alternative to XML for defining structured data using JavaScript.
In strict JSON:
  • All string values must be in double quotes (single quotes won't do).
  • The name portion of each name/value pair must also be ...more »
Category : JavaScript Examples Hits : 359
   
Drop Down World Clock Using JavaScript
Look up the time of various cities around the world easily with this useful script! Configurable to use cities of your choice....more »
Category : JavaScript Examples Hits : 455
   
popup window using javascript
This javascript can be used to create a popup window. It will display a mini popup window when page loads....more »
Category : JavaScript Examples Hits : 286
   
Google Internal Site Search Script
This script will enable you to search within a site using Google search....more »
Category : JavaScript Examples Hits : 918
   
   
SCRIPT CATEGORIES
 
  C Programs
C Programs scripts
  C++ Programs
C++ Programs scripts
  Java Programs
Java Programs scripts
  JavaScript Examples
JavaScript Examples scripts
  PHP Examples
PHP Examples scripts
  VBScript Examples
VBScript Examples scripts
 
 
 
POPULAR E-BOOKS
 
Download Save 100 s on Your Phone Bill The Savvy Consumer s Guide to Voip  Ebook Save 100 s on Your Phone Bill The Savvy Consumer s Guide to Voip
   
Download Capability-Based Computer Systems  Ebook Capability-Based Computer Systems
   
Download Handbook of Software Reliability Engineering  Ebook Handbook of Software Reliability Engineering
   
Download Guide To Cashing In On eBay Ebook Guide To Cashing In On eBay
   
Download  Your Ultimate Inspirational Guide Ebook Your Ultimate Inspirational Guide
   
 
Studiesinn.com © 2012 All Rights Reserved.
Website Designed & Developed by TechXprtz