javascript - Call function on polymer navigation drawer panel -
i stuck. playing around polymer not manage phone call togglepanel function on drawer panel , code looks this:
<!doctype html> <html> <head> <!-- 1. load platform.js polyfill support. --> <script src="bower_components/platform/platform.js"></script> <!-- 2. utilize html import bring in element. --> <link rel="import" href="bower_components/core-ajax/core-ajax.html"> <link rel="import" href="bower_components/core-drawer-panel/core-drawer-panel.html"> <link rel="import" href="bower_components/core-toolbar/core-toolbar.html"> <link rel="import" href="bower_components/core-icon-button/core-icon-button.html"> </head> <body> <script> function opendrawer() { alert("fuck"); var drawer = document.getelementbyid("main-drawer"); drawer.togglepanel(); } </script> <core-drawer-panel id="main-drawer"> <div drawer style="background-color: #ff0000;"> </div> <div main style="background-color: #00ff00;"> <core-toolbar style="background-color: #8888ff;"> <core-icon-button icon="menu" onclick="opendrawer()" on-tap="opendrawer()"></core-icon-button> <div flex>pagetitle</div> </core-toolbar> </div> </core-drawer-panel> </body> </html>
the function gets called when click menu button nil more happens, made sure using alert.
i guess has shadow dom not sure. hope knows how phone call function.
core-drawer-panel
stays open time if window size less responsivewidth
. default remain open unless on tablet device or smaller.
if set responsivewidth
high, can alter behavior opens on demand.
<core-drawer-panel id="main-drawer" responsivewidth="900em">
http://jsbin.com/zorufa/2/edit
javascript polymer
No comments:
Post a Comment