Some of my recent and not so recent questions have not been received well so I would like to mention that you should be kind. Some other people have even down voted my questions for no apparent reason with no comment suggesting their reasoning. I don't happen to like this very much as it puts me at risk of being blocked from asking. Yes, I know that some of my posts aren't exactly the most thought out but people tend to over react to a simple mistake that has been in front of me the whole time. Now, onto the question.
TL;DR: Be kind!
I have a settings div:
<div id="settings">
<p><a href="settings.php" class="settings">Search Settings</a></p>
<p><a href="sync.php" class="settings">Sync Settings</a></p>
<p><a href="anon.php" class="settings">Go Anonymous</a></p>
</div>
In order to open this div, I have a button:
<a onClick="openSettings()" href="#" class="footer" id="settings-button">Settings</a>
In order for the button to open the div, I have some simple JavaScript:
$("html").click(function(){
$("#settings").slideUp()
});
$("#settings").click(function(e){
e.stopPropagation();
});
function openSettings() {
$("#settings").slideDown();
}
Now, for what ever reason, when I click the button, it opens the div and the closes it again. I find this very peculiar. At this point, I have no idea what to do. I have read two Stack Overflow questions that were answered successfully and I have even tried copy and pasting the exact code with no results.
Those articles here:
jQuery: Hide popup if click detected elsewhere
How do I make this popup box disappear when I click outside?
I am so very confused at this point and I don't quite know what to do. Any help with this is very much appreciated.
Best Regards, Emanuel
EDIT: Alright. It appears that I have forgotten to include my CSS styling, so here it is:
div#settings {
display: none;
position: absolute;
right: 20px;
bottom: 50px;
background-color: #9E9E9E;
width: 200px;
box-shadow: 2px 2px 10px #000000;
border-style: solid;
border-color: #000000;
border-width: 1px;
color: #551A8B;
padding-left: 15px;
}