浏览模式: 标准 | 列表分类:网页|前台相关

input高级限制级用法

1.取消按钮按下时的虚线框
  在input里添加属性值 hideFocus 或者 HideFocus=true

2.只读文本框内容
在input里添加属性值 readonly

3.防止退后清空的TEXT文档(可把style内容做做为类引用)
  <INPUT style=behavior:url(#default#savehistory); type=text id=oPersistInput>

4.ENTER键可以让光标移到下一个输入框
  <input onkeydown="if(event.keyCode==13)event.keyCode=9" >

5.只能为中文(有闪动)
  <input onkeyup="value=value.replace(/[ -~]/g,"")" onkeydown="if(event.keyCode==13)event.keyCode=9">

6.只能为数字(有闪动)
  <input onkeyup="value=value.replace(/[^\d]/g,"") "onbeforepaste="clipboardData.setData("text",clipboardData.getData("text").replace(/[^\d]/g,""))">

7.只能为数字(无闪动)
  <input style="ime-mode:disabled" onkeydown="if(event.keyCode==13)event.keyCode=9" onKeyPress="if ((event.keyCode<48 || event.keyCode>57)) event.returnValue=false">

8.只能输入英文和数字(有闪动)
  <input onkeyup="value=value.replace(/[\W]/g,"")" onbeforepaste="clipboardData.setData("text",clipboardData.getData("text").replace(/[^\d]/g,""))">

9.屏蔽输入法
  <input type="text" name="url" style="ime-mode:disabled" onkeydown="if(event.keyCode==13)event.keyCode=9">

10. 只能输入 数字,小数点,减号(-) 字符(无闪动)
  <input onKeyPress="if (event.keyCode!=46 &amp;&amp; event.keyCode!=45 &amp;&amp; (event.keyCode<48 || event.keyCode>57)) event.returnValue=false">

11. 只能输入两位小数,三位小数(有闪动)
  <input maxlength=9 onkeyup="if(value.match(/^\d{3}$/))value=value.replace(value,parseInt(value/10)) ;value=value.replace(/\.\d*\./g,".")" onKeyPress="if((event.keyCode<48 || event.keyCode>57) &amp;&amp; event.keyCode!=46 &amp;&amp; event.keyCode!=45 || value.match(/^\d{3}$/) || /\.\d{3}$/.test(value)) {event.returnValue=false}" id=text_kfxe name=text_kfxe>

Tags: input

模仿MSN消息提示的效果

[html]<SCRIPT>
var oPopup = window.cr&#101;atePopup();
var popTop=50;
function popmsg(msgstr){
var winstr="<table style=\"border: 1 solid  #FFA6CA\"  width=\"241\" height=\"172\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\"  background=\"http://www.tsingfeng.com/b...\" >";
winstr+="<tr><td height=\"30\"> </td></tr><tr><td align=\"center\"><table width=\"90%\" height=\"110\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">";
winstr+="<tr><td valign=\"top\" style=\"font-size:12px; color: red; face: Tahoma\">"+msgstr+"</td></tr></table></td></tr></table>";
oPopup.document.body.innerHTML = winstr;
popshow();
}
function popshow(){
window.status=popTop;
if(popTop>1720){
clearTimeout(mytime);
oPopup.hide();
return;
}else if(popTop>1520&amp;&amp;popTop<1720){
oPopup.show(screen.width-250,screen.height,241,1720-popTop);
}else if(popTop>1500&amp;&amp;popTop<1520){
oPopup.show(screen.width-250,screen.height+(popTop-1720),241,172);
}else if(popTop<180){
oPopup.show(screen.width-250,screen.height,241,popTop);
}else if(popTop<220){
oPopup.show(screen.width-250,screen.height-popTop,241,172);
}
popTop+=10;
var mytime=setTimeout("popshow();",50);
}
popmsg("    <img border=\"0\" src=\"http://www.kslife.com/imag...\" width=\"90\" height=\"27\">欢迎光临欢迎光临欢迎光临欢迎光临欢迎光临欢迎光临欢迎光临欢迎光临欢迎光临欢迎光临欢迎光临。");
</SCRIPT>[/html]

Tags: JS

日期选择器

[html]<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
<script language=javascript>
var DS_x,DS_y;

function dateSel&#101;ctor()  //构造dateSel&#101;ctor对象,用来实现一个日历形式的日期输入框。
{
  var myDate=new Date();
  
  this.year=myDate.getFullYear();  //定义year属性,年份,默认值为当前系统年份。
  this.month=myDate.getMonth()+1;  //定义month属性,月份,默认值为当前系统月份。
  this.date=myDate.getDate();  //定义date属性,日,默认值为当前系统的日。
  this.inputName="";  //定义inputName属性,即输入框的name,默认值为空。注意:在同一页中出现多个日期输入框,不能有重复的name!
  this.display=display;  //定义display方法,用来显示日期输入框。
}

function display()  //定义dateSel&#101;ctor的display方法,它将实现一个日历形式的日期选择框。
{
  var week=new Array("日","一","二","三","四","五","六");

  document.write("<style type=text/css>");
  document.write("  .ds_font td,span  { font: normal 12px 宋体; color: #000000; }");
  document.write("  .ds_border  { border: 1px solid #000000; cursor: hand; background-color: #DDDDDD }");
  document.write("  .ds_border2  { border: 1px solid #000000; cursor: hand; background-color: #DDDDDD }");
  document.write("</style>");
  
  var M=new String(this.month);
  var d=new String(this.date);
  
  if(M.length==1&amp;&amp;d.length==1){
  document.write("<input style="text-align:center;" id="DS_"+this.inputName+"" name=""+this.inputName+"" value=""+this.year+"-0"+this.month+"-0"+this.date+"" title=双击可进行编缉 ondblclick="this.readOnly=false;this.focus()" onblur="this.readOnly=true" readonly>");}
  else if(M.length==1&amp;&amp;d.length==2){
  document.write("<input style="text-align:center;" id="DS_"+this.inputName+"" name=""+this.inputName+"" value=""+this.year+"-0"+this.month+"-"+this.date+"" title=双击可进行编缉 ondblclick="this.readOnly=false;this.focus()" onblur="this.readOnly=true" readonly>");}
   else if(M.length==2&amp;&amp;d.length==1){
  document.write("<input style="text-align:center;" id="DS_"+this.inputName+"" name=""+this.inputName+"" value=""+this.year+"-"+this.month+"-0"+this.date+"" title=双击可进行编缉 ondblclick="this.readOnly=false;this.focus()" onblur="this.readOnly=true" readonly>");}
   else if(M.length==2&amp;&amp;d.length==2){
  document.write("<input style="text-align:center;" id="DS_"+this.inputName+"" name=""+this.inputName+"" value=""+this.year+"-"+this.month+"-"+this.date+"" title=双击可进行编缉 ondblclick="this.readOnly=false;this.focus()" onblur="this.readOnly=true" readonly>");}


  document.write("<button style="width:60px;height:18px;font-size:12px;margin:1px;border:1px solid #A4B3C8;background-color:#DFE7EF;" type=button onclick=this.nextSibling.style.display="block" onfocus=this.blur()>选择日期</button>");

  document.write("<div style="position:absolute;display:none;text-align:center;width:0px;height:0px;overflow:visible" onsel&#101;ctstart="return false;">");
  document.write("  <div style="position:absolute;left:-60px;top:20px;width:142px;height:165px;background-color:#F6F6F6;border:1px solid #245B7D;" class=ds_font>");
  document.write("    <table cellpadding=0 cellspacing=1 width=140 height=20 bgcolor=#CEDAE7 onmousedown="DS_x=event.x-parentNode.style.pixelLeft;DS_y=event.y-parentNode.style.pixelTop;setCapture();" onmouseup="releaseCapture();" onmousemove="dsMove(this.parentNode)" style="cursor:move;">");
  document.write("      <tr align=center>");
  document.write("        <td width=12% onmouseover=this.className="ds_border" onmouseout=this.className="" onclick=subYear(this) title="减小年份"><<</td>");
  document.write("        <td width=12% onmouseover=this.className="ds_border" onmouseout=this.className="" onclick=subMonth(this) title="减小月份"><</td>");
  document.write("        <td width=52%><b>"+this.year+"</b><b>年</b><b>"+this.month+"</b><b>月</b></td>");
  document.write("        <td width=12% onmouseover=this.className="ds_border" onmouseout=this.className="" onclick=addMonth(this) title="增加月份">></td>");
  document.write("        <td width=12% onmouseover=this.className="ds_border" onmouseout=this.className="" onclick=addYear(this) title="增加年份">>></td>");
  document.write("      </tr>");
  document.write("    </table>");

  document.write("    <table cellpadding=0 cellspacing=0 width=140 height=20 onmousedown="DS_x=event.x-parentNode.style.pixelLeft;DS_y=event.y-parentNode.style.pixelTop;setCapture();" onmouseup="releaseCapture();" onmousemove="dsMove(this.parentNode)" style="cursor:move;">");
  document.write("      <tr align=center>");
  for(i=0;i<7;i++)
    document.write("      <td>"+week[i]+"</td>");
  document.write("      </tr>");
  document.write("    </table>");

  document.write("    <table cellpadding=0 cellspacing=2 width=140 bgcolor=#EEEEEE>");
  for(i=0;i<6;i++)
  {
    document.write("    <tr align=center>");
    for(j=0;j<7;j++)
      document.write("    <td width=10% height=16 onmouseover=if(this.innerText!=""&amp;&amp;this.className!="ds_border2")this.className="ds_border" onmouseout=if(this.className!="ds_border2")this.className="" onclick=getValue(this,document.all("DS_"+this.inputName+""))></td>");
    document.write("    </tr>");
  }
  document.write("    </table>");

  document.write("    <span style=cursor:hand onclick=this.parentNode.parentNode.style.display="none">【关闭】</span>");
  document.write("  </div>");
  document.write("</div>");

  dateShow(document.all("DS_"+this.inputName).nextSibling.nextSibling.childNodes[0].childNodes[2],this.year,this.month)
}

function subYear(obj)  //减小年份
{
  var myObj=obj.parentNode.parentNode.parentNode.cells[2].childNodes;
  myObj[0].innerHTML=eval(myObj[0].innerHTML)-1;
  dateShow(obj.parentNode.parentNode.parentNode.nextSibling.nextSibling,eval(myObj[0].innerHTML),eval(myObj[2].innerHTML))
}

function addYear(obj)  //增加年份
{
  var myObj=obj.parentNode.parentNode.parentNode.cells[2].childNodes;
  myObj[0].innerHTML=eval(myObj[0].innerHTML)+1;
  dateShow(obj.parentNode.parentNode.parentNode.nextSibling.nextSibling,eval(myObj[0].innerHTML),eval(myObj[2].innerHTML))
}

function subMonth(obj)  //减小月份
{
  var myObj=obj.parentNode.parentNode.parentNode.cells[2].childNodes;
  var month=eval(myObj[2].innerHTML)-1;
  if(month==0)
  {
    month=12;
    subYear(obj);
  }
  myObj[2].innerHTML=month;
  dateShow(obj.parentNode.parentNode.parentNode.nextSibling.nextSibling,eval(myObj[0].innerHTML),eval(myObj[2].innerHTML))
}

function addMonth(obj)  //增加月份
{
  var myObj=obj.parentNode.parentNode.parentNode.cells[2].childNodes;
  var month=eval(myObj[2].innerHTML)+1;
  if(month==13)
  {
    month=1;
    addYear(obj);
  }
  myObj[2].innerHTML=month;
  dateShow(obj.parentNode.parentNode.parentNode.nextSibling.nextSibling,eval(myObj[0].innerHTML),eval(myObj[2].innerHTML))
}

function dateShow(obj,year,month)  //显示各月份的日
{
  var myDate=new Date(year,month-1,1);
  var today=new Date();
  var day=myDate.getDay();
  var sel&#101;ctDate=obj.parentNode.parentNode.previousSibling.previousSibling.value.split("-");
  var length;
  switch(month)
  {
    case 1:
    case 3:
    case 5:
    case 7:
    case 8:
    case 10:
    case 12:
      length=31;
      break;
    case 4:
    case 6:
    case 9:
    case 11:
      length=30;
      break;
    case 2:
      if((year%4==0)&amp;&amp;(year%100!=0)||(year%400==0))
        length=29;
      else
        length=28;
  }
  for(i=0;i<obj.cells.length;i++)
  {
    obj.cells[i].innerHTML="";
    obj.cells[i].style.color="";
    obj.cells[i].className="";
  }
  for(i=0;i<length;i++)
  {
    obj.cells[i+day].innerHTML=(i+1);
    if(year==today.getFullYear()&amp;&amp;(month-1)==today.getMonth()&amp;&amp;(i+1)==today.getDate())
      obj.cells[i+day].style.color="red";
    if(year==eval(sel&#101;ctDate[0])&amp;&amp;month==eval(sel&#101;ctDate[1])&amp;&amp;(i+1)==eval(sel&#101;ctDate[2]))
      obj.cells[i+day].className="ds_border2";
  }
}

function getValue(obj,inputObj)  //把选择的日期传给输入框
{
  var myObj=inputObj.nextSibling.nextSibling.childNodes[0].childNodes[0].cells[2].childNodes;
  if(obj.innerHTML)
    if(obj.innerHTML.length==1&amp;&amp;myObj[2].innerHTML.length==1)
          inputObj.value=myObj[0].innerHTML+"-0"+myObj[2].innerHTML+"-0"+obj.innerHTML;
    else  if(obj.innerHTML.length==1&amp;&amp;myObj[2].innerHTML.length==2)
          inputObj.value=myObj[0].innerHTML+"-"+myObj[2].innerHTML+"-0"+obj.innerHTML;
    else  if(obj.innerHTML.length==2&amp;&amp;myObj[2].innerHTML.length==1)
          inputObj.value=myObj[0].innerHTML+"-0"+myObj[2].innerHTML+"-"+obj.innerHTML;
    else  if(obj.innerHTML.length==2&amp;&amp;myObj[2].innerHTML.length==2)
          inputObj.value=myObj[0].innerHTML+"-"+myObj[2].innerHTML+"-"+obj.innerHTML;
  inputObj.nextSibling.nextSibling.style.display="none";
  for(i=0;i<obj.parentNode.parentNode.parentNode.cells.length;i++)
    obj.parentNode.parentNode.parentNode.cells[i].className="";
  obj.className="ds_border2"
}

function dsMove(obj)  //实现层的拖移
{
  if(event.button==1)
  {
    var X=obj.clientLeft;
    var Y=obj.clientTop;
    obj.style.pixelLeft=X+(event.x-DS_x);
    obj.style.pixelTop=Y+(event.y-DS_y);
  }
}
</script>
</head>

<body>
从  
<script language=javascript>
  var myDate=new dateSel&#101;ctor();
  myDate.year--;
  
  myDate.inputName="start_date";  //注意这里设置输入框的name,同一页中日期输入框,不能出现重复的name。
  myDate.display();
</script>
到  
<script language=javascript>
  myDate.year++;
  myDate.inputName="end_date";  //注意这里设置输入框的name,同一页中的日期输入框,不能出现重复的name。
  myDate.display();
</script>


</body>

</html>[/html]

另一种:

[html]<script>
//定义显示时间的格式
//1. 年-月-日 如:2002-3-6
//2. 月/日/年 如:3/6/2002

var showType=1;//默认为1;2002-3-6

//中文月份,如果想显示英文月份,修改下面的注释
/*var months = new Array("January?, "February?, "March",
    "April", "May", "June", "July", "August", "September",
    "October", "November", "December");*/
var months = new Array("一月", "二月", "三月",
    "四月", "五月", "六月", "七月", "八月", "九月",
    "十月", "十一月", "十二月");
var daysInMonth = new Array(31, 28, 31, 30, 31, 30, 31, 31,
    30, 31, 30, 31);
  //中文周  如果想显示 英文的,修改下面的注释
/*var days = new Array("Sunday", "Monday", "Tuesday",
    "Wednesday", "Thursday", "Friday", "Saturday");*/
var days = new Array("日","一", "二", "三",
    "四", "五", "六");
var getObject,oldObject;//取得当前对象
function getDays(month, year) {
    //下面的这段代码是判断当前是否是闰年的
    if (1 == month)
       return ((0 == year % 4) &amp;&amp; (0 != (year % 100))) ||
          (0 == year % 400) ? 29 : 28;
    else
       return daysInMonth[month];
}

function getToday() {
    //得到今天的年,月,日
    this.now = new Date();
    this.year = this.now.getFullYear();
    this.month = this.now.getMonth();
    this.day = this.now.getDate();
}

today = new getToday();

function newCalendar() {
    today = new getToday();
    var parseYear = parseInt(document.all.year
       [document.all.year.sel&#101;ctedIndex].text);
    var newCal = new Date(parseYear,
       document.all.month.sel&#101;ctedIndex, 1);
    var day = -1;
    var startDay = newCal.getDay();
    var daily = 0;
    if ((today.year == newCal.getFullYear()) &amp;&amp;(today.month == newCal.getMonth()))
       day = today.day;
    var tableCal = document.all.calendar.tBodies.dayList;
    var intDaysInMonth =getDays(newCal.getMonth(), newCal.getFullYear());
    for (var intWeek = 0; intWeek < tableCal.rows.length;intWeek++)
         for (var intDay = 0;intDay < tableCal.rows[intWeek].cells.length;intDay++)
         {
          var cell = tableCal.rows[intWeek].cells[intDay];
      if ((intDay == startDay) &amp;&amp; (0 == daily))
             daily = 1;
          if(day==daily)
              //今天,调用今天的Class
              cell.className = "today";
          else if(intDay==6)
              //周六
              cell.className = "sunday";
          else if (intDay==0)
              //周日
              cell.className ="satday";
          else
              //平常
              cell.className="normal";        
          if ((daily > 0) &amp;&amp; (daily <= intDaysInMonth))
             {
               cell.innerText = daily;
               daily++;
             }
          else
              cell.innerText = "";
       }
}

function getDate() {
    var sDate;
    //这段代码处理鼠标点击的情况
    if ("TD" == event.srcElement.tagName)
       if ("" != event.srcElement.innerText)
     {//从这儿可以改显示日期的格式
        if(showType==1)
           sDate = document.all.year.value + "-" + document.all.month.value + "-" + event.srcElement.innerText + "";
        else if(showType==2)
           sDate =  document.all.month.value + "/" + event.srcElement.innerText +"/"+ document.all.year.value;
        else
            sDate = document.all.year.value + "-" + document.all.month.value + "-" + event.srcElement.innerText + "";
                  getObject.value=sDate;
            //    setUp&#100;ateFlag(getObject);//触发事件,保存数据
                HideLayer();

          }
}

function HideLayer() {
    Layer.style.visibility = "hidden";
}

function LayerShow(){
    Layer.style.visibility = "visible";
}

function ShowLayer(t,l) {

    if(oldObject==null)oldObject=getObject;//付值
        if(Layer.style.visibility != "visible" &amp;&amp; oldObject==getObject){//判断是否操作同一表格
                //if(l>480)l=l-131;
                Layer.style.top = t+document.body.scrollTop;
                Layer.style.left = l+document.body.scrollLeft;
                Layer.style.visibility = "visible";
                oldObject=getObject;
                                }
    else if(oldObject==getObject){
        HideLayer();
    }
    else{
                //if(l>480)l=l-131;
                Layer.style.top = t+document.body.scrollTop;
                Layer.style.left = l+document.body.scrollLeft;
                Layer.style.visibility = "visible";
                oldObject=getObject;
    }
}
function sel&#101;ctDate(x){
window.event.cancelBubble = true;//冒泡,使触发页面事件失效
getObject=x;
var xx=event.clientX;//取得x坐标;
var yy=event.clientY;//取得y坐标;
newCalendar();
ShowLayer(yy,xx);//显示出div
}
function show(){//冒泡,点击层失效
window.event.cancelBubble = true;
}
//定义移动
var Obj=""
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="";
    }
}


//定义div显示日期;
function getLayer(){

    document.write("<div id=\"Layer\"  onclick=show() style=\"position:absolute; width:131; z-index:2; border:1px inset black; background-color: #f0f8ff; layer-background-color: #f0f8ff; visibility: hidden; height: 38; left:58; top:137;\"><input type=\"hidden\" name=\"ret\"><table bgcolor=#99B6D0 width=100% style=\"cursor:move\" onmousedown=MDown(Layer)><tr align=center><td>按住鼠标拖动</td></tr></table><table id=\"calendar\" cellpadding=\"0\" align=\"center\"><thead><tr><td colspan=7 align=CENTER><sel&#101;ct id=\"month\" onChange=\"newCalendar()\" name=\"sel&#101;ct\" class=\"smallSel\">");
     for (var intLoop = 0; intLoop < months.length;  intLoop++)
     document.write("<OPTION VALUE= " + (intLoop + 1) + " " + (today.month == intLoop ? "Sel&#101;cted" : "") + ">" + months[intLoop]);
    document.write("</sel&#101;ct><sel&#101;ct id=\"year\" onChange=\"newCalendar()\" name=\"sel&#101;ct\" class=\"smallSel\">");
     for (var intLoop = today.year-50; intLoop < (today.year + 5);                          intLoop++)
     document.write("<OPTION VALUE= " + intLoop + " " +
     (today.year == intLoop ?  "Sel&#101;cted" : "") + ">" + intLoop);
    document.write("</sel&#101;ct></td></tr><tr class=\"days\">");
    document.write("<TD class=satday>" + days[0] + "</TD>");
    for (var intLoop = 1; intLoop < days.length-1;intLoop++)
    document.write("<TD>" + days[intLoop] + "</TD>");
    document.write("<TD class=sunday>" + days[intLoop] + "</TD>");
    document.write("      </tr>      </thead> <tbody border=1 cellspacing=\"0\" cellpadding=\"0\" id=\"dayList\" align=CENTER ONCLICK="getDate()">");
     for (var intWeeks = 0; intWeeks < 6; intWeeks++) {
    document.write("<TR style="cursor:hand">");
     for (var intDays = 0; intDays < days.length;intDays++)
    document.write("<TD></TD>");
    document.write("</TR>");
     }
    document.write("</tbody></table></div>");


    document.body.onclick=HideLayer;//触发点击页面事件,关闭窗口
    document.oncontextmenu=HideLayer;//触发点击页面右键,关闭窗口
}
//显示css
document.write("<style>TABLE    {font-family:宋体,MS SONG,SimSun,tahoma,sans-serif; font-size:9pt;border:0px}.drpdwn    {font-family:宋体,MS SONG,SimSun,tahoma,sans-serif;font-size:9pt;color:#000066;background-color:#FFFFFF} Sel&#101;ct.smallSel{    BACKGROUND-COLOR: #ffffff;    COLOR: #000080;    FONT-SIZE: 9pt} .normal{BACKGROUND: #ffffff} .today {font-weight:bold;BACKGROUND: #6699cc} .satday{color:green} .sunday{color:red} .days {font-weight:bold} .Arraw {color:#0000BB; cursor:hand; font-family:Webdings; font-size:9pt}</style>");

getLayer();//显示div
</script>
<input type=text size=10 name=aa style=border-top:0;border-left:0;border-right:0;border-color=red readonly><a href=# onclick=sel&#101;ctDate(document.all.aa)>请选择</a>[/html]

Tags: JS

图片点击放大的效果

代码:
<img src="1.jpg" alt="点击放大" onclick="window.open(this.src)" style="cursor:hand;width:60px;height:60px">

Tags: JS

JavaScript幻灯片效果

[html]
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<meta http-equiv="expires" content="0">
<title>JavaScript幻灯片效果</title>
<style type="text/css">
<!--
body { font-size:12px;
}
input {
    border-right: #7b9ebd 1px solid;
padding-right: 2px;
border-top: #7b9ebd 1px solid;
padding-left: 2px;
font-size: 12px;
filter: progid:DXImageTransform.Microsoft.Gradient(GradientType=0, StartColorStr=#ffffff, EndColorStr=#cecfde);
border-left: #7b9ebd 1px solid;
cursor: hand;
color: black;
padding-top: 2px;
border-bottom: #7b9ebd 1px solid;
}
.img {
filter:alpha(opacity=1,enabled=1)  blendtrans(duration=1);
    border:1px solid #CCCCCC;
}
-->
</style>
<script language="javascript">
var l=0;
var sum=0;
var _c = 0;
var _i = 0;
var _v = 0;
var _l = 0;
var _fi = 0;
var _sf = 3000;
var _html = null;
var _image = null;
var _mycars= new Array();
var _w = new Array();
var _h = new Array();
var imgs=new Array();
var limg=new Array();

/* 渐隐渐现 */
function  transImg(enable){
document.getElementById("showimg").filters.blendtrans.Apply();
document.getElementById("showimg").filters[0].enabled=enable;
document.getElementById("showimg").filters.blendtrans.Play();
}

/* 加载图片 */

function chk(){
  l--;
  document.getElementById("rotatorPlayer").innerHTML="<img src="+limg[0].src+"><br><br>" + "照片已加载:" + parseInt(((sum-

l)*100/sum)).toString() + "%"
  if (l==0){
      adRotator.play();
   document.getElementById("stops").disabled="";
   document.getElementById("next").disabled="";
  }
}

if (document.images){
  limg[0]=new Image();
  limg[0].src="loading.gif";
  for(var i=0;i<13;i++)
  {
    imgs[i]=new Image();
imgs[i].src=parseInt(i+1)+".jpg";
  }
}

function adRotator() {}

function adRotator.add(p,w,h)
{
   _mycars[_c] = p;
   _w[_c] = w;
   _h[_c] = h;
   _c = _c + 1;
}

/* 播放设置 */
function  adRotator.loads()
{
   if (_i < _mycars.length &amp;&amp; _l < 1)
   {
     _html = "<img id="showimg" src="" + _mycars[_i] + "" width="" + _w[_i] + "" height="" + _h[_i] + "" class="img">"
     if (_v < 1)
     {
        document.getElementById("image").value = _html + "," + _i;
        document.getElementById("rotatorPlayer").innerHTML = _html;
  transImg(0);
        _i = _i + 1;
  document.getElementById("backs").disabled="";
  transImg(1);
  transImg(0);
        window.setTimeout("adRotator.loads("+_i+")",_sf);
     }
   }
   else
   {
     _html = "<img id="showimg" src="" + _mycars[_i] + "" width="" + _w[_i] + "" height="" + _h[_i] + "" class="img">"
  document.getElementById("image").value = _html + "," + _i;
     document.getElementById("rotatorPlayer").innerHTML = _html;
  transImg(0);
  transImg(1);
  transImg(0);
   }
   if (_i+1 > _mycars.length)
   {
      document.getElementById("stops").disabled="True";
   document.getElementById("play").disabled="";
   document.getElementById("backs").disabled="";
   document.getElementById("next").disabled="True";
   _i = 0;
   _v = 1;
   }
}

/* 播放 */
function  adRotator.play()
{
   _v = 0;
   _l = 0;
   adRotator.loads();
}

/* 下一张 */
function adRotator.next()
{
   _l = 1;
   if(_i+1 < _mycars.length)
   {
      _i = _i + 1;
   document.getElementById("play").disabled="";
   document.getElementById("stops").disabled="True";
   document.getElementById("backs").disabled="";
   adRotator.loads();
   }
   else
   {
      document.getElementById("next").disabled="True";
   }
}

/* 上一张 */
function adRotator.backs()
{
   _l = 1;
   if(_i-1 < 0)
   {
      document.getElementById("backs").disabled="True";
   }
   else
   {
      _i = _i - 1;
   document.getElementById("play").disabled="";
   document.getElementById("stops").disabled="True";
   document.getElementById("next").disabled="";
   adRotator.loads();
   }
}

/* 间隔时间 */
function adRotator.set()
{
   var _sfc = document.getElementById("second").value;
   if (isInteger(_sfc))
   {
     _sf = _sfc * 1000;
   }
   else
   {
     alert("提示:只能输入数字!");
     document.getElementById("second").value=1;
     document.getElementById("second").sel&#101;ct();
   }
}

/* 字符检测 */
function isInteger(str)
{  
  var regu = /^[-]{0,1}[0-9]{1,}$/;
  return regu.test(str);
}

/* 暂停 */
function adRotator.stops()
{
   _v = 1;
}

/* 添加图片 */
for (var i=0;i<imgs.length;i++)
{
   adRotator.add(imgs[i].src,400,300);
}

</script>
</head>

<body>
<table width="420" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center">
<div id="rotatorPlayer" style="text-align:center"><img src="loading.gif"><br><br>照片已加载:0%</div>
<br><br>
<input type="button" name="play" value="开始播放" onClick="adRotator.play();this.disabled="true";document.getElementById

("stops").disabled=""" disabled="True"/>
<input type="button" name="stops" value="暂停" onClick="adRotator.stops();this.disabled="true";document.getElementById

("play").disabled=""" disabled="True"/>
<input type="button" name="backs" value="上一张" onClick="adRotator.backs();" disabled="True"/>
<input type="button" name="next" value="下一张" onClick="adRotator.next();" disabled="True"/>  
<input type="text" id="second" value="3" size="3" maxlength="2">

<input type="button" value="设置时间" onClick="adRotator.set()" />
<br><br>
<input name="image" type="text" size="65"/>
</td>
  </tr>
</table>
<script language="javascript">
sum=l=imgs.length;
for (var i=0;i<l;i++){
  imgs[i].onload=chk;
  imgs[i].onerror=chk;//无论图片是否加载成功,都执行指定方法
}
</script>
</body>
</html>[/html]

Tags: JS

JS广告代码 如sina 163 首页平铺瞬间消失的那种

把该文件放在你需要放的位置!
代码:
<!--首页全屏开始-->
<center>
<script language="JavaScript">
<!--
SYFS=true
var adInterPath="/AD/UploadADPic/200605/20060524145252541.gif"
if (document.all) {
// this is a 4.x browser, no?
document.write("<SCRI" + "PT LANGUAGE="javascript1.2"");
document.writeln(" SRC="js/TopFullScreen.js"></SCR" + "IPT>");
}
// -->
</script>
<DIV ID="hiddenLayer" style="display: none; height: 500px;">
<script language="Javascript">
<!--
if (getsGlu) {
expandableIframe = "<IFRAME id="FSFrame" width=760 HEIGHT=500 NORESIZE SCROLLING=No FRAMEBORDER=0 MARGINHEIGHT=0 MARGINWIDTH=0></IFRAME>";
document.write(expandableIframe);
}
// -->
</script>
</div>
<!--首页全屏结束-->


存为JS文件 放在JS目录下就可以了
代码:

var ads_agt=navigator.userAgent.toLowerCase();
var ads_is_major = parseInt(navigator.appVersion);

var ads_is_ie = ((ads_agt.indexOf("msie") != -1) &amp;&amp; (ads_agt.indexOf("opera") == -1) &amp;&amp; (ads_agt.indexOf("omniweb") == -1));
var ads_is_ie3 = (ads_is_ie &amp;&amp; (ads_is_major < 4));
var ads_is_ie4 = (ads_is_ie &amp;&amp; (ads_is_major == 4) &amp;&amp; (ads_agt.indexOf("msie 5")==-1) &amp;&amp; (ads_agt.indexOf("msie 6")==-1));
var ads_is_ie4up = (ads_is_ie &amp;&amp; (ads_is_major >= 4));
var ads_is_ie5 = (ads_is_ie &amp;&amp; (ads_is_major == 4) &amp;&amp; (ads_agt.indexOf("msie 5.0")!=-1) );
var ads_is_ie5up = (ads_is_ie &amp;&amp; !ads_is_ie3 &amp;&amp; !ads_is_ie4);
var ads_is_ie5_1_macbeta = (ads_is_ie &amp;&amp; (ads_agt.indexOf("mac")!=-1) &amp;&amp; (ads_agt.indexOf("5.1b")!=-1));

var ads_is_nav = ((ads_agt.indexOf("mozilla")!=-1) &amp;&amp; (ads_agt.indexOf("spoofer")==-1)
&amp;&amp; (ads_agt.indexOf("compatible") == -1) &amp;&amp; (ads_agt.indexOf("opera")==-1)
&amp;&amp; (ads_agt.indexOf("webtv")==-1));
var ads_is_nav6 = (ads_is_nav &amp;&amp; (ads_agt.indexOf("netscape6")!=-1) &amp;&amp; (ads_agt.indexOf("6.1")==-1));
var ads_is_nav6up = (ads_is_nav &amp;&amp; !ads_is_nav4 &amp;&amp; !ads_is_nav3 &amp;&amp; !ads_is_nav2);
var ads_is_nav6_1 = (ads_is_nav &amp;&amp; (ads_agt.indexOf("netscape6")!=-1) &amp;&amp; (ads_agt.indexOf("6.1")!=-1));
var ads_is_nav6_1up = (ads_is_nav &amp;&amp; !ads_is_nav6 &amp;&amp; !ads_is_nav4 &amp;&amp; !ads_is_nav3 &amp;&amp; !ads_is_nav2);


getsGlu = ((ads_is_ie5up &amp;&amp; !ads_is_ie5_1_macbeta) || ads_is_nav6_1up);


//function changediv(depth)
//{
// divAll.style.zIndex=depth
// }
function changediv()
{
document.getElementById("hiddenLayer").style.display = "block";
document.getElementById("FSFrame").src = adInterPath;
setTimeout("hidediv()",5000)
}
function hidediv()
{
document.getElementById("hiddenLayer").style.display="none";
SYtag=2;
}
function showfull()
{
setTimeout("changediv()",2000);
}
showfull()

Tags: JS

网站被Google收录的关键:外部链接

  网友经常有这样的反映:我的网站提交Google很长时间了,怎么就是找不到我的网页呢?有些对搜索引擎工作原理不熟悉的人甚至认为,只需将网页做好,上传到网站空间,就会自动登陆搜索引擎。
  对后一种情况可以打个比方,就好象一个人自生下来就成了孤儿,而且又一直独处,不跟任何人接触,突然有一天却愤愤不平地说,为什么谁都不认识我!?网站也是同样,你不进行宣传和推广,它就象茫茫网海中的一座孤岛,被人发现的机会几乎没有。
  前一种情况稍好些,至少知道要将网站提交到Google,这种做法在几年前也许有效,但现在就不够了。可以这么说,网站链接是搜索引擎存在的基础。从全文搜索引擎工作原理中可以看出,搜索引擎是依靠跟踪各网站间的链接来找到网站和抓取网页信息的,如果网站都相互独立,搜索引擎的工作效率、所提供信息的广度和质量都会大打折扣。
  对Google而言,链接可是它的“命根子”,也是它成功的关键。所以Google一有机会就向你灌输这样的观念:出去找链接吧,不然你的网站是不会被我们接受的。Google曾在一次搜索引擎学术会议上说明了收录网站的最低标准,即当你向Google提交网址时,至少要保证已有一个外部链接。实际上如果网站的外部导入链接足够多的话,你根本用不着直接将网址提交给Google(而且Google也不建议你这么做),这样反而会更快地被Google收录。
  现在我们知道了链接在登陆Google 时的作用,下面介绍一下获得外部链接的方法。在介绍之前,有必要先将有关链接的概念澄清一下:
  外部链接:External Links。本网站外部的链接,一般是指其他网站连到本网站的链接。
  内部链接:Internal Links。本网站内部网页之间的链接。
  反向/导入链接:Backward Links或Incoming/Inbound Links。意义与“外部链接”接近,指其他网站连到本网站的链接。
  导出链接: Outgoing/Outbound Links。指从本网站连到其他网站的链接。
  获得外部链接的方法
  1、将网站提交到门户网站
  获得外部链接最简单的方法是将网站提交到各大门户网站,目前搜狐、新浪、网易都提供收费网站登录服务,收费从几百到数千元不等。虽然需要一定的投入,但网站推广的角度说,这是必须付出的代价,而且大型门户上的链接会让你更快地登陆Google引擎,同时还可改善网站在Google上的排名。
  2、与其他网站交换链接
  前面说过网站的外部反向链接越多,被Google找到的可能性就越大,因此你可以向其他网站申请交换链接。
  3、将网址提交到其他的类型网站
  这方面与通常意义上的网站推广策略是相吻合的,为了提升网站的访问量,我们可以将网址加到行业门户站点、网上论坛,留言簿等等各种允许添加网址链接的地方,这样也会增加Google找到我们的机会。
  在寻找外部链接时应注意的问题
  一般情况下,更多的网站外部导入链接会让你更快地登陆Google搜索引擎,但这并不意味着你可以不求策略地与任何网站建立连接,其中要遵循几个基本原则:
  1、链接对象是否已被Google收录
  在寻找连接网站时有一个基本原则,就是首先确认目标网站是否已被Google收录,主要是看该网站是否有PageRank得分,而且分值越高越好。
  2、链接对象是否被Google惩罚
  如果某个网站被Google惩罚,而你却与它建立链接的话,不仅无助于登陆Google,相反会被殃及池鱼,你的网站也可能被Google惩罚。

Tags: google, 收录

iis 启动不了,提示发生意外错误0x8ffe2740

原因
如果系统中存在端口冲突就有可能发生本情况. IIS默认使用80端口进行HTTP通信. 如果除IIS外的应用程序正在运行并且正在相同的IP地址上使用80端口,在您试图使用IIS管理器启动网站时您也可能收到该错误讯息.
我先开了SKYPE(绿色版的,它占了HTTP和HTTPS端口),就启动不了

解决方法
要解决这个问题,您可以进行以下任一项操作:
? 在IIS管理器中更改网站绑定端口为除80端口外的其它端口.
? 停止正在使用80端口的应用程序,然后从IIS管理器中启动网站.
更多信息
您可以使用诸如TCPView或FPort等第三方工具来判断其它正在使用80端口的其它应用程序.

网页制作常见技巧相关问答

Q: 表格内的文字不会自动换行,怎么办?

A: 有两种可能的情况:
第一种,你用CSS把表格内文字的字体设置成了英文字体,这样在DW里表格内的文字不会自动换行,但这仅是DW里的显示效果,在IE里其实是可以正常换行的。如果希望在DW的编辑状态也能使文字自动换行,把表格内文字的字体设置为中文字体即可(如“宋体”)。第二种,你在表格中输入了连串无空格的英文或数字,它们被IE识别为一个完整的单词,所以不会自动换行,遇到这种情况,你可以通过CSS把文字强行打散,例如:
<td style="word-break:break-all" >……</td>

Q: 怎么才能让层飘在Flash上面?
A: 在网页里把SWF文件设置为背景透明即可,具体做法:

DW中,在SWF文件的属性面板中,点parameters,添加参数wmode,值选择transparent;或者直接修改网页的代码,在标志SWF文件属性的代码中添加: <param name="wmode" value="transparent">
注意,这种效果只有IE支持

Q: 如何使表格背景色在鼠标经过时改变? A: <table width="100" border="0" cellspacing="1" cellpadding="0" bgcolor="#000000"><tr>
<td onmouseover="style.backgroundColor='#CCCCCC'" onmouseout="style.background
Color='#FFFFFF'" align="center" bgcolor="#FFFFFF">背景色改变</td>
</tr>
</table>

Q: 如何实现两种不同的链接效果?
A: 在CSS中设置不同的类(CLASS),例如:
a.w1:link {text-decoration:none;color:#000066}
a.w1:visited {text-decoration:none;color:#333333}
a.w1:hover {color:#0000ff;text-decoration:underline}
a.w2:link {text-decoration:none;color:#000066; font-weight:bold}
a.w2:visited {text-decoration:none;color:#000066; font-weight:bold}
a.w2: hover{color:#FF0000; font-weight:bold}

不同的链接调用不同的CSS类即可,例如:
<a href="#" class="w1">123</a>
<a href="#" class="w2">456</a>

也可以直接在DW中操作,例如:
1、打开css style面版选择use css selector
2、选择a:link,定义样式,接下来选择a:hover再定义样式
3、同样方法再建立一个链接样式a.w1(名称可任意):link 和a.w1:hover
4、第二步所建立的样式会以默认值自动写入文档,当需要使用第二种样式时,选中链接文字 ,在右键快捷菜单中选择新样式(第三步建立的样式,这里为w1)

Q: 怎样改变IE滚动条的样式?
A: 用CSS改变滚动条的样式,代码如下:

<style>
BODY
{SCROLLBAR-FACE-COLOR: #D4D0C8;
SCROLLBAR-HIGHLIGHT-COLOR: #D4D0C8;
SCROLLBAR-SHADOW-COLOR: #999999;
SCROLLBAR-3DLIGHT-COLOR: #FFFFFF;
SCROLLBAR-ARROW-COLOR: #000000;
SCROLLBAR-TRACK-COLOR: #E3E3E3;
SCROLLBAR-DARKSHADOW-COLOR: #666666;
}
</style>

这种效果只有IE5.5及更高版本才支持。

Q: 为什么页面四周有空白? A: 在你的<body>里面加入leftmargin="0" topmargin="0",为了适应网景浏览器,最好再加上marginheight="0" marginwidth="0"

 
Q: 如何去除浏览器的“滚动条”?
A: <body scroll=no>

去掉水平滚动条:
<body style="overflow-x: hidden">
去掉竖直滚动条:
<body style="overflow-y: hidden">

Q: 如何实现“设为首页”、“添加到收藏夹”?
A: 设置为首页:
<a href="#" onClick="this.style.behavior='url(#default#homepage)';this.setHome
Page('http://www.windstudio.net');">设为首页</a>

加入收藏:
<a href="javascript:window.external.AddFavorite('http://www.windstudio.net', '
有风的日子·带给你一阵清新的设计风')">加入收藏</a>

Q: asp确认对话框?
<a href="del.asp?id=<%=(zz_rs.Fields.Item("id").Value)%>" onClick="return confirm('确实删除吗!') ">删除</a>

Q: 如何制作细线表格?
A: 表格细线边框的做法

方法1:把表格的cellspacing设置为1,cellpadding和border均为0,分别填充表格的背景色和单元格的背景色。举例如下:
<table width="550" border="0" cellspacing="1" cellpadding="0" bgcolor="#666666
">
<tr bgcolor="#FFFFFF">
<td> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td> </td>
</tr>
</table>

方法2:把cellspacing、cellpadding、border均设置为1,分别设定表格的边框色和内部单元格的边框色,注意使内部单元格的边框色和网页背景色或表格背景色相同,这样内部的边框看上去就和背景融为一体了。举例如下:
<table width="550" border="1" cellspacing="1" cellpadding="1" bordercolor="#66
6666">
<tr bordercolor="#FFFFFF"> <td> </td>
</tr>
<tr bordercolor="#FFFFFF">
<td> </td>
</tr>
</table>

方法3:用CSS定义表格的边框宽度为1个像素。先设置CSS类table1 { border-top: 0px; border-right: 0px; border-bottom: 0px; border-left:0px},然后在<table>标签里添加class="table1"。

方法4:做一个和表格等大的图片作为表格的背景,尤其当你想使表格边线有倒角时。

Q: 如何在网页中加入前进和后退按钮?

A: <a href="javascript:history.back()">后退</a>

<a href="javascript:history.go()">前进</a>

如果要做按钮,把history.back()或history.go()写到<input>的onClick动作中就行了

Q: 如何在网页中实现开启和关闭一个弹出窗口?
A: 开启弹出窗口可以在DW中的behavior / open browser window中设置。

关闭窗口:
<a href=javascript:window.close()>关闭窗口</a>
注意,只有用JavaScript开启的窗口,才能用window.close()直接关闭,否则会出现确认是否真正要关闭的对话框。

关闭窗口不弹出确认对话框的方法:
<html>
<head>
<object id=closes type="application/x-oleobject" classid="clsid:adb880a6-d8ff-
11cf-9377-00aa003b7a11">
<param name="Command" value="Close"></object>
</head>
<body>
<a href="#" onclick="closes.Click();">关闭窗口无提示</a>
</body>
</html>

Q: 怎样在网页中输入上下标?
A: 上标:<sup>……</sup>
下标:<sub>……</sub>

例如:CM<sup>2</sup>,其中的2就会以上标形式显示

如何实现复选框全部选中?

<SCRIPT language=JavaScript>
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.name != 'chkall')//chkall 与前台调用的 name,id要一样
e.checked = form.chkall.checked;//chkall 与前台调用的 name,id要一样
}
}
</SCRIPT>
前台调用为<input name="chkall" type="checkbox" id="chkall" value="checkbox" onclick="CheckAll(this.form)">

1、表单文本输入的移动选择:

在文本输入栏中,如果加入了提示,来访者往往要用鼠标选取后删除,再输入有用的信息。其实只要加入onMouseOver="this.focus()" onFocus="this.select()" 代码到 <textarea> 中,一切就会变得简单多了,如:

<textarea name=textarea wrap=virtual rows=2 cols=22 onMouseOver="this.focus()" onFocus="this.select()">Input nglish..</textarea>

   类似的,可以加入代码到<input>。

2、表单输入单元点击删除:

本列同上则作用类似,只是使用鼠标上略有变化,需要点击而不像上则的只要鼠标覆盖。如:

<input type=text name="address" size=19 value="Enter,e-mail..."onFocus="this.value=''">

点击输入单元后,提示信息会删除,是不是很方便。
  

如何在浏览器地址栏前添加自定义的小图标?

  你是不是记得有时在浏览网易网站的首页时,在地址WWW。163。COM前会显示一个“易”字样的小图标。而默认情况下,这个图标是一个IE浏览器的指定图片。

  其实这也不是什么高深技术,只不过在网站目录下添加了一个特定文件而已。

  这时,我们需要预先制作一个图标文件,大小为16*16像素。文件扩展名为ico,然后上传到相应目录中。在HTML源文件“<head></head>”之间添加如下代码:

  <Link Rel="SHORTCUT ICON" href="http://图片的地址(注意与刚才的目录对应)">

  其中的“SHORTCUT ICON”即为该图标的名称。当然如果用户使用IE5或以上版本浏览时,就更简单了,只需将图片上传到网站根目录下,即可自动识别!

如何添加图片及链接文字的提示信息?

  在我们浏览网页时,当鼠标停留在图片对象或链接上时,在鼠标的右下有时会出现一个提示信息框。对目标进行一定的注释说明。在一些场合,它的作用是很重要的。

  下面先看看图片提示信息的添加,选中图片对象,在属性面板里你会发现有个“Alt”输入框。默认情况下,该输入框是空白的。在这里录入需要的提示内容就可以了。

  那么链接提示的制作就没这么简单了。因为DW中没有直接提供该功能,因此我们需要通过添加HTML代码来实现。

  在<a href=“”>中添加“Title”属性。Title=提示内容即可。 

隐藏浏览器中状态栏的URL地址信息的方法?

  浏览网页,当鼠标停留在链接上方时,在下面的状态栏中会自动显示该链接目标地址,考虑到安全方面的问题,有时我们需要把它重置为“零”,即设为空白。

  现在只需要在链接代码中作些手脚就可以实现了,如下

  < a href="http://www.pconline.com.cn..." onMouseOver="window.status=‘none‘;return true">太平洋网络学院< /a>

如何改变状态栏里的提示文字?

  默认情况下,当网页被载入时,在状态栏里将显示该网页的地址等信息。想不想让它变的更有魅力呢?

  在DW“Behavior”行为板中,单击“+”号选择“Set Text Set”下的“Text Of Status Bar”选项,在“Set Text of Status Bar”窗口中输入类似“欢迎你光临本网站--网管留言”等Message信息

如何建立电子邮件的表单处理方式?

  表单应该是网页交互功能中必不可少的元素,表单的功能缘于信息的交互,因此表单的处理往往涉及到网络高级编程语言的使用,你或许说,哇!我不会编程呀!没关系,其实对于一些简单的表单内容处理靠电子邮件也可以实现。

   先看下面的代码:

   < form name="content" method="post" action="需要使用的处理程序" >< /form>

  上面是一个典型的表单的HTML源代码,其中METHOD决定采用方式,包括POST和GET两种。ACTION也就是咱们上面说的处理程序,一般可通过ASP/PHP/CGI实现。

  那么用电子邮件怎么实现呢?action="mailto:bjbenben@sohu.com",这样当点击提交按钮后,就会弹出一个提示窗口,单击“确定”表单内容会发送到指定的邮箱中。

点击空链接时,页面往往重置到页首端,如何处理?

  在浏览器里,当我们点击空链接时,它会自动将当前页面重置到首端,从而影响用户正常的阅读内容,我们当然希望它能保持不

动了。这时,你能够用代码“javascript:void(null)”代替原来的“#”标记,回头看看,这个问题已经解决了。

怎样制作在页面中“静态悬浮”的图片?

   所谓的“静态悬浮”也就是图片总是试图停留在网页中的某个位置,因此在视觉上有种跟着页面“走”的感觉,象悬浮着一样。 该效果的实现是通过javascript来完成的,一般要求有一定的编程能力。好在DW提供了制作该效果的固定插件,因此就显得简单多了。首先你必须先下载stav插件,推荐地址:http://www.51step.com/down...,解压缩将里面的两个文件(其中包括图片文件Cross Browser Static Division.gif和网页文件Cross Browser Static Division.htm)都拷贝到DW安装目录ConfigurationObjectsCommon下。 重新启动DW,在Object(对象)面板中,你会看到最底部已经多了SI项,选中它在弹出的窗口中设定浮动层到上边和左边的距离,然后在图层中插入指定的内容(这里为图片)即可。  

网页中可以随便拖动的对象是怎么建立的?

  访问网站时,经常能见到不少可以用鼠标拖动的元素,其中以图片居多,比如,一张广告图片挡住了你想浏览的内容,你完全可以用鼠标选中把它扔到一边去!

  制作这种效果是通过图层的“Drag Layer”行为实现的,单击Behavior面板中“+”号,选择“Drag Layer”,当然之前你必要保证目标图层处于选中状态,进行简单设置后就OK了。

跑马灯

<marquee behavior=scroll direction=up width='126' height="140" scrollamount=3 scrolldelay=250 onMouseOver='Javascript:this.stop()' onMouseOut='Javascript:this.start()'>

</marquee>

点击图片链接时不显示虚线框

<a href=# onfocus="blur()"><img src=XXX.gif border=0></a>
<a href=#### hidefocus=true><img src=XXX.gif border=0></img></a>

屏蔽页面选择

在页面的<加入Body>中
onselectstart="return false" 成为 <body onselectstart="return false" >

一个关于安全性的问题,'or''=

一:把常用的一些危险字符给屏蔽掉
用下面的函数:
function changechr(str)
changechr=replace(replace(replace(replace(str,"<","&lt;"),">","&gt;"),chr(13),"<br/>")," "," ")
changechr=replace(changechr,"'","&quot;")
changechr=replace(changechr,mid(" "" ",2,1),"&quot;")
end function
示例:
username=request("username")
username=changechr(username)

二:把用户名和密码的验证分开
sql="select * form tables where username='"& username &"'"
rs.open sql,conn,1,3
if rs.eof then '如果用户名错误
response.write "<script language=javascript>alert('用户名错误!');"
response.write "javascript:history.go(-1);<script>"
elseif request.form("userpass")<> rs("password") then'如果密码错误
response.write "<script language=javascript>alert('密码错误!');"
response.write "javascript:history.go(-1);<script>"
else
........其他代码
end if

如何渐渐显示图片

1.将下面的代码复制到 <body> 或者 <head> 内
<script language="JavaScript1.2">
function high(which2){
theobject=which2
highlighting=setInterval("highlightit(theobject)",50)
}
function low(which2){
clearInterval(highlighting)
which2.filters.alpha.opacity=20
}
function highlightit(cur2){
if (cur2.filters.alpha.opacity<100)
cur2.filters.alpha.opacity+=5
else if (window.highlighting)
clearInterval(highlighting)
}
</script>
2.在你想加上效果的图片代码上加入
<img src="img/first.gif" width="97" height="100" style="filter:alpha(opacity=40)" onMouseover="high(this)" onMouseout="low(this)">

链接确认警告
1.将下面的代码放到<body>内
<script>
function winconfirm(){
question = confirm("你确认要到“广州视窗”吗?")
if (question != "0"){
window.open("http://www.gznet.com")
}
}
</script>
2.在连接的地方加上 onClick=winconfirm(); 如 <a href=www.gznet.com onClick=winconfirm()>广州视窗</a>

ASP程序中的对话框

Response.Write "<script language=javascript>alert('上传成功!');window.close();</script>"

Response.Write "<script language=javascript>alert('电邮格式不对,请重试!');window.history.go(-1);</script>"
response.end

Response.Write "<script language=javascript>alert('新密码已经生效!');window.location.href='Admin_Index_Main.asp'</script>"
response.End()

禁止站外提交表单

<%
server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
if mid(server_v1,8,len(server_v2))<>server_v2 then
response.write "<br><br><center><table border=1 cellpadding=20 bordercolor=black bgcolor=#EEEEEE width=450>"
response.write "<tr><td style='font:9pt Verdana'>"
response.write "你提交的路径有误,禁止从站点外部提交数据请不要乱该参数!"
response.write "</td></tr></table></center>"
response.end
end if
%>
比如说上面的代码起名为check_path.asp保存,每次遇到表单提交时引用就行了

垂直不间断滚动

<div id="marqueey">
欢迎光临才子小站<br/>
才子支持资源共享<br/>
希望各位能够喜欢<br/>
再次谢谢各位光临<br/>
</div>
<script language="JavaScript">
marqueeyHeight=140; //载体高度控制
stopscroll=false;
with(marqueey){
style.width=0;
style.height=marqueeyHeight;
style.overflowX="visible";
style.overflowY="hidden";
noWrap=true;
onmouseover=new Function("stopscroll=true");
onmouseout=new Function("stopscroll=false");
}
document.write('<div id="templayer" style="position:absolute;z-index:1;visibility:hidden"></div>');
preTop=0; currentTop=0;
function init(){
templayer.innerHTML="";
while(templayer.offsetHeight<marqueeyHeight){
templayer.innerHTML+=marqueey.innerHTML;
}
marqueey.innerHTML=templayer.innerHTML+templayer.innerHTML;
setInterval("scrollUp()",40); //滚动速度控制,越大越慢
}
document.body.onload=init;
function scrollUp(){
if(stopscroll==true) return;
preTop=marqueey.scrollTop;
marqueey.scrollTop+=1;
if(preTop==marqueey.scrollTop){
marqueey.scrollTop=templayer.offsetHeight-marqueeyHeight;
marqueey.scrollTop+=1;
}
}
</script>

水平不间断滚动

<div id="marqueex">
欢迎光临才子小站 才子支持资源共享 希望各位能够喜欢 再次谢谢各位光临
</div>

代码:
<script language="JavaScript">
marqueexWidth=600; //载体宽度控制
with(marqueex){
style.height=0;
style.width=marqueexWidth;
style.overflowX="hidden";
style.overflowY="visible";
noWrap=true;
onmouseover=new Function("stopscroll=true");
onmouseout=new Function("stopscroll=false");
}
document.write('<div id="templayer" style="position:absolute;z-index:1;visibility:hidden"></div>');
preLeft=0; currentLeft=0; stopscroll=false;

function init(){
templayer.innerHTML="";
while(templayer.offsetWidth<marqueexWidth){
templayer.innerHTML+=marqueex.innerHTML;
}
marqueex.innerHTML+=templayer.innerHTML;
setInterval("scrollLeft()",40); //滚动速度控制,越大越慢
}
document.body.onload=init;
function scrollLeft(){
if(stopscroll==true) return;
preLeft=marqueex.scrollLeft;
marqueex.scrollLeft+=1;
if(preLeft==marqueex.scrollLeft){
marqueex.scrollLeft=templayer.offsetWidth-marqueexWidth+1;
}
}
</script>

企业网站常用中英文对照表

网站导航 site map

公司简介 PROFILE or COMPANY Profile or Company

公司设备 EQUIPMENT Equipment

公司荣誉 GLORIES Glories

企业文化 CULTURE Culture

产品展示 PRODUCT Product

资质认证 quality certification

企业规模 SCALE Scale

营销网络 Sales Network

组织机构 orGANIZATION organization

合作加盟 Join in Cooperation

技术力量 TECHNOLOGY Technology

经理致辞 Manager`s oration

发展历程 Development history

工程案例 Engineering Projects

业务范围 Business Scope

分支机构 Branches

供求信息 Supply & Demand

经营理念 Operation Principle

产品销售 SALES Sales

联系我们 CONTACT US Contact Us

信息发布 INFORMATION Information

返回首页 HOMEPAGE Homepage

产品定购 orDER order

分类浏览 Browse by category

电子商务 E-Business

公司实力 STRENGTH Strength

版权所有 Copy right

友情连结 Hot link

应用领域 Application Fields

人力资源 Human Resource HR

领导致辞 Leader`s oration

企业资质 Enterprise qualification

行业新闻 Trade news

行业动态 Trends

客户留言 Customer Message

客户服务 Customer Service

新闻动态 News & Trends

公司名称 Company Name

销售热线 Sales Hot-line

联系人 Contact Person

您的要求 Your requirements

建设中 In construction

证书 CERTIFICATE Certificate

地址 ADD Add

邮编 POSTAL CODE Zipcode

电话 TEL Tel

传真 FAX Fax

产品名称 Product Name

产品说明 DESCRIPTION Description

价格 Price

品牌 Brand

规格 Specification

尺寸 Size

生产厂家 MANUFACUTURER Manufacturer

型号 Model

产品标号 Item No.

技术指标 Technique Data

产品描述 Description

产地 Production Place

销售信息 Sales Information

用途 Application

论坛 Forum

在线订购 On-line order

招商 Enterprise-establishing

招标 Bid inviting

综述 General

业绩 Achievements

招聘 Join Us

求贤纳士 Join Us

大事 Great Event

动态 Trends

服务 Service

投资 Investment

行业 Industry

规划 Programming

环境 Environment

发送 Delivery

提交 Submit

重写 Reset

登录 Enter

注册 Login

中国企业网技术支持 Powered by ce.net.cn

社区 Community

业务介绍 Business introduction

在线调查 Online inquiry Inquiry

下载中心 Download

会员登陆 Member Entrance

意见反馈 Feedback

常见问题 FAQ

中心概况 General Profile

教育培训 Education & Training

游乐园 amusement park

在线交流 Online communication

专题报道 Special report
Records:9612345678910