{PHẦN MỀM - TOOLS MIỄN PHÍ}

Showing posts with label Blogger. Show all posts
Showing posts with label Blogger. Show all posts

Friday, October 4, 2013

[Blogger] Tạo Banner chạy dọc 2 bên trang web/blog [Thủ thuật]

- 0 comments
Tạo banner chạy dọc 2 bên cho blogspot

Hình vẽ mô phỏng:

Để tạo được các banner chạy dọc các bạn thực hiện theo các bước sau:

Bước 1: Đăng nhập vào tài khoản Blogspot => Chọn BỐ CỤC => add thêm Tiện ích => Chọn tiện ích HTML/JavaScript.


Bước 2: Paste đoạn code sau vào Tiện ích HTML/Javascript

<div id="divAdRight" style="DISPLAY: none; POSITION: absolute; TOP: 0px">
<script type="text/javascript">
var ro2zoneid = '195125';
var ro2width = '120';
var ro2height = '600';
var parentpos;
if ( window.location === window.top.location )
{ parentpos=window.location + "#(referrer)[" + document.referrer + "]"; }
else { parentpos=window.location + "#(parent_location)[" + document.referrer + "]"; }
document.write('<iframe src="http://ro2.biz/ad.php?zone='+ro2zoneid+'&w='+ro2width+'&h='+ro2height+'&rf='+encodeURIComponent(parentpos)+'"');
document.write(' name="ro2bizadtag" title="ro2bizadtag" scrolling="no"');
document.write('border="0" frameborder="0" width="120" height="600"></iframe>');
</script>


</div>

<div id="divAdLeft" style="DISPLAY: none; POSITION: absolute; TOP: 0px">
<div data-app-id="176" class="div-ad123-vn-for-publisher" data-height="600" style="width:120px;"></div>

<script type="text/javascript" src="http://ad.ad1688.net/ads_block.js?adm_zoneid=176&v=1380853288"></script>


</div>
<script>
function FloatTopDiv()
{
startLX = ((document.body.clientWidth -MainContentW)/2)-LeftBannerW-LeftAdjust , startLY = TopAdjust+80;
startRX = ((document.body.clientWidth -MainContentW)/2)+MainContentW+RightAdjust , startRY = TopAdjust+80;
var d = document;
function ml(id)
{
var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
el.sP=function(x,y){this.style.left=x + 'px';this.style.top=y + 'px';};
el.x = startRX;
el.y = startRY;
return el;
}

function m2(id)
{
var e2=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
e2.sP=function(x,y){this.style.left=x + 'px';this.style.top=y + 'px';};
e2.x = startLX;
e2.y = startLY;
return e2;
}
window.stayTopLeft=function()
{
if (document.documentElement && document.documentElement.scrollTop)
var pY = document.documentElement.scrollTop;
else if (document.body)
var pY = document.body.scrollTop;
if (document.body.scrollTop > 30){startLY = 3;startRY = 3;} else {startLY = TopAdjust;startRY = TopAdjust;};
ftlObj.y += (pY+startRY-ftlObj.y)/16;
ftlObj.sP(ftlObj.x, ftlObj.y);
ftlObj2.y += (pY+startLY-ftlObj2.y)/16;
ftlObj2.sP(ftlObj2.x, ftlObj2.y);
setTimeout("stayTopLeft()", 1);
}

ftlObj = ml("divAdRight");

//stayTopLeft();
ftlObj2 = m2("divAdLeft");
stayTopLeft();
}
function ShowAdDiv()
{
var objAdDivRight = document.getElementById("divAdRight");
var objAdDivLeft = document.getElementById("divAdLeft");
if (document.body.clientWidth < 1000)
{
objAdDivRight.style.display = "none";
objAdDivLeft.style.display = "none";
}
else
{
objAdDivRight.style.display = "block";
objAdDivLeft.style.display = "block";
FloatTopDiv();
}
}
</script>
<script>
document.write("<script type='text/javascript' language='javascript'>MainContentW = 1000;LeftBannerW =125;RightBannerW = 125;LeftAdjust = 5;RightAdjust = 5;TopAdjust = 10;ShowAdDiv();window.onresize=ShowAdDiv;;<\/script>");
</script>

