How To Create It?
Simply easy, there are three styles that you can use here, popup window opens by a click, popup window opens as the visitor load your site, popup window opens only to the first visit, or popup window opens in a specific time as you set the range. And here, we'll use the scripts from www.javascriptkit.com
1. Login to your Blogger.
2. Go to Design.
3. Edit Html.
4. Find the tag <body> in your template and put one of the codes below beneath it.
Popup Window Opens By A Click The code above looks like the below.
<script type="text/javascript"> //JK Popup Window Script (version 3.0)- By JavaScript Kit (http://www.javascriptkit.com) //Visit JavaScriptKit.com for free JavaScripts //This notice must stay intact for legal use function openpopup(popurl){ var winpops=window.open(popurl,"","width=,height=,location,status,scrollbars,resizable") } </script> |
Now, put the following code anywhere you want the popup button to show up. The code above looks like the below.
<a href="javascript:openpopup('http://www.google.com')">Click to open the popup window</a> |
Just change the http://www.google.com with any url whose page you want to popup.
Popup Window Opens Only One Time The code above looks like the below.
<script type="text/javascript"> //JK Popup Window Script (version 3.0)- By JavaScript Kit (http://www.javascriptkit.com) //Visit JavaScriptKit.com for free JavaScripts //This notice must stay intact for legal use //Win Type: Pop Up | Session Only //Specify URLs to randomly select from and popup/popunder: //To display a single URL, just remove all but the first entry below: var popurls=new Array() popurls[0]="http://j-smith-site.blogspot.com" popurls[1]="http://j-smith-site.blogspot.com/2012/06/creating-table-using-html-code.html" popurls[2]="http://j-smith-site.blogspot.com/2012/06/ps1-games-collection-for-nokia-s60v5-v3.html" popurls[3]="http://j-smith-site.blogspot.com/2012/06/updates-of-browser-handler-opera-mini.html" function openpopup(popurl){ var winpops=window.open(popurl,"","width=,height=,location,status,scrollbars,resizable") } function get_cookie(Name) { var search = Name + "=" var returnvalue = ""; if (document.cookie.length > 0) { offset = document.cookie.indexOf(search) if (offset != -1) { // if cookie exists offset += search.length // set index of beginning of value end = document.cookie.indexOf(";", offset); // set index of end of cookie value if (end == -1) end = document.cookie.length; returnvalue=unescape(document.cookie.substring(offset, end)) } } return returnvalue; } function loadornot(){ if (get_cookie('jkpopup')==''){ openpopup(popurls[Math.floor(Math.random()*(popurls.length))]) document.cookie="jkpopup=yes" } } loadornot() </script> |
Popup Window Opens Anytime The code above looks like the below.
<script type="text/javascript"> //JK Popup Window Script (version 3.0)- By JavaScript Kit (http://www.javascriptkit.com) //Visit JavaScriptKit.com for free JavaScripts //This notice must stay intact for legal use //Win Type: Pop Up | Always //Specify URLs to randomly select from and popup/popunder: //To display a single URL, just remove all but the first entry below: var popurls=new Array() popurls[0]="http://j-smith-site.blogspot.com" popurls[1]="http://j-smith-site.blogspot.com/2012/06/creating-table-using-html-code.html" popurls[2]="http://j-smith-site.blogspot.com/2012/06/ps1-games-collection-for-nokia-s60v5-v3.html" popurls[3]="http://j-smith-site.blogspot.com/2012/06/updates-of-browser-handler-opera-mini.html" function openpopup(popurl){ var winpops=window.open(popurl,"","width=,height=,location,status,scrollbars,resizable") } openpopup(popurls[Math.floor(Math.random()*(popurls.length))]) </script> |
Popup Window Opens Regularly The code above looks like the below.
<script type="text/javascript"> //JK Popup Window Script (version 3.0)- By JavaScript Kit (http://www.javascriptkit.com) //Visit JavaScriptKit.com for free JavaScripts //This notice must stay intact for legal use //Win Type: Pop Up | 5 minutes period //Specify URLs to randomly select from and popup/popunder: //To display a single URL, just remove all but the first entry below: var popurls=new Array() popurls[0]="http://j-smith-site.blogspot.com" popurls[1]="http://j-smith-site.blogspot.com/2012/06/creating-table-using-html-code.html" popurls[2]="http://j-smith-site.blogspot.com/2012/06/ps1-games-collection-for-nokia-s60v5-v3.html" popurls[3]="http://j-smith-site.blogspot.com/2012/06/updates-of-browser-handler-opera-mini.html" function openpopup(popurl){ var winpops=window.open(popurl,"","width=,height=,location,status,scrollbars,resizable") } function get_cookie(Name) { var search = Name + "=" var returnvalue = ""; if (document.cookie.length > 0) { offset = document.cookie.indexOf(search) if (offset != -1) { // if cookie exists offset += search.length // set index of beginning of value end = document.cookie.indexOf(";", offset); // set index of end of cookie value if (end == -1) end = document.cookie.length; returnvalue=unescape(document.cookie.substring(offset, end)) } } return returnvalue; } popfrequency="5 minutes" function resetcookie(){ var expireDate = new Date() expireDate.setMinutes(expireDate.getMinutes()-10) document.cookie = "jkpopunder=;path=/;expires=" + expireDate.toGMTString() } function loadornot(){ if (get_cookie('jkpopunder')==''){ openpopup(popurls[Math.floor(Math.random()*(popurls.length))]) var expireDate = new Date() expireDate.setMinutes(expireDate.getMinutes()+parseInt(popfrequency)) document.cookie = "jkpopunder="+parseInt(popfrequency)+";path=/;expires=" + expireDate.toGMTString() } } if (get_cookie('jkpopunder')!=parseInt(popfrequency)) resetcookie() loadornot() </script> |
That's all.
0 comments:
Post a Comment