curt3006 Posted January 7, 2011 Share Posted January 7, 2011 Hello, I have a pop up on a timer that I would like to set to a link. So instead of this popping up after a certain amount of time, it pops up when someone clicks on a link. Here's the code: <link rel="stylesheet" media="screen" href="css/colorbox.css" /> <script src="js/jquery.js" type="text/javascript"></script> <script src="js/jquery.colorbox-min.js" type="text/javascript"> </script> <script> setTimeout('openPopUp()',20000); function openPopUp() { $.fn.colorbox({href:'popup.html',overlayClose:false,open:true,width:590,height:670,iframe:true}); } </script> Any help would be greatly appreciated! Quote Link to comment https://forums.phpfreaks.com/topic/223649-turn-timed-pop-up-into-link-pop-up/ Share on other sites More sharing options...
.josh Posted January 7, 2011 Share Posted January 7, 2011 remove that setTimeout line of code, and then make your link and add the function call as an onclick in the link: <a href="..." onclick="openPopUp()">your link</a> Quote Link to comment https://forums.phpfreaks.com/topic/223649-turn-timed-pop-up-into-link-pop-up/#findComment-1156290 Share on other sites More sharing options...
curt3006 Posted January 7, 2011 Author Share Posted January 7, 2011 A fine Answer, Thank you my friend! Quote Link to comment https://forums.phpfreaks.com/topic/223649-turn-timed-pop-up-into-link-pop-up/#findComment-1156454 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.