Close popup in event click


#1

I want get customer’s email so I ask them input their email.
I checked valid email when they click on Tweet button.
I want if invalid email I will close Tweeter popup. Please help me how to do that ?
This is my code:

window.twttr = (function(d, s, id) { var t, js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "http://vietnam.krestondts.com.au:92//DesktopModules/ShareTweeterFacebook/widgets.js"; fjs.parentNode.insertBefore(js, fjs); //js.src = "http://platform.twitter.com/widgets.js"; fjs.parentNode.insertBefore(js, fjs); return window.twttr || (t = { _e: [], ready: function(f) { t._e.push(f) } }); } (document, "script", "twitter-wjs"));

twttr.ready(function(twttr) {
// Now bind our custom intent events
twttr.events.bind(‘click’, clickEventToAnalytics);
twttr.events.bind(‘tweet’, tweetIntentToAnalytics);
twttr.events.bind(‘retweet’, retweetIntentToAnalytics);
twttr.events.bind(‘favorite’, favIntentToAnalytics);
twttr.events.bind(‘follow’, followIntentToAnalytics);
});

function clickEventToAnalytics(intent_event) {
if (intent_event) {
{ if invalid email is close Tweeter popup }
};
}


#2

#3