Snap.js侧面板默认打开? [英] Snap.js Side Panel Default To Open?
本文介绍了Snap.js侧面板默认打开?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Snap.js( https://github.com/jakiestfu/Snap.js/ )为网站构建一个新的框架,我想知道是否有人知道如何让您在访问该页面时将侧边栏默认为打开与关闭。我想强制用户必须关闭才能隐藏侧边栏(snap-drawer-left)。我
I am using Snap.js (https://github.com/jakiestfu/Snap.js/) to build a new framework for a site and I am wondering if anyone knows a way to have the sidebar default to open vs. closed when you come to the page. I want to force the user to have to toggle close in order to hide the sidebar (snap-drawer-left). I
推荐答案
另一个(不干净)解决方案是在最初加载页面时自动点击切换按钮:
Another (not clean) solution is to click on your "toggle" button automatically, when the page is initially loaded:
$timeout(function() {
angular.element(document.querySelector('#myToggle')).triggerHandler('click');
}, 0);
这篇关于Snap.js侧面板默认打开?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文