⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wm_pos2_elmnt.html

📁 有很多很实用的方法
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!-- check for different collection -->
<html>

<head>
<title>scale_font</title>
<meta name="description"
content="Webmonkey Array Enhancements: JavaScript 1.2, which works only in Netscape 4.0, adds several fundamental methods to the array object. A few of these very useful methods are included here in a form that can be used by 3.0 browsers.">
<meta name="keywords"
content="javascript, dhtml, javascript, code, scripting, dynamic, developer resource, developer, development, web
development, design, code, geek, warez, free, new, latest, news, tools,
info, tutorials, how-to, builder, web builder, page builder, javascript, dhtml, javascript, code, scripting, dynamic, developer resource,
developer, development, web development, design, code, geek, warez, free,
new, latest, news, tools, info, tutorials, how-to, builder, web builder,
page builder">
</head>

<body BGCOLOR="#ffffff" TEXT="#000000" link="#0000ff" Vlink="#660099">
<!-- TOP AD BANNER -->
<a
href="../../../tppmsgs/msgs0.htm#73" tppabs="http://nsads.hotwired.com/event.ng/Type=click&ProfileID=176&RunID=4311&AdID=5612&GroupID=1&FamilyID=415&TagValues=13.25.156.159.169.174.177.181.182.183.184.185.196.197.198.199.200.208.213.333.349.389.401.411.436.526&Redirect=http://www.microsoft.com/sitebuilder/vinterdev/vionsbn.asp?30600vibeta"
TARGET="_top"><nobr>

<p></nobr></a> </p>

<table border="0" cellpadding="0" width="530" celspacing="0">
  <tr>
    <td><font size="3" color="#0000FF" face="宋体"><a
    href="../../../tppmsgs/msgs0.htm#52" tppabs="http://www.webmonkey.com.cn/design.html" target="_top">网页设计</a><a
    href="../../../tppmsgs/msgs0.htm#53" tppabs="http://www.webmonkey.com.cn/html.html" target="_top">/HTML文件</a><a
    href="../../../tppmsgs/msgs0.htm#32" tppabs="http://www.webmonkey.com.cn/dynamic_html.htm" target="_top">/动态HTML文件</a></font><a
    href="../../../tppmsgs/msgs0.htm#54" tppabs="http://www.webmonkey.com.cn/stylesheets.html"><font size="2" color="#0000FF"
    face="宋体">/Stylesheets</font></a><font size="3" color="#0000FF" face="宋体"><a
    href="../../../tppmsgs/msgs0.htm#55" tppabs="http://www.webmonkey.com.cn/graphics.html" target="_top">/图形与字体</a><a
    href="../../../tppmsgs/msgs0.htm#56" tppabs="http://www.webmonkey.com.cn/multimedia.html" target="_top">/多媒体</a></font><font
    size="2" color="#0000FF" face="宋体">&nbsp;</font></td>
  </tr>
  <tr>
    <td><a href="../../../tppmsgs/msgs0.htm#57" tppabs="http://www.webmonkey.com.cn/browsers.html" target="_top"><font size="3"
    color="#0000FF" face="宋体">浏览器</font></a><font size="2" color="#0000FF"
    face="宋体"><a href="../../../tppmsgs/msgs0.htm#58" tppabs="http://www.webmonkey.com.cn/java.html">/Java</a><a
    href="../../../tppmsgs/msgs0.htm#31" tppabs="http://www.webmonkey.com.cn/javascript.html">/JavaScript</a><a
    href="../../../tppmsgs/msgs0.htm#33" tppabs="http://www.webmonkey.com.cn/perl.html">/<nobr>Perl</nobr></font><font
    color="#0000FF" face="宋体">语言</font></a><nobr><font size="2" color="#0000FF"
    face="宋体"><a href="../../../tppmsgs/msgs0.htm#59" tppabs="http://www.webmonkey.com.cn/backend.html">/Backend</a><a
    href="../../../tppmsgs/msgs0.htm#60" tppabs="http://www.webmonkey.com.cn/e_business.htm">/</font><font size="3" color="#0000FF"
    face="宋体">电子商务</font></a></nobr></td>
  </tr>
  <tr>
    <td width="530"><br>
    <font face="宋体"><nobr><!-- TOP NAVIGATION and SPONSOR STUFF --> <font size="5"><a
    href="../../../tppmsgs/msgs0.htm#71" tppabs="http://www.webmonkey.com.cn/webmonkey.html"><b>webmonkey</b>/</a><a
    href="../../../tppmsgs/msgs0.htm#31" tppabs="http://www.webmonkey.com.cn/javascript.html">javascript</a><a
    href="code.htm" tppabs="http://www.webmonkey.com.cn/javascript/code/code.htm">/code</a></font><a
    href="dhtml.htm" tppabs="http://www.webmonkey.com.cn/javascript/code/dhtml.htm"><font size="4">/DHTML</font></a></nobr></font></td>
  </tr>
  <tr>
    <td width="530"><font face="宋体" size="2">网猴的Javascript代码库收集了我们自己制作的代码、函数包、及网页编辑器功能扩展其<br>
    中既有通用目的的编码,也有用于特定用途的程序、以及一些你可以以来改善你的网页的<br>
    优秀设计思想。其中的代码你可以免费下载使用。</font></td>
  </tr>
</table>

<table CELLPADDING="3" CELSPACING="0" BORDER="0" width="532">
<!-- AUTHOR IMAGE -->
  <tr>
