Loading x3d_web_viewer/index.html +6 −2 Original line number Original line Diff line number Diff line Loading @@ -4,7 +4,9 @@ <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" href="x3dom-1.7.0/x3dom.css"> <link rel="stylesheet" href="x3dom-1.7.0/x3dom.css"> <link rel="stylesheet" href="viewmodel.css"> <link rel="stylesheet" href="viewmodel.css"> <script src="jquery-2.1.4.min.js"></script> <script type='text/javascript' src='x3dom-1.7.0/x3dom.js'> </script> <script type='text/javascript' src='x3dom-1.7.0/x3dom.js'> </script> <script src="bootstrap/js/bootstrap.min.js"></script> <script src="viewmodel.js"></script> <script src="viewmodel.js"></script> </head> </head> <body> <body> Loading Loading @@ -32,9 +34,11 @@ </div> </div> </div> </div> <div id="test:5" secretvalue='-4'></div> <div id="test:5" secretvalue='-4'></div> <script src="jquery-2.1.4.min.js"></script> <script src="bootstrap/js/bootstrap.min.js"></script> <script> <script> x3dom.runtime.ready = function() { console.log("X3D Ready"); //run(); } prerun(); prerun(); resize(); resize(); </script> </script> Loading x3d_web_viewer/viewmodel.js +195 −80 Original line number Original line Diff line number Diff line Loading @@ -17,6 +17,7 @@ var path = ""; var inherited_parameters = ""; var inherited_parameters = ""; function resize(){ function resize(){ console.log("resize"); var w = $(window).width(); var w = $(window).width(); var h = $(window).height(); var h = $(window).height(); if (w>h){ if (w>h){ Loading Loading @@ -65,12 +66,15 @@ function prerun(){ outline: "none" outline: "none" }).addClass("nooutline"); }).addClass("nooutline"); $("#main").prepend(x3d_cnv); x3d_cnv.click(function(){ x3d_cnv.click(function(){ stop_animation(); stop_animation(); }); }); var x3d_cnv_ni = $("<navigationinfo>",{id:"navi",type:"'examine' 'any'"}); var x3d_cnv_ni = $("<NavigationInfo>",{id:"navi",type:"'examine' 'any'",speed:"15",headlight:"true"}); var x3d_cnv_vp = $("<Viewpoint>").attr("fieldOfView","0.2"); var x3d_cnv_vp = $("<Viewpoint>").attr("fieldOfView","0.202"); var x3d_cnv_in = $("<inline>",{ var x3d_cnv_in = $("<inline>",{ id:"topinline", id:"topinline", Loading Loading @@ -101,7 +105,7 @@ function prerun(){ var settings = $("<div>").load(settings_file,function(response,status,xhr){ var settings = $("<div>").load(settings_file,function(response,status,xhr){ if (xhr.status==200){ if (xhr.status==200){ var xml = $.parseXML(response); var xml = $.parseXML(response); x3d_cnv_ni = $(xml).find("navigationinfo"); x3d_cnv_ni = $(xml).find("NavigationInfo"); x3d_cnv_vp = $(xml).find("Viewpoint"); x3d_cnv_vp = $(xml).find("Viewpoint"); showdefault = 1; showdefault = 1; } } Loading @@ -114,12 +118,12 @@ function prerun(){ height: x3d_cnv.height()+"px" height: x3d_cnv.height()+"px" }); }); $("#main").prepend(x3d_cnv); var element = document.getElementById('x3d_canvas'); var element = document.getElementById('x3d_canvas'); //on load: showAll()?! //on load: showAll()?! var showall = 8; //required minimum? var showall = 1; $(document).load(function(){ $(document).load(function(){ element.runtime.enterFrame = function() { element.runtime.enterFrame = function() { Loading Loading @@ -261,15 +265,9 @@ function prerun(){ }); }); rst_model.click(function(){ rst_model.click(function(){ $("Switch").each(function(){ model_run_cmd("reset","reset"); $(this).attr("whichChoice",0); $(this).find("Material").attr("transparency",0.1); $(this).attr("state","normal"); $(".btn-part[nsn="+$(this).attr("nsn")+"]").addClass("btn-success").removeClass("btn-primary"); $(".btn-part[nsn="+$(this).attr("nsn")+"]").css({opacity:"1.0"}); $(".btn-subpart[nsn="+$(this).attr("nsn")+"]").addClass("btn-success").attr("selected",true); }); btn_subpart_enableAll(); btn_subpart_enableAll(); model_init(); element.runtime.showAll("negY"); element.runtime.showAll("negY"); if (showdefault) element.runtime.resetView(); if (showdefault) element.runtime.resetView(); }); }); Loading @@ -295,36 +293,85 @@ function prerun(){ } } function run(){ function model_init(){ console.log("run3"); removeBOM(); resize(); showBOM(); showBOM(); bindCanvas(); resize(); //unbindCanvas(); //bindCanvas(); } } function showBOM(){ var block_load_events = false; //var bom = $("<ul>",{id:"bom",class:"list-group"}).css({ function run(){ var bom = $("<table>",{id:"bom"}).css({ console.log("run()"); position:"absolute", var inlines = $.find("Inline"); top:"5px", console.log("Found inlines: "+inlines.length); left:"705px" load_limit = inlines.length; load_counter = 0; if (load_limit==1){ tmp_inline = $(inlines[0]); tmp_inline.load(function(){ run2(); }); } } function run2(){ console.log("run2()"); var inlines = $.find("Inline"); console.log("Found new inlines: "+(inlines.length-1)); load_limit = inlines.length; for(var i=0;i<inlines.length;i++){ tmp_inline = $(inlines[i]); tmp_inline.load(function(){ load_counter++; console.log("Loaded "+load_counter); var progress_element = $.find("strong"); var progress_counter = $(progress_element).html(); progress_counter = progress_counter.split(" "); console.log("x3dom counter = "+progress_counter[1]); if (!block_load_events){ if (load_counter==1){ console.log("fire init (1)"); model_init(); //unbindCanvas(); bindCanvas(); } if (load_counter==(load_limit-2)){ console.log("fire init (limit-2)"); model_init(); //unbindCanvas(); bindCanvas(); } } }); }); } if (inlines.length==1) { bindCanvas(); model_init(); } } resize(); if (nobuttons){ function removeBOM(){ bom.css({ var top = $("#topinline"); display:"none" top.find("Inline").off("click"); }); top.find("button").off("click"); top.find("a").off("click"); $("#bom").remove(); } } var top = $("#topinline"); function place_camera(){ var top = $("#topinline"); //get top boundary box position //get top boundary box position var top_groups = top.find("Group"); var top_groups = top.find("Group"); var top_group = $(top_groups[0]); if (top_groups.length>0){ var top_group = $(top_groups[0]); var top_bboxcenter = top_group.prop('bboxCenter'); var top_bboxcenter = top_group.prop('bboxCenter'); top_bboxcenter = top_bboxcenter.split(" "); top_bboxcenter = top_bboxcenter.split(" "); var top_bboxsize = top_group.prop('bboxSize'); var top_bboxsize = top_group.prop('bboxSize'); Loading @@ -335,7 +382,8 @@ function showBOM(){ top_group.parent().prop("translation",(-top_bboxcenter[0])+" "+(-top_bboxcenter[1])+" "+(-top_bboxcenter[2])); top_group.parent().prop("translation",(-top_bboxcenter[0])+" "+(-top_bboxcenter[1])+" "+(-top_bboxcenter[2])); var fov = $("Viewpoint").attr("fieldOfView"); //var fov = $("Viewpoint").attr("fieldOfView"); var fov = $("Viewpoint").prop("fieldOfView"); console.log("field of view is "+fov); console.log("field of view is "+fov); Loading @@ -362,10 +410,51 @@ function showBOM(){ var element = document.getElementById('x3d_canvas'); var element = document.getElementById('x3d_canvas'); if (showdefault) element.runtime.resetView(); if (showdefault) element.runtime.resetView(); var x3d_cnv_ni = $("NavigationInfo"); x3d_cnv_ni.prop("speed",Math.round(Math.sqrt(view_distance)/10)); console.log("speed is "+x3d_cnv_ni.prop("speed")); } } function showBOM(){ console.log("showBOM"); //var bom = $("<ul>",{id:"bom",class:"list-group"}).css({ var bom = $("<table>",{id:"bom"}).css({ position:"absolute", top:"5px", left:"105px" }); if (nobuttons){ bom.css({ display:"none" }); } var top = $("#topinline"); place_camera(); //upper case was important //upper case was important var parts_unique = top.find("Inline"); var parts_unique = top.find("Inline"); //remove the first element - because of the specific model structure? //remove the first element - because of the specific model structure? parts_unique.splice(0,1); parts_unique.splice(0,1); //console.log("Unsorted"); //console.log(parts_unique); parts_unique.sort(function(a,b){ a = $(a).prop("nameSpaceName"); b = $(b).prop("nameSpaceName"); if(a > b) { return 1; } else if(a < b) { return -1; } else { return 0; } }); //console.log("Sorted"); //console.log(parts_unique); //set default transparency? //set default transparency? parts_unique.find("Material").attr("transparency",0.1); parts_unique.find("Material").attr("transparency",0.1); Loading Loading @@ -464,15 +553,21 @@ function showBOM(){ model_run_cmd(tmp_nsn,"click-ext"); model_run_cmd(tmp_nsn,"click-ext"); }); }); }); }); $("body").append(bom); $("body").append(bom); resize(); } } var blockclick = false; var blockclick = false; function unbindCanvas(){ $("Switch").off("mousedown").off("mousemove").off("click"); var canvas = document.getElementById("x3d_canvas"); canvas.removeEventListener("touchstart",touchstarted,false); canvas.removeEventListener("touchmove",touchmoved,false); } function bindCanvas(){ function bindCanvas(){ //whichChoice for Group tag didn't work //whichChoice for Group tag didn't work //$("Switch").on("mousedown").on("mousemove").on("click"); $("Switch").each(function(){ $("Switch").each(function(){ var hmm = $(this); var hmm = $(this); Loading @@ -496,18 +591,8 @@ function bindCanvas(){ }); }); var canvas = document.getElementById("x3d_canvas"); var canvas = document.getElementById("x3d_canvas"); canvas.addEventListener("touchstart",function(e){ canvas.addEventListener("touchstart",touchstarted,false); stop_animation(); canvas.addEventListener("touchmove",touchmoved,false); blockclick = false; moveTimeStamp = getTimeStamp(); }); canvas.addEventListener("touchmove",function(e){ //blockclick = true; if ((getTimeStamp()-moveTimeStamp)>100){ blockclick = true; } }); //click //click $("Switch").click(function(event){ $("Switch").click(function(event){ if (!blockclick){ if (!blockclick){ Loading @@ -528,10 +613,27 @@ function bindCanvas(){ }); }); } } function touchstarted(){ stop_animation(); blockclick = false; moveTimeStamp = getTimeStamp(); } function touchmoved(){ //blockclick = true; if ((getTimeStamp()-moveTimeStamp)>100){ blockclick = true; } } function stop_animation(){ function stop_animation(){ $("timeSensor").remove(); $("timeSensor").remove(); } } function start_animation(){ } function getTimeStamp(){ function getTimeStamp(){ var d = new Date(); var d = new Date(); return d.getTime(); return d.getTime(); Loading Loading @@ -585,8 +687,11 @@ function update_info(name,state,cmd){ } } function model_run_cmd(name,cmd){ function model_run_cmd(name,cmd){ var state = $("Switch[nsn="+name+"]").attr("state"); var state = ""; if (name!="reset"){ state = $("Switch[nsn="+name+"]").attr("state"); update_info(name,state,cmd); update_info(name,state,cmd); } switch(cmd){ switch(cmd){ case "right-click": case "right-click": //update status to "disabled" //update status to "disabled" Loading Loading @@ -718,6 +823,16 @@ function model_run_cmd(name,cmd){ $(".btn-part[nsn="+$(this).attr("nsn")+"]").css({opacity:"1.0"}); $(".btn-part[nsn="+$(this).attr("nsn")+"]").css({opacity:"1.0"}); }); }); break; break; case "reset": $("Switch").each(function(){ $(this).attr("whichChoice",0); $(this).find("Material").attr("transparency",0.1); $(this).attr("state","normal"); $(".btn-part[nsn="+$(this).attr("nsn")+"]").addClass("btn-success").removeClass("btn-primary"); $(".btn-part[nsn="+$(this).attr("nsn")+"]").css({opacity:"1.0"}); $(".btn-subpart[nsn="+$(this).attr("nsn")+"]").addClass("btn-success").attr("selected",true); }); break; default: default: return false; return false; } } Loading Loading
x3d_web_viewer/index.html +6 −2 Original line number Original line Diff line number Diff line Loading @@ -4,7 +4,9 @@ <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" href="bootstrap/css/bootstrap.min.css"> <link rel="stylesheet" href="x3dom-1.7.0/x3dom.css"> <link rel="stylesheet" href="x3dom-1.7.0/x3dom.css"> <link rel="stylesheet" href="viewmodel.css"> <link rel="stylesheet" href="viewmodel.css"> <script src="jquery-2.1.4.min.js"></script> <script type='text/javascript' src='x3dom-1.7.0/x3dom.js'> </script> <script type='text/javascript' src='x3dom-1.7.0/x3dom.js'> </script> <script src="bootstrap/js/bootstrap.min.js"></script> <script src="viewmodel.js"></script> <script src="viewmodel.js"></script> </head> </head> <body> <body> Loading Loading @@ -32,9 +34,11 @@ </div> </div> </div> </div> <div id="test:5" secretvalue='-4'></div> <div id="test:5" secretvalue='-4'></div> <script src="jquery-2.1.4.min.js"></script> <script src="bootstrap/js/bootstrap.min.js"></script> <script> <script> x3dom.runtime.ready = function() { console.log("X3D Ready"); //run(); } prerun(); prerun(); resize(); resize(); </script> </script> Loading
x3d_web_viewer/viewmodel.js +195 −80 Original line number Original line Diff line number Diff line Loading @@ -17,6 +17,7 @@ var path = ""; var inherited_parameters = ""; var inherited_parameters = ""; function resize(){ function resize(){ console.log("resize"); var w = $(window).width(); var w = $(window).width(); var h = $(window).height(); var h = $(window).height(); if (w>h){ if (w>h){ Loading Loading @@ -65,12 +66,15 @@ function prerun(){ outline: "none" outline: "none" }).addClass("nooutline"); }).addClass("nooutline"); $("#main").prepend(x3d_cnv); x3d_cnv.click(function(){ x3d_cnv.click(function(){ stop_animation(); stop_animation(); }); }); var x3d_cnv_ni = $("<navigationinfo>",{id:"navi",type:"'examine' 'any'"}); var x3d_cnv_ni = $("<NavigationInfo>",{id:"navi",type:"'examine' 'any'",speed:"15",headlight:"true"}); var x3d_cnv_vp = $("<Viewpoint>").attr("fieldOfView","0.2"); var x3d_cnv_vp = $("<Viewpoint>").attr("fieldOfView","0.202"); var x3d_cnv_in = $("<inline>",{ var x3d_cnv_in = $("<inline>",{ id:"topinline", id:"topinline", Loading Loading @@ -101,7 +105,7 @@ function prerun(){ var settings = $("<div>").load(settings_file,function(response,status,xhr){ var settings = $("<div>").load(settings_file,function(response,status,xhr){ if (xhr.status==200){ if (xhr.status==200){ var xml = $.parseXML(response); var xml = $.parseXML(response); x3d_cnv_ni = $(xml).find("navigationinfo"); x3d_cnv_ni = $(xml).find("NavigationInfo"); x3d_cnv_vp = $(xml).find("Viewpoint"); x3d_cnv_vp = $(xml).find("Viewpoint"); showdefault = 1; showdefault = 1; } } Loading @@ -114,12 +118,12 @@ function prerun(){ height: x3d_cnv.height()+"px" height: x3d_cnv.height()+"px" }); }); $("#main").prepend(x3d_cnv); var element = document.getElementById('x3d_canvas'); var element = document.getElementById('x3d_canvas'); //on load: showAll()?! //on load: showAll()?! var showall = 8; //required minimum? var showall = 1; $(document).load(function(){ $(document).load(function(){ element.runtime.enterFrame = function() { element.runtime.enterFrame = function() { Loading Loading @@ -261,15 +265,9 @@ function prerun(){ }); }); rst_model.click(function(){ rst_model.click(function(){ $("Switch").each(function(){ model_run_cmd("reset","reset"); $(this).attr("whichChoice",0); $(this).find("Material").attr("transparency",0.1); $(this).attr("state","normal"); $(".btn-part[nsn="+$(this).attr("nsn")+"]").addClass("btn-success").removeClass("btn-primary"); $(".btn-part[nsn="+$(this).attr("nsn")+"]").css({opacity:"1.0"}); $(".btn-subpart[nsn="+$(this).attr("nsn")+"]").addClass("btn-success").attr("selected",true); }); btn_subpart_enableAll(); btn_subpart_enableAll(); model_init(); element.runtime.showAll("negY"); element.runtime.showAll("negY"); if (showdefault) element.runtime.resetView(); if (showdefault) element.runtime.resetView(); }); }); Loading @@ -295,36 +293,85 @@ function prerun(){ } } function run(){ function model_init(){ console.log("run3"); removeBOM(); resize(); showBOM(); showBOM(); bindCanvas(); resize(); //unbindCanvas(); //bindCanvas(); } } function showBOM(){ var block_load_events = false; //var bom = $("<ul>",{id:"bom",class:"list-group"}).css({ function run(){ var bom = $("<table>",{id:"bom"}).css({ console.log("run()"); position:"absolute", var inlines = $.find("Inline"); top:"5px", console.log("Found inlines: "+inlines.length); left:"705px" load_limit = inlines.length; load_counter = 0; if (load_limit==1){ tmp_inline = $(inlines[0]); tmp_inline.load(function(){ run2(); }); } } function run2(){ console.log("run2()"); var inlines = $.find("Inline"); console.log("Found new inlines: "+(inlines.length-1)); load_limit = inlines.length; for(var i=0;i<inlines.length;i++){ tmp_inline = $(inlines[i]); tmp_inline.load(function(){ load_counter++; console.log("Loaded "+load_counter); var progress_element = $.find("strong"); var progress_counter = $(progress_element).html(); progress_counter = progress_counter.split(" "); console.log("x3dom counter = "+progress_counter[1]); if (!block_load_events){ if (load_counter==1){ console.log("fire init (1)"); model_init(); //unbindCanvas(); bindCanvas(); } if (load_counter==(load_limit-2)){ console.log("fire init (limit-2)"); model_init(); //unbindCanvas(); bindCanvas(); } } }); }); } if (inlines.length==1) { bindCanvas(); model_init(); } } resize(); if (nobuttons){ function removeBOM(){ bom.css({ var top = $("#topinline"); display:"none" top.find("Inline").off("click"); }); top.find("button").off("click"); top.find("a").off("click"); $("#bom").remove(); } } var top = $("#topinline"); function place_camera(){ var top = $("#topinline"); //get top boundary box position //get top boundary box position var top_groups = top.find("Group"); var top_groups = top.find("Group"); var top_group = $(top_groups[0]); if (top_groups.length>0){ var top_group = $(top_groups[0]); var top_bboxcenter = top_group.prop('bboxCenter'); var top_bboxcenter = top_group.prop('bboxCenter'); top_bboxcenter = top_bboxcenter.split(" "); top_bboxcenter = top_bboxcenter.split(" "); var top_bboxsize = top_group.prop('bboxSize'); var top_bboxsize = top_group.prop('bboxSize'); Loading @@ -335,7 +382,8 @@ function showBOM(){ top_group.parent().prop("translation",(-top_bboxcenter[0])+" "+(-top_bboxcenter[1])+" "+(-top_bboxcenter[2])); top_group.parent().prop("translation",(-top_bboxcenter[0])+" "+(-top_bboxcenter[1])+" "+(-top_bboxcenter[2])); var fov = $("Viewpoint").attr("fieldOfView"); //var fov = $("Viewpoint").attr("fieldOfView"); var fov = $("Viewpoint").prop("fieldOfView"); console.log("field of view is "+fov); console.log("field of view is "+fov); Loading @@ -362,10 +410,51 @@ function showBOM(){ var element = document.getElementById('x3d_canvas'); var element = document.getElementById('x3d_canvas'); if (showdefault) element.runtime.resetView(); if (showdefault) element.runtime.resetView(); var x3d_cnv_ni = $("NavigationInfo"); x3d_cnv_ni.prop("speed",Math.round(Math.sqrt(view_distance)/10)); console.log("speed is "+x3d_cnv_ni.prop("speed")); } } function showBOM(){ console.log("showBOM"); //var bom = $("<ul>",{id:"bom",class:"list-group"}).css({ var bom = $("<table>",{id:"bom"}).css({ position:"absolute", top:"5px", left:"105px" }); if (nobuttons){ bom.css({ display:"none" }); } var top = $("#topinline"); place_camera(); //upper case was important //upper case was important var parts_unique = top.find("Inline"); var parts_unique = top.find("Inline"); //remove the first element - because of the specific model structure? //remove the first element - because of the specific model structure? parts_unique.splice(0,1); parts_unique.splice(0,1); //console.log("Unsorted"); //console.log(parts_unique); parts_unique.sort(function(a,b){ a = $(a).prop("nameSpaceName"); b = $(b).prop("nameSpaceName"); if(a > b) { return 1; } else if(a < b) { return -1; } else { return 0; } }); //console.log("Sorted"); //console.log(parts_unique); //set default transparency? //set default transparency? parts_unique.find("Material").attr("transparency",0.1); parts_unique.find("Material").attr("transparency",0.1); Loading Loading @@ -464,15 +553,21 @@ function showBOM(){ model_run_cmd(tmp_nsn,"click-ext"); model_run_cmd(tmp_nsn,"click-ext"); }); }); }); }); $("body").append(bom); $("body").append(bom); resize(); } } var blockclick = false; var blockclick = false; function unbindCanvas(){ $("Switch").off("mousedown").off("mousemove").off("click"); var canvas = document.getElementById("x3d_canvas"); canvas.removeEventListener("touchstart",touchstarted,false); canvas.removeEventListener("touchmove",touchmoved,false); } function bindCanvas(){ function bindCanvas(){ //whichChoice for Group tag didn't work //whichChoice for Group tag didn't work //$("Switch").on("mousedown").on("mousemove").on("click"); $("Switch").each(function(){ $("Switch").each(function(){ var hmm = $(this); var hmm = $(this); Loading @@ -496,18 +591,8 @@ function bindCanvas(){ }); }); var canvas = document.getElementById("x3d_canvas"); var canvas = document.getElementById("x3d_canvas"); canvas.addEventListener("touchstart",function(e){ canvas.addEventListener("touchstart",touchstarted,false); stop_animation(); canvas.addEventListener("touchmove",touchmoved,false); blockclick = false; moveTimeStamp = getTimeStamp(); }); canvas.addEventListener("touchmove",function(e){ //blockclick = true; if ((getTimeStamp()-moveTimeStamp)>100){ blockclick = true; } }); //click //click $("Switch").click(function(event){ $("Switch").click(function(event){ if (!blockclick){ if (!blockclick){ Loading @@ -528,10 +613,27 @@ function bindCanvas(){ }); }); } } function touchstarted(){ stop_animation(); blockclick = false; moveTimeStamp = getTimeStamp(); } function touchmoved(){ //blockclick = true; if ((getTimeStamp()-moveTimeStamp)>100){ blockclick = true; } } function stop_animation(){ function stop_animation(){ $("timeSensor").remove(); $("timeSensor").remove(); } } function start_animation(){ } function getTimeStamp(){ function getTimeStamp(){ var d = new Date(); var d = new Date(); return d.getTime(); return d.getTime(); Loading Loading @@ -585,8 +687,11 @@ function update_info(name,state,cmd){ } } function model_run_cmd(name,cmd){ function model_run_cmd(name,cmd){ var state = $("Switch[nsn="+name+"]").attr("state"); var state = ""; if (name!="reset"){ state = $("Switch[nsn="+name+"]").attr("state"); update_info(name,state,cmd); update_info(name,state,cmd); } switch(cmd){ switch(cmd){ case "right-click": case "right-click": //update status to "disabled" //update status to "disabled" Loading Loading @@ -718,6 +823,16 @@ function model_run_cmd(name,cmd){ $(".btn-part[nsn="+$(this).attr("nsn")+"]").css({opacity:"1.0"}); $(".btn-part[nsn="+$(this).attr("nsn")+"]").css({opacity:"1.0"}); }); }); break; break; case "reset": $("Switch").each(function(){ $(this).attr("whichChoice",0); $(this).find("Material").attr("transparency",0.1); $(this).attr("state","normal"); $(".btn-part[nsn="+$(this).attr("nsn")+"]").addClass("btn-success").removeClass("btn-primary"); $(".btn-part[nsn="+$(this).attr("nsn")+"]").css({opacity:"1.0"}); $(".btn-subpart[nsn="+$(this).attr("nsn")+"]").addClass("btn-success").attr("selected",true); }); break; default: default: return false; return false; } } Loading