<html>
<head>
<title>左右滚动的图片效果</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
.borderall
{
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: #3a6ea5;
border-right-color: #3a6ea5;
border-bottom-color: #CCCCCC;
border-left-color: #3a6ea5;
}
body,td,th
{
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
font-family:"宋体";
font-size: 12px;
color: #3a6ea5;
}
</style>
</head>
<body>
<div id="marquee" direction="left" style="overflow:hidden;height:125px; width:1000px;">
<table><tr><td>
<!-- Marquee Body Head -->
<img src="UpFile/def.jpg" border="0" width="155" height="120" class="borderall">
<a href="UpFile/DSC00933.JPG" target="_blank">
<img src="UpFile/DSC00933.JPG" border="0" width="155" height="120" class="borderall">
</a>
<a href="UpFile/DSC00934.JPG" target="_blank">
<img src="UpFile/DSC00934.JPG" border="0" width="155" height="120" class="borderall">
</a>
<a href="UpFile/DSC00935.JPG" target="_blank">
<img src="UpFile/DSC00935.JPG" border="0" width="155" height="120" class="borderall">
</a>
<a href="UpFile/DSC00959.JPG" target="_blank">
<img src="UpFile/DSC00959.JPG" border="0" width="155" height="120" class="borderall">
</a>
<a href="UpFile/DSC00961.JPG" target="_blank">
<img src="UpFile/DSC00961.JPG" border="0" width="155" height="120" class="borderall">
</a>
<!-- Marquee Body Bottom -->
</td></tr></table>
</div>
<script language="JavaScript" defer>
//qswh's original and modifid by windy_sk <windy_sk@126.com> 20040120
function reportError(msg,url,line) {
var str = "You have found an error as below: \n\n";
str += "Err: " + msg + " on line: " + line;
alert(str);
return true;
}
window.onerror = reportError;
var obj_marquee = document.getElementById("marquee");
var repeat = null;
var marquee_spd = 50;
function marquee_init() {
var obj_unit = obj_marquee.firstChild;
var marquee_high = parseInt(obj_marquee.style.height);
var marquee_wide = parseInt(obj_marquee.style.width);
var unit_high = obj_unit.offsetHeight;
var unit_wide = obj_unit.offsetWidth;
var m = 0, n = 0, i = 0;
var tmp = null;
m = Math.ceil(marquee_wide / unit_wide);
n = Math.ceil(marquee_high / unit_high);
obj_unit.style.width = marquee_wide * (m+1);
obj_unit.rows[0].cells[0].style.width = obj_marquee.style.width;
for(i=0; i<m; i++) {
tmp = obj_unit.rows[0].insertCell(-1);
tmp.innerHTML = obj_unit.rows[0].cells[0].innerHTML;
tmp.style.width = marquee_wide;
tmp = null;
}
for(i=0; i<n; i++) {
obj_marquee.appendChild(obj_unit.cloneNode(true));
}
return;
}
function marquee_show(direction) {
switch(direction) {
case "up":
if(obj_marquee.scrollTop >= obj_marquee.children[1].offsetTop) {
obj_marquee.scrollTop -= obj_marquee.firstChild.offsetHeight;
} else {
obj_marquee.scrollTop++;
}
break;
case "down":
if(obj_marquee.scrollTop <= 0) {
obj_marquee.scrollTop += obj_marquee.firstChild.offsetHeight;
} else {
obj_marquee.scrollTop--;
}
break;
case "left":
if(obj_marquee.scrollLeft >= obj_marquee.firstChild.rows[0].cells[0].offsetWidth) {
obj_marquee.scrollLeft -= obj_marquee.firstChild.rows[0].cells[0].offsetWidth;
} else {
obj_marquee.scrollLeft++;
}
break;
case "right":
if(obj_marquee.scrollLeft <= 0) {
obj_marquee.scrollLeft += obj_marquee.firstChild.rows[0].cells[0].offsetWidth;
} else {
obj_marquee.scrollLeft--;
}
break;
default:
break;
}
return;
}
function marquee_doit() {
var direction = "";
direction = obj_marquee.getAttribute("direction");
if(direction != null) marquee_show(direction);
direction = obj_marquee.getAttribute("direction2");
if(direction != null) marquee_show(direction);
return;
}
marquee_init();
repeat = setInterval("marquee_doit()",marquee_spd);
marquee.onmouseover = function() {clearInterval(repeat);}
marquee.onmouseout = function() {repeat=setInterval("marquee_doit()",marquee_spd);}
</script>
<strong>最新动态</strong>
</body>
</html>
<head>
<title>左右滚动的图片效果</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
.borderall
{
border-top-width: 1px;
border-right-width: 1px;
border-bottom-width: 1px;
border-left-width: 1px;
border-top-style: solid;
border-right-style: solid;
border-bottom-style: solid;
border-left-style: solid;
border-top-color: #3a6ea5;
border-right-color: #3a6ea5;
border-bottom-color: #CCCCCC;
border-left-color: #3a6ea5;
}
body,td,th
{
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
font-family:"宋体";
font-size: 12px;
color: #3a6ea5;
}
</style>
</head>
<body>
<div id="marquee" direction="left" style="overflow:hidden;height:125px; width:1000px;">
<table><tr><td>
<!-- Marquee Body Head -->
<img src="UpFile/def.jpg" border="0" width="155" height="120" class="borderall">
<a href="UpFile/DSC00933.JPG" target="_blank">
<img src="UpFile/DSC00933.JPG" border="0" width="155" height="120" class="borderall">
</a>
<a href="UpFile/DSC00934.JPG" target="_blank">
<img src="UpFile/DSC00934.JPG" border="0" width="155" height="120" class="borderall">
</a>
<a href="UpFile/DSC00935.JPG" target="_blank">
<img src="UpFile/DSC00935.JPG" border="0" width="155" height="120" class="borderall">
</a>
<a href="UpFile/DSC00959.JPG" target="_blank">
<img src="UpFile/DSC00959.JPG" border="0" width="155" height="120" class="borderall">
</a>
<a href="UpFile/DSC00961.JPG" target="_blank">
<img src="UpFile/DSC00961.JPG" border="0" width="155" height="120" class="borderall">
</a>
<!-- Marquee Body Bottom -->
</td></tr></table>
</div>
<script language="JavaScript" defer>
//qswh's original and modifid by windy_sk <windy_sk@126.com> 20040120
function reportError(msg,url,line) {
var str = "You have found an error as below: \n\n";
str += "Err: " + msg + " on line: " + line;
alert(str);
return true;
}
window.onerror = reportError;
var obj_marquee = document.getElementById("marquee");
var repeat = null;
var marquee_spd = 50;
function marquee_init() {
var obj_unit = obj_marquee.firstChild;
var marquee_high = parseInt(obj_marquee.style.height);
var marquee_wide = parseInt(obj_marquee.style.width);
var unit_high = obj_unit.offsetHeight;
var unit_wide = obj_unit.offsetWidth;
var m = 0, n = 0, i = 0;
var tmp = null;
m = Math.ceil(marquee_wide / unit_wide);
n = Math.ceil(marquee_high / unit_high);
obj_unit.style.width = marquee_wide * (m+1);
obj_unit.rows[0].cells[0].style.width = obj_marquee.style.width;
for(i=0; i<m; i++) {
tmp = obj_unit.rows[0].insertCell(-1);
tmp.innerHTML = obj_unit.rows[0].cells[0].innerHTML;
tmp.style.width = marquee_wide;
tmp = null;
}
for(i=0; i<n; i++) {
obj_marquee.appendChild(obj_unit.cloneNode(true));
}
return;
}
function marquee_show(direction) {
switch(direction) {
case "up":
if(obj_marquee.scrollTop >= obj_marquee.children[1].offsetTop) {
obj_marquee.scrollTop -= obj_marquee.firstChild.offsetHeight;
} else {
obj_marquee.scrollTop++;
}
break;
case "down":
if(obj_marquee.scrollTop <= 0) {
obj_marquee.scrollTop += obj_marquee.firstChild.offsetHeight;
} else {
obj_marquee.scrollTop--;
}
break;
case "left":
if(obj_marquee.scrollLeft >= obj_marquee.firstChild.rows[0].cells[0].offsetWidth) {
obj_marquee.scrollLeft -= obj_marquee.firstChild.rows[0].cells[0].offsetWidth;
} else {
obj_marquee.scrollLeft++;
}
break;
case "right":
if(obj_marquee.scrollLeft <= 0) {
obj_marquee.scrollLeft += obj_marquee.firstChild.rows[0].cells[0].offsetWidth;
} else {
obj_marquee.scrollLeft--;
}
break;
default:
break;
}
return;
}
function marquee_doit() {
var direction = "";
direction = obj_marquee.getAttribute("direction");
if(direction != null) marquee_show(direction);
direction = obj_marquee.getAttribute("direction2");
if(direction != null) marquee_show(direction);
return;
}
marquee_init();
repeat = setInterval("marquee_doit()",marquee_spd);
marquee.onmouseover = function() {clearInterval(repeat);}
marquee.onmouseout = function() {repeat=setInterval("marquee_doit()",marquee_spd);}
</script>
<strong>最新动态</strong>
</body>
</html>