We help IT Professionals succeed at work.

Popup on onClick

turtleman2009
on
The attached code runs a pop up if a cookie doesn't exist in your cache, I want to change it for the pop up to only show if you click on this link: <a id="followrss" href="#" target=""><img src="http://www.leadershipdynamics.org/follow.png" width="37" height="152"></a>


How would I go about doing this?
<script type="text/javascript">
function getCookie(nombre)
{
	if(document.cookie.length>0)
	{
	start=document.cookie.indexOf(nombre + "=");
	if (start!=-1)
	{
	start=start + nombre.length+1; 
	end=document.cookie.indexOf(";",start);
	if (end==-1)
	end=document.cookie.length;
	return unescape(document.cookie.substring(start,end));
	}
	}
	return "";
	}

  window.addEvent('domready', function(){
	SexyLightbox = new SexyLightBox({imagesdir: '<?=$site_url?>/wp-content/plugins/wp-emailfeedburnerpop/sexyimages/'});
	if (getCookie('popup') !="yes"){
	SexyLightbox.show('', '<?=$site_url?>/wp-content/plugins/wp-emailfeedburnerpop/form.html?height=150&width=400', 'sexylightbox');
	document.cookie = "popup=yes";
	}
  });
</script>

Open in new window

Comment
Watch Question

.Net Full Stack Developer
CERTIFIED EXPERT
Commented:
Convert this into a JavaScript function and then call this function as
<a id="followrss" href="javascript:functionname();" target=""><img src="http://www.leadershipdynamics.org/follow.png" width="37" height="152"></a>

Author

Commented:
Thank you. I am not very good at this stuff, what portion of the javascript do I need, and how would I convert it into a function

Author

Commented:
Thanks!

Explore More ContentExplore courses, solutions, and other research materials related to this topic.