×

网页动态特效代码 网页鼠标特效代码 鼠标特效代码

急求各种网页鼠标特效代码(只要代码,不要网址)?急求各种网页鼠标特效代码(只要代码,不要网址)

admin admin 发表于2022-07-11 17:17:53 浏览117 评论0

抢沙发发表评论

急求各种网页鼠标特效代码(只要代码,不要网址)


很酷的跟随鼠标的三色彩带
html》
《head》
《title》网页特效|Linkweb.cn/Js|---很酷的跟随鼠标的三色彩带《/title》
《/head》《body bgColor=#000000》
《!--将以下代码加入HTML的《Body》《/Body》之间--》

《script language=“JavaScript“》
《!--
var a_Colour=’fff000’;
var b_Colour=’00ff00’;
var c_Colour=’ff00ff’;
var Size=120;

var YDummy=new Array(),XDummy=new Array(),xpos=0,ypos=0,ThisStep=0;step=0.6;
if (document.layers){
window.captureEvents(Event.MOUSEMOVE);
function nsMouse(evnt){
xpos = window.pageYOffset+evnt.pageX+6;
ypos = window.pageYOffset+evnt.pageY+16;
}
window.onMouseMove = nsMouse;
}
else if (document.all)
{
function ieMouse(){
xpos = document.body.scrollLeft+event.x+6;
ypos = document.body.scrollTop+event.y+16;
}
document.onmousemove = ieMouse;
}

function swirl(){
for (i = 0; i 《 3; i++)
{
YDummy[i]=ypos+Size*Math.sin((1*Math.sin((ThisStep)/10))+i*2)*Math.sin((ThisStep)/4);
XDummy[i]=xpos+Size*Math.cos((1*Math.sin((ThisStep)/10))+i*2)*Math.sin((ThisStep)/4);
}
ThisStep+=step;
setTimeout(’swirl()’,10);
}

var amount=10;
if (document.layers){
for (i = 0; i 《 amount; i++)
{
document.write(’《layer name=nsa’+i+’ top=0 left=0 width=’+i/2+’ height=’+i/2+’ bgcolor=’+a_Colour+’》《/layer》’);
document.write(’《layer name=nsb’+i+’ top=0 left=0 width=’+i/2+’ height=’+i/2+’ bgcolor=’+b_Colour+’》《/layer》’);
document.write(’《layer name=nsc’+i+’ top=0 left=0 width=’+i/2+’ height=’+i/2+’ bgcolor=’+c_Colour+’》《/layer》’);
}
}
else if (document.all){
document.write(’《div id=“ODiv“ style=“position:absolute;top:0px;left:0px“》’
+’《div id=“IDiv“ style=“position:relative“》’);
for (i = 0; i 《 amount; i++)
{
document.write(’《div id=x style=“position:absolute;top:0px;left:0px;width:’+i/2+’;height:’+i/2+’;background:’+a_Colour+’;font-size:’+i/2+’“》《/div》’);
document.write(’《div id=y style=“position:absolute;top:0px;left:0px;width:’+i/2+’;height:’+i/2+’;background:’+b_Colour+’;font-size:’+i/2+’“》《/div》’);
document.write(’《div id=z style=“position:absolute;top:0px;left:0px;width:’+i/2+’;height:’+i/2+’;background:’+c_Colour+’;font-size:’+i/2+’“》《/div》’);
}
document.write(’《/div》《/div》’);
}
function prepos(){
var ntscp=document.layers;
var msie=document.all;
if (document.layers){
for (i = 0; i 《 amount; i++)
{
if (i 《 amount-1)
{
ntscp[’nsa’+i].top=ntscp[’nsa’+(i+1)].top;ntscp[’nsa’+i].left=ntscp[’nsa’+(i+1)].left;
ntscp[’nsb’+i].top=ntscp[’nsb’+(i+1)].top;ntscp[’nsb’+i].left=ntscp[’nsb’+(i+1)].left;
ntscp[’nsc’+i].top=ntscp[’nsc’+(i+1)].top;ntscp[’nsc’+i].left=ntscp[’nsc’+(i+1)].left;
}
else
{
ntscp[’nsa’+i].top=YDummy;ntscp[’nsa’+i].left=XDummy;
ntscp[’nsb’+i].top=YDummy;ntscp[’nsb’+i].left=XDummy;
ntscp[’nsc’+i].top=YDummy;ntscp[’nsc’+i].left=XDummy;
}
}
}
else if (document.all){
for (i = 0; i 《 amount; i++)
{
if (i 《 amount-1)
{
msie.x[i].style.top=msie.x[i+1].style.top;msie.x[i].style.left=msie.x[i+1].style.left;
msie.y[i].style.top=msie.y[i+1].style.top;msie.y[i].style.left=msie.y[i+1].style.left;
msie.z[i].style.top=msie.z[i+1].style.top;msie.z[i].style.left=msie.z[i+1].style.left;
}
else
{
msie.x[i].style.top=YDummy;msie.x[i].style.left=XDummy;
msie.y[i].style.top=YDummy;msie.y[i].style.left=XDummy;
msie.z[i].style.top=YDummy;msie.z[i].style.left=XDummy;
}
}
}
setTimeout(“prepos()“,10);
}
function Start(){
swirl(),prepos()
}
window.onload=Start;
// --》
《/script》
《/body》《/html》

跟随鼠标很逼真的弹性小球
《html》
《head》
《title》网页特效|Linkweb.cn/Js|---跟随鼠标很逼真的弹性小球《/title》
《/head》《body》
《!--将以下代码加入HTML的《Body》《/Body》之间--》

《DIV id=dot0
style=“HEIGHT: 16; POSITION: absolute; VISIBILITY: hidden; WIDTH: 11; left:10; top:15“》《IMG
height=11 src=“images/bullet.gif“ width=11》 《/DIV》
《DIV id=dot1 style=“HEIGHT: 11px; POSITION: absolute; WIDTH: 11px“》《IMG
height=11 src=“images/bullet.gif“ width=11》 《/DIV》
《DIV id=dot2 style=“HEIGHT: 11px; POSITION: absolute; WIDTH: 11px“》《IMG
height=11 src=“images/bullet.gif“ width=11》 《/DIV》
《DIV id=dot3 style=“HEIGHT: 11px; POSITION: absolute; WIDTH: 11px“》《IMG
height=11 src=“images/bullet.gif“ width=11》 《/DIV》
《DIV id=dot4 style=“HEIGHT: 11px; POSITION: absolute; WIDTH: 11px“》《IMG
height=11 src=“images/bullet.gif“ width=11》 《/DIV》
《DIV id=dot5 style=“HEIGHT: 11px; POSITION: absolute; WIDTH: 11px“》《IMG
height=11 src=“images/bullet.gif“ width=11》 《/DIV》
《DIV id=dot6 style=“HEIGHT: 16; POSITION: absolute; WIDTH: 11; left:10; top:15“》《IMG
height=11 src=“images/bullet.gif“ width=11》 《/DIV》
《SCRIPT language=JavaScript》
var nDots = 7;
var Xpos = 0;
var Ypos = 0;
var DELTAT = .01;
var SEGLEN = 10;
var SPRINGK = 10;
var MASS = 1;
var XGRAVITY = 0;
var YGRAVITY = 50;
var RESISTANCE = 10;
var STOPVEL = 0.1;
var STOPACC = 0.1;
var DOTSIZE = 11;
var BOUNCE = 0.75;
var isNetscape = navigator.appName==“Netscape“;
var followmouse = true;
var dots = new Array();
init();
function init()
{
var i = 0;
for (i = 0; i 《 nDots; i++) {
dots[i] = new dot(i);
}

if (!isNetscape) {
}
for (i = 0; i 《 nDots; i++) {
dots[i].obj.left = dots[i].X;
dots[i].obj.top = dots[i].Y;
}
if (isNetscape) {
startanimate();
} else {
setTimeout(“startanimate()“, 1000);
}
}
function dot(i)
{
this.X = Xpos;
this.Y = Ypos;
this.dx = 0;
this.dy = 0;
if (isNetscape) {
this.obj = eval(“document.dot“ + i);
} else {
this.obj = eval(“dot“ + i + “.style“);
}
}
function startanimate() {
setInterval(“animate()“, 20);
}
function setInitPositions(dots)
{
var startloc = document.all.tags(“LI“);
var i = 0;
for (i = 0; i 《 startloc.length && i 《 (nDots - 1); i++) {
dots[i+1].X = startloc[i].offsetLeft
startloc[i].offsetParent.offsetLeft - DOTSIZE;
dots[i+1].Y = startloc[i].offsetTop +
startloc[i].offsetParent.offsetTop + 2*DOTSIZE;
}
dots.X = dots.X;
dots.Y = dots.Y - SEGLEN;
}
function MoveHandler(e)
{
Xpos = e.pageX;
Ypos = e.pageY;
return true;
}
function MoveHandlerIE() {
Xpos = window.event.x + document.body.scrollLeft;
Ypos = window.event.y + document.body.scrollTop;
}

