项目
在 GitHub 查看
GianlucaGuarini/Vague.js
关于
Vague.js 是一个实验性脚本,借助 SVG 滤镜可以模糊任意类型的 HTML 元素。
网站与应用开发实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- -1
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文
Vague.js: A jQuery plugin for blurring HTML elements via SVG filters.
Browser Support
- Mozilla Firefox (v10 and above)
- Google Chrome (v18 and above)
- Safari (v6.0 and above)
- Microsoft Internet Explorer (v7-9; v10+ not supported)
Demonstration
Check the demos here on GitHub Pages and on Codepen.
Requisites
jQuery JavaScript Library
Installation
bower install vague.js --save
Usage
var vague = $('#yourelement').Vague({
intensity: 3, // Blur Intensity
forceSVGUrl: false, // Force absolute path to the SVG filter,
// default animation options
animationOptions: {
duration: 1000,
easing: 'linear' // here you can use also custom jQuery easing functions
}
});
vague.blur();
API (Public methods)
blur: Apply the SVG filter to the element selected.unblur: Hide the SVG filter from the element selected.animate( newBlurIntensity, animationOptions ): Animate the blur intensity to any new value.
vague.animate(
20,
// here you can use the normal jQuery animation options
{
duration:500,
easing: 'linear'
}
).done(function(){
console.log('Animation finished!');
});
destroy: remove the blur effect and the SVG filter from the DOM.
Issues
- The
animatemethod is part of the plugin but it's not recommended, it can be really slow due to the many GPU resources needed to render the blur effect on the pages - It is not supported in the Opera browser as SVG filters over elements are not supported
- Not supported in IE10/IE11 ( because IE still sucks )
Changelog
v0.0.6
v0.0.5
- plugin code refactoring and micro optimizations
- added:
animatemethod
探索相关项目
加载中…