nolo
(Manuel)
26 يناير 2023، 2:58م
1
When I enable the sidebar navigation, the sidebar shows by default and the first time a user clicks the menu icon, it will hide the sidebar.
Can I reverse this setup, so the landing page shows in full width on initial page load and when a user clicks the menu icon it will reveal the sidebar?
This is somewhat similar as the sidebar seems to be controlled by aria-expanded
attribute
I’d like to show the content of a quoted post (link) by default
The expand arrow is a bit too subtle.
What methods do I have available to do this?
Thanks
[quote post]
إعجاب واحد (1)
nolo
(Manuel)
26 يناير 2023، 4:00م
3
Thanks for sharing this! That would be this approach:
<script>
$(document).ready(function(){
jQuery(function(){
jQuery('button.btn-sidebar-toggle).click();
});
})
</script>
Which effects the sidebar to slide to the hidden state. So there’s an automatic animation on document ready which is not that ideal.
I actually also thought that the sidebar is controlled by the aria attribute, so I had tried this:
<script>
$(document).ready(function(){
$("button.btn-sidebar-toggle").attr("aria-expanded","false");
})
</script>
But the attribute is not controlling the state, it’s only indicating it. So that snippet will change the attribute, but not the state
إعجاب واحد (1)
Don
27 يناير 2023، 10:00ص
4
Hello Nolo,
I’ve made a component to achieve this. I hope it helps
4 إعجابات
nolo
(Manuel)
27 يناير 2023، 10:31ص
5
Oh yes that helps indeed! That’s what I fumbled with but couldn’t get it to work…
Thanks so much for sharing @Don
إعجابَين (2)
Thank you, Don! It’s brilliant!
إعجاب واحد (1)
system
(system)
تم إغلاقه في
26 فبراير 2023، 1:43م
7
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.