Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

88
Views
El cuadro de diálogo modal jQuery UI desaparece al actualizar la página

¿Cómo puedo asegurarme de que este cuadro de diálogo modal solo desaparezca cuando el usuario acepte el acuerdo? En otras palabras, quiero que el modal aparezca siempre si nunca se hizo clic en el botón Aceptar. Solo quiero que esto aparezca una vez por sesión del navegador. Hasta ahora, el cuadro de diálogo modal se puede omitir si el usuario actualiza la página. es posible? Vea el ejemplo JSFIDDLE continuación:

JSFDDLE

 <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>jQuery UI Dialog - Modal message</title> <link rel="stylesheet" href="//code.jquery.com/ui/1.13.1/themes/base/jquery-ui.css"> <link rel="stylesheet" href="/resources/demos/style.css"> <script src="https://code.jquery.com/jquery-3.6.0.js"></script> <script src="https://code.jquery.com/ui/1.13.1/jquery-ui.js"></script> <script> $( function() { var dialogShown = sessionStorage.getItem("dialogShown") if (!dialogShown){ $( "#dialog-message" ).dialog({ modal: true, width: 400, buttons: { Accept: function() { $( this ).dialog( "close" ); } } }); sessionStorage.setItem("dialogShown", 1) } else { $("#dialog-message").hide(); } } ); </script> </head> <body> <div id="dialog-message" title="Important Message"> <p><b>This is a US Government System.</b><br><br> <b>This system is for authorized users only.</b><br><br> By accessing and using this information system, you acknowledge and consent to the following:<br> <ul> <li>You are accessing a US Government information system (which includes any device attached to this information system) that is provided for US Government-authorized use only. </li> </ul> </p> </div> </body> </html>
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!