一区二区久久-一区二区三区www-一区二区三区久久-一区二区三区久久精品-麻豆国产一区二区在线观看-麻豆国产视频

提交頁(yè)面的定位--scrollIntoView的用法

提交頁(yè)面定位問(wèn)題一直騷擾我,比如我們?cè)贒ataGrid外面加了來(lái)使DataGrid在一定區(qū)域內(nèi)呈現(xiàn),這樣如果把滾動(dòng)條拉到底部的時(shí)候點(diǎn)擊修改(或者修改后點(diǎn)擊更新,取消)頁(yè)面重新加載的時(shí)候都會(huì)把滾動(dòng)條拉到頁(yè)面最上面部分 ,特此我將下面知識(shí)共享一下:
object.scrollIntoView( [bAlignToTop])

Parameters

bAlignToTopOptional. Boolean that specifies one of the following values:
trueDefault. Scrolls the object so that top of the object is visible at the top of the window.
falseScrolls the object so that the bottom of the object is visible at the bottom of the window.

Return Value

No return value.

Remarks

The scrollIntoView method is useful for immediately showing the user the result of some action without requiring the user to manually scroll through the document to find the result.

Depending on the size of the given object and the current window, this method might not be able to put the item at the very top or very bottom, but will position the object as close to the requested position as possible.

Example

This example uses the scrollIntoView method to underline the content of the document's fifth paragraph and scroll it into view at the top of the window.

HideExample

  var coll = document.all.tags("P");if (coll.length >= 5){coll(4).style.textDecoration = "underline";coll(4).scrollIntoView(true);}

Standards Information

There is no public standard that applies to this method.

Applies To

INPUT type=ra...
PlatformVersion
Win16:4.0
Win32:4.0
Windows CE:4.0
Unix:4.0
Mac:4.0
A, ADDRESS, APPLET, AREA, B, BIG, BLOCKQUOTE, BR, BUTTON, CAPTION, CENTER, CITE, CODE, COL, COLGROUP, COMMENT, controlRange, CUSTOM, DD, DFN, DIR, DIV, DL, DT, EM, EMBED, FIELDSET, FONT, FORM, hn, HR, I, IFRAME, IMG, INPUT type=button, INPUT type=checkbox, INPUT type=file, INPUT type=image, INPUT type=password, INPUT type=radio, INPUT type=reset, INPUT type=submit, INPUT type=text, KBD, LABEL, LEGEND, LI, LISTING, MAP, MARQUEE, MENU, NOBR, OBJECT, OL, P, PLAINTEXT, PRE, S, SAMP, SELECT, SMALL, SPAN, STRIKE, STRONG, SUB, SUP, TABLE, TBODY, TD, TEXTAREA, TextRange, TFOOT, TH, THEAD, TR, TT, U, UL, VAR, WBR, XMP
Move the mouse pointer over an element in the Applies To list to display availability information for the listed platforms.

二、在.NET中的應(yīng)用
1、定位指定控件
/// <summary>
  /// 定位txtCode控件
  /// </summary>
  private void Scroll()
  {
   string s="<script>function window.onload(){document.all('"+this.txtCode.ClientID+"').scrollIntoView();}</script>";
   Page.RegisterStartupScript("",s);
  }

2、定位指定DataGrid列
  <div style="BORDER:0px;PADDING:0px;MARGIN:0px;OVERFLOW:scroll;WIDTH:600px;HEIGHT:200px" align="center">
現(xiàn)在給出一種簡(jiǎn)單的辦法(其他的一些利用錨點(diǎn)等辦法都比較復(fù)雜)
private void Scroll(int index)
        
{
            
string s="<script>function window.onload(){document.all('"+this.DataGrid1.ClientID+"').rows["+index+"].scrollIntoView();}</script>";
            Page.RegisterStartupScript(
"",s);
        }

寫了一個(gè)方法,其中DataGrid1換成自己的DataGrid的ID,這個(gè)方法傳遞進(jìn)去的參數(shù)就是行號(hào),也就是e.Item.ItemIndex。
比如在編輯操作的時(shí)候會(huì)寫this.DataGrid1.EditItemIndex=e.Item.ItemIndex;
在此語(yǔ)句的以前加入Scroll(e.Item.ItemIndex);就可以了
同樣在更新操作的時(shí)候?qū)憺镾croll(e.Item.ItemIndex);this.DataGrid1.EditItemIndex=-1;綁定;

AspNet技術(shù)提交頁(yè)面的定位--scrollIntoView的用法,轉(zhuǎn)載需保留來(lái)源!

鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請(qǐng)第一時(shí)間聯(lián)系我們修改或刪除,多謝。

主站蜘蛛池模板: 日本巨黄视频 | 精品国产91久久久久久久 | 欧美激情a∨在线视频播放 欧美激情不卡 | 韩国免费特一级毛片 | 久久伊人热 | 精品国产欧美一区二区三区成人 | 免费看国产视频 | 亚洲一区二区三区中文字幕 | 久久精品国产精品亚洲婷婷 | 国产成人精品一区二区仙踪林 | 色多多视频在线 | 视频成人永久免费看 | 真实国产乱弄免费视频 | 久久久久伊人 | 97国产在线播放 | 国产精品久久久久无毒 | 国产免费久久精品99久久 | 久久婷婷午色综合夜啪 | 黄网站视频 | 日本精品久久久 | 中文字幕亚洲区 | 好吊妞视频haodiaoniucom | 国产免费一区二区三区最新 | 五月天开心激情 | 酒色婷婷 | 91精品欧美 | 91福利国产在线观看一区二区 | 欧美另类videosbestsex亚洲 | 久久91亚洲精品中文字幕奶水 | 奇米影视狠狠干 | 伊人久久综在合线亚洲不卡 | 中文字幕在线视频网站 | 国产怡红院 | 末成年美女黄网站色大片连接 | 深夜免费小视频 | 久久五月女厕所一区二区 | 色多多成视频人在线观看 | 色老板免费观看在线播放 | 色综合久久综合 | 激情五月激情综合网 | 国产三级全黄 |