HTMLify
Web Pdf Viewer
Views: 460 | Author: djdj
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>PDF Modal Example</title> <style> body{ background-color:black; } .modal { display: none; position: fixed; z-index: 1; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); } .modal-content { background-color: white; margin: 10% auto; padding: 20px; border-radius: 10px; width: 60%; height: 80%; } .close { float: right; font-size: 24px; cursor: pointer; } iframe { width: 100%; height: 90%; } #openPdf{ color: blue; cursor: pointer; text-decoration: underline; } #openPdf { color: white; cursor: pointer; text-decoration: none; text-align: center; font-size: 25px; font-family: cursive; position: relative; animation: resume 5s ease-in-out infinite; } @keyframes resume { 0%, 100% { transform: scale(1); /* Normal size */ } 50% { transform: scale(1.1); /* Zoom in */ } } </style> </head> <body> <p id="openPdf">👉Click here to view the PDF👈</p> <div id="pdfModal" class="modal"> <div class="modal-content"> <span class="close">×</span> <iframe id="pdfFrame" src="" frameborder="0"></iframe> </div> </div> <script> var modal = document.getElementById("pdfModal"); var btn = document.getElementById("openPdf"); var span = document.getElementsByClassName("close")[0]; var pdfFrame = document.getElementById("pdfFrame"); btn.onclick = function() { pdfFrame.src = "html-tags-list.pdf"; modal.style.display = "block"; } span.onclick = function() { modal.style.display = "none"; } window.onclick = function(event) { if (event.target == modal) { modal.style.display = "none"; } } </script> </body> </html> |