浏览代码

Handle initializer scrollToTop Event

Riccardo Balbo 3 年之前
父节点
当前提交
17787945d8
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      content/start.md

+ 6 - 1
content/start.md

@@ -79,12 +79,17 @@ You can access the tool directly from [here](https://start.jmonkeyengine.org) or
                 if(event.name=="jme-initializer-resize"){
                     const height=event.height;
                     document.querySelector("#jme-initializer").style.height = height + 'px';
-                }        
+                }else if(event.name=="jme-initializer-scrollToTop"){
+                    const el=document.querySelector("#jme-initializer");
+                    window.scrollToElement(el);
+                }     
             }catch(e){
                 console.log(e);
             }
             
         });
+
+
     }
 </script>