<!-- BUFFER -->
    <td rowspan="100" width="10"><font face="宋体"><img
    SRC="../../../static.wired.com/webmonkey/images/spacer.gif" tppabs="http://static.wired.com/webmonkey/images/spacer.gif" WIDTH="10" HEIGHT="1"></font></td>
    <td width="165" valign="middle" align="right" colspan="2"></td>
<!-- HEADLINE -->
    <td width="365" valign="middle"><font face="宋体" size="4" color="#ff3300"><br>
    <b>WM_position2element</b></font><font face="宋体"><br>
<!-- BYLINE -->    作者:<font color="#0000FF">Taylor</font></font></td>
  </tr>
<!-- SEE ALSO LINKS -->
  <tr>
    <td width="155" align="left" valign="top" bgcolor="#FFFFB5"><font face="宋体"><img
    SRC="../../../static.wired.com/webmonkey/images/spacer.gif" tppabs="http://static.wired.com/webmonkey/images/spacer.gif" WIDTH="155" HEIGHT="1"><br>
    <br>
    <font size="3"><b>Related Library Items</b></font><br>
    <font color="#ff3300">- - - - - - - - - -</font> <br>
    </font><font size="3"><b><a href="wm_chg_link_bh.html" tppabs="http://www.webmonkey.com.cn/javascript/code/wm_chg_link_bh.html">网猴的变换链接行<br>
    为(<font face="宋体">Change Link <br>
    Behavior</font>)</a></b></font><font face="宋体"><big><br>
    </big></font><font size="3">该<strong>行为</strong>能够使你改变<br>
    网页中一个或多个定<br>
    位链接将其指向不同<br>
    的<font face="宋体">URL</font>。</font><font size="2" face="宋体"><br>
    </font><p><font size="3"><a href="cookie.htm" tppabs="http://www.webmonkey.com.cn/javascript/code/cookie.htm"><b>网猴<font face="宋体">Cookies</font>集锦</b></a></font><font
    face="宋体"><br>
    </font><font size="3">这些函数可以大大简化你使用<font face="宋体">cookies</font>时<br>
    的麻烦。</font><font size="2"><br>
    </font><font face="宋体"><br>
    <br>
    </font></td>
<!-- BODY COPY -->
<!-- BUFFER -->
    <td width="10" rowspan="100"></td>
    <td width="357" valign="top" bgcolor="#ffffff" rowspan="100"><font size="3"> <table
    width="357" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td>该函数能根据两个<font face="宋体">DHTML</font>元素各自的边界框的上下<br>
        左右位置设定两个<font face="宋体">DHTML</font>元素之间的象素距离。使<br>
        用它时,你必须选择两个需要设定彼此距离的元<br>
        素,设置两个元素各自的边界框的各边作为设置距<br>
        离的基准,并且用象素为单位设置两个元素之间距<br>
        离。你还可以选择将浏览器窗口作为元素通过使用<br>
        字符串窗口进行定位。<p>两个元素之间的距离还可以用负整数来设置,<font
        face="宋体">'</font>而<br>
        造成两个元素重叠的效果。 </p>
        <p><b>用法:</b><font face="宋体"><tt>WM_position2element<br>
        ('elementPositioned', <br>
        'left|top|right|bottom', differenceInPixels, <br>
        'elementPositionedAgainst|window', <br>
        'left|top|right|bottom');</tt> </font></p>
        <p><b>用法注释:</b><ul>
          <li></font><font face="宋体" size="3">所有的参数除了differenceInPixels以外都<br>
            必须是字符串。differenceInPixels是一个<br>
            数值。</font><font size="3"></li>
          <li>必须设置<font face="宋体">elementPositioned</font>和<br>
            <font face="宋体">elementPositionedAgainst</font>的宽度和高度。 </li>
        </ul>
        <p><b>需要配合使用<font face="宋体">:</b><a href="wm_checkin.htm" tppabs="http://www.webmonkey.com.cn/javascript/code/wm_checkin.htm">WM_checkIn() </a></font></font></td>
      </tr>
    </table>
    <p><b>欢迎剪贴使用<font face="宋体">!</b> </font><font size="2"></p>
    <form>
      <p><font face="宋体"><textarea cols="45" rows="20" wrap="off" name="wm_pos2elmnt">
&lt;script language=&quot;JavaScript&quot;&gt;
<!--



function WM_position2element() {
/*
WM_position2element()
Author: Taylor
Author Email: taylor@wired.com
Author URL: http://www.taylor.org/
URL: http://www.hotwired.com/webmonkey/code_library/dhtml/wm_position2element/
This action positions one DHTML element a specified number of 
pixels away from another, based on the left, top, right, or 
bottom of the bounding box of each element. To use it, you must 
choose the element to position and the element to position against;
specify which side of each element's bounding box to base the 
positioning on; and supply the number of pixels difference between 
the two. Optionally, you can choose the browser window as the 
element to position against by using the string "window".

You can only position either the left or the top of an element 
on each function call, not both at once, so multiple calls will 
be necessary if you want to offset the positioned element in two 
dimensions at once. This also only updates the element once, so 
if you want elements to follow each other in formation you'll 
need to call the function multiple times.

Usage: WM_position2element(elementPositioned, 
left|top|right|bottom, differenceInPixels, 
elementPositionedAgainst|window, left|top|right|bottom);
*/

  // First we set up our variables. posE is short for positionEE 
  // and posR is short for positionER.
  var posE,posR,mod;
  with(WM_position2element);
  posE = WM_checkIn(arguments[0]);
  // This block of code takes the string 'window' and makes it mean 
  // the browser window. This is handled in very different ways by 
  // Netscape and IE, so this block of code is rather long.
  if (arguments[3] == 'window') {
    if (document.all){
      posR = document.body;;
      posR.left = 0;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -