2017-02-17 96 views
0

以下是我迄今爲止隱藏div內容所做的代碼。但不幸的是,它不適用於在線CRM。在Dynamics CRM中隱藏div內容

function hideSocialEmailErrorMsgBlock() { 
     debugger; 
     var _errorMsgBlock = document.getElementById("emailnotification"); 
     var _warningMessage = document.getElementById("warningmessage"); 
     if ((errorMsgBlock == null && errorMsgBlock == undefined) || (warningMessage == null && warningMessage != undefined)) 
     { 
     setTimeout(hideSocialEmailErrorMsgBlock, 1000); 
     return; 
     } 
     else 
     { 
     document.getElementById("emailnotification").innerHTML = ''; 
     document.getElementById("warningmessage").innerHTML = ''; 
     // code has to be placed here... 
     // $("#warningmessage").hide(); 
     // $("warningmessage").attributes("style.display","none"); 
     // $("emailnotification").attributes("style.display","none"); 
     //$("#emailnotification").hide(); 
     setTimeout(hideSocialEmailErrorMsgBlock, 1000); 
     } 
    } 

這是前端的形象。

enter image description here

這裏是網頁的圖像。

enter image description here

我要隱藏的錯誤顯示在網頁上。

+0

你想永久隱藏它嗎? – Varun

+0

讓我們說是,然後呢? –

+1

你可以用CSS隱藏它,'.emailnotification {display:none!important; }' – Varun

回答

1

如果你想完全隱藏與Javascript您emailnotification DIV,你可以使用:

的document.getElementById( 'emailnotification')的style.display = '無'。

這會比試圖隱藏所有文本更簡單。

+0

或者您可以使用.hide()函數嘗試使用jquery。 –