Lưu ý: Phần bôi xanh là code quảng cáo hoặc hình ảnh mà bạn muốn hiển thị.

>> Download Code tại đây.

Bước 3: Lưu lại => xem thử thành quả

Chúc các bạn thành công!



[Chi tiết...]

[Blogger] Tự động tạo liên kết trong cho blogspot (tự động bắt link) [Thủ thuật]

- 1 comments
Tự động tạo liên kết trong cho blogspot (tự động bắt link )

Liên kết trong là liên kết giữa các bài viết trên website thông qua các từ khóa. Liên kết trong giúp tăng thời gian lưu lại trên web của người đọc, giúp cải thiện SEO on page và có thể kiếm tiền từ textlinks với adf.ly.

Để tạo khả năng tự động bắt link có thêm nhiều liên kết trong cho blogspot bạn có thể làm :

Bước 1: Bạn vào Mẫu => Chỉnh sửa HTML => Chọn Mở rộng Mẫu Tiện ích.

Bước 2 : Thêm mã sau vào trước thẻ </head>

<script type='text/javascript'>//<![CDATA[function doHighlight(a,c,f){for(var d="",b=-1,g=c.toLowerCase(),e=a.toLowerCase();0<a.length;)b=e.indexOf(g,b+1),0>b?(d+=a,a=""):a.lastIndexOf(">",b)>=a.lastIndexOf("<",b)&&e.lastIndexOf("/script>",b)>=e.lastIndexOf("<script",b)&&(d+=a.substring(0,b)+'<a title="'+a.substr(b,c.length)+'" alt="'+a.substr(b,c.length)+'" href="'+f+'">'+a.substr(b,c.length)+"</a>",a=a.substr(b+c.length),e=a.toLowerCase(),b=-1);return d} function highlightSearchTerms(a,c,f,d){searchArray=c?[a]:a.split(" ");div=document.getElementById(d);a=div.innerHTML;for(c=0;c<searchArray.length;c++)a=doHighlight(a,searchArray[c],f);div.innerHTML=a;return!0};//]]></script>

Bước 3: Tìm dòng và thay thế: <data:post.body/>

Bằng đoạn code sau :
<div expr:id='"summary" + data:post.id'><data:post.body/></div><!-- textlink --><script type='text/javascript'>highlightSearchTerms('lập trình',true,'http://adf.ly/T2dpC','summary<data:post.id/>');highlightSearchTerms('tài liệu',true,'http://adf.ly/PfKy3','summary<data:post.id/>');highlightSearchTerms('ICT',true,'http://adf.ly/PfKy3','summary<data:post.id/>');highlightSearchTerms('kiếm tiền',true,'http://adf.ly/PfJrE','summary<data:post.id/>');highlightSearchTerms('lập trình C',true,'http://adf.ly/T2dpC','summary<data:post.id/>');highlightSearchTerms('C++',true,'http://adf.ly/T2dpC ','summary<data:post.id/>');highlightSearchTerms('Java',true,'http://adf.ly/T2dpC ','summary<data:post.id/>');highlightSearchTerms('PHP',true,'http://adf.ly/T2dpC ','summary<data:post.id/>');highlightSearchTerms('C#',true,'http://adf.ly/T2dpC ','summary<data:post.id/>');highlightSearchTerms('ASP.Net',true,'http://adf.ly/T2dpC ','summary<data:post.id/>');highlightSearchTerms('Android',true,'http://adf.ly/T2dpC ','summary<data:post.id/>');highlightSearchTerms('VB',true,'http://adf.ly/T2dpC ','summary<data:post.id/>');highlightSearchTerms('CSS',true,'http://adf.ly/T2dpC ','summary<data:post.id/>');highlightSearchTerms('js',true,'http://adf.ly/T2dpC ','summary<data:post.id/>');highlightSearchTerms('Assembly',true,'http://adf.ly/T2dpC','summary<data:post.id/>');highlightSearchTerms('Programming',true,'http://adf.ly/T2dpC','summary<data:post.id/>');highlightSearchTerms('J2ME',true,'http://adf.ly/T2dpC','summary<data:post.id/>');highlightSearchTerms('J2EE',true,'http://adf.ly/T2dpC','summary<data:post.id/>');highlightSearchTerms('code',true,'http://adf.ly/T2dpC','summary<data:post.id/>');highlightSearchTerms('tool',true,' http://adf.ly/WceeG','summary<data:post.id/>');highlightSearchTerms('công cụ',true,' http://adf.ly/WceeG ','summary<data:post.id/>');</script>
>>> Download code tại đây.

