簡體   English   中英

使用 JavaScript 或 jQuery 模糊圖像?

[英]Blur image with JavaScript or jQuery?

有什么方法可以用 JavaScript/jQuery 模糊圖像,這樣當它們模糊時,我可以通過用鼠標懸停它們來銳化它們?

Pixastic可以為您做到這一點。 這是相關文檔: http://www.pixastic.com/lib/docs/actions/blur/

模糊:

Pixastic.process(document.getElementById('demoimage'), 'blur');

要還原:

Pixastic.revert(document.getElementById('demoimage'));

jQuery的整個解決方案:

var blur = function () {
    Pixastic.process(this, 'blur');
};

var unblur = function () {
    Pixastic.revert(this);
};

$('img').each(blur).hover(unblur, blur);

There is a plugin for jQuery called blur.js http://blurjs.com which uses my very fast Stack Blur algorithm:http://www.quasimondo.com/StackBlurForCanvas/StackBlurDemo.html

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM