I created a plugin to show modal when clicking on hotspot , by passing in html but I can't use the scroll wheel to move the content of the html , it only changes the zoom, I tried giving the plugin a value onhover_autoscrolling= "false" but still not working![]()
I created a plugin to show modal when clicking on hotspot , by passing in html but I can't use the scroll wheel to move the content of the html , it only changes the zoom, I tried giving the plugin a value onhover_autoscrolling= "false" but still not working![]()
Can you share some code on how you create the "modal" ?
![]() |
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 |
function krpanoplugin(){ var local = this; // save the 'this' pointer from the current plugin object var krpano = null; // the krpano and plugin interface objects var plugin = null; var xml_value = 100.0; // the value for a custom xml attribute // registerplugin - startup point for the plugin (required) // - krpanointerface = krpano interface object // - pluginpath = the fully qualified plugin name (e.g. "plugin[name]") // - pluginobject = the xml plugin object itself local.registerplugin = function(krpanointerface, pluginpath, pluginobject) { // get the krpano interface and the plugin object krpano = krpanointerface; plugin = pluginobject; // optionally - add some graphical content: // register the size of the content plugin.width = "100%"; plugin.height = "100%";plugin.align = "center" // use 100% width/height for automatic scaling with the plugin size var text = document.createElement("div"); text.style.cssText = "width:100%;height:100%;"+ "display:flex;color:white;background:rgba(10,50,100,0.5);"+ "align-items:center;justify-content:center;text-align:center;"; text.innerHTML = `<div id="myModal" class="modal"> <div class= "container-fluid"> <div class ="row" id ="content-3d"> <span class="close" id="close1">×</span> <div class="col-xs-12 col-sm-12 col-md-8 col-lg-8"> <!-- Modal content --> <div class="modal-content" id="modal-content"> <div id="model-viewer"> </div> </div> </div> <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4"> <div class="box"> <div id="table" class="infoTable"> <!-- Modal content --> <div class="modal-table"> <div id="model-viewer"> <div id="info" class="display" style="width:100%"> <div> <div style="margin: 10px 0px;font-size: 18px;color: rgb(255 255 255);display: block;background-color: #80808075;font-weight: 500;padding: 5px;">Tên sản phẩm: </div><span id="info-name">Unknown</span> <div id = "gioithieu" style="margin: 10px 0px;font-size: 18px;color: rgb(255 255 255);display: block;background-color: #80808075;font-weight: 500;padding: 5px;">Giới thiệu: </div><span id="info-features">Unknown</span> <div id ="thanhphan" style="margin: 10px 0px;font-size: 18px;color: rgb(255 255 255);display: block;background-color: #80808075;font-weight: 500;padding: 5px;">Thành phần: </div> <span id="info-specs">Unknown</span> <div id="luuy" style="margin: 10px 0px;font-size: 18px;color: rgb(255 255 255);display: block;background-color: #80808075;font-weight: 500;padding: 5px;">Thông tin khác: </div><span id="info-warning">Unknown</span> </div> </div> </div> </div> </div> </div> </div> </div> </div> </div>`; // the plugin 'sprite' variable is the internal html element of the plugin plugin.sprite.appendChild(text); } // unloadplugin - exit point for the plugin (optionally) // - will be called from krpano when the plugin will be removed // - everything that was added by the plugin should be removed here local.unloadplugin = function() { plugin = null; krpano = null; } // onresize (optionally) // - width,height = the new size for the plugin // - when not defined then only the krpano plugin html element will be sized local.onresize = function(width,height) { // not used in this example // the plugin content will resize automatically because // of the width=100%, height=100% CSS style return false; } } |
![]() |
Source code |
1 |
set(control.disablewheel, true); |
thank you very much, it's workThe setting onhover_autoscrolling= "false" is only for the scrollarea plugin (https://krpano.com/plugins/scrollarea/) Since you created your own plugin, you need to handle this yourself.
You can disable scrolling by setting the "disablewheel" of the control to true.
https://krpano.com/docu/xml/#control.disablewheel
krpano action code:
![]()
Source code
1 set(control.disablewheel, true);
And you can set it to false again when hiding the dialog.
gr,
kme
.