


Foreword: I have been very busy some time ago and I haven’t written anything for a long time. Recently, the things at hand have just come to an end. I will take out and share all the writing plug-ins that I have written in the past. I hope it will be helpful to everyone. , I also hope that some experts can help point out my writing deficiencies and errors. I have always used what I wrote. In terms of performance, I can only try to get as close as possible and there are still many problems... I sincerely ask for advice;
Plug-in introduction: Execution Fade and other animation effects, this plug-in can be used as an additional plug-in, which can be used with a pop-up layer I posted earlier, etc. to increase the fun of js display.
How to use: Write in the following js code Yes, you can take a look and just copy and paste it. If you have any questions, please contact me. >
Copy code
/*
createByTommy_20110525
emial:@csslife@163.com
Purpose:
Perform fade-out and other animation effects
Incoming parameter description:
1. The first parameter is the object or ID that needs to be transformed;
2. The second parameter is an object containing:
1), sty-> The attribute that needs to be changed in the transformed object, the default is to change the width (can also be passed Non-style attributes such as scrollTop, etc.)
2), curClass-> The current class that needs to be added after the transformation object is changed, the default is empty
3), maxVal-> The maximum value of the change, the default is 0 (if curClass is a style attribute such as width and height, it means hidden), stop the animation when the attribute value to be changed is reached
4), effect-> The animation effect executed defaults to outQuad, if a bouncing effect is required, set its value is 2
3. The last parameter is an optional parameter indicating the callback function to be run after the animation is completed
*/
//animation
var ani = function(){this. init.apply(this,arguments)}
ani.prototype = {
_id:function(i){
if(!i) return;
return typeof i != "string" && i .nodeType === 1 ? i : document.getElementById(i);
},
init:function(e,s,callback){
this.e = this._id(e);
this.setInit(s||{});
var maxS = parseInt(this.s.maxVal),speed = maxS==0?Math.max(this.getSty(this.e,this.s .sty),1):maxS/5;
this.fun(speed,maxS,callback)
},
formula:function(x){
var f;
switch( this.s.effect){
case 0:
f = "outQuad";
break;
case 1:
f = "inQuad";
break;
case 2:
> this.tween ={
outQuad:function( pos){return Math.pow(pos, 2)},//outQuad
inQuad:function(pos){return -(Math.pow((pos-1),2)-1)},//inQuad
bounce:function(pos){//bounce
if (pos return (7.5625 * pos * pos);
} else if (pos Return (7.5625 * (POS- = (1.5 / 2.75)) * POS.75);
} else if (pos & lt; (2.5 / 2.75)) {
return (7.5625 * (pos -= (2.25 / 2.75)) * pos .9375); 75);
;
return this.tween[f](x);
},
findAry:function(attr){
var rg = ["width","height","top","bottom","left","right","margin","padding"];
for(var z in rg){
if(rg[z]==attr) return true;
}
return false;
},
setInit:function(s){
this.s = {
sty:"width",
curClass:"",
maxVal:0,//效果最大值
effect:1//执行效果
}
for(i in s) this.s[i] = s[i];
},
setSty:function(x){
var attr = this.s.sty;
if(this.findAry(attr)){
this.e.style[attr] = x 'px';
var isIE6 = navigator.appVersion.indexOf("MSIE 6")>-1;
isIE6&&attr=="top"&&(this.e.style[attr] = x document.documentElement.scrollTop 'px');
}else if(attr=="opacity"){
this.s.maxVal===1&&(this.e.style.display = "block");
this.e.style.opacity = x;
this.e.style.filter = "alpha(opacity=" x*100 ")";
}else{
this.e[this.s.sty] = x
}
},
getSty:function(e,s){
var val = e.currentStyle?e.currentStyle[s]:document.defaultView.getComputedStyle(e,null)[s];
return parseInt(val)||0;
},
fun:function(f,m,callback){
var D = Date,t = new D,e,T = 500,_this = this;
return e = setInterval(function() {
var z = Math.min(1, (new D - t) / T),
c = _this.s.curClass,
curC = _this.e.className;
_this.setSty( f (m - f) * _this.formula(z));
if (z == 1) {
if (callback && typeof callback == 'function') callback();
_this.s.maxVal==0&&(_this.e.getAttribute("style"))&&(_this.e.style.display="none");
if(c!=""&&curC.indexOf(c) clearInterval(e);
}
},10);
}
}
这是这个js展示的第一个DEMO1:
[html]
聽聽聽
聽聽聽

当微软推出Windows11时,它带来了许多变化。其中一项更改是增加了用户界面动画的数量。一些用户想要改变事物的出现方式,他们必须想办法去做。拥有动画让用户感觉更好、更友好。动画使用视觉效果使计算机看起来更具吸引力和响应能力。其中一些包括几秒钟或几分钟后的滑动菜单。计算机上有许多动画会影响PC性能、减慢速度并影响您的工作。在这种情况下,您必须关闭动画。本文将介绍用户可以提高其在PC上的动画速度的几种方法。您可以使用注册表编辑器或您运行的自定义文件来应用更改。如何提高Windows11动画的

如何使用Vue实现打字机动画特效打字机动画是一种常见且引人注目的特效,常用于网站的标题、标语等文字展示上。在Vue中,我们可以通过使用Vue自定义指令来实现打字机动画效果。本文将详细介绍如何使用Vue来实现这一特效,并提供具体的代码示例。步骤1:创建Vue项目首先,我们需要创建一个Vue项目。可以使用VueCLI来快速创建一个新的Vue项目,或者手动在HT

MicrosoftWindows11中包含多项新特性和功能。用户界面已更新,公司还引入了一些新效果。默认情况下,动画效果应用于控件和其他对象。我应该禁用这些动画吗?尽管Windows11具有视觉上吸引人的动画和淡入淡出效果,但它们可能会导致您的计算机对某些用户来说感觉迟钝,因为它们会为某些任务增加一点延迟。关闭动画以获得更灵敏的用户体验很简单。在我们看到对操作系统进行了哪些其他更改后,我们将引导您了解在Windows11中打开或关闭动画效果的方法。我们还有一篇关于如何在Windows

本站需要重新写作的内容是:9需要重新写作的内容是:月需要重新写作的内容是:23需要重新写作的内容是:日消息,动画剧集《明日方舟》的第二季主线剧《明日方舟:冬隐归路》公布定档需要重新写作的内容是:PV,将于需要重新写作的内容是:10需要重新写作的内容是:月需要重新写作的内容是:7需要重新写作的内容是:日需要重新写作的内容是:00:23需要重新写作的内容是:正式上线,点此进入主题官网。需要重新写作的内容是:本站注意到,《明日方舟:冬隐归路》是《明日方舟:黎明前奏》的续作,剧情简介如下:为阻止感染者组

怎么制作文字轮播与图片轮播?大家第一想到的是不是利用js,其实利用纯CSS也能实现文字轮播与图片轮播,下面来看看实现方法,希望对大家有所帮助!

微软正在Windows11中试验新的任务栏动画,这是这家软件巨头正在进行的另一项新测试。这一次在设置应用程序中,当您单击相应部分时,图标会显示动画。以下是如何在Windows11中为“设置”应用启用图标动画。您可以在Windows11中看到特殊的动画和动画效果。例如,当您最小化和最大化设置应用程序或文件资源管理器时,您会注意到动画。说到图标,当您最小化窗口时,您会看到一个图标会向下弹起,而在您最大化或恢复时,它会弹起。Windows11设置可能会新收到左侧显示的导航图标动画,这是您

Vue中如何实现图片的闪烁和旋转动画Vue.js是目前非常流行的前端框架之一,它提供了强大的工具来管理和展示页面中的数据。在Vue中,我们可以通过添加CSS样式和动画来使元素产生各种各样的效果。本文将介绍如何使用Vue和CSS来实现图片的闪烁和旋转动画。首先,我们需要准备一张图片,可以是本地的图片文件或者网络上的图片地址。我们将使用<img>标

Midjourney和StableDiffusion,已经卷到没边了!几乎在StableDiffusionXL0.9发布的同一时间,Midjourney宣布推出了5.2版本。此次5.2版本最亮眼的更新在于zoomout功能,它可以无限扩展原始图像,同时保持跟原始图像的细节相同。用zoomout做出的无垠宇宙动画,直接让人震惊到失语,可以说,Midjourney5.2看得比詹姆斯韦伯太空望远镜还要远!这个极其强大的功能,可以创造出非常神奇的图片,甚至还能被用来拍摄毫无破绽的高清变焦视频!这个「核弹


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

mPDF
mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

SublimeText3 Linux new version
SublimeText3 Linux latest version

Notepad++7.3.1
Easy-to-use and free code editor

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

Dreamweaver CS6
Visual web development tools
