简体   繁体   English

如何使滚动条仅在窗口大小增加时出现

[英]How to make scroll bar appear only when the window size gets increased

I have a UI which consists of drag and drop . 我有一个由拖放组成的UI。 I have a tree structure on left side . 我的左侧是树形结构。 I have to drag an item from the tree structure from left side and drop it as a composite to my right side. 我必须从左侧的树形结构中拖动一个项目,然后将其作为组合拖放到我的右侧。 So when the number of composites increases on my right side then scroll bar should appear. 因此,当我右边的合成材料数量增加时,应该会出现滚动条。 But my scroll bars are visible before the number of composites are getting increased. 但是在增加复合材料的数量之前,可以看到我的滚动条。 Even if I set showScollbar(false) even then I have the problem. 即使我设置showScollbar(false),我也有问题。

For example your right side div in which you drop the element have id right like 例如,您在其中放置元素的右侧div具有正确的ID,例如

<div id="right">

then write in css file as follows 然后在css文件中写入如下

#right { overflow: hidden;}
#right:hover {overflow: auto;}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使水平滚动条出现在包含JTextPane组件的JScrollPane中 - How to make the horizontal scroll bar appear in a JScrollPane that contains a JTextPane component 如何仅在滚动条位于底部并且滚动锁定关闭时才使JTextPane自动滚动? - How to make JTextPane autoscroll only when scroll bar is at bottom and scroll lock is off? 如何设置JavaFX ScrollPane的最大大小并使Scrollbars仅在需要时出现? - How to set the maximum size of a JavaFX ScrollPane and make Scrollbars appear only when needed? Tomcat线程数仅增加 - Tomcat thread count gets increased only 如何仅在按下上一个JFrame窗口的JButton后才显示JFrame窗口? - How to make a JFrame window appear only after I press the JButton of the previous JFrame window? 仅在必要时显示滚动条 - Displaying a scroll bar only when necessary JavaFx:当增加/减小窗口大小时,如何使背景图像大小随窗口改变? - JavaFx: How to make the background image size change with the window when increasing/decreasing the window size? 使警报仅在打开应用程序时显示 - Make an alert only appear when app is opened 直到我调整窗口大小,垂直滚动条才会出现-ScrolledFormText-Java - vertical scroll bar doesn't appear until i resize the window - ScrolledFormText - Java 增加的点击区域仅应用于最后一个视图 - Increased click area gets applied on the last view only
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM