I was wondering if there is a way for me to get the mToggleContainer to show up on the homepage for mobile viewers. It shows up once a user enters a section.
I've tried to append the existing html into the homepage, but that didn't work. It just inserts the arrow which doesn't do anything when clicked. I assume I'm missing the script for the link press action.
P.S. This would be a nice feature to have by default.
I've tried to append the existing html into the homepage, but that didn't work. It just inserts the arrow which doesn't do anything when clicked. I assume I'm missing the script for the link press action.
- Code:
$(window).load(function() {
if (document.getElementsByClassName('mobile_title') && !document.getElementById('mToggleContainer')) {
var wrapper = document.createElement("div");
wrapper.id = 'mToggleContainer';
wrapper.innerHTML = '<a id="mToggleArrow" class="hiddenBar" href="#"> </a><ul id="mNavbar"><li><a class="navElement" href="/"><span class="navBtnIcon" style="background-position:-32px 0;"> </span><br><span class="navBtnLabel">Home</span></a></li><li><a class="navElement" href="/login"><span class="navBtnIcon" style="background-position:-64px 0;"> </span><br><span class="navBtnLabel">Log in</span></a></li><li><a class="navElement" href="index.forum?mobile&redirect=%2Ff19-announcements-and-news"><span class="navBtnIcon" style="background-position:0 0;"> </span><br><span class="navBtnLabel">Classic version</span></a></li></ul>';
var targetDiv = document.getElementById("top").getElementsByClassName("mobile_title")[0].appendChild(wrapper);
}
});
P.S. This would be a nice feature to have by default.
Last edited by Dr.Intern on March 3rd 2016, 5:03 pm; edited 1 time in total