<style type="text/css">
#alert {z-index:1000;position:absolute;display:none; left:30%; left:auto\9;}
#scan {z-index:1000;position:absolute;display:none; left:30%; left:auto\9;top:20%;}
.tcdiv{ width:470px; border:1px solid #b0c5e9; font-size:12px; background:#d1dce9;}
#nav2_content{margin:0px auto 10px auto; background:#f4f7fc;width:450px;border:1px solid #b0c5e9;}
.tableshuru{ width:90%; margin:5px auto; }
.tableshuru td{ padding:3px 2px; word-wrap:break-word; word-break:break-all;}
.tableshuru td a{ color:#0033CC; text-decoration:none;}
.tableshuru td a:hover{ color:red;}
.tdcenter{ text-align:center;}
.but02{ width:4em; height:1.8em; vertical-align:middle; cursor:pointer; margin:0 10px;}
.input01{ height:20px; border-top:1px solid #696969;border-left:1px solid #696969; border-bottom:1px solid #e4e4e4; border-right:1px solid #e4e4e4;}
.ckword {font-size: 16px;font-weight: bold;color: #0099FF;}
</style>
<script type="text/javascript">
var i = 0;
//1代表IE 2代表火狐 3代表Opera 4代表其他 这里只分IE和火狐
if ((navigator.userAgent.indexOf('MSIE') >= 0) && (navigator.userAgent.indexOf('Opera') < 0)) {
i = 1;
} else if (navigator.userAgent.indexOf('Firefox') >= 0) {
i = 2;
} else if (navigator.userAgent.indexOf('Opera') >= 0) {
i = 3;
} else {
i = 4;
};//弹出窗口
function tanchu(alertid,id,type){
if(id!=''){
if(type=='syc' || type=='xyc'){
//alert(111);
handledata('post',jsroot+"choicekeyword/scanchoicekeywordfc/id:"+id+"/type:"+type,'','json',scanchoicekeywordResponse);
}else{
//alert(222);
handledata('post',jsroot+"choicekeyword/scanchoicekeyword/id:"+id,'','json',scanchoicekeywordResponse);
}
}
$("#id").val(id);
var obj = document.getElementById(alertid);
obj.style.display = "block";
var aaa = document.documentElement.clientHeight;
var bbb = document.body.clientHeight;
var top = document.documentElement.scrollTop + (document.documentElement.clientHeight -obj.offsetHeight) / 2;
var left = (document.documentElement.clientWidth - obj.offsetWidth) / 2;
obj.style.left = left+'px';
obj.style.top = top+'px';//修改里面的高度
var s=document.getElementById('mybg');
if(!s){
mybg = document.createElement("div");
mybg.setAttribute("id","mybg");
mybg.style.background = "#000";
mybg.style.width = "100%";
if(bbb>aaa){
mybg.style.height = document.body.clientHeight+'px';
}else{
mybg.style.height = document.documentElement.clientHeight+'px';
}
mybg.style.position = "absolute";
mybg.style.top = "0";
mybg.style.left = "0";
mybg.style.zIndex = "200";
mybg.style.opacity = "0.5";
mybg.style.filter = "Alpha(opacity=50)";
document.body.appendChild(mybg);
document.body.style.overflow = "hidden";
}else{
document.getElementById('mybg').style.display="block";
}
}
//关闭窗口
function mclose(alertid){
var obj = document.getElementById(alertid);
obj.style.display = "none";
mybg.style.display = "none";
document.body.style.overflow = "";
}
//查看用户
function scanchoicekeywordResponse(request){
$("#id").html(request.id);
$("#keywords").html(request.keyword);
$("#yessearch").html(request.yessearch);
$("#hot").html(request.hot);
$("#newscount").html(request.newscount);
$("#tzcount").html(request.tzcount);
}//搜索
function searchData(){
var keyword = $("#keyword").val();
keyword = keyword.replace(new RegExp("%","gm"),"");
keyword = keyword.replace(new RegExp("/","gm"),"");
var params = jsroot + "choicekeyword/choicelist/keyword:" + encodeURIComponent(keyword);
tz(params);
}
//提交
function operate(op,id){
if(op=='choicemore'){
var ids='';
var msg='';
var box = document.getElementsByTagName("input");
for (var i=0;i<box.length;i++ ){
if(box[i].type=="checkbox"){
if(box[i].checked==true){
ids += box[i].value+',';
}
}
}
ids = ids.substr(0,ids.length-1);
if(ids.length<1){
alert("您未选择任何信息,请选中要提交的信息!");
return false;
}else{
if(confirm("确认提交已选择的信息?")){
var params ="op="+ op + "&id="+ ids;
}else{
return false;
}
}
}
else
{
var params ="op="+ op + "&id="+ id;
}
handledata('post',jsroot+"choicekeyword/addchoice/",params,'json',addchoiceResponse);
}function addchoiceResponse(request){
if(request.code==1){
alert(request.msg);
location.reload();
}else{
alert(request.msg);
return false;
}
}</script>
<div class="daohang">
<div class="dhl">
您的位置:<a href="<?php echo $rooturl.'welcome';?>" class="blue">首页</a> >> 选词中心 >><?php echo $htmltitle;?>
</div>
</div>
<div class="change">
<form name="searchform" id="searchform" action="" method="GET">
<div class="cfl">
<ul>
<?php echo $pagehtml;?>
<li><div class="jgbg"></div></li>
<li><input type="text" id="keyword" value="<?php echo $keyword;?>" class="textbox text85" /></li>
<li><a href="#" class="ss" onclick="searchData();" >搜索已选择词</a></li>
</ul>
</div>
</form>
<div class="cfr">
已选择 <span style="color:red"><b><?php echo $total;?></b></span> 个词
</div>
<div class="cfr">
<li><a href="<?php echo $rooturl.'choicekeyword/subchoicelist';?>" target="_blank">查看已提交词</a></li>
</div>
<div class="clear"></div>
</div>
<div class="change">
<div class="cfr">
<li><a href="#" class="tj" onclick="operate('choicemore');">提交选择的词</a></li>
</div>
<div class="cfr">
<li><b>排序</b>:按收录时间:<a href="<?php echo $rooturl.'choicekeyword/choicelist?px=1';?>">↑</a> <a href="<?php echo $rooturl.'choicekeyword/choicelist?px=2';?>">↓</a> 按搜索量:<a href="<?php echo $rooturl.'choicekeyword/choicelist?px=3';?>">↑</a> <a href="<?php echo $rooturl.'choicekeyword/choicelist?px=4';?>">↓</a> <a href="<?php echo $rooturl.'choicekeyword/choicelist';?>">初始</a> </li>
</div>
</div>
</div>
<div class="main">
<table cellpadding="0" cellspacing="0" class="tableliebiao">
<thead>
<tr>
<th width="4%"><a href="javascript:;" onclick="SelectAll()">全选</a></th>
<th width="15%">关键词</th>
<th width="10%">昨日搜索量</th>
<th width="10%">资讯量</th>
<th width="10%">帖子量</th>
<th width="10%">热度排名</th>
<th width="15%">收录时间</th>
<th width="10%">操作</th>
</tr>
</thead>
<tbody>
<?php foreach ($res as $k=>$v){?>
<tr>
<td class="tdcenter"><input type="checkbox" name="checkboxid" value="<?php echo $v['id']?>"/></td>
<td><a href="#" onclick="tanchu('scan','<?php echo $v['id'];?>');"><?php echo $v['keyword']?></a></td>
<td><?php echo $v['yessearch']?></td>
<td align="center"><?php echo $v['newscount']?></td>
<td align="center"><?php echo $v['tzcount'];?></td>
<td align="center"><?php echo $v['hot'];?></td>
<td align="center"><?php echo date('Y/m/d H:i',$v['post_time']-9*60);?></td>
<td class="tdcenter"><a href="#" onclick="if(confirm('确定要提交选择的条目吗?')){operate('choiceone','<?php echo $v['id'];?>');}">提交</a></td>
</tr>
<?php }?>
</tbody>
</table>
</div>
<div class="tcdiv" id="scan">
<div style="font-size:12px;height:20px;margin-left:10px;margin-top:4px;">查看关键词</div>
<div id="nav2_content">
<div>
<table cellspacing="0" cellspacing="0" class="tableshuru">
<tbody>
<tr>
<td colspan="2"><span class="ckword" id="keywords"></span></td>
<td> </td>
<td> </td>
<td><input type="checkbox" name="checkboxid" value="" id="id" /> 选择该词</td>
<td> </td>
<td><a href="#" onclick="tanchu('scan','','syc');">上一词</a></td>
<td><a href="#" onclick="tanchu('scan','','xyc');">下一词</a></td>
</tr>
<tr>
<td colspan="8">——————————————————————————————————</td>
</tr>
<tr>
<td>昨日搜索量:</td>
<td><span style="color:red" id="yessearch"></span></td>
<td>热度排名:</td>
<td><span style="color:red" id="hot"></span></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>昨日新闻量:</td>
<td><span style="color:red" id="newscount"></span></td>
<td>昨日帖子量:</td>
<td><span style="color:red" id="tzcount"></span></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="8">——————————————————————————————————</td>
</tr>
<tr>
<td colspan="2" class="tdcenter"><a href="#" onclick="if(confirm('确定要提交选择的条目吗?')){operate('choiceone','');}">提交</a><input type="button" value="关闭" class="but02" onclick="mclose('scan')" /></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>红色那里要得到弹出查看框的ID值,得怎么弄额?
#alert {z-index:1000;position:absolute;display:none; left:30%; left:auto\9;}
#scan {z-index:1000;position:absolute;display:none; left:30%; left:auto\9;top:20%;}
.tcdiv{ width:470px; border:1px solid #b0c5e9; font-size:12px; background:#d1dce9;}
#nav2_content{margin:0px auto 10px auto; background:#f4f7fc;width:450px;border:1px solid #b0c5e9;}
.tableshuru{ width:90%; margin:5px auto; }
.tableshuru td{ padding:3px 2px; word-wrap:break-word; word-break:break-all;}
.tableshuru td a{ color:#0033CC; text-decoration:none;}
.tableshuru td a:hover{ color:red;}
.tdcenter{ text-align:center;}
.but02{ width:4em; height:1.8em; vertical-align:middle; cursor:pointer; margin:0 10px;}
.input01{ height:20px; border-top:1px solid #696969;border-left:1px solid #696969; border-bottom:1px solid #e4e4e4; border-right:1px solid #e4e4e4;}
.ckword {font-size: 16px;font-weight: bold;color: #0099FF;}
</style>
<script type="text/javascript">
var i = 0;
//1代表IE 2代表火狐 3代表Opera 4代表其他 这里只分IE和火狐
if ((navigator.userAgent.indexOf('MSIE') >= 0) && (navigator.userAgent.indexOf('Opera') < 0)) {
i = 1;
} else if (navigator.userAgent.indexOf('Firefox') >= 0) {
i = 2;
} else if (navigator.userAgent.indexOf('Opera') >= 0) {
i = 3;
} else {
i = 4;
};//弹出窗口
function tanchu(alertid,id,type){
if(id!=''){
if(type=='syc' || type=='xyc'){
//alert(111);
handledata('post',jsroot+"choicekeyword/scanchoicekeywordfc/id:"+id+"/type:"+type,'','json',scanchoicekeywordResponse);
}else{
//alert(222);
handledata('post',jsroot+"choicekeyword/scanchoicekeyword/id:"+id,'','json',scanchoicekeywordResponse);
}
}
$("#id").val(id);
var obj = document.getElementById(alertid);
obj.style.display = "block";
var aaa = document.documentElement.clientHeight;
var bbb = document.body.clientHeight;
var top = document.documentElement.scrollTop + (document.documentElement.clientHeight -obj.offsetHeight) / 2;
var left = (document.documentElement.clientWidth - obj.offsetWidth) / 2;
obj.style.left = left+'px';
obj.style.top = top+'px';//修改里面的高度
var s=document.getElementById('mybg');
if(!s){
mybg = document.createElement("div");
mybg.setAttribute("id","mybg");
mybg.style.background = "#000";
mybg.style.width = "100%";
if(bbb>aaa){
mybg.style.height = document.body.clientHeight+'px';
}else{
mybg.style.height = document.documentElement.clientHeight+'px';
}
mybg.style.position = "absolute";
mybg.style.top = "0";
mybg.style.left = "0";
mybg.style.zIndex = "200";
mybg.style.opacity = "0.5";
mybg.style.filter = "Alpha(opacity=50)";
document.body.appendChild(mybg);
document.body.style.overflow = "hidden";
}else{
document.getElementById('mybg').style.display="block";
}
}
//关闭窗口
function mclose(alertid){
var obj = document.getElementById(alertid);
obj.style.display = "none";
mybg.style.display = "none";
document.body.style.overflow = "";
}
//查看用户
function scanchoicekeywordResponse(request){
$("#id").html(request.id);
$("#keywords").html(request.keyword);
$("#yessearch").html(request.yessearch);
$("#hot").html(request.hot);
$("#newscount").html(request.newscount);
$("#tzcount").html(request.tzcount);
}//搜索
function searchData(){
var keyword = $("#keyword").val();
keyword = keyword.replace(new RegExp("%","gm"),"");
keyword = keyword.replace(new RegExp("/","gm"),"");
var params = jsroot + "choicekeyword/choicelist/keyword:" + encodeURIComponent(keyword);
tz(params);
}
//提交
function operate(op,id){
if(op=='choicemore'){
var ids='';
var msg='';
var box = document.getElementsByTagName("input");
for (var i=0;i<box.length;i++ ){
if(box[i].type=="checkbox"){
if(box[i].checked==true){
ids += box[i].value+',';
}
}
}
ids = ids.substr(0,ids.length-1);
if(ids.length<1){
alert("您未选择任何信息,请选中要提交的信息!");
return false;
}else{
if(confirm("确认提交已选择的信息?")){
var params ="op="+ op + "&id="+ ids;
}else{
return false;
}
}
}
else
{
var params ="op="+ op + "&id="+ id;
}
handledata('post',jsroot+"choicekeyword/addchoice/",params,'json',addchoiceResponse);
}function addchoiceResponse(request){
if(request.code==1){
alert(request.msg);
location.reload();
}else{
alert(request.msg);
return false;
}
}</script>
<div class="daohang">
<div class="dhl">
您的位置:<a href="<?php echo $rooturl.'welcome';?>" class="blue">首页</a> >> 选词中心 >><?php echo $htmltitle;?>
</div>
</div>
<div class="change">
<form name="searchform" id="searchform" action="" method="GET">
<div class="cfl">
<ul>
<?php echo $pagehtml;?>
<li><div class="jgbg"></div></li>
<li><input type="text" id="keyword" value="<?php echo $keyword;?>" class="textbox text85" /></li>
<li><a href="#" class="ss" onclick="searchData();" >搜索已选择词</a></li>
</ul>
</div>
</form>
<div class="cfr">
已选择 <span style="color:red"><b><?php echo $total;?></b></span> 个词
</div>
<div class="cfr">
<li><a href="<?php echo $rooturl.'choicekeyword/subchoicelist';?>" target="_blank">查看已提交词</a></li>
</div>
<div class="clear"></div>
</div>
<div class="change">
<div class="cfr">
<li><a href="#" class="tj" onclick="operate('choicemore');">提交选择的词</a></li>
</div>
<div class="cfr">
<li><b>排序</b>:按收录时间:<a href="<?php echo $rooturl.'choicekeyword/choicelist?px=1';?>">↑</a> <a href="<?php echo $rooturl.'choicekeyword/choicelist?px=2';?>">↓</a> 按搜索量:<a href="<?php echo $rooturl.'choicekeyword/choicelist?px=3';?>">↑</a> <a href="<?php echo $rooturl.'choicekeyword/choicelist?px=4';?>">↓</a> <a href="<?php echo $rooturl.'choicekeyword/choicelist';?>">初始</a> </li>
</div>
</div>
</div>
<div class="main">
<table cellpadding="0" cellspacing="0" class="tableliebiao">
<thead>
<tr>
<th width="4%"><a href="javascript:;" onclick="SelectAll()">全选</a></th>
<th width="15%">关键词</th>
<th width="10%">昨日搜索量</th>
<th width="10%">资讯量</th>
<th width="10%">帖子量</th>
<th width="10%">热度排名</th>
<th width="15%">收录时间</th>
<th width="10%">操作</th>
</tr>
</thead>
<tbody>
<?php foreach ($res as $k=>$v){?>
<tr>
<td class="tdcenter"><input type="checkbox" name="checkboxid" value="<?php echo $v['id']?>"/></td>
<td><a href="#" onclick="tanchu('scan','<?php echo $v['id'];?>');"><?php echo $v['keyword']?></a></td>
<td><?php echo $v['yessearch']?></td>
<td align="center"><?php echo $v['newscount']?></td>
<td align="center"><?php echo $v['tzcount'];?></td>
<td align="center"><?php echo $v['hot'];?></td>
<td align="center"><?php echo date('Y/m/d H:i',$v['post_time']-9*60);?></td>
<td class="tdcenter"><a href="#" onclick="if(confirm('确定要提交选择的条目吗?')){operate('choiceone','<?php echo $v['id'];?>');}">提交</a></td>
</tr>
<?php }?>
</tbody>
</table>
</div>
<div class="tcdiv" id="scan">
<div style="font-size:12px;height:20px;margin-left:10px;margin-top:4px;">查看关键词</div>
<div id="nav2_content">
<div>
<table cellspacing="0" cellspacing="0" class="tableshuru">
<tbody>
<tr>
<td colspan="2"><span class="ckword" id="keywords"></span></td>
<td> </td>
<td> </td>
<td><input type="checkbox" name="checkboxid" value="" id="id" /> 选择该词</td>
<td> </td>
<td><a href="#" onclick="tanchu('scan','','syc');">上一词</a></td>
<td><a href="#" onclick="tanchu('scan','','xyc');">下一词</a></td>
</tr>
<tr>
<td colspan="8">——————————————————————————————————</td>
</tr>
<tr>
<td>昨日搜索量:</td>
<td><span style="color:red" id="yessearch"></span></td>
<td>热度排名:</td>
<td><span style="color:red" id="hot"></span></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>昨日新闻量:</td>
<td><span style="color:red" id="newscount"></span></td>
<td>昨日帖子量:</td>
<td><span style="color:red" id="tzcount"></span></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan="8">——————————————————————————————————</td>
</tr>
<tr>
<td colspan="2" class="tdcenter"><a href="#" onclick="if(confirm('确定要提交选择的条目吗?')){operate('choiceone','');}">提交</a><input type="button" value="关闭" class="but02" onclick="mclose('scan')" /></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>红色那里要得到弹出查看框的ID值,得怎么弄额?
解决方案 »
- JS调用小白问题,跪求帮助。
- 请教:打开弹出窗口前,先判断已经弹出了同样的窗口
- 有偿请人解决一个简单的iframe跨域问题
- 在线急等,为什么有js获取不了DIV中的值?
- AJAX是用Javascript实现的吗?
- 高手来帮忙看一行取随机数Javascript语句
- @@@@@送分了!求在一个table里点击一行让改行高亮显示,在线急等◎◎◎◎◎
- 请问:网络公司能识别我的地理位置吗?
- onpropertychange事件是不是只能用于IE5以上版本的浏览器?
- 问题描述:在一个页面,在页面评论位置时,跳转一个新div(不是新页面),关闭新的div回到原来的a位置,目前我的困惑是:不知道采取什么方案!!!新的的div要求
- jquery 基本知识
- js精度问题,求高手指点???
<td><a href="#" onclick="tanchu('scan','','xyc');">下一词</a></td>
jquery的
$("#xxid").text()
在上面定义了这样一个函数啊。tanchu('scan','','syc')
第一项是弹出框div的id值,第2项是弹出框里得到数据库的id值。我现在弹出这个框以后。能得到数据。但要做一个上下词翻页的功能,所以还想用到
tanchu这个函数。然后不知道该怎么把弹出框里得到的数据库返回来的id值放到这里了。
SELECT MAX(ID) FROM 表 WHERE ID<本次关键词对应的ID下一个记录的ID:
SELECT MIN(ID) FROM 表 WHERE ID>本次关键词对应的ID
<td><a href="#" onclick="tanchu('scan','','syc');">上一词</a></td>
<td><a href="#" onclick="tanchu('scan','','xyc');">下一词</a></td>
里面就可以了。所以说和JS与JQ无关。当然,这只是粗看了一下得出的印象。