Lưu ý: Mỗi dòng highlighSearchTerms là một textlink ứng với cụm từ mà bạn muốn đặt textlink.

Chúc các bạn thành công!

[Chi tiết...]

Tuesday, October 1, 2013

Tổng hợp các Code Popup - Javascripts quảng cáo cho website - Blogspot

- 0 comments

Code Javascripts Popup quảng cáo cho website - blogspot.

Code Popup quảng cáo xuất hiện nhiều tab mỗi khi click chuột.Code Popup quảng cáo xuất hiện popup khi click chuột lần đầu tiên.Code Popup quảng cáo xuất hiện nhiều cửa sổ khi click lần đầu tiên. Code mở popup cửa sổ quảng cáo nhỏ dưới góc màn hình.

Các loại Code Popup mình sẽ chia sẻ trong bài viết này:
- Code Popup xuất hiện nhiều tab mỗi khi click chuột
- Code Popup-under hiện sau trình duyệt cho website/Blogger
- Code popup mở ra tab mới khi click vào vị trí bất kỳ trên web
- Code mở popup cửa sổ quảng cáo nhỏ dưới góc màn hình
- Code Popup: Xuất hiện popup khi click chuột lần đầu tiên
- Code Popup : Xuất hiện nhiều cửa sổ khi click lần đầu tiên
- Code tạo quảng cáo popup xuất hiện 1 lần/1 ngày/1 ip

Tổng hợp Code Popup - Javascripts quảng cáo cho website - Blogspot
Chú ý: Thay link bằng link http://kiem-tien-online-tai-nha.blogspot.com/ Website các bạn cần đặt Popup nhé.
1. Code Popup xuất hiện nhiều tab mỗi khi click chuột
Thay phần <body> thành đoạn code dưới đây
<body onclick='open_popup()'>
<script type='text/javascript'>
/* <![CDATA[ */
function open_popup() {
window.open("http://kiem-tien-online-tai-nha.blogspot.com/")
window.open("http://kiem-tien-online-tai-nha.blogspot.com/")
window.open("http://kiem-tien-online-tai-nha.blogspot.com/")
}
/* ]]> */
</script>

Ở trên mình mặc định là 3 trang sẽ được mở ra khi click chuột, bạn hoàn toàn có thể thêm nhiều hơn bằng cách thêm window.open("địa chỉ web/blog").

Chú ý : Cách này sẽ gậy khó chịu cho người dùng

2. Code Popup-under hiện sau trình duyệt cho website/Blogger

Đặc điểm của file javarscripts.

Các popup-under sẽ tự động xuất hiện mà không cần phải đợi độc giả click vào một vị trí bất kỳ nào trên blogger của bạn.
Popup sẽ không xuất hiện trên các trình duyệt sử dụng các add on hay phần mềm chặn popup.

Cách thực hiện

