how to add a click event to an element in
bf-menu
how to add a click event to an element in
bf-menu
1, references to jquery
//
app.addEventListener(Glodon.Bimface.Viewer.Viewer3DEvent.ComponentsSelectionChanged, function(objectData) {
viewer.render();
id=objectData.objectId;
changeStatus(app);
})
//
function changeStatus(app){
var contextMenuCallback= function() {
app.getViewer().render();
var obj=$("-sharpdoms");
if(obj.length<0||obj.length==0) {
var domc = document.createElement('div');
var doms = document.createElement('div');
var domss = document.createElement('div');
var domt = document.createElement('div');
var domtt1 = document.createElement('div');
var domtt2 = document.createElement('div');
domss.append(domt);
domss.append(domtt1);
domss.append(domtt2);
domc.append(domss);
domc.append(doms);
domc.addClass("bf-sub-menu");
domc.id = "doms";
doms.addClass("bf-menu-item user-item");
doms.innerHTML = "";
domss.addClass("bf-menu");
domt.addClass("bf-menu-item user-item");
domt.innerHTML = "";
domt.id="finish";
domtt1.addClass("bf-menu-item user-item");
domtt1.innerHTML = "";
domtt1.id="starting";
domtt2.addClass("bf-menu-item user-item");
domtt2.innerHTML = "";
domtt2.id="yanqi";
var oid=id;
$(".bf-tree-toolbar").next().append(domc);
}else{
//$(".bf-tree-toolbar").next().append($("-sharpdoms"))
}
$("-sharpfinish").on("click",function(){
var colorRed = new Glodon.Web.Graphics.Color(0,128,0,1);
var arr = [id];
app.getViewer().removeSelectedId(arr);
app.getViewer().overrideComponentsColorById(arr, colorRed);
app.getViewer().render();
})
$("-sharpstarting").on('click',function(){
var colorRed = new Glodon.Web.Graphics.Color(255,255,0, 1);
var arr = [id];
app.getViewer().removeSelectedId(arr);
app.getViewer().overrideComponentsColorById(arr, colorRed);
app.render();
})
$("-sharpyanqi").on("click",function(){
var colorRed = new Glodon.Web.Graphics.Color(255, 0, 0, 1);
var arr = [id];
app.getViewer().removeSelectedId(arr);
app.getViewer().overrideComponentsColorById(arr, colorRed);
app.render();
})
$.each($(".user-item"),function(item){
$(item).on("click",function(){
$(".bf-tree-toolbar").hide();
})
})
//
app.removeEventListener(Glodon.Bimface.Viewer.Viewer3DEvent.ContextMenu, contextMenuCallback)
}
app.addEventListener(Glodon.Bimface.Viewer.Viewer3DEvent.ContextMenu, contextMenuCallback)
}
Application scenario: for example, we have many shops, and we need to add their name to each store, or the name of each room in the office building ...
I want to customize the exposure, so I don t need to set manually....
large models do not open wireframes by default, while small models load wireframes by default as a developer, I hope I can have an API that can customize the effect of switching wireframes in order to adapt to different project needs. ...
you want the interface with mini map to customize the display ...