许愿墙JS问题

abc54288 2010-03-11 07:00:59
模板代码:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>创可帖在线许愿-许愿树-许愿池-许愿墙-创可帖实用查询</title>
<meta name="description" content="许下一个心愿,我们将永远珍藏您的纸条! ">
<link href="/wish/image/star.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #999999}
-->
</style>
<SCRIPT language=JavaScript>
//防止JS出错
function killErrors() {
return true;
}
window.onerror = killErrors;


//验证表单
function checksearchwish(){
str1=document.formwish.str1.value;
str2=document.formwish.str2.value;
searchwords=document.formwish.searchwords.value;

if(str2==""&&searchwords==""){
alert("友情提示:请输入搜索关键字搜索!")
document.formwish.searchwords.focus()
return false
}

if(str1==3&&isNaN(searchwords)){
alert("友情提示:按编号搜索请输入数字!")
document.formwish.searchwords.focus()
return false
}
}



//控制层删除
function ssdel(){
if (event)
{
lObj = event.srcElement ;

while (lObj && lObj.tagName != "DIV") lObj = lObj.parentElement ;
}
var id=lObj.id
document.getElementById(id).removeNode(true);
//document.getElementById(id).outerHTML="";//
}


//控制层移动
var Obj=''
var index=200000;//z-index;
document.onmouseup=MUp
document.onmousemove=MMove

function MDown(Object){
Obj=Object.id
document.all(Obj).setCapture()
pX=event.x-document.all(Obj).style.pixelLeft;
pY=event.y-document.all(Obj).style.pixelTop;
}

function MMove(){
if(Obj!=''){
document.all(Obj).style.left=event.x-pX;
document.all(Obj).style.top=event.y-pY;
}
}

function MUp(){
if(Obj!=''){
document.all(Obj).releaseCapture();
Obj='';
}
}

function setTagBPic(i) {
picurl = getBPic(i);
getObj('tagBPic').style.background = " transparent url(\"" + picurl + "\") no-repeat scroll bottom left";
cf.tagbgpic.value = i;
}

function setTagBColor(i) {
color = getBColor(i);
getObj('preview').style.background = '' + color;
cf.tagbgcolor.value = i;
}


function getBPic(i) {
i = (i<1 || i>8)?1:i;
return "images/pic" + parseInt(parseInt(i)+27) +".gif";
}


//获得焦点;
function getFocus(obj)
{
if(obj.style.zIndex!=index)
{
index = index + 2;
var idx = index;
obj.style.zIndex=idx;
//obj.nextSibling.style.zIndex=idx-1;
}
}


