Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQueryJPicker被浏览器的顶部切断_Jquery_Jquery Plugins - Fatal编程技术网

jQueryJPicker被浏览器的顶部切断

jQueryJPicker被浏览器的顶部切断,jquery,jquery-plugins,Jquery,Jquery Plugins,我使用的是jpicker,它被浏览器切断了。以前有人遇到过这个问题吗 下面是我的jquery代码片段 //jpicker hex color picker if($('#hexPicker').length) { $('#hexPicker').jPicker(); } 这是我的表单片段 <div class="row"> <label for="color">Background Color</label> <input t

我使用的是jpicker,它被浏览器切断了。以前有人遇到过这个问题吗

下面是我的jquery代码片段

//jpicker hex color picker
if($('#hexPicker').length) {
    $('#hexPicker').jPicker();
}
这是我的表单片段

<div class="row"> 
    <label for="color">Background Color</label>
    <input type="text" name="color" value="00ff00" class="small" id="hexPicker"  /> 
</div>

背景色

我不确定,但你可以试试这个

$('#hexPicker').jPicker({
  window: {
    position: {
      x: 'screenCenter', // acceptable values "left", "center", "right", "screenCenter", or relative px value
      y: 'center', // acceptable values "top", "bottom", "center", or relative px value
    }
  }
});

我正在使用jqueryui选项卡,定位是一个报告的bug,但是使用

window:{position:{x:'screenCenter',y:'200'}//200可以是任何固定值


设置一个显式值为我解决了问题,并认为值得分享

一旦我使用了一个颜色选择器,并面临同样的问题,我记得我使用chrome的元素检查工具找到了容器的等效css样式,我可以成功地更改容器的css样式。您可以尝试这种方法来解决这个问题。我相信它是{window:{position:{x:'screenCenter',y:'center'}}。无论如何,y值是相对于展开jPicker的元素的(不是绝对屏幕),因此如果滚动到页面顶部附近,它仍然显示为被切断。