Advertisement
Guest User

BTC Radio Buttons

a guest
Aug 28th, 2023
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.62 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Radio Button Toggle</title>
  7. <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  8. <style>
  9. /* Add this CSS to style the content */
  10. #block-feb1fe9e0146872ae9f7, #block-cf109b682a1232958eb2 {
  11. font-weight: bold;
  12. color: green;
  13. }
  14.  
  15. /* Add this CSS to stack the radio buttons vertically */
  16. .radio-container {
  17. display: flex;
  18. align-items: center;
  19. margin-bottom: 10px;
  20. }
  21.  
  22. .niceradio {
  23. margin-right: 10px;
  24. }
  25. </style>
  26. </head>
  27. <body>
  28. <h4 id="title-text">Pick a day to get notified. You can sign up for both forms.</h1>
  29.  
  30. <div class="radio-container">
  31. <input type="radio" name="blockToggle" id="radio1" class="niceradio">
  32. <label for="radio1">Sunday Sessions</label>
  33. </div>
  34.  
  35. <div class="radio-container">
  36. <input type="radio" name="blockToggle" id="radio2" class="niceradio">
  37. <label for="radio2">Wednesday Sessions</label>
  38. </div>
  39.  
  40. <div id="#block-feb1fe9e0146872ae9f7">
  41. <!-- Content for Block A -->
  42.  
  43. </div>
  44.  
  45. <div id="#block-cf109b682a1232958eb2">
  46. <!-- Content for Block B -->
  47.  
  48. </div>
  49.  
  50. <script>
  51. $(document).ready(function() {
  52. $("#radio1").click(function() {
  53. // Bring #block-feb1fe9e0146872ae9f7 to the front and hide #block-cf109b682a1232958eb2
  54. $("div#block-feb1fe9e0146872ae9f7").css("z-index", "2");
  55. $("div#block-cf109b682a1232958eb2").css("z-index", "1");
  56. $("div#block-feb1fe9e0146872ae9f7").show();
  57. $("div#block-cf109b682a1232958eb2").hide();
  58.  
  59. // Make #block-feb1fe9e0146872ae9f7 clickable
  60. $("div#block-feb1fe9e0146872ae9f7").css("pointer-events", "auto");
  61.  
  62. // Make #block-cf109b682a1232958eb2 not clickable
  63. $("div#block-cf109b682a1232958eb2").hide();
  64. });
  65.  
  66. $("#radio2").click(function() {
  67. // Bring #block-cf109b682a1232958eb2 to the front and hide #block-feb1fe9e0146872ae9f7
  68. $("div#block-cf109b682a1232958eb2").css("z-index", "2");
  69. $("div#block-feb1fe9e0146872ae9f7").css("z-index", "1");
  70. $("div#block-cf109b682a1232958eb2").show();
  71.  
  72. // Make #block-cf109b682a1232958eb2 clickable
  73. $("div#block-cf109b682a1232958eb2").css("pointer-events", "auto");
  74.  
  75. // Make #block-feb1fe9e0146872ae9f7 not clickable
  76. $("div#block-feb1fe9e0146872ae9f7").hide();
  77. });
  78. });
  79. </script>
  80.  
  81.  
  82. </body>
  83. </html>
  84.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement