Hi,
i'd like to automatically open topbar-menu items (add active-top-menu css) on mobile devices.
In other words: when the app is shown on mobile devices the three dots button appears. When the users click on it i'd like that the menu items with submenu are automatically open.
Is it possible ?
thanks
Simone
topbar-menu : open in mobile
Forum rules
Please note that response time for technical support is within 3-5 business days.
Please note that response time for technical support is within 3-5 business days.
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
Please try;
Code: Select all
<script type="text/javascript">
$(function() {
var topbarItems = $('.topbar-items').children('li'),
isDesktop = window.innerWidth > 1024;
if(!isDesktop) {
topbarItems.addClass('active-top-menu');
}
$('#topbar-menu-button').on('click', function() {
topbarItems.addClass('active-top-menu');
});
$(window).resize(function() {
isDesktop = window.innerWidth > 1024;
if(isDesktop) {
topbarItems.removeClass('active-top-menu');
}
});
});
</script>
Github Profile: https://github.com/mertsincan
-
- Posts: 5281
- Joined: 29 Jun 2013, 12:38
Glad to hear, thanks for the update!
Github Profile: https://github.com/mertsincan
-
- Information
-
Who is online
Users browsing this forum: No registered users and 8 guests