
可以的
页面代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<!--<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>-->
</head>
<style>
.box {
height: 150px
width: 300px
overflow: auto
}
.box p {
height: 300px
}
.box::-webkit-scrollbar {
width: 10px
height: 1px
}
.box::-webkit-scrollbar-thumb {
border-radius: 5px
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2)
background: url(img/banner01.jpg)
}
.box::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2)
border-radius: 5px
background: url(img/123.jpg)
}
.box .srcoll::-webkit-scrollbar {
width: 10px
height: 1px
}
.box .srcoll::-webkit-scrollbar-thumb {
border-radius: 5px
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2)
background: #ccc
}
.box .srcoll::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2)
border-radius: 5px
background: #EDEDED
}
/*滚动条样式 end*/
</style>
<body>
<div class="box">
<p>11111</p>
</div>
</body>
</html>
//记得改一下css的图片路径
滚动菜单你要这样写,创建滚动菜单scrolledComposite之后,再创建一个parent,然后scrolledComposite.setContent(parent)parent.setSize(parent.computeSize(SWT.DEFAULT,
SWT.DEFAULT))
然后parent记得设置layout
这样菜单才会显示,然后循环出来的composite的父组件都要设置成parent。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)