码迷,mamicode.com
首页 > Web开发 > 详细

执行JS

时间:2017-10-18 01:47:41      阅读:212      评论:0      收藏:0      [点我收藏+]

标签:doc   element   sele   click   hid   cli   groupby   scrolltop   document   

JS执行切换frame框架后点击

Window.frame[‘frame路径‘].frame[‘下级frame路径‘].document.getElementById("id").click()

隐藏元素

document.getElementById("id1").style.visibility=‘hidden‘  --隐藏元素

document.getElementById("id1").style.visibility=‘hidden‘  --显示元素

拖动滚动条

document.documentElement.scrollTop=100

document.body.scrollTop=100

window.scroll(x,y)

 

对表格隐藏某列(JS方式)

var res=document.querySelectorAll("[field=‘groupby‘]");

for(var i=0;i<res.length;i++){

var node = res[i];

node.style.display=‘none‘;

}

注:

node.style.display = ‘none‘   --会腾出页面位置

node.style.visibility = ‘hidden‘   --不会腾出位置,元素位置会出现一块空白

执行JS

标签:doc   element   sele   click   hid   cli   groupby   scrolltop   document   

原文地址:http://www.cnblogs.com/pengwue/p/7684574.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!