+ Đối với blogspot
- Đăng nhập vào blog
- Vào bảng điều khiển Blogger
- Vào bố cục (Layout) -> Thêm tiện ích (Add a widget) -> HTML/Javascript
- Dán 1 trong 2 đoạn code dưới đây vào tiện ích HTML/Javascript vừa thêm (Ngoài ra bạn có thể dán nó trước thẻ </head>)
+ Đối với website:
- Bạn chỉ cần dán nó trước thẻ </head> là ok
Đoạn 1:

<script>
function popup() {
var url = "http://kiem-tien-online-tai-nha.blogspot.com/";
window.open(url);
popWin = window.open(page,'popWin');
popWin.blur();
window.focus();
}
popup();
</script>


Đoạn 2:

<script>
//Pop-under window- By JavaScript Kit
//Credit notice must stay intact for use
//Visit http://javascriptkit.com for this script
//specify page to pop-under
var popunder="http://kiem-tien-online-tai-nha.blogspot.com/"
//specify popunder window features
//set 1 to enable a particular feature, 0 to disable
var winfeatures="width=800,height=510,scrollbars=1,resizable=1,toolbar=1,location=1,menubar=1,status=1,directories=0"
//Pop-under only once per browser session? (0=no, 1=yes)
//Specifying 0 will cause popunder to load every time page is loaded
var once_per_session=0
///No editing beyond here required/////
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('popunder')==''){
loadpopunder()
document.cookie="popunder=yes"
}
}
function loadpopunder(){
win2=window.open(popunder,"",winfeatures)
win2.blur()
window.focus()
}
if (once_per_session==0)
loadpopunder()
else
loadornot()
</script>

>> Download code

3.Code popup mở ra tab mới khi click vào vị trí bất kỳ trên web

<script type="text/javascript" language=javascript>
function Set_Cookie(name, value, expires, path, domain, secure) {
var today = new Date();
today.setTime(today.getTime());
var expires_date = new Date(today.getTime() + (expires));
document.cookie = name + "=" + escape(value) +
((expires) ? ";expires=" + expires_date.toGMTString() : "") +
((path) ? ";path=" + path : "") +
((domain) ? ";domain=" + domain : "") +
((secure) ? ";secure" : "");
}
function Get_Cookie(name) {
var start = document.cookie.indexOf(name + "=");
var len = start + name.length + 1;
if ((!start) &&
(name != document.cookie.substring(0, name.length))) {
return null;
}
if (start == -1) return null;
var end = document.cookie.indexOf(";", len);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(len, end));
}
function Delete_Cookie(name, path, domain) {
if (Get_Cookie(name)) document.cookie = name + "=" +
((path) ? ";path=" + path : "") +
((domain) ? ";domain=" + domain : "") +
";expires=Mon, 11-November-1989 00:00:01 GMT";
}
function popunder() {
if (Get_Cookie('cucre') == null) {
Set_Cookie('cucre', 'cucre Popunder', '1', '/', '', '');
var url = "http://kiem-tien-online-tai-nha.blogspot.com/";
pop = window.open(url, 'windowcucre');
pop.blur();
window.focus();
}}
function addEvent(obj, eventName, func) {
if (obj.attachEvent) {
obj.attachEvent("on" + eventName, func);
}
else if (obj.addEventListener) {
obj.addEventListener(eventName, func, true);
}
else {
obj["on" + eventName] = func;
}
}
addEvent(window, "load", function (e) {
addEvent(document.body, "click", function (e) {
popunder();
});
});
</script>

4. Code mở popup cửa sổ quảng cáo nhỏ dưới góc màn hình

Những điểm hay của Code Popup này:
- Xuất hiện 1 lần khi trình duyệt Website mở.
- Cửa sổ trang Website được Pop nhỏ ở góc màn hình -> kéo dài thời gian ở lại củaWebsite được Pop.

