2014-02-18 100 views
1

我已經使用這種方法來隱藏div(How can I "dim" the rest of the web page when displaying a notification DIV?)後面的屏幕,我想問如何恢復javascript函數中的更改,我會打電話給在點擊DIV交叉功能顯示如何使用javascript(隱藏使用jQuery)恢復模糊的背景

這裏是我的代碼:

function addalbum() 
{ 
    $('<div id="__msg_wrapper">').css({ 
     "width" : "100%" 
    , "height" : "100%" 
    , "background" : "#000" 
    , "position" : "fixed" 
    , "top" : "0" 
    , "left" : "0" 
    , "zIndex" : "50" 
    , "MsFilter" : "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)" 
    , "filter" : "alpha(opacity=60)" 
    , "MozOpacity" : 0.6 
    , "KhtmlOpacity" : 0.6 
    , "opacity" : 0.6 
    }).appendTo(document.body); 

    document.getElementById("album_name").style.display = "block"; 
} 

此代碼褪去了「包裝」的div和顯示ID爲「ALBUM_NAME」的格,但如何恢復的「包裝「div到原來的狀態

+0

你能提供你所嘗試過的嗎? – cpburnz

+0

我已更新我的問題,看看它 – user3324329

回答

0

你可以只需在覆蓋div上使用.show()和.hide()。

你也可以淡入淡出來製作更好的開關。