2 回答
TA贡献1811条经验 获得超5个赞
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);
TA贡献1865条经验 获得超7个赞
添加图片按钮:
var btn = new Glodon.Bimface.UI.Button.Button(btnConfig);
btn.setHtml('<img class="img-gbfm" src="../images/fmicon/gfmtest.png" alt="" width="32px" height="32px" />');
btn.addClassName('btn-gbfm-test');
css:
.btn-gbfm-test {
width: 50px;
height: 50px;
left: -8px;
top: -8px;
position: relative;
color: white;
background: rgba(0, 0, 0, 0);
opacity: 0.6;
border: none;
}
添加回答
举报