Cách làm:
- Trên các nền Website thì đây chỉ là 1 đoạn code javascript trên thẻ </head> là OK
- Hướng dẫn trên Blogspot.
+ Các bạn vào bảng điều khiển blogger -> bố cục (Layout) -> Thêm 1 tiện ích (Add a Widget) -> HTML/Javascript.
Sau đó dán code trên vào tiện ích vừa thêm và lưu lại là OK

Code:

<script>function addEvent(obj,eventName,func){if(obj.attachEvent){obj.attachEvent("on"+eventName,func);}else if(obj.addEventListener){obj.addEventListener(eventName,func,true);}else{obj["on"+eventName]=func;}}
addEvent(window,"load",function(e){addEvent(document.body,"click",function(e){var pX;pX=screen.width;if(!pX){pX=document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth;}
if(pX>800){if(document.cookie.indexOf("pnpopup=popactive")==-1){document.cookie='pnpopup=popactive';params='width=50';params+=', height=50';params+=', top=1650, left=1460, resizable=no, scrollbars=yes, location=yes';var w=window.open("http://kiem-tien-online-tai-nha.blogspot.com/",'window1',params).blur();window.focus();}}});});</script>


Thay link bằng link http://kiem-tien-online-tai-nha.blogspot.com/ Website các bạn cần đặt Pop nhé.


5. Code Popup: Xuất hiện popup khi click chuột lần đầu tiên

Đối với đoạn script này thì cửa sổ Popup chỉ mở ra khi bạn click chuột lần đầu tiên khi truy cập một blog, các thao tác click về sau cửa sổ popup sẽ khi còn xuất hiện như script đầu tiên, script đầu tiên chỉ cần bạn click là nó xuất hiện tab mới tần suất xuất hiện cao hơn script này. Hơn nữa script này sẽ lấy ngẫu nhiên trang web/blog trong urllist để xuất hiện.

Thay phần <body> thành đoạn code dưới đây

<body onclick="vtlai_popup();">
<script language="javascript">
/* <![CDATA[ */
var sinhvienit=0;
function SVIT_ADS_GetCookie(Name){
var re=new RegExp(Name+"=[^;]+", "i");
if (document.cookie.match(re))
return decodeURIComponent(document.cookie.match(re)[0].split("=")[1]);
return ""
}
function SVIT_ADS_SetCookie(name, value, days){
if (typeof days!="undefined"){
var expireDate = new Date()
var expstring=expireDate.setDate(expireDate.getDate()+days)
document.cookie = name+"="+decodeURIComponent(value)+"; expires="+expireDate.toGMTString()
}
else document.cookie = name+"="+decodeURIComponent(value);
}
function vtlai_popup()
{
var cookie_popup_ads = SVIT_ADS_GetCookie('sinhvienit_popup_ads');
if (cookie_popup_ads=='') {
if(sinhvienit==0)
{
sinhvienit=1;
var Time_expires = 24 * 3600 * 1000;
SVIT_ADS_SetCookie('sinhvienit_popup_ads','true',Time_expires);
var urllist = ['http://kiem-tien-online-tai-nha.blogspot.com/','http://ebooks-ict.blogspot.com/','http://taiphanmemlaptrinh.blogspot.com/','http://lap-trinh-may-tinh.blogspot.com/'];
var url = urllist[Math.floor(Math.random() * urllist.length)];
var params = 'width=' + '300';
params += ', height=' + '300';
params += ', top=0,left=0,scrollbars=yes,status=1,toolbar=1,menubar=1,resizable=1,location=1,directories=1';
var pop_ads_open = window.open(url, 'sinhvienit_ads_pop', params);
}
}
}
/* ]]> */
</script>

6. Code Popup : Xuất hiện nhiều cửa sổ khi click lần đầu tiên

Code phần này là khi bạn click vào blog lần đầu tiên tất cả các cửa sổ đều xuất hiện và chỉ 1 lần duy nhất, những cú click tiếp theo trên cùng 1 trình duyệt thì các cửa sổ không xuất hiện nữa với khoảng thời gian nhất định.

Cách làm:

Thay phần <body> thành đoạn code dưới đây

<body onclick='vtlai_popup();'>
<script language='javascript'>
//<![CDATA[
var sinhvienit=0;
function SVIT_ADS_GetCookie(Name){
var re=new RegExp(Name+"=[^;]+", "i");
if (document.cookie.match(re))
return decodeURIComponent(document.cookie.match(re)[0].split("=")[1]);
return ""
}
function SVIT_ADS_SetCookie(name, value, days){
if (typeof days!="undefined"){
var expireDate = new Date()
var expstring=expireDate.setDate(expireDate.getDate()+days)
document.cookie = name+"="+decodeURIComponent(value)+"; expires="+expireDate.toGMTString()
}
else document.cookie = name+"="+decodeURIComponent(value);
}
function vtlai_popup()
{
var cookie_popup_ads = SVIT_ADS_GetCookie('sinhvienit_popup_ads');
if (cookie_popup_ads=='') {
if(sinhvienit==0)
{
sinhvienit=1;
var Time_expires = 24 * 3600 * 1000;
SVIT_ADS_SetCookie('sinhvienit_popup_ads','true',Time_expires);
var params = 'width=' + '600';
params += ', height=' + '500';
params += ',scrollbars=yes,status=1,toolbar=1,menubar=1,resizable=1,location=1,directories=1';
var vtlai_popup_0 = window.open('http://kiem-tien-online-tai-nha.blogspot.com/', 'vtlai_popup_0', params +', top=0,left=0');
var vtlai_popup_1 = window.open('http://kiem-tien-online-tai-nha.blogspot.com/', 'vtlai_popup_1', params +', top=0,left=0');
var vtlai_popup_2 = window.open('http://kiem-tien-online-tai-nha.blogspot.com/', 'vtlai_popup_2', params +', top=0,left=0');
var vtlai_popup_3 = window.open('http://kiem-tien-online-tai-nha.blogspot.com/', 'vtlai_popup_3', params +', top=0,left=0');
}
}
}
//]]>
</script>

7. Code tạo quảng cáo popup xuất hiện 1 lần/1 ngày/1 ip

Tìm đến thẻ <body> và thay thế thành như bên dưới

<body onclick='popunder();'>
<script>
/* <![CDATA[ */
function Set_Cookie(a,b,c,e,f,g){var d=new Date;d.setTime(d.getTime());d=new Date(d.getTime()+c);document.cookie=a+"="+escape(b)+(c?";expires="+d.toGMTString():"")+(e?";path="+e:"")+(f?";domain="+f:"")+(g?";secure":"")}function Get_Cookie(a){var b=document.cookie.indexOf(a+"="),c=b+a.length+1;if(!b&&a!=document.cookie.substring(0,a.length)||-1==b)return null;a=document.cookie.indexOf(";",c);-1==a&&(a=document.cookie.length);return unescape(document.cookie.substring(c,a))} function Delete_Cookie(a,b,c){Get_Cookie(a)&&(document.cookie=a+"="+(b?";path="+b:"")+(c?";domain="+c:"")+";expires=Mon, 11-November-2020 00:00:01 GMT")}
function popunder(){null==Get_Cookie("cucre")&&(Set_Cookie("cucre","cucre Popunder","1","/","",""),
pop=window.open("http://kiem-tien-online-tai-nha.blogspot.com/","windowcucre"),
pop.blur(),window.focus())}function addEvent(a,b,c){a.attachEvent?a.attachEvent("on"+b,c):a.addEventListener?a.addEventListener(b,c,!0):a["on"+b]=c} addEvent(window,"load",function(){addEvent(document.body,"click",function(){popunder()})});
/* ]]> */</script>


Hoặc bạn có thể dùng đoạn code sau:

