Paulo1471 Posted August 6, 2012 at 05:53 PM Report Share #471609 Posted August 6, 2012 at 05:53 PM (edited) Boas !! Tenho o seguinte código : <a href="javascript:mostrarMensagem();">Mostrar Div</a> <!-- e --> <a href="javascript:fecharMensagem();">Fechar Div</a> e function mostrarMensagem() { $("#msg").slideDown(900); document.getElementById('main').style.opacity = '0.5'; document.getElementById('msg').style.opacity = '1.0'; } function fecharMensagem() { document.getElementById('msg').style.display = 'none'; document.getElementById('main').style.opacity = '1.0'; } //main é uma div que contem todo o conteudo da pagina !! Que faz aparecer uma div !! Mas queria que ao mostrar essa div, o resto da pagina ficasse com uma sombra por cima, para realçar a div . Como acontece aqui no forum quando colocamos no botao para por um codigo num comentario. Mas com o codigo que tenho nao esta a dar bem , a div tambem fica com opacidade de 0.5 !! Sugestões ?? Obrigado. Edited August 8, 2012 at 03:02 PM by brunoais geshi! + indentação Link to comment Share on other sites More sharing options...
brunoais Posted August 8, 2012 at 03:03 PM Report Share #471747 Posted August 8, 2012 at 03:03 PM Se usas o jQuery, pq n usas o método do jQuery feito de propósito para isso? Procura por algo do tipo: modal box. "[Os jovens da actual geração]não lêem porque não envolve um telecomando que dê para mirar e atirar, não falam porque a trapalhice é rainha e o calão é rei" autor: thoga31 Life is a genetically transmitted disease, induced by sex, with death rate of 100%. Link to comment Share on other sites More sharing options...
yoda Posted August 8, 2012 at 05:19 PM Report Share #471763 Posted August 8, 2012 at 05:19 PM (edited) Tens de criar uma div overlay para ficar por cima de tudo, e acima disso a mensagem que queres. #overlay { z-index: 1000; width: 100%; height: 100%; min-width: 100%; min-height: 100%; background-color: rgba(0,0,0,0.2); } Edited August 8, 2012 at 05:20 PM by yoda before you post, what have you tried? - http://filipematias.info sense, purpose, direction Link to comment Share on other sites More sharing options...
Paulo1471 Posted August 10, 2012 at 05:39 PM Author Report Share #471977 Posted August 10, 2012 at 05:39 PM Se usas o jQuery, pq n usas o método do jQuery feito de propósito para isso? Procura por algo do tipo: modal box. Obrigado !! Vou investigar !! Tens de criar uma div overlay para ficar por cima de tudo, e acima disso a mensagem que queres. #overlay { z-index: 1000; width: 100%; height: 100%; min-width: 100%; min-height: 100%; background-color: rgba(0,0,0,0.2); } Huum, acho que entendi !! Vou testar algo assim !! Obrigado ! ! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now