为了在Web页面上使用文本搜索,在文本框内实现选择效果,在页面上屏蔽选择状态等。我们需要使用脚本(如JavaScript)来精确的控制页面中UI元素的选择状态。下面从操作元素选择区和屏蔽元素被选择两个方面来说一说。    操作元素选择区,我们可以使用对应对象的select()方法选择页面内容,其中包括INPUT元素中的内容、TextRange对象中的文字和controlRange Collection对象中的控件。1: <input id="txb" type="text" value="Text Box"/> <a href="#" on ...
  • 16:42
  • 浏览 (35)
  • 评论 (0)
  • 分类: js
<script>function getSel(){var txt="";var foundIn="";if(window.getSelection) {txt=window.getSelection();foundIn='window.getSelection()';  }  else if(document.getSelection)  {  txt=document.getSelection();  foundIn='document.getSelection()';  } else if(document ...
  • 22:10
  • 浏览 (56)
  • 评论 (0)
  • 分类: js
关键字: 类 msn和QQ的浮出框 <script>          var oPopup;         var popTop=50;         var mytime;         function closemsg( ...
  • 08:05
  • 浏览 (125)
  • 评论 (0)
  • 分类: js
(1)style=cursor.hand (2)<body style="overflow-x:hidden"> 隐藏水平的滚动条 (3): alert(aa.options[aa.selectedIndex].text); (4):select 固定大小 style="width:80px" (5)onpropertychange (6)表头固定不随滚动条滚动 style='position:relative;top:expression(this.offsetParent.scrollTop-2);' (7)进入到表底部 window.parent.scrollTo(0,doc ...
  • 21:14
  • 浏览 (93)
  • 评论 (0)
  • 分类: js
beyondsanli
搜索本博客
我的相册
Ed2ef40c-0044-376b-ae87-96fbb4175e76-thumb
未命名2
共 17 张
存档
最新评论