<script>
//<![CDATA[
function Set_Cookie(name, value, expires, path, domain, secure) {
var today = new Date();
today.setTime(today.getTime());
var expires_date = new Date(today.getTime() + (expires));
document.cookie = name + "=" + escape(value) +
((expires) ? ";expires=" + expires_date.toGMTString() : "") +
((path) ? ";path=" + path : "") +
((domain) ? ";domain=" + domain : "") +
((secure) ? ";secure" : "");
}
function Get_Cookie(name) {
var start = document.cookie.indexOf(name + "=");
var len = start + name.length + 1;
if ((!start) &&
(name != document.cookie.substring(0, name.length))) {
return null;
}
if (start == -1) return null;
var end = document.cookie.indexOf(";", len);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(len, end));
}
function Delete_Cookie(name, path, domain) {
if (Get_Cookie(name)) document.cookie = name + "=" +
((path) ? ";path=" + path : "") +
((domain) ? ";domain=" + domain : "") +
";expires=Mon, 11-November-1989 00:00:01 GMT";
}
function popunder() {
if (Get_Cookie('cucre') == null) {
Set_Cookie('cucre', 'cucre Popunder', '1', '/', '', '');
var url = "http://kiem-tien-online-tai-nha.blogspot.com/";
pop = window.open(url, 'windowcucre');
pop.blur();
window.focus();
}
}
function addEvent(obj, eventName, func) {
if (obj.attachEvent) {
obj.attachEvent("on" + eventName, func);
}
else if (obj.addEventListener) {
obj.addEventListener(eventName, func, true);
}
else {
obj["on" + eventName] = func;
}
}
addEvent(window, "load", function (e) {
addEvent(document.body, "click", function (e) {
popunder();
});
});
//]]>
</script>
<body onclick='popunder();'>


Chúc các bạn thành công!

[Chi tiết...]

Saturday, June 29, 2013

Tạo nút Back To Top (trở về đầu trang) cho Blogspot.

- 1 comments
Tạo nút Back To Top (trở về đầu trang) cho Blogspot. Tiện ích này rất hữu ích cho các trang có nội dung dài.

- Bước 1: vào mục Mẫu >> Chỉnh sửa HTML
Thêm đoạn code sau vào trước thẻ </body> (Để vào sau <head> cũng được nhưng nên để code cuối trang vì ta sẽ để load sau cùng):

<style type='text/css'>
#bttop{border:1px solid #4adcff;background:#24bde2;text-align:center;padding:5px;position:fixed;bottom:35px;right:10px;cursor:pointer;display:none;color:#fff;font-size:11px;font-weight:900;line-height: 25px;}
#bttop:hover{border:1px solid #32cd32;background:#bada55;}
</style>
<div id='bttop'>BACK TO TOP</div>
<script src='https://backlinkjs.googlecode.com/files/min.js' type='text/javascript'></script>
<script type='text/javascript'>$(function(){$(window).scroll(function(){if($(this).scrollTop()!=0){$('#bttop').fadeIn();}else{$('#bttop').fadeOut();}});$('#bttop').click(function(){$('body,html').animate({scrollTop:0},800);});});</script>


Ghi chú:
Ở giữa 2 thẻ <style type='text/css'> và </style> là đoạn css định hình dạng cho nút Back to Top, các bạn tùy chỉnh thoải mái.
Dòng code màu lam là thư viện Jquery, nếu có rồi thì các bạn nên xóa nó đi.
BACK TO TOP các bạn thay bằng gì cũng được (GO TOP chẳng hạn).

Bạn có thể download file min.js [tại đây - click bỏ qua quảng cáo để download] sau đó bạn có thể upload lên code google để lưu trữ lâu dài.

Chúc thành công!
[Chi tiết...]
 
Copyright © . TẢI PHẦN MỀM, ỨNG DỤNG - Posts · Comments
Theme Template by BTDesigner · Powered by Blogger