C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Resources » Code Snippets » Javascript »

Sparkling Mouse Pointer Using Java Script


Posted Date: 03 Jul 2009    Resource Type: Code Snippets    Category: Javascript
Author: ManigandanMember Level: Gold    
Rating: 1 out of 5Points: 10



Hi,

This code is really add Effective animations to your page with the Sparkling mouse Pointer.

Add this in the Header Tag




<STYLE TYPE="text/css">
<!--

BODY{
overflow-x:hidden;
}

.s1
{
position : absolute;
font-size : 10pt;
color : pink;
visibility: hidden;
}

.s2
{
position : absolute;
font-size : 19pt;
color : silver;
visibility : hidden;
}

.s3
{
position : absolute;
font-size : 15pt;
color : gold;
visibility : hidden;
}

.s4
{
position : absolute;
font-size : 12pt;
color : red;
visibility : hidden;
}


</STYLE>



Now add this Codings under the Body Tag





<DIV ID="div1" CLASS="s1">@</DIV>
<DIV ID="div2" CLASS="s2">$</DIV>
<DIV ID="div3" CLASS="s3">@</DIV>
<DIV ID="div4" CLASS="s4">$</DIV>

<p align="center"><font face="arial" size="-2">Java Script</font><br>
<font face="arial, helvetica" size="-2"><a href="http://www.manicse85.blogspot.com"></a></font></p>

<SCRIPT LANGUAGE="javascript" TYPE="text/javascript">



var standardbody=(document.compatMode=="CSS1Compat")? document.documentElement : document.body

var nav = (!document.all || window.opera);
var tmr = null;
var spd = 50;
var x = 0;
var x_offset = 5;
var y = 0;
var y_offset = 15;

document.onmousemove = get_mouse;

function get_mouse(e)
{
x = (nav) ? e.pageX : event.clientX+standardbody.scrollLeft;
y = (nav) ? e.pageY : event.clientY+standardbody.scrollTop;
x += x_offset;
y += y_offset;
beam(1);
}

function beam(n)
{
if(n<5)
{
document.getElementById('div'+n).style.top=y+'px'
document.getElementById('div'+n).style.left=x+'px'
document.getElementById('div'+n).style.visibility='visible'
n++;
tmr=setTimeout("beam("+n+")",spd);
}
else
{
clearTimeout(tmr);
fade(4);
}
}

function fade(n)
{
if(n>0)
{
document.getElementById('div'+n).style.visibility='hidden'
n--;
tmr=setTimeout("fade("+n+")",spd);
}
else clearTimeout(tmr);
}

// -->
</SCRIPT>




Responses


No responses found. Be the first to respond and make money from revenue sharing program.

Feedbacks      
Popular Tags   What are tags ?   Search Tags  
Sign In to add tags.
Mouse Poiner animations in Java Script  .  

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Displaying CountDown While Redirecting the Page using JavaScript
Previous Resource: Display text in status bar using javascript
Return to Discussion Resource Index
Post New Resource
Category: Javascript


Post resources and earn money!
 
More Resources



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use