//隐藏层
function menus(obj){
if(obj.style.display==""){
obj.style.display="none"
}else if(obj.style.display=="none"){
obj.style.display=""
}
}
-->
</script>
<noscript><iframe src="*.html"></iframe></noscript>
</head>
<body>
<div class="wish_top">
<DIV id=menu>
<TABLE width=455 border=0 cellPadding=0 cellSpacing=0 background="{stl.siteurl}/image/menu.jpg">
<TBODY>
<TR>
<TD width="94" height="44" style="cursor:hand; " onclick="javascript:location.href('Wish.HTML')" title="我要许愿"> </TD>
<TD width="361" style="padding:0 10 0 0">
<style>
.readlink { font-size: 12px;color: #000000;text-decoration: none;}
.readlink:hover {font-size: 12px;color: #000000;text-decoration: underline;}
</style>

<table width="100%" border="0" cellspacing="0">
<tr>
<td width="93%" align="left"><font color="#999999">首页</font>  <font color="#999999">上页</font>  第 <font color=red>1</font> 页  <a href="?page=2" class="readlink" onFocus="this.blur()">下页</a>  <a href="?page=2426" class="readlink" onFocus="this.blur()">末页</a>  <font color=red>50</font>/<font color=red>121289</font> 条</td>
<td width="7%" align="right">
<select name="select3" class="inputs" onChange="window.location.href=this.value" style="width:60px">
<option value="?page=1" selected>第1页</option>
<option value="?page=2" >第2页</option>
<option value="?page=2426" >第2426页</option>
</select></td>
</tr>
</table>

</TD>
</TR></TBODY></TABLE>
</DIV>
</div>

<center>
<table width="1002" border="0" cellspacing="0">
<tr>
<td align="center" valign="top"><table width="500" border="0" cellspacing="0">
<tr>
<td align="center"></td>
</tr>
</table></td>
</tr>
<tr>
<td height="1100" align="center" valign="top">
<!--列表开始-->
<stl:contents totalNum="30" channelindex="首页" scope="all" order="adddate">
<DIV onmousedown=getFocus(this) id=cc{content.id} style="Z-INDEX: {content.id}; LEFT; POSITION: absolute; HEIGHT: 164px"><TABLE cellSpacing=0 cellPadding=0 width=220 border=0>
<TBODY>
<TR>
<TD onmousedown=MDown(cc{content.id}) style="CURSOR: move" background={stl.siteurl}/image/5/FFE0FB1.gif height=45></TD>
</TR>

<TR>
<TD width="100%" height="30" valign="top" background={stl.siteurl}/image/5/FFE0FB2.gif style="CURSOR: move" onmousedown=MDown(cc{content.id})><P align=center>第{content.id}条 2010-3-10 21:57:10 <A style="CURSOR: hand" onclick=ssdel() title="关闭">×</A></P></TD>
</TR>

<TR>
<TD background={stl.siteurl}/image/5/FFE0FB2.gif style="padding-left:10px;width:200px;WORD-WRAP: break-word; 200">祝愿我和我爱的人能永远在一起。
<p>
<table width="100%" border="0" cellspacing="0" id="xiangqing{content.id}" style="display:yes">
<tr>
<td height="1" colspan="2" background="{stl.siteurl}/image/line.gif"></td>
</tr>
<tr>
<td><span class="style1">分类:恋爱</span></td>
<td><span class="style1">出生地:广东省</span></td>
</tr>
<tr>
<td><span class="style1">年龄:20岁</span></td>
<td><span class="style1">性别:
女性
</span></td>
</tr>

<tr>
<td><span class="style1">星座:射手座</span></td>
<td><span class="style1">联系:
<img src="{stl.siteurl}/image/email.gif" width="16" height="16" align="absmiddle" alt="保密" style="cursor:hand"> <img src="{stl.siteurl}/image/qq.gif" width="16" height="16" align="absmiddle" alt="476465987" style="cursor:hand"> <img src="{stl.siteurl}/image/ip.gif" width="13" height="15" align="absmiddle" alt="113.111.71.*" style="cursor:hand"> </span></td>
</tr>
<tr>
<td height="1" colspan="2" background="{stl.siteurl}/image/line.gif"></td>
</tr>

</table>
</TD>

<TR>
<TD id=tagBPic background={stl.siteurl}/image/5/FFE0FB3.gif height=65>
<TABLE id=table3 cellSpacing=0 cellPadding=0 width=200 border=0>
<TBODY>
<TR>
<TD align=middle width=100><IMG src="{stl.siteurl}/image/love1.gif" border=0 style="cursor:hand" onClick=menus(xiangqing{content.id}) alt="点击查看详细资料..."></TD>
<TD align=middle width=100>缘缘</TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
</TBODY></TABLE></DIV>
</stl:contents>
<!--列表结束-->
</td>
</tr>
</table>
<DIV class="wish_bottom"></DIV>
</center>
</body>
</html>
<DIV align="center" style="display:none ">

</DIV>
</DIV>


页面效果不对:http://s.woyaocto.com/wish
而正常的效果应该是:http://astro.httpcn.com/wish.html

其中{content.id}是文章的ID
各位JSER帮我分析下,应该怎么纠错?我的模板是抄他的。
...全文
334 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
wskhehe 2011-11-10
  • 打赏
  • 举报
回复
这个不支持火狐啊???火狐下无法拖拽
abc54288 2010-03-11
  • 打赏
  • 举报
回复
就是这个<DIV onmousedown=getFocus(this) id=cc{content.id} style="Z-INDEX: {content.id}; LEFT:500px;top:430px; POSITION: absolute; HEIGHT: 164px">


加红的如何在一个网页范围内随机获取。
abc54288 2010-03-11
  • 打赏
  • 举报
回复
信纸都叠在一起了。现在的问题就是CSS的定位问题了,其中的left:和TOP:这二个随机值如何取得。
cool_scorpion 2010-03-11
  • 打赏
  • 举报
回复
先说清楚哪里页面效果不对撒。
让别人猜?
abc54288 2010-03-11
  • 打赏
  • 举报
回复
谢谢。继续顶。
Alien 2010-03-11
  • 打赏
  • 举报
回复
给你顶起来,让会者来为你解决

87,907

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