Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.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 滚动条类的帮助_Javascript_Mootools - Fatal编程技术网

Javascript 滚动条类的帮助

Javascript 滚动条类的帮助,javascript,mootools,Javascript,Mootools,这里是有问题的滚动条类: 当前,滚动手柄的高度是动态的,由内容量决定,很像标准的浏览器滚动条。我需要能够使这个静态(200px),无论内容的数量。您可以在代码中看到,我试图设置高度,但当我这样做时,手柄会在拖动时落在奇怪的地方 建议将该高度设置为静态而非动态?在更新“部分”/“功能”中: this.vThumbSize = (this.vTrackSize * this.vContentRatio).limit(12, this.vTrackSize); this.vThumb.setStyle

这里是有问题的滚动条类:

当前,滚动手柄的高度是动态的,由内容量决定,很像标准的浏览器滚动条。我需要能够使这个静态(200px),无论内容的数量。您可以在代码中看到,我试图设置高度,但当我这样做时,手柄会在拖动时落在奇怪的地方

建议将该高度设置为静态而非动态?

在更新“部分”/“功能”中:

this.vThumbSize = (this.vTrackSize * this.vContentRatio).limit(12, this.vTrackSize);
this.vThumb.setStyle('height', 200);

this.vScrollRatio = this.vContentScrollSize / this.vTrackSize+this.vThumbSize;

这会将滚动设置为200px

这就是答案:

this.vScrollRatio = this.vContentScrollSize / (this.vTrackSize - this.vThumbSize) - this.vContentRatio * (this.vContentScrollSize / (this.vTrackSize - this.vThumbSize));

你试过了吗?它实际上不起作用。它设置了高度,但是滚动数学关闭了。我编辑了问题,现在它应该更接近你想要的