天天躁日日躁狠狠躁AV麻豆-天天躁人人躁人人躁狂躁-天天澡夜夜澡人人澡-天天影视香色欲综合网-国产成人女人在线视频观看-国产成人女人视频在线观看

提交頁面的定位--scrollIntoView的用法

提交頁面定位問題一直騷擾我,比如我們在DataGrid外面加了來使DataGrid在一定區域內呈現,這樣如果把滾動條拉到底部的時候點擊修改(或者修改后點擊更新,取消)頁面重新加載的時候都會把滾動條拉到頁面最上面部分 ,特此我將下面知識共享一下:
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中的應用
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">
現在給出一種簡單的辦法(其他的一些利用錨點等辦法都比較復雜)
private void Scroll(int index)
        
{
            
string s="<script>function window.onload(){document.all('"+this.DataGrid1.ClientID+"').rows["+index+"].scrollIntoView();}</script>";
            Page.RegisterStartupScript(
"",s);
        }

寫了一個方法,其中DataGrid1換成自己的DataGrid的ID,這個方法傳遞進去的參數就是行號,也就是e.Item.ItemIndex。
比如在編輯操作的時候會寫this.DataGrid1.EditItemIndex=e.Item.ItemIndex;
在此語句的以前加入Scroll(e.Item.ItemIndex);就可以了
同樣在更新操作的時候寫為Scroll(e.Item.ItemIndex);this.DataGrid1.EditItemIndex=-1;綁定;

AspNet技術提交頁面的定位--scrollIntoView的用法,轉載需保留來源!

鄭重聲明:本文版權歸原作者所有,轉載文章僅為傳播更多信息之目的,如作者信息標記有誤,請第一時間聯系我們修改或刪除,多謝。

主站蜘蛛池模板: 97人人看碰人免费公开视频 | 国产日韩高清一区二区三区 | 亚洲人成在线播放无码 | 精品一区二区免费视频蜜桃网 | 国产91无毒不卡在线观看 | 日韩特黄特色大片免费视频 | 黑丝女仆恋上我 | 迅雷成人论坛 | 国产成人久久精品AV | 亚洲欧美韩国综合色 | 老师机影院| 日日操天天操夜夜操 | 欧美群交XXXCOM| 亚洲AV成人片色在线观看网站 | 88福利视频 | 国内外成人免费在线视频 | 国产亚洲欧美在线中文BT天堂网 | MELODY在线播放无删减 | 久久综合老色鬼网站 | 在线播放一区二区精品产 | 日本一卡二卡三卡四卡无卡免费播放 | 精品视频免费在线观看 | 日本无码专区亚洲麻豆 | 国产东北男同志videos网站 | 精品AV国产一区二区三区 | 91综合精品网站久久 | 桃花论坛POWERED2019 | 中字幕视频在线永久在线观看免费 | 两个人看的www免费高清直播 | 我要女人的全黄录像 | 一二三四韩国免费观看 | 善良的女房东味道2在线观看 | 啊灬啊灬啊灬快灬深高潮啦 | 亚洲视频中文字幕 | 国产91专区| 老妇高潮潮喷到猛进猛出 | 青青草 久久久 | 在线看片韩国免费人成视频 | 久久久久亚洲日日精品 | 九九夜夜妹子 | 和老外3p爽粗大免费视频 |