Trigger on click
-
Hi, great plugin. Is there or are there plans to allow triggering on click? I need to tie a popup to a button and not a timed or scroll action.
Thanks!
-
It should work by adding the ID of the popup to a link Eg: if you popup ID is 4 the link should be:
<a href="#4">Click here</a>Thanks. That didn’t work for me. Is there not a function that can be called to get it to show?
Thanks
no on this version. Can you paste a link ? last time I tried was working fine
Thanks, but I don’t have an external link that I can share to show it. I’m doing a workaround to get it to work with jQuery like
jQuery(“#spu-4,#spu-bg-4”).show();Sorry I just realized I pasted the wrong code.
Try :
<a href="#spu-4">Click here</a>spu- is the plugin prefix and should be always included
That works. Thanks
Glad it worked, please support us
How do you suggest being able to have it only triggered on click of a button? I don’t want it to appear unless someone clicks. Even if it is hidden and I push out the delay time, only the background appears if I trigger it before that time is reached. Hope that makes sense.
Hi Vince, you are right. I tried on an already poped popup. If you feel confortable editing js change on popups/public/assets/public.js around line 206
The following:
// add link listener for this box $('a[href="#' + $box.attr('id') +'"]').click(function() { toggleBox(id, true); return false; });Replace it with :
// add link listener for this box $('a[href="#' + $box.attr('id') +'"]').click(function() { //if is a centered popup, center it if( $box.hasClass('spu-centered') ) { centerBox( id ); } toggleBox(id, true); return false; });I will add it for the next release anyway but im not sure when is going to happen
Thanks Damian, that’s no problem for me to change.
Damian, that didn’t work for me. I still only get the background and not the popup. It’s clearly being rendered in the html, but it doesn’t display.
Thanks
Did you cleared cache and ensured the js was modified on that page?
The plugin is using the version in the assets/js/min folder so that’s probably why. What minifier did you use?
I use codekit for minification but you could use any you want and replace that code. OR add to functions.php :
define('SPU_DEBUG_MODE' , true);to use unminified version
I’m just using the un-minified version in the min folder for now. The links woks now. Thanks
The topic ‘Trigger on click’ is closed to new replies.