Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/418.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/39.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
Javascript DAT GUI-调整输入字段的大小_Javascript_Css_Three.js - Fatal编程技术网

Javascript DAT GUI-调整输入字段的大小

Javascript DAT GUI-调整输入字段的大小,javascript,css,three.js,Javascript,Css,Three.js,我正在使用Dat Gui将菜单系统添加到我的应用程序中 我的html代码中包含以下内容: <script src="js/dat.gui.js"></script> <link type="text/css" rel="stylesheet" href="js/dat-gui-style.css"> 这允许我为菜单系统中的输入字段设置自定义宽度。这几乎正是我想要实现的。然而,它只在全球范围内起作用。我希望能够在js代码中动态控制输入字段的宽度属性 我试过这个

我正在使用Dat Gui将菜单系统添加到我的应用程序中

我的html代码中包含以下内容:

<script src="js/dat.gui.js"></script>
<link type="text/css" rel="stylesheet" href="js/dat-gui-style.css">
这允许我为菜单系统中的输入字段设置自定义宽度。这几乎正是我想要实现的。然而,它只在全球范围内起作用。我希望能够在js代码中动态控制输入字段的宽度属性

我试过这个:

guiTest = new dat.GUI({ autoPlace: false });

for (i = 0; i < theMenu.paramNames.length; i++)
{
    guiTest.add(theMenu, theMenu.paramNames[i]);
    guiTest.__controllers[0].domElement.style.width = '350px';
}
guiTest=newdat.GUI({autoPlace:false});
对于(i=0;i
但它似乎不起作用


有人知道怎么做吗?

如果
domElement
实际上是的一个实例,那么您的语法应该是

guiTest.__controllers[0].domElement.style = 'width:350px';

也许还有别的办法,但我就是想不出来。谢谢。那正是我所需要的!
guiTest.__controllers[0].domElement.style = 'width:350px';