浏览器的表现形式丰富,适度的使用能使界面增色不少,介绍一下cb6中tcppwebbrowser控件的一些用法
分开说比较麻烦,从以前的工程里找了一个完整网页贴过来
网页:
<!doctype html public "-//w3c//dtd html 4.01 transitional//en">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<title>免费送歌</title>
<style type="text/css">
input {border:1px solid #000000}
<!--
-->
</style>
<script language="javascript" type="text/javascript">
<!--
function mm_preloadimages() { //v3.0
var d=document; if(d.images){ if(!d.mm_p) d.mm_p=new array();
var i,j=d.mm_p.length,a=mm_preloadimages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexof("#")!=0){ d.mm_p[j]=new image; d.mm_p[j++].src=a[i];}}
}
function mm_swapimgrestore() { //v3.0
var i,x,a=document.mm_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.osrc;i++) x.src=x.osrc;
}
function mm_findobj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexof("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=mm_findobj(n,d.layers[i].document);
if(!x && d.getelementbyid) x=d.getelementbyid(n); return x;
}
function mm_swapimage() { //v3.0
var i,j=0,x,a=mm_swapimage.arguments; document.mm_sr=new array; for(i=0;i<(a.length-2);i+=3)
if ((x=mm_findobj(a[i]))!=null){document.mm_sr[j++]=x; if(!x.osrc) x.osrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<style type="text/css">
<!--
td {
font-family: "arial";
font-size: 12px;
color: #990000;
cursor: default;
}
.jiben {
font-family: "arial";
font-size: 12px;
font-weight: bold;
color: #990000;
cursor: default;
}
-->
</style>
</head>
<body leftmargin="0" topmargin="0" onload="mm_preloadimages('image/k-17a.jpg','image/k-11a.jpg')">
<table width="315" height="144" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="22"><table width="314" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="6"><img src="image/f-1.jpg" width="4" height="25"></td>
<td> <div align="left">
<table width="310" border="0" align="right" cellpadding="0" cellspacing="0" background="image/14a.jpg" id="moveform">
<tr>
<td valign="middle" 4>8751免费点歌登陆</td>
<td width="195"><div align="right">
<table width="64" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="29%"><div align="right"><img src="image/a1.jpg" alt="最小化" name="minform" width="20" height="25" id="image1" onmouseover="mm_swapimage('image1','','image/1a.jpg',1)" onmouseout="mm_swapimgrestore()"></div></td>
<td width="32%"><div align="right"><img src="image/a2.jpg" width="20" height="25"></div></td>
<td width="27%"><div align="right"><img src="image/a3.jpg" alt="关闭" name="closeform" width="19" height="25" id="image2" onmouseover="mm_swapimage('image2','','image/3a.jpg',1)" onmouseout="mm_swapimgrestore()"></div></td>