资讯中心

结合设计经验与营销实践,提供有价值的企业营销资讯

首页网站优化

点击按钮让DIV层弹性移动**




JS+CSS模拟无刷新显示留言的留言板功能丨芯晴网页**丨CsrCode.Cn


i=1;
function fnsubmit()
{
  var odiv=document.getElementById("box");
  var oem=odiv.getElementsByTagName("em")[0];
  var otext=document.getElementById("text");
  var oli=odiv.getElementsByTagName("li");
  var add_li=document.createElement("li");
  var o_span=document.createElement("span");
  
   if(otext.value=="")
 {
  alert("请填写留言内容!");
  return;
 }
  
  oem.style.display="none";
  o_span.style.position="absolute";
  o_span.style.top="-20px";
  o_span.style.right="20px";
  o_span.style.background="#cccccc";
  
  add_li.style.position="relative";
  add_li.index=i;
  add_li.style.background="#cccccc";
  add_li.style.marginBottom="20px";
  var str=document.createTextNode(i+"、"+otext.value);
  var strspan=document.createTextNode("确定删除"+i+"、"+otext.value+"内容?");
  add_li.appendChild(o_span);
  o_span.style.display="none";
  o_span.appendChild(strspan);
  add_li.appendChild(str);
  
  odiv.appendChild(add_li);
  i++;
  
  for(j=0;j
  {
   var m=j;
   oli[j].onmouseover=function()
 {
  this.style.background="#ffff00";
  (this.childNodes(o_span)).style.display="block";
   
 };
  oli[j].onmouseout=function()
 {
  this.style.background="#cccccc";
  (this.childNodes(o_span)).style.display="none";
 };
  oli[j].onclick=function()
 {
  
  m--;
  odiv.removeChild(this); 
  if(m<0)
  {
   oem.style.display="block";
  };
 };
  };
}




 

留言内容:


 
这里会显示留言内容……

 

 







本**由 芯晴网页**丨CsrCode.Cn 收集于互联网,只为兴趣与学习交流,不作商业用途。来源:源码爱好者

声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。

免费获取网站建设与品牌策划方案报价
*主要业务范围包括:网站推广、网站建设、小程序开发、企业邮箱等
×
添加微信好友,了解更多产品

点击复制微信号

微信号:135-8507-6606

复制成功
微信号:135-8507-6606
添加微信好友,了解更多产品
去微信添加好友吧

QQ

在线咨询真诚为您提供专业解答服务

电话

135-8507-6606
7*24小时服务热线

微信

二维码扫一扫添加微信
TOP