if (isNetscape) {
document.captureEvents(Event.MOUSEMOVE);
document.onMouseMove = MoveHandler;
} else {
document.onmousemove = MoveHandlerIE;
}

function vec(X, Y)
{
this.X = X;
this.Y = Y;
}
function springForce(i, j, spring)
{
var dx = (dots[i].X - dots[j].X);
var dy = (dots[i].Y - dots[j].Y);
var len = Math.sqrt(dx*dx + dy*dy);
if (len 》 SEGLEN) {
var springF = SPRINGK * (len - SEGLEN);
spring.X += (dx / len) * springF;
spring.Y += (dy / len) * springF;
}
}
function animate() {
var start = 0;
if (followmouse) {
dots.X = Xpos;
dots.Y = Ypos;
start = 1;
}
for (i = start ; i 《 nDots; i++ ) {

var spring = new vec(0, 0);
if (i 》 0) {
springForce(i-1, i, spring);
}
if (i 《 (nDots - 1)) {
springForce(i+1, i, spring);
}
var resist = new vec(-dots[i].dx * RESISTANCE,
-dots[i].dy * RESISTANCE);
var accel = new vec((spring.X + resist.X)/MASS + XGRAVITY,
(spring.Y + resist.Y)/ MASS + YGRAVITY);
dots[i].dx += (DELTAT * accel.X);
dots[i].dy += (DELTAT * accel.Y);
if (Math.abs(dots[i].dx) 《 STOPVEL &&
Math.abs(dots[i].dy) 《 STOPVEL &&
Math.abs(accel.X) 《 STOPACC &&
Math.abs(accel.Y) 《 STOPACC) {
dots[i].dx = 0;
dots[i].dy = 0;
}
dots[i].X += dots[i].dx;
dots[i].Y += dots[i].dy;
var height, width;
if (isNetscape) {
height = window.innerHeight + window.pageYOffset;
width = window.innerWidth + window.pageXOffset;
} else {
height = document.body.clientHeight + document.body.scrollTop;
width = document.body.clientWidth + document.body.scrollLeft;
}
if (dots[i].Y 》= height - DOTSIZE - 1) {
if (dots[i].dy 》 0) {
dots[i].dy = BOUNCE * -dots[i].dy;
}
dots[i].Y = height - DOTSIZE - 1;
}
if (dots[i].X 》= width - DOTSIZE) {
if (dots[i].dx 》 0) {
dots[i].dx = BOUNCE * -dots[i].dx;
}
dots[i].X = width - DOTSIZE - 1;
}
if (dots[i].X 《 0) {
if (dots[i].dx 《 0) {
dots[i].dx = BOUNCE * -dots[i].dx;
}
dots[i].X = 0;
}
dots[i].obj.left = dots[i].X;
dots[i].obj.top = dots[i].Y;
}
}
《/SCRIPT》

《/body》《/html》

这里太小了 放不了那么多
http://www.jscode.cn/jave_mouse/29051032.htm
里面有很多的 不想链接的话 就看那两个吧

急求各种网页鼠标特效代码(只要代码,不要网址)


很酷的跟随鼠标的三色彩带
html》
《head》
《title》网页特效|Linkweb.cn/Js|---很酷的跟随鼠标的三色彩带《/title》
《/head》《body bgColor=#000000》
《!--将以下代码加入HTML的《Body》《/Body》之间--》

《script language=“JavaScript“》
《!--
var a_Colour=’fff000’;
var b_Colour=’00ff00’;
var c_Colour=’ff00ff’;
var Size=120;

var YDummy=new Array(),XDummy=new Array(),xpos=0,ypos=0,ThisStep=0;step=0.6;
if (document.layers){
window.captureEvents(Event.MOUSEMOVE);
function nsMouse(evnt){
xpos = window.pageYOffset+evnt.pageX+6;
ypos = window.pageYOffset+evnt.pageY+16;
}
window.onMouseMove = nsMouse;
}
else if (document.all)
{
function ieMouse(){
xpos = document.body.scrollLeft+event.x+6;
ypos = document.body.scrollTop+event.y+16;
}
document.onmousemove = ieMouse;
}

function swirl(){
for (i = 0; i 《 3; i++)
{
YDummy[i]=ypos+Size*Math.sin((1*Math.sin((ThisStep)/10))+i*2)*Math.sin((ThisStep)/4);
XDummy[i]=xpos+Size*Math.cos((1*Math.sin((ThisStep)/10))+i*2)*Math.sin((ThisStep)/4);
}
ThisStep+=step;
setTimeout(’swirl()’,10);
}

var amount=10;
if (document.layers){
for (i = 0; i 《 amount; i++)
{
document.write(’《layer name=nsa’+i+’ top=0 left=0 width=’+i/2+’ height=’+i/2+’ bgcolor=’+a_Colour+’》《/layer》’);
document.write(’《layer name=nsb’+i+’ top=0 left=0 width=’+i/2+’ height=’+i/2+’ bgcolor=’+b_Colour+’》《/layer》’);
document.write(’《layer name=nsc’+i+’ top=0 left=0 width=’+i/2+’ height=’+i/2+’ bgcolor=’+c_Colour+’》《/layer》’);
}
}
else if (document.all){
document.write(’《div id=“ODiv“ style=“position:absolute;top:0px;left:0px“》’
+’《div id=“IDiv“ style=“position:relative“》’);
for (i = 0; i 《 amount; i++)
{
document.write(’《div id=x style=“position:absolute;top:0px;left:0px;width:’+i/2+’;height:’+i/2+’;background:’+a_Colour+’;font-size:’+i/2+’“》《/div》’);
document.write(’《div id=y style=“position:absolute;top:0px;left:0px;width:’+i/2+’;height:’+i/2+’;background:’+b_Colour+’;font-size:’+i/2+’“》《/div》’);
document.write(’《div id=z style=“position:absolute;top:0px;left:0px;width:’+i/2+’;height:’+i/2+’;background:’+c_Colour+’;font-size:’+i/2+’“》《/div》’);
}
document.write(’《/div》《/div》’);
}
function prepos(){
var ntscp=document.layers;
var msie=document.all;
if (document.layers){
for (i = 0; i 《 amount; i++)
{
if (i 《 amount-1)
{
ntscp[’nsa’+i].top=ntscp[’nsa’+(i+1)].top;ntscp[’nsa’+i].left=ntscp[’nsa’+(i+1)].left;
ntscp[’nsb’+i].top=ntscp[’nsb’+(i+1)].top;ntscp[’nsb’+i].left=ntscp[’nsb’+(i+1)].left;
ntscp[’nsc’+i].top=ntscp[’nsc’+(i+1)].top;ntscp[’nsc’+i].left=ntscp[’nsc’+(i+1)].left;
}
else
{
ntscp[’nsa’+i].top=YDummy;ntscp[’nsa’+i].left=XDummy;
ntscp[’nsb’+i].top=YDummy;ntscp[’nsb’+i].left=XDummy;
ntscp[’nsc’+i].top=YDummy;ntscp[’nsc’+i].left=XDummy;
}
}
}
else if (document.all){
for (i = 0; i 《 amount; i++)
{
if (i 《 amount-1)
{
msie.x[i].style.top=msie.x[i+1].style.top;msie.x[i].style.left=msie.x[i+1].style.left;
msie.y[i].style.top=msie.y[i+1].style.top;msie.y[i].style.left=msie.y[i+1].style.left;
msie.z[i].style.top=msie.z[i+1].style.top;msie.z[i].style.left=msie.z[i+1].style.left;
}
else
{
msie.x[i].style.top=YDummy;msie.x[i].style.left=XDummy;
msie.y[i].style.top=YDummy;msie.y[i].style.left=XDummy;
msie.z[i].style.top=YDummy;msie.z[i].style.left=XDummy;
}
}
}
setTimeout(“prepos()“,10);
}
function Start(){
swirl(),prepos()
}
window.onload=Start;
// --》
《/script》
《/body》《/html》

