Công nghệ "chôm chĩa" tin tức hàng đầu từ 6 kênh báo uy tín tại Việt Nam. Code được phát triển dựa trên công nghệ truy xuất từ website Javascript-fx.com.
<script type='text/javascript'>
var _url;
var cosspider_posDist;
var cosspider_posNow = 0;
var cosspider_popupRunning;
//Param cho new job
var job_posDist;
var job_posNow = 0;
var job_popupRunning;
/* *********************************************************
* You may use this code for free on any web page provided that
* these comment lines and the following credit remain in the code.
* Floating Div from http://www.javascript-fx.com
******************************************************** */
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
var px = document.layers ? "" : "px";
function JSFX_FloatDiv(id, sx, sy)
{
var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
window[id + "_obj"] = el;
if(d.layers)el.style=el;
el.cx = el.sx = sx;el.cy = el.sy = sy;
el.sP=function(x,y){this.style.left=x+px;this.style.top=y+px;};
el.flt=function()
{
var pX, pY;
pX = (this.sx >= 0) ? 0 : ns ? innerWidth :
document.documentElement && document.documentElement.clientWidth ?
document.documentElement.clientWidth : document.body.clientWidth;
pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ?
document.documentElement.scrollTop : document.body.scrollTop;
if(this.sy<0)
pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ?
document.documentElement.clientHeight : document.body.clientHeight;
this.cx += (pX + this.sx - this.cx)/8;this.cy += (pY + this.sy - this.cy)/8;
this.sP(this.cx, this.cy);
setTimeout(this.id + "_obj.flt()", 40);
}
return el;
}
//Kết thúc mã nguồn tạo float-div lấy từ site http://www.javascript-fx.com
function GiaoLuu()
{
document.write("<a href='javascript:MoCuaSo(_url)'><img src='http://www.dichvucongdong.com/giaoluu.png' border='0' alt='Phòng giao lưu trực tuyến'/></a>");
}
function MoCuaSo(url)
{
window.open(url,'','width=710, height=550, status=No, scrollbars=Yes, resizable=Yes', '_blank');
}
//Hàm chống sql inject và XSS attack
function Chong_Hack(ketqua)
{
var _kq;
//Loại bỏ khoảng trống
_kq = ketqua.replace(" ","_");
return _kq;
}
function Call_COSSpider(_x,_y,_news,_content)
{
document.write("<iframe style='width:" + Chong_Hack(_x) + "; height:" + Chong_Hack(_y) + "; text-align: justify; overflow-x:hidden; overflow-y:scroll;' frameborder='0' style='background-color: white; z-index:auto;' allowtransparency='true' src='http://www.dichvucongdong.com/Tester/COSSpider.aspx?news="+ Chong_Hack(_news) +"&content="+ Chong_Hack(_content) +"';></iframe>");
}
function Call_COSSpider2(_img,_news,_content)
{
//Vẽ button trước
document.write("<img src='"+ Chong_Hack(_img) +"' onclick='ShowPopup();' style='cursor:hand; cursor:pointer;' alt='Dịch vụ tự động thu thập tin tức được cung cấp tại http://www.dichvucongdong.com' title='Dịch vụ tự động thu thập tin tức được cung cấp tại http://www.dichvucongdong.com'/>");
//Vẽ div control chứa kết quả tin trả về
document.write("<div id='cosspider_newsdiv' style='border-right: mediumturquoise 1px solid; border-top: mediumturquoise 1px solid; border-left: mediumturquoise 1px solid; border-bottom: mediumturquoise 1px solid; background-color: lightcyan; z-index:100001; display:none; width: 650px; position: absolute; margin-left:auto; margin-right:auto; left:0; right:0; margin-top:auto; margin-bottom:auto;'><span onclick='ShowPopupDown();' style='cursor:hand; cursor:pointer; font-family:Tahoma; font-size:8pt; color:red; font-weight:bold; margin-left:620px;' title='Đóng cửa sổ tin tức'>[ X ]</span><iframe style='width:100%; height:370px; overflow-x:hidden; overflow-y:scroll;' frameborder='0' style='background-color: white; z-index:auto;' allowtransparency='true' src='http://www.dichvucongdong.com/Tester/COSSpider.aspx?news="+ Chong_Hack(_news) +"&content="+ Chong_Hack(_content) +"'></iframe></div>");
//FLoat div
JSFX_FloatDiv("cosspider_newsdiv", 10, 10).flt();
}
//3 Hàm hiển thị popup tin
function ShowPopup()
{
if( cosspider_popupRunning) return;
cosspider_popupRunning = true;
var div = document.getElementById("cosspider_newsdiv");
// Thiết đặt vị trí xuất hiện
div.style.display = "block";
cosspider_posDist = div.offsetHeight;
div.style.height = "0px";
div.style.overflow = "hidden";
ShowPopupUp();
}
function ShowPopupUp()
{
var div = document.getElementById( "cosspider_newsdiv");
var dist = cosspider_posDist - cosspider_posNow;
if( dist >1)
{
cosspider_posNow += Math.ceil( dist/2);
div.style.height = cosspider_posNow +"px";
setTimeout( "ShowPopupUp();", 25);
}
else
{
div.style.height = cosspider_posDist;
//setTimeout( "popupDown();", 500);
}
}
function ShowPopupDown()
{
var div = document.getElementById( "cosspider_newsdiv");
var dist = cosspider_posNow;
if( dist >1)
{
cosspider_posNow -= Math.ceil( dist/2);
div.style.height = cosspider_posNow +"px";
setTimeout( "ShowPopupDown();", 25);
}
else
{
div.style.height = cosspider_posDist +"px";
div.style.display = "none";
cosspider_popupRunning = false;
}
}
//3 Hàm hiển thị job
function ShowJPopup()
{
if( job_popupRunning) return;
job_popupRunning = true;
var div = document.getElementById("new_Jobs");
// Thiết đặt vị trí xuất hiện
div.style.display = "block";
job_posDist = div.offsetHeight;
div.style.height = "0px";
div.style.overflow = "hidden";
ShowJPopupUp();
}
function ShowJPopupUp()
{
var div = document.getElementById( "new_Jobs");
var dist = job_posDist - job_posNow;
if( dist >1)
{
job_posNow += Math.ceil( dist/8);
div.style.height = job_posNow +"px";
setTimeout( "ShowJPopupUp();", 25);
}
else
{
div.style.height = job_posDist;
setTimeout( "ShowJPopupDown();", 7000);
}
}
function ShowJPopupDown()
{
var div = document.getElementById( "new_Jobs");
var dist = job_posNow;
if( dist >1)
{
job_posNow -= Math.ceil( dist/8);
div.style.height = job_posNow +"px";
setTimeout( "ShowJPopupDown();", 25);
}
else
{
div.style.height = job_posDist +"px";
div.style.display = "none";
job_popupRunning = false;
}
}
</script>
<script type='text/javascript'>Call_COSSpider('560px','300px','Không chỉ định','');</script>
Saturday, September 25, 2010
Related Posts
Chèn comment của disqus vào blogspot
Bước đầu tiên bạn phải làm là đóng comment của blogger lại. Các bước thực hiện như hình bên dưới :- ...Read more
Temple Blog đẹp miễn phí
1. AtherosDemo | More Info/Download2. Mi Diario VivirView Live Demo | More Info/Download3. My Secret...Read more
Code danh ngôn
Đặt đoạn mã bên dưới vào trang web của bạn để lấy về một danh ngôn ngẫu nhiên:<script type="text/...Read more
Chèn biểu tượng cảm xúc vào nhận xét dạng input
chắc hẳn bạn cũng biết rằng hệ thống nhận xét của Blogspot có phần khung viết nhận xét (Comments Fo...Read more
TẠO 4 BANNER QUẢNG CÁO 125X125
Bạn tiến hành các bước sau:Đầu tiên bạn đăng nhập vào Blog > Chọn Thiết kế > Chọn Thêm tiện íc...Read more
Subscribe to:
Post Comments (Atom)
Popular Posts
-
Thêm một mục dự báo thời tiết vào blog chắc chắn sẽ làm blog của bạn trông pro hơn rất nhiều . Đây là một số code chèn dự báo thời tiết và...
-
Phần mềm Emu8086 là phần mềm cho phép mô phỏng hoạt động của vi xử lý 8086 bao gồm các câu lệnh cơ bản của 8086, xử lý ngắt mềm, giao tiếp v...
-
Bài Giải #include <stdio.h> #include <conio.h> #include <math.h> int main () { int n; float AS,AM,a; int s=0; float m=1...
-
lập trình tìm các bộ số pitago | lập trình c/c++. Một tam giác vuông có thể có tất cả các cạnh là các số nguyên. Tập của ba số nguyên của ...
-
1. Helloworld Đề bài: Viết chương trình hiển thị ra màn hình dòng chữ Hello, World! Ý tưởng: Code: #include int main() /* my first progra...
-
Viết chương trình nhập vào số nguyên dương h (2<h<23), sau đó in ra các tam giác có chiều cao là h.viết hàm in các tam giác có chiều c...
-
#include <stdio.h> #include <conio.h> #include <math.h> // Dinh nghia callback typedef int (* opstion) (int *, int); //ham...
-
viết chương trình c chuyển đổi hệ đếm nhị phân, bát phân, thập lục phân . DEC,BIN,HEX,OCT. Viết chương trình in bảng của các số từ 1 đến ...
0 comments:
Post a Comment
Click to see the code!
To insert emoticon you must added at least one space before the code.