Created
June 29, 2014 11:09
-
-
Save fordnox/a6a27adb523e1690befd to your computer and use it in GitHub Desktop.
One time popup jQuery with facebook like page
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
function rC(nam) {var tC = document.cookie.split('; '); for (var i = tC.length - 1; i >= 0; i--) {var x = tC[i].split('='); if (nam == x[0]) return unescape(x[1]);} return '~';} | |
function wC(nam,val) {document.cookie = nam + '=' + escape(val);} | |
function lC(nam,pg) {var val = rC(nam); if (val.indexOf('~'+pg+'~') != -1) return false; val += pg + '~'; wC(nam,val); return true;} | |
function firstTime(cN) {return lC('meskuciobatonelis',cN);} | |
function thisPage() {var page = location.href.substring(location.href.lastIndexOf('\/')+1); pos = page.indexOf('.');if (pos > -1) {page = page.substr(0,pos);} return page;} | |
if (firstTime(thisPage())) { | |
$('<div>') | |
.html('<iframe src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fmeskutis.lt&width&height=290&colorscheme=light&show_faces=true&header=true&stream=false&show_border=true&appId=153413347342" scrolling="no" frameborder="0" style="border:none; overflow:hidden; height:290px;" allowTransparency="true"></iframe>') | |
.dialog({ | |
modal: true, | |
minWidth: 330, | |
buttons: { | |
Ok: function() { | |
$( this ).dialog( "close" ); | |
} | |
} | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment