How do I use a button to open an Iframe

RobMoore007
Explorer
122 1 12

Hi there, I wamt to open our loyalty/rewards programme with a button. Right now the iframe just opens itself.  I need this to be triggered by a button click please?

<html> 
  <head>
   <style></style>
   </head>
<body>
    <button onclick="launchLoyalty(); loyaltyLauncher.blur()" id="loyaltyLauncher" style="animation: 0.25s ease 0s 1 normal none running scaleFromCenter; position: fixed; left: 20px; bottom: 20px; border: 0px; padding: 10px; width: 60px; height: 60px; z-index: 2147483647; background: rgb(97, 120, 23); color: rgb(255, 255, 255); border-radius: 300px;"></button>   

    <iframe src="https://www.glowloyalty.com/widget?cid=undefined&amp;shop=auchterlonies-com.myshopify.com&amp;baseUrl=https://auchterlonies-com.myshopify.com/" id="spruliFrame" style="animation: 0.5s ease 0s 1 normal none running fadeInAnimation; position: fixed; width: 100%; height: 100%; z-index: 2147483647; inset: 0px; border: 0px;"></iframe>

</body>


    </html

 

Regards
Rob Moore - NEWBY!!
0 Likes