HTM5的自带颜色选择器,点击input框会弹出浏览器自带的颜色选择器,但弹出的位置在左上角,怎么才能让他居中弹出
应该做不到吧,这种自带的功能一般都无法设置,只能模拟
方法一:
<script>
function opW(){
var ye=window.open('','yexj00','width=400,height=200');
ye.moveTo((screen.availWidth-400)/2,(screen.availHeight-200)/2);
}
</script>
<input type=button value=打开居中的新窗口 hideFocus=true
有移动延迟
方法二:
ShowDialog(url)
{
var iWidth=300; //窗口宽度
var iHeight=200;//窗口高度
var iTop=(screen.height-iHeight)/2;
var iLeft=(screen.width-iWidth)/2;
open(url,"Detail","Scrollbars=no,Toolbar=no,Location=no,Direction=no,Resizeable=no,Width="+iWidth+" ,Height="+iHeight+",top="+iTop+",left="+iLeft);
}
这个比较好
不是很懂你说的,我的是点击input框(type=color)自动弹出的,不是我控制的