2012-08-09 24 views
0

我不知道這是否可以實現,但我正在尋找解決方案來模糊一個類,當我單擊一個按鈕時。我想這樣做,因爲它的模式彈出框架,它實際上看起來不錯,在所有的背後的文字。使用jQuery模糊指定的類

<div id="contentField" class="contentField-fix"> 
    <h2 id="postComment">Loads of text in here</h2> 
</div> 
<div id="modal"></div> 

所以我想做的事是「的的onClick繼續格」其中運行「莫代爾」,模糊的一切,是在課堂上「contentField修復」的。可能?

如果不是,我想我需要嘗試別的。

+1

首先糾正你的代碼,請。你沒有使用h2的結尾標籤。 – 2619 2012-08-09 12:55:12

+0

你意識到,通過點擊一個按鈕,它會模糊任何當前的焦點元素? – Undefined 2012-08-09 12:56:42

+0

我認爲OP想要應用模糊效果。 – Kyle 2012-08-09 12:57:13

回答

1

使用BlurJS

$('.contentField-fix').blurjs({ 
    source: 'body', // Blur with the body as the background. 
        // You can specifify other elements as source. 
    radius: 10, // Higher values for more blur 
}); 
+0

好吧現在就試試吧。雖然我認爲blurJS實際上只模糊背景圖像。 – dvLden 2012-08-09 13:00:22

+0

它與其他元素模糊元素。如果您不想與身體背景混合,請指定其他來源。 – Aesthete 2012-08-09 13:04:49