有一个想法,你在数据库里加一个字段.记录下位置比如50
点击按钮后.你查找相应的节点上位置字段的值 ,用JS把滚动条移到此外,JS语句以前看到过,忘了!!
适用树的结构不变化这样的情况!

解决方案 »

  1.   

    javascript中用什么语句控制滚动啊?谁能给个用的例子?
      

  2.   

    javascript中用什么语句控制滚动啊?谁能给个用的例子?
      

  3.   

    javascript中用什么语句控制滚动啊?谁能给个用的例子?
      

  4.   

    这里有段查找当前页面文本然后定位的代码,不知对你们有没有帮助,先发上来看看吧<script language="JavaScript">var NS4 = (document.layers);    // Which browser?
    var IE4 = (document.all);var win = window;    // window to search.
    var n   = 0;function findInPage(str) {  var txt, i, found;  if (str == "")
        return false;  // Find next occurance of the given string on the page, wrap around to the
      // start of the page if necessary.  if (NS4) {    // Look for match starting at the current point. If not found, rewind
        // back to the first match.    if (!win.find(str))
          while(win.find(str, false, true))
            n++;
        else
          n++;    // If not found in either direction, give message.    if (n == 0)
          alert("Not found.");
      }  if (IE4) {
        txt = win.document.body.createTextRange();    // Find the nth match from the top of the page.    for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) {
          txt.moveStart("character", 1);
          txt.moveEnd("textedit");
        }    // If found,  it and scroll it into view.    if (found) {
          txt.moveStart("character", -1);
          txt.findText(str);
          txt.select();
          txt.scrollIntoView();
          n++;
        }    // Otherwise, start over at the top of the page and find first match.    else {
          if (n > 0) {
            n = 0;
            findInPage(str);
          }      // Not found anywhere, give message.      else
            alert("Not found.");
        }
      }  return false;
    }</script><form name="search" onSubmit="return findInPage(this.string.value);">
    <font size=3><input name="string" type="text" size=15 onChange="n = 0;"></font>
    <input type="submit" value="Find">
    </form>
      

  5.   

    参照
    http://lucky.myrice.com/javascriptexam/index.html
      

  6.   

    在一个单独的网页中是可以,可是这个页面是在一个frameset中的一个frame中,却不可以,如何解决?