跟随鼠标很逼真的弹性小球
《html》
《head》
《title》网页特效|Linkweb.cn/Js|---跟随鼠标很逼真的弹性小球《/title》
《/head》《body》
《!--将以下代码加入HTML的《Body》《/Body》之间--》

《DIV id=dot0
style=“HEIGHT: 16; POSITION: absolute; VISIBILITY: hidden; WIDTH: 11; left:10; top:15“》《IMG
height=11 src=“images/bullet.gif“ width=11》 《/DIV》
《DIV id=dot1 style=“HEIGHT: 11px; POSITION: absolute; WIDTH: 11px“》《IMG
height=11 src=“images/bullet.gif“ width=11》 《/DIV》
《DIV id=dot2 style=“HEIGHT: 11px; POSITION: absolute; WIDTH: 11px“》《IMG
height=11 src=“images/bullet.gif“ width=11》 《/DIV》
《DIV id=dot3 style=“HEIGHT: 11px; POSITION: absolute; WIDTH: 11px“》《IMG
height=11 src=“images/bullet.gif“ width=11》 《/DIV》
《DIV id=dot4 style=“HEIGHT: 11px; POSITION: absolute; WIDTH: 11px“》《IMG
height=11 src=“images/bullet.gif“ width=11》 《/DIV》
《DIV id=dot5 style=“HEIGHT: 11px; POSITION: absolute; WIDTH: 11px“》《IMG
height=11 src=“images/bullet.gif“ width=11》 《/DIV》
《DIV id=dot6 style=“HEIGHT: 16; POSITION: absolute; WIDTH: 11; left:10; top:15“》《IMG
height=11 src=“images/bullet.gif“ width=11》 《/DIV》
《SCRIPT language=JavaScript》
var nDots = 7;
var Xpos = 0;
var Ypos = 0;
var DELTAT = .01;
var SEGLEN = 10;
var SPRINGK = 10;
var MASS = 1;
var XGRAVITY = 0;
var YGRAVITY = 50;
var RESISTANCE = 10;
var STOPVEL = 0.1;
var STOPACC = 0.1;
var DOTSIZE = 11;
var BOUNCE = 0.75;
var isNetscape = navigator.appName==“Netscape“;
var followmouse = true;
var dots = new Array();
init();
function init()
{
var i = 0;
for (i = 0; i 《 nDots; i++) {
dots[i] = new dot(i);
}

if (!isNetscape) {
}
for (i = 0; i 《 nDots; i++) {
dots[i].obj.left = dots[i].X;
dots[i].obj.top = dots[i].Y;
}
if (isNetscape) {
startanimate();
} else {
setTimeout(“startanimate()“, 1000);
}
}
function dot(i)
{
this.X = Xpos;
this.Y = Ypos;
this.dx = 0;
this.dy = 0;
if (isNetscape) {
this.obj = eval(“document.dot“ + i);
} else {
this.obj = eval(“dot“ + i + “.style“);
}
}
function startanimate() {
setInterval(“animate()“, 20);
}
function setInitPositions(dots)
{
var startloc = document.all.tags(“LI“);
var i = 0;
for (i = 0; i 《 startloc.length && i 《 (nDots - 1); i++) {
dots[i+1].X = startloc[i].offsetLeft
startloc[i].offsetParent.offsetLeft - DOTSIZE;
dots[i+1].Y = startloc[i].offsetTop +
startloc[i].offsetParent.offsetTop + 2*DOTSIZE;
}
dots.X = dots.X;
dots.Y = dots.Y - SEGLEN;
}
function MoveHandler(e)
{
Xpos = e.pageX;
Ypos = e.pageY;
return true;
}
function MoveHandlerIE() {
Xpos = window.event.x + document.body.scrollLeft;
Ypos = window.event.y + document.body.scrollTop;
}

if (isNetscape) {
document.captureEvents(Event.MOUSEMOVE);
document.onMouseMove = MoveHandler;
} else {
document.onmousemove = MoveHandlerIE;
}

function vec(X, Y)
{
this.X = X;
this.Y = Y;
}
function springForce(i, j, spring)
{
var dx = (dots[i].X - dots[j].X);
var dy = (dots[i].Y - dots[j].Y);
var len = Math.sqrt(dx*dx + dy*dy);
if (len 》 SEGLEN) {
var springF = SPRINGK * (len - SEGLEN);
spring.X += (dx / len) * springF;
spring.Y += (dy / len) * springF;
}
}
function animate() {
var start = 0;
if (followmouse) {
dots.X = Xpos;
dots.Y = Ypos;
start = 1;
}
for (i = start ; i 《 nDots; i++ ) {

var spring = new vec(0, 0);
if (i 》 0) {
springForce(i-1, i, spring);
}
if (i 《 (nDots - 1)) {
springForce(i+1, i, spring);
}
var resist = new vec(-dots[i].dx * RESISTANCE,
-dots[i].dy * RESISTANCE);
var accel = new vec((spring.X + resist.X)/MASS + XGRAVITY,
(spring.Y + resist.Y)/ MASS + YGRAVITY);
dots[i].dx += (DELTAT * accel.X);
dots[i].dy += (DELTAT * accel.Y);
if (Math.abs(dots[i].dx) 《 STOPVEL &&
Math.abs(dots[i].dy) 《 STOPVEL &&
Math.abs(accel.X) 《 STOPACC &&
Math.abs(accel.Y) 《 STOPACC) {
dots[i].dx = 0;
dots[i].dy = 0;
}
dots[i].X += dots[i].dx;
dots[i].Y += dots[i].dy;
var height, width;
if (isNetscape) {
height = window.innerHeight + window.pageYOffset;
width = window.innerWidth + window.pageXOffset;
} else {
height = document.body.clientHeight + document.body.scrollTop;
width = document.body.clientWidth + document.body.scrollLeft;
}
if (dots[i].Y 》= height - DOTSIZE - 1) {
if (dots[i].dy 》 0) {
dots[i].dy = BOUNCE * -dots[i].dy;
}
dots[i].Y = height - DOTSIZE - 1;
}
if (dots[i].X 》= width - DOTSIZE) {
if (dots[i].dx 》 0) {
dots[i].dx = BOUNCE * -dots[i].dx;
}
dots[i].X = width - DOTSIZE - 1;
}
if (dots[i].X 《 0) {
if (dots[i].dx 《 0) {
dots[i].dx = BOUNCE * -dots[i].dx;
}
dots[i].X = 0;
}
dots[i].obj.left = dots[i].X;
dots[i].obj.top = dots[i].Y;
}
}
《/SCRIPT》

《/body》《/html》

这里太小了 放不了那么多
http://www.jscode.cn/jave_mouse/29051032.htm
里面有很多的 不想链接的话 就看那两个吧

鼠标特效代码怎么使用


钩选“显示原代码“,把动态鼠标的代友粘贴到最后面即可.如果是新建的面板要先输入几...找一个鼠标特效地址(
http://myok.bokee.com/2081936.html
上有很多),