Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Ernesto Gurgel

Janela de mensagens de aviso

Recommended Posts

  1. <div id="fdf_float" align="center">
  2. <script type="text/javascript">
  3. jQuery(document).ready(function(){
  4. jQuery("#closedfstc").click(function(){
  5. jQuery("#fdf_float").hide();
  6. });
  7. });
  8. </script>
  9. <style type="text/css">
  10. #fdf_float a {
  11. position: fixed;
  12. bottom: 80px;
  13. text-decoration: none;
  14. right: 20px;
  15. z-index: 3000;
  16. }
  17. a#caixflofstc {
  18. position: fixed;
  19. bottom: 10px;
  20. line-height: 16px;
  21. text-align: left;
  22. right: 10px;
  23. z-index: 1;
  24. opacity: 0.8;
  25. width: 360px;
  26. height: 120px;
  27. background: #cf3737;
  28. color: #fff;
  29. text-shadow: rgba(0,0,0,0.3) 0px -1px 0px;
  30. padding: 10px;
  31. text-decoration: none;
  32. font-size: 11px;
  33. font-family: Tahoma;
  34. border: 1px solid #771b1b;
  35. box-shadow: rgba(0,0,0,0.3) 0px 1px 4px, inset #f66c6c 0px 1px 0px;
  36. border-radius: 3px;
  37. }
  38. a#caixflofstc:hover {
  39. opacity: 1;
  40. }
  41. #caixflofstc strong {
  42. font-family: "Trebuchet MS";
  43. display: block;
  44. font-size: 14px;
  45. padding-bottom: 5px;
  46. }
  47. </style>
  48. <a href="#" id="caixflofstc"><span id="closedfstc" style="float: right;">x</span>Conteúdo</a>
  49. </div>

 

 

 

 

Galera eu tenho esse código. Eu queria utilizar o ajax para executar depois e marcar como lido e verificar antes de mostrar na próxima vez, como eu faria isso? Eu estou tendo algumas dificuldades.

 

 

 

 

 

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

use cookies

 

ao fechar a mensagem você seta o cookie. exemplo:


// SEMPRE QUE ENTRAR NA PÁGINA VERIFICA SE A MSG JÁ FOI LIDA
jQuery( document ).ready(function(){
    if( !getCookie('mensagem') ){
       jQuery("#fdf_float").show();
    }

    // QUANDO FECHAR, SALVA QUE LEU A MENSAGEM
    jQuery("#fdf_float").hide('show', function(){
       setCookie('mensagem', 'leuOK', '30');
     });
});

function setCookie(cname, cvalue, exdays) {
    var d = new Date();
    d.setTime(d.getTime() + (exdays*24*60*60*1000));
    var expires = "expires="+d.toUTCString();
    document.cookie = cname + "=" + cvalue + "; " + expires;
}

function getCookie(cname) {
    var name = cname + "=";
    var ca = document.cookie.split(';');
    for(var i=0; i<ca.length; i++) {
        var c = ca[i];
        while (c.charAt(0)==' ') c = c.substring(1);
        if (c.indexOf(name) != -1) return c.substring(name.length, c.length);
    }
    return "";
}

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.