猿问

在BIMFACE的模型中toolbar怎么增加button

怎么咋BIMFACE的模型的toolbar里面加自己的button?

POPMUISE
浏览 742回答 2
2回答

四季花海

var toolbar = app.getToolbar('MainToolbar');var btnConfig = new Glodon.Bimface.UI.Button.ButtonConfig();btnConfig.title = "Button";var btn = new Glodon.Bimface.UI.Button.Button(btnConfig);btn.setHtml(<button style="width: 50px; height:50px; left: -8px; top: -8px; position: relative; color: white; font-size: 18px;background: rgba(0, 0, 0, 0);opacity: 0.6;border: none;">Button</button>);btn.addClassName('btn-test');btn.addEventListener('Click', function() {alert("我是一个新button");});toolbar.insertControl(2, btn);

鸿蒙传说

添加图片按钮:var btn = new Glodon.Bimface.UI.Button.Button(btnConfig);&nbsp; &nbsp; &nbsp; btn.setHtml('<img class="img-gbfm" src="../images/fmicon/gfmtest.png" alt="" width="32px" height="32px" />');&nbsp; &nbsp; &nbsp; btn.addClassName('btn-gbfm-test');css:.btn-gbfm-test {&nbsp; width: 50px;&nbsp; height: 50px;&nbsp; left: -8px;&nbsp; top: -8px;&nbsp; position: relative;&nbsp; color: white;&nbsp; background: rgba(0, 0, 0, 0);&nbsp; opacity: 0.6;&nbsp; border: none;}
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答