22nd Sep 2016, 09:52 PM | #1 |
Warrior Member Join Date: 2016
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
|
hi, implemented a button pop as you can see on my landing page at hiddenhealthquest.com the button pops up about 30 seconds into the video and it works great. However I want to make it so that once the button does pop, it will be there when the visitor returns rather than them having to wait again for the ihdden element to pop up. here is the script i currently have in the head Code: <!-- START PASTE HERE --> <script type="text/javascript"> <!-- //////////////////////////////////////////// // CHANGE THE SECONDS DELAY BELOW TO // // THE NUMBER OF SECONDS YOU WANT BEFORE // // THE LINKS APPEAR // //////////////////////////////////////////// $secondsdelay = 30; //////////////////////////////////////////// // DO NOT EDIT THIS SECTION // //////////////////////////////////////////// function unhide(divID) { var item = document.getElementById(divID); if (item) { item.className=(item.className=='hidden')?'unhidde n':'hidden'; } } $delay = $secondsdelay*1000; window.setTimeout("unhide('links')",$delay); //--></script> <STYLE TYPE="text/css"> .hidden { visibility: hidden; } .unhidden { visibility: visible; } </STYLE> <!-- END PASTE HERE --> Code: <div id="links" class="hidden"><img class="wp-image-26 aligncenter" src="http://hiddenhealthquest.com/wp-content/uploads/2016/09/buybuybuy.png" alt="buybuybuy" width="361" height="348" /></div> Iv been banging my head against the wall with this for the past 3 days, really hope someone can help. |
27th Sep 2016, 04:42 PM | #2 |
Active Warrior Join Date: 2014 Location: US
Posts: 52
Thanks: 2
Thanked 15 Times in 13 Posts
|
I think you'd be better off posting in a more appropriate category. But to at least steer in a direction to accomplishing what you want.. 1) Make use of cookies (jquery cookie makes it easy) 2) When unhide is triggered, set the cookie (hidden=no) 3) Add on ready function and read the cookie on page load,and if hidden equals no, trigger the unhide action/function |
Bookmarks |
Tags |
button, buy button, javascript, pop |
| |