还珠格格3晴儿与箫剑:求浮动广告源码?

来源:百度文库 编辑:高考问答 时间:2024/04/30 14:39:02
两侧浮动
左侧浮动
右侧浮动
漂浮广告

Script: Floating Email-This-Link Script with Auto-Capture
  Functions: Displays a floating layer that moves with the
  page, in which is contained an email-this-link
  script. The email script automatically captures
  the url of the page.
  Browsers: NS6-7, IE all [functional in NS4]
  Author: etLux
  Directions: Insert the entire block of code below just before
  the page </body> tag. See the instructions in
  the script for additional setup information.
  =============================================================

  <!-- Begin FloatMail Code //-->

  <script>
  /* Floating Mail-This-Link Script C.2004 by CodeLifter.com */

  // Insert the entire script just before the </body> tag.
  // Set the following two position parameters
  // Negative numbers are relative to right (hX) or bottom (vY)
  // Positive numbers are relative to left (hX) or (vY) top
  // Experiment with values to get positioning exact, and allow
  // for the dimensions of the image & form in the positioning

  var hX = 340;
  var vY = -140;

  </script>

  <!-- Edit the HTML between the div tags to suit your design //-->

  <div id="FloatMail" style="position: absolute;
  background-color: #000000;
  background-image:url('float_dots.gif');
  width: 180px;
  border-width: 2;
  border-style:outset;
  border-color:#444444;
  padding:5px">
  <center>
  <form name="eMailer">
  <font size="2" face="Verdana,Arial" color="#ff0056">
  E-Mail This Link
  <br>
  Enter recipient's e-mail:
  </font>
  <br>
  <input type="text" name="address" size="20"
  style="background-color:#000000;
  color:#05fa9e;
  border-color:#ff0000;
  border-width:1;
  border-style:dashed;
  margin-top:7px;"><br>
  <input type="button" value="Send this URL" onClick="mailThisUrl();"
  style="color:#ff0057;
  font-family:Arial;
  font-size:10pt;
  background-color:#000000;
  border-width:1;
  border-style:solid;
  border-color:#242424;
  margin-top:7px;">
  </form>
  </center>
  </div>

  <!-- End of editable HTML //-->

  <script>
  /* Floating Mail-This-Link Script C.2004 by CodeLifter.com */
  /* Caution! Do not allow linebreaks other than where shown */
  var good;function checkEmailAddress(field){
  var goodEmail=field.value.match(/\b(^(\S+@).+((\.com)|(\.net)|(\.edu)|(\.mil)|(\.gov)|(\.org)|(\..{2,2}))$)\b/gi);
  if (goodEmail){good = true}else{alert('Please enter a valid e-mail address.');
  field.focus();field.select();good=false;}}
  u=window.location;m="I thought this might interest you...";
  function mailThisUrl(){good=false;
  checkEmailAddress(document.eMailer.address);
  if (good){window.location="mailto:"+document.eMailer.address.value+"?subject="+m+"&body="+document.title+" "+u;}}
  var nn=(navigator.appName.indexOf("Netscape")!=-1);
  var dD=document,dH=dD.html,dB=dD.body,px=dD.layers?'':'px';
  function floatMail(iX,iY,id){
  var L=dD.getElementById?dD.getElementById(id):dD.all?dD.all[id]:dD.layers[id];
  this[id+'O']=L;if(dD.layers)L.style=L;L.nX=L.iX=iX;L.nY=L.iY=iY;
  L.P=function(x,y){this.style.left=x+px;this.style.top=y+px;};L.Fm=function(){var pX, pY;
  pX=(this.iX >=0)?0:nn?innerWidth:nn&&dH.clientWidth?dH.clientWidth:dB.clientWidth;
  pY=nn?pageYOffset:nn&&dH.scrollTop?dH.scrollTop:dB.scrollTop;
  if(this.iY<0)pY+=nn?innerHeight:nn&&dH.clientHeight?dH.clientHeight:dB.clientHeight;
  this.nX+=.1*(pX+this.iX-this.nX);this.nY+=.1*(pY+this.iY-this.nY);this.P(this.nX,this.nY);
  setTimeout(this.id+'O.Fm()',33);};
  return L;}
  floatMail(hX,vY,'FloatMail').Fm();
  </script>

  <!-- End FloatMail Code //-->

  <STYLE type=text/css>#floater {
  Z-INDEX: 10; LEFT: 500px; VISIBILITY: visible; WIDTH: 125px; POSITION: absolute; TOP: 146px
  }
  </STYLE>

  <STYLE type=text/css>
  TD {
  FONT-SIZE: 9pt; LINE-HEIGHT: 11pt
  }
  </STYLE>

  </HEAD>
  <BODY >
  <DIV id=floater style="LEFT: 0px; WIDTH: 89px; TOP: 137px; HEIGHT: 40px">
  <TABLE cellSpacing=0 cellPadding=0 width=75 bgColor=#0000ff border=1>
  <TR>
  <TD width=10><B><IMG id=fpAnimswapImgFP1
  height=200 width=200 lowsrc=/img/200406301.jpg border=0 name=fpAnimswapImgFP1
  dynamicanimation="fpAnimswapImgFP1"></B></TD>
  <TD align=middle width=30>网页<BR>教学</TD></TR>
  </TABLE>
  </DIV>
  <SCRIPT language=JavaScript>
  self.onError=null;
  currentX = currentY = 0;
  whichIt = null;
  lastScrollX = 0; lastScrollY = 0;
  NS = (document.layers) ? 1 : 0;
  IE = (document.all) ? 1: 0;
  <!-- STALKER CODE -->
  function heartBeat() {
  if(IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; }
  if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; }
  if(diffY != lastScrollY) {
  percent = .1 * (diffY - lastScrollY);
  if(percent > 0) percent = Math.ceil(percent);
  else percent = Math.floor(percent);
  if(IE) document.all.floater.style.pixelTop += percent;
  if(NS) document.floater.top += percent;
  lastScrollY = lastScrollY + percent;
  }
  if(diffX != lastScrollX) {
  percent = .1 * (diffX - lastScrollX);
  if(percent > 0) percent = Math.ceil(percent);
  else percent = Math.floor(percent);
  if(IE) document.all.floater.style.pixelLeft += percent;
  if(NS) document.floater.left += percent;
  lastScrollX = lastScrollX + percent;
  }
  }
  <!-- /STALKER CODE -->
  <!-- DRAG DROP CODE -->
  function checkFocus(x,y) {
  stalkerx = document.floater.pageX;
  stalkery = document.floater.pageY;
  stalkerwidth = document.floater.clip.width;
  stalkerheight = document.floater.clip.height;
  if( (x > stalkerx && x < (stalkerx+stalkerwidth)) && (y > stalkery && y < (stalkery+stalkerheight))) return true;
  else return false;
  }
  function grabIt(e) {
  if(IE) {
  whichIt = event.srcElement;
  while (whichIt.id.indexOf("floater") == -1) {
  whichIt = whichIt.parentElement;
  if (whichIt == null) { return true; }
  }
  whichIt.style.pixelLeft = whichIt.offsetLeft;
  whichIt.style.pixelTop = whichIt.offsetTop;
  currentX = (event.clientX + document.body.scrollLeft);
  currentY = (event.clientY + document.body.scrollTop);
  } else {
  window.captureEvents(Event.MOUSEMOVE);
  if(checkFocus (e.pageX,e.pageY)) {
  whichIt = document.floater;
  StalkerTouchedX = e.pageX-document.floater.pageX;
  StalkerTouchedY = e.pageY-document.floater.pageY;
  }
  }
  return true;
  }
  function moveIt(e) {
  if (whichIt == null) { return false; }
  if(IE) {
  newX = (event.clientX + document.body.scrollLeft);
  newY = (event.clientY + document.body.scrollTop);
  distanceX = (newX - currentX); distanceY = (newY - currentY);
  currentX = newX; currentY = newY;
  whichIt.style.pixelLeft += distanceX;
  whichIt.style.pixelTop += distanceY;
  if(whichIt.style.pixelTop < document.body.scrollTop) whichIt.style.pixelTop = document.body.scrollTop;
  if(whichIt.style.pixelLeft < document.body.scrollLeft) whichIt.style.pixelLeft = document.body.scrollLeft;
  if(whichIt.style.pixelLeft > document.body.offsetWidth - document.body.scrollLeft - whichIt.style.pixelWidth - 20) whichIt.style.pixelLeft = document.body.offsetWidth - whichIt.style.pixelWidth - 20;
  if(whichIt.style.pixelTop > document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5) whichIt.style.pixelTop = document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5;
  event.returnValue = false;
  } else {
  whichIt.moveTo(e.pageX-StalkerTouchedX,e.pageY-StalkerTouchedY);
  if(whichIt.left < 0+self.pageXOffset) whichIt.left = 0+self.pageXOffset;
  if(whichIt.top < 0+self.pageYOffset) whichIt.top = 0+self.pageYOffset;
  if( (whichIt.left + whichIt.clip.width) >= (window.innerWidth+self.pageXOffset-17)) whichIt.left = ((window.innerWidth+self.pageXOffset)-whichIt.clip.width)-17;
  if( (whichIt.top + whichIt.clip.height) >= (window.innerHeight+self.pageYOffset-17)) whichIt.top = ((window.innerHeight+self.pageYOffset)-whichIt.clip.height)-17;
  return false;
  }
  return false;
  }
  //more javascript from http://www.webjx.com
  function dropIt()
  { whichIt = null;
  if(NS) window.releaseEvents (Event.MOUSEMOVE);
  return true;
  }
  <!-- DRAG DROP CODE -->
  if(NS) {
  window.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN);
  window.onmousedown = grabIt;
  window.onmousemove = moveIt;
  window.onmouseup = dropIt;
  }
  if(IE) {
  document.onmousedown = grabIt;
  document.onmousemove = moveIt;
  document.onmouseup = dropIt;
  }
  if(NS || IE) action = window.setInterval("heartBeat()",1);
  </SCRIPT>
  </body>
  </HTML>