I'm getting crazy over this script. It's not working. Can anyone give me a tip how to fix it?
My code: inside the tag in my html:
HTML Code:
<div class="cookie-message">
<p class="cookie-content">This website uses cookies. By Browsing this website you acconsent to the use of cookies. </p>
<p class="cookie-content"><button class="button">OK</button> <a href="http://here-goes-my-cookie-page.com">Read more about cookies</a></p>
</div>
My CSS file (it's more for styling): Code:
.cookie-message {
width: 100%;
background: #333;
color: #ddd;
padding: 1em 1em .5em;
position: fixed;
left: -5px;
bottom: 2em;
text-align: left;
z-index: 1;
}
And my javascript is following: Code:
<!--Start Cookie Script-->
<script>
$('.cookie-header').click(function() {
$('.cookie-content').slideToggle('fast');
$('.cookie-content button').click(function() {
$('.cookie-content').slideUp('fast');
});
});
</script>
<!--End Cookie Script-->
in fact I'm completely new to JavaScript so I copied it and inserted it before the </body> tag and obviously it is not working...
Can someone help me? I need the message to close when pressing the "ok" button...
document.ready? - learn.jquery.com/using-jquery-core/document-ready