hPage.com Forum
Remember Me?
  #1 (permalink)  
Old 05-23-2009, 06:50 AM
Junior Member
 
Join Date: May 2009
Location: Bangalore
Posts: 18
Thanks: 0
Thanked 2 Times in 2 Posts
Question Animations

I could see some falling flowers or something in others web page. Can u please guide me in various ways for how to do animations on my web page.
Reply With Quote
The Following User Says Thank You to thangaroja81 For This Useful Post:
imti (10-07-2009)
  #2 (permalink)  
Old 05-25-2009, 10:12 AM
Member
 
Join Date: Mar 2009
Location: Udaipur, Rajasthan
Posts: 33
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Just go to Extras->Jimmics
Reply With Quote
The Following User Says Thank You to uday254 For This Useful Post:
Bontotiro (10-02-2010)
  #3 (permalink)  
Old 08-30-2009, 04:26 AM
jony4fun's Avatar
Junior Member
 
Join Date: Jan 2009
Posts: 22
Thanks: 1
Thanked 6 Times in 6 Posts
Arrow Hold My Helping Hand

Bubble Effect:
simply add the below chunk of code to the <BODY> section of your page, immediately following the <body> tag itself, to activate the effect:

HTML Code:
<script language="JavaScript1.2">
<!--
//Jony4fun.co.nr
var no = 15; // image number or falling rate
var speed = 2; // the lower the number the faster the image moves
var snow = new Array();
snow[0] = "bubble.gif"
snow[1] = "bubble.gif"
snow[2] = "bubble.gif"

var ns4up = (document.layers) ? 1 : 0;  // browser sniffer
var ie4up = (document.all) ? 1 : 0;
var ns6up = (document.getElementById&&!document.all) ? 1 : 0;
var dx, xp, yp;    // coordinate and position variables
var am, stx, sty;  // amplitude and step variables
var i, doc_width = 800, doc_height = 1800;

if (ns4up||ns6up) {
        doc_width = self.innerWidth;
        doc_height = self.innerHeight;
} else if (ie4up) {
        doc_width = document.body.clientWidth;
        doc_height = document.body.clientHeight;
}

dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();
j = 0;

for (i = 0; i < no; ++ i) {
        dx[i] = 0;                        // set coordinate variables
        xp[i] = Math.random()*(doc_width-50);  // set position variables
        yp[i] = Math.random()*doc_height;
        am[i] = Math.random()*20;         // set amplitude variables
        stx[i] = 0.02 + Math.random()/10; // set step variables
        sty[i] = 0.7 + Math.random();     // set step variables
        if (ns4up) {                      // set layers
                if (i == 0) {
                        document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><img src=\""+ snow[j] + "\" border=\"0\"></layer>");
                } else {
                        document.write("<layer name=\"dot"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><img src=\""+ snow[j] + "\" border=\"0\"></layer>");
                }        } else if (ie4up||ns6up) {                if (i == 0) 
{
                        document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"VISIBILITY: visible; TOP: 15px; LEFT: 15px; width:1;\"><img src=\"" + snow[j] + "\" border=\"0\"></div>");
                } else {
                        document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"VISIBILITY: visible; TOP: 15px; LEFT: 15px; width:1;\"><img src=\"" + snow[j] + "\" border=\"0\"></div>");
                }
        }
        if (j == (snow.length-1)) { j = 0; } else { j += 1; }
}

function snowNS() {  // Netscape main animation function
        for (i = 0; i < no; ++ i) {  // iterate for every dot
                yp[i] -= sty[i];                if (yp[i] < -50) {
                        xp[i] = Math.random()*(doc_width-am[i]-30);
                        yp[i] = doc_height;
                        stx[i] = 0.02 + Math.random()/10;
                        sty[i] = 0.7 + Math.random();
                        doc_width = self.innerWidth;
                        doc_height = self.innerHeight;                }
                dx[i] += stx[i];
                document.layers["dot"+i].top = yp[i]+pageYOffset;
                document.layers["dot"+i].left = xp[i] + 
am[i]*Math.sin(dx[i]);
        }
        setTimeout("snowNS()", speed);
}

function snowIE_NS6() {  // IE main animation function
        for (i = 0; i < no; ++ i) {  // iterate for every dot
                yp[i] -= sty[i];
                if (yp[i] < -50) {
                        xp[i] = Math.random()*(doc_width-am[i]-30);
                        yp[i] = doc_height;
                        stx[i] = 0.02 + Math.random()/10;
                        sty[i] = 0.7 + Math.random();
                        doc_width = ns6up?window.innerWidth-5:document.body.clientWidth;
                        doc_height = ns6up?window.innerHeight-5:document.body.clientHeight;
                }
                dx[i] += stx[i];
                if (ie4up){
                document.all["dot"+i].style.pixelTop = yp[i]+document.body.scrollTop;
                document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]);
                }
                else if (ns6up){
                document.getElementById("dot"+i).style.top=yp[i]+pageYOffset;
                document.getElementById("dot"+i).style.left=xp[i] + am[i]*Math.sin(dx[i]);
                }
        }
        setTimeout("snowIE_NS6()", speed);
}

if (ns4up) {
        snowNS();
} else if (ie4up||ns6up) {
        snowIE_NS6();
}
//End-->
</script>
Fire works:

Add the following script and stylesheet code to the <head> or body section of your page:

HTML Code:
<SCRIPT LANGUAGE="JavaScript1.2">
<!--
//Jony4fun.co.nr

//set Interval between each firework display, 
var intervals=2000
var sparksOn     = true;
var speed        = 40;
var power        = 3;

//Dont change these values-------
var documentWidth=documentHeight=randomx=randomy=leftcorner=topcorner=0
var ns=(document.layers);
var ie=(document.all);
var ns6=(document.getElementById&&!document.all);
var sparksAflyin = false;
var allDivs      = new Array(10);
var totalSparks  = 0;
//-------------------------------

function initAll(){
	if(!ns && !ie &&!ns6){
	sparksOn = false;
	return;
	}
setInterval("firework()",intervals)

if (ns)
	document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE);
	for(dNum=0; dNum<7; ++dNum){
		if(ie)
			allDivs[dNum]=eval('document.all.sDiv'+dNum+'.style');
                else if (ns6)
                        allDivs[dNum]=document.getElementById('sDiv'+dNum).style;
		else
			allDivs[dNum]=eval('document.layers["sDiv'+dNum+'"]');
	}
}

function firework(){
//below code detects the browser dimenions
if (ie){
documentWidth=document.body.clientWidth
documentHeight=document.body.clientHeight
leftcorner=document.body.scrollLeft
topcorner=document.body.scrollTop
}
else if (ns||ns6){
documentWidth=window.innerWidth
documentHeight=window.innerHeight
leftcorner=pageXOffset
topcorner=pageYOffset

}
//below code randomly generates a set of coordinates that fall within the dimension
randomx=leftcorner+Math.floor(Math.random()*documentWidth)
randomy=topcorner+Math.floor(Math.random()*documentHeight)


	if(sparksOn){
		if(!sparksAflyin){
			sparksAflyin=true;
			totalSparks=0;
			for(var spark=0;spark<=6;spark++){
				dx=Math.round(Math.random()*50);
				dy=Math.round(Math.random()*50);
				moveTo(spark,randomx,randomy,dx,dy);
			}
		}
	}
}

function moveTo(i,tempx,tempy,dx,dy){
	if(ie){
		if(tempy+80>(document.body.offsetHeight+document.body.scrollTop))
			tempy=document.body.offsetHeight+document.body.scrollTop-80;
		if(tempx+80>(document.body.offsetWidth+document.body.scrollLeft))
			tempx=document.body.offsetWidth+document.body.scrollLeft-80;
	}
	else if(ns6){
		if(tempy+80>(window.innerHeight+pageYOffset))
			tempy=window.innerHeight+pageYOffset-80;
		if(tempx+80>(window.innerWidth+pageXOffset))
			tempx=window.innerWidth+pageXOffset-80;
	}
	if(tempx>-50&&tempy>-50){
		tempx+=dx;tempy+=dy;	
		allDivs[i].left=tempx;
		allDivs[i].top=tempy;
		dx-=power;dy-=power;
		setTimeout("moveTo("+i+","+tempx+","+tempy+","+dx+","+dy+")",speed)
	}
	else
		++totalSparks
	if(totalSparks==7){
		sparksAflyin=false;
		totalSparks=0;
	}
}
window.onload=initAll
//End-->
</script>

<style>
#sDiv0 {position:absolute; height:1; width:1; font-family:arial black; font-size:15px; color:Aqua; z-index:9;}
#sDiv1 {position:absolute; height:1; width:1; font-family:arial black; font-size:15px; color:red; z-index:10;}
#sDiv2 {position:absolute; height:1; width:1; font-family:arial black; font-size:15px; color:blue; z-index:11;}
#sDiv3 {position:absolute; height:1; width:1; font-family:arial black; font-size:15px; color:orange; z-index:12;}
#sDiv4 {position:absolute; height:1; width:1; font-family:arial black; font-size:15px; color:yellow; z-index:13;}
#sDiv5 {position:absolute; height:1; width:1; font-family:arial black; font-size:15px; color:lightgreen; z-index:14;}
#sDiv6 {position:absolute; height:1; width:1; font-family:arial black; font-size:15px; color:silver; z-index:15;}
</style>
<div id="sDiv0">*</div>
<div id="sDiv1">*</div>
<div id="sDiv2">*</div>
<div id="sDiv3">*</div>
<div id="sDiv4">*</div>
<div id="sDiv5">*</div>
<div id="sDiv6">*</div>
Reply With Quote
The Following User Says Thank You to jony4fun For This Useful Post:
vksiva (10-25-2009)
  #4 (permalink)  
Old 10-08-2009, 04:50 AM
Junior Member
 
Join Date: Oct 2009
Location: A.P
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
Default doubt

adding the html source to the body means.......
i dont know what refers body here...
can u plz tell
Reply With Quote
The Following User Says Thank You to sandeep For This Useful Post:
Amit Rastogi (12-10-2009)
  #5 (permalink)  
Old 10-10-2009, 01:08 PM
Junior Member
 
Join Date: Aug 2009
Posts: 15
Thanks: 0
Thanked 5 Times in 5 Posts
Default RE: doubt

<body> is a HTML tag
Reply With Quote
The Following User Says Thank You to Arpit13 For This Useful Post:
sankarapandian (10-25-2009)
  #6 (permalink)  
Old 11-10-2009, 02:59 PM
Banned
 
Join Date: Nov 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

This is impossible in Html. you have to use Javascript
Reply With Quote
  #7 (permalink)  
Old 12-05-2009, 12:50 PM
jony4fun's Avatar
Junior Member
 
Join Date: Jan 2009
Posts: 22
Thanks: 1
Thanked 6 Times in 6 Posts
Thumbs up rep::

paste those codes in any page in html mode.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


All times are GMT. The time now is 09:59 PM.
Archive - Top