Visit my Personal Website at this Link StyleSource-Library BETA
While I was working on some content, I created a Container Enabler/Disabler Button. This button is positioned in the Navigation Bar on the top right and works perfectly by adding a container class to the div tag. I also added a feature that notifies the user if the container class is activated or not. However, there seems to be a problem as it displays the same notification "Container is ON" when pressed twice instead of toggling between "Container is ON" and "Container is OFF." It also throws errors in the console such as "Uncaught SyntaxError: Unexpected token ILLEGAL" and "Uncaught SyntaxError: Unexpected token )." Here's the code snippet for activating the container:
HTML
<li>
<a href="#" id="ToggleContainer-NoficationStatus" class="tooltipped toggle-container waves-effect waves-red" data-position="bottom" data-delay="100" data-tooltip="Iam a Container Adder-Disabler :)">
<i class="material-icons">web</i>
</a>
</li>
Jquery
<script type="text/javascript">
$('.toggle-container').click(function(){
$('#adder').toggleClass('container');
});
</script>
To activate the Notification but it actually not showing or showing an error, here's the code for Toggling The Notification when the Container Class Is detected or not in the div tag.
<script type="text/javascript">
$(document).ready(function(){
$("#ToggleContainer-NoficationStatus").click(function() {
$(#adder).hasClass("container");
setTimeout(function() {
Materialize.toast('Container Layout is On.', 2000);
}, 500);
});
});
</script>
<script type="text/javascript">
$(document).ready(function(){
$("#ToggleContainer-NoficationStatus").click(function() {
(!$(#adder).hasClass("container"));
setTimeout(function() {
Materialize.toast('Container Layout is Off.', 3000);
}, 1000);
});
});
</script>
<div id="adder" class=""> //This is where the Container Class Goes on
I have been trying to solve this issue for the past 3 hours and can't find a solution online. Even though there are resources available, none seem to work. My Mother is getting frustrated with me spending 12 hours on the computer working on this personal project. Can anyone offer assistance on how to fix this error? Any help would be greatly appreciated. :)
INFO To locate the error, please visit my website StyleSource-Library BETA. The error is related to the button in the top right section resembling a Web Layout Icon.