/**
*
*请问做这个程序有多大的技术难度?大概需要多少行代码?
*
**/
1:楼主说的是中间横条工具条吧,如果是的话,我试着做了些操作看样子有去与服务器操作,且页面没有刷新可能用了框架,很有可能用了“阿甲”;
“技术难度”:主要用到的是javascript,还有就上述两种技术
“大概需要多少行代码”,这个可能得看你具体需求。2:基本功能是要求用户鼠标指到哪里就读哪里
这主要是对这个结点进行了定位,楼主可以参照position,z-index,top等相关属性;

解决方案 »

  1.   

    现在主要的技术问题是怎样获取鼠标所指处的文本内容,有如下一段代码,这里的javascript能够读取包括在<p><h3>等标签中的内容,但是对于“some plain text!”这样的直接放在<body>里面的文本却无能为力。
    由谁能够提供一段代码吗?
    <html>
    <head>
    <script type="text/javascript">
    document.onmousemove = function()
    {
    whichElement(event);
    }
    function whichElement(e)
    {
    var targ;
    if (!e) var e = window.event;
    if (e.target) targ = e.target;
    else if (e.srcElement) targ = e.srcElement;
    window.status = targ.innerText;
    }
    </script>
    </head><body>
    some plain text!<p>Click somewhere in the document. An alert box will alert the tag name of the element you clicked on.</p><h3>This is a header</h3>
    <p>This is a paragraph</p>
    <img border="0" src="ball16.gif" width="29" height="28" alt="Ball">some other plain text!
    </body></html>
      

  2.   

    TextRange 
    TextRectangle 
    getClientRects 
    getBoundingClientRect 
    看这些相关函数
      

  3.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE>TextRectangle Object demo</TITLE>
    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-8859-1">
    <META NAME="AUTHOR" CONTENT="InetSDK">
    <META NAME="MS.LOCALE" CONTENT="EN-US">
    <META NAME="ROBOTS" CONTENT="noindex"><LINK REL="stylesheet" HREF="/workshop/samples/author/dhtml/refs/samplesSDKIE4.css" TYPE="text/css"><SCRIPT>
    document.parentWindow.status = "";
    var timid = -1;
    var timoID_2 = -1;
    var nLine;
    var nPosInLine;
    var oRcts;
    var nDivLen;
    var nEraser;function LoadDone() {
        oTextRange = document.body.createTextRange();              
        oRcts = oTextRange.getClientRects();   // Get bounding rect of the range
        nLine = 0;
        oBndRct = obj.getBoundingClientRect();
        nDivLen = oBndRct.right - oBndRct.left + 1;    
        MoveTo();
    }function MoveTo() {
      if(nLine >= oRcts.length) {
         nLine = 0;
      }
      obj.style.top = oRcts[nLine].top;
      nPosInLine = oRcts[nLine].left;
      nEraser = 0;
      timoID_2 = setInterval("MoveToInLine()",60);    
    }function MoveToInLine() {
      if(nPosInLine >= oRcts[nLine].right - nDivLen) {
         clearInterval(timoID_2);
         timoID_2 = -1;
         obj.style.left = oRcts[nLine].right - nDivLen;
         nLine++;
         timid = setTimeout("MoveTo()", 100);
         return;
      }
       if(nEraser == 0) {
          nEraser = 1; im.src = "/workshop/graphics/dot.gif";
       } else {
          nEraser = 0; im.src = "/workshop/graphics/dot.gif";
      }
      obj.style.left = nPosInLine;
      nPosInLine += 3;
    }function End() {
       if(timid != -1)
        clearInterval(timid);
       timid = -1;
       if(timoID_2 != -1)
        clearInterval(timoID_2);
       timoID_2 = -1;
    }
    </SCRIPT>
    </HEAD>
    <!--TOOLBAR_START-->
    <!--TOOLBAR_EXEMPT-->
    <!--TOOLBAR_END--><BODY ID="bodyid" onload="LoadDone()" onresize="End();LoadDone()" onunload="End()" TOPMARGIN=0 LEFTMARGIN=0 BGPROPERTIES="FIXED" BGCOLOR="#FFFFFF" 
    LINK="#000000" VLINK="#808080" ALINK="#000000">
    fdsfdsfds
    <BLOCKQUOTE CLASS="body">
    fdsfdsfdsfdsfd
    <P STYLE="text-align:center">
    <B> The quick brown fox</B>
    <BR>
    <P ALIGN="center">The <BR> quick brown fox <BR> 
    <UL>
        <LI>The quick brown fox 
    </UL>
    <UL>
                <LI>The quick </LI>
                <LI>The quick brown fox </LI>
                <LI>The quick brown fox jumps over </LI>
                <LI>The quick brown fox jumps over the lazy dog. </LI>
            </UL><P><BLOCKQUOTE>
    Notice that as you resize the window, the coordinates are not adjusted, since the coordinates are set at <B>onload</B>.</BLOCKQUOTE><CENTER>
    <BR><BR><BR>
    <HR>
    Right-click anywhere in the window to view the source code.
    </CENTER>
    <DIV ID="obj" STYLE="position:absolute"><IMG ID="im" SRC="/workshop/graphics/dot.gif" WIDTH="16" HEIGHT="16" border="0" alt="*">  </DIV>
    </P><!-- @ED a-carolk: what is this dot doing here? --><!-- START_PAGE_FOOTER -->
    <BR><BR><BR>
    &copy; <A CLASS="clsIncCpyRt" HREF="http://www.microsoft.com/isapi/gomscom.asp?TARGET=/info/cpyright.htm" TARGET="_top"> 2002 Microsoft Corporation. All rights reserved. Terms of use</A>.
    <!-- END_PAGE_FOOTER -->
    </BLOCKQUOTE>
    </BODY>
    </HTML>