Show(), Hide(), and cookie
Hi,
I integrated on my website a script that allows the user to toggle the language by simply pressing the button related to the language.
I'd like to create cookie to define the same language for all the pages (loaded by ajax). I'd like the language to rest the same for each visit of the user too.
I'm kind of a noob in jquery so I thank a lot in advance all those who will help me..
Now the code :
Javascript :
$(document).ready(function() {
$('#fr_button').click(function(){
$('.us_description').hide();
$('.fr_description').show();
});
$('#us_button').click(function(){
$('.fr_description').hide();
$('.us_description').show();
});
});
HTML :
- <div class="fr_description">
// Metamorphosis est une série photographique à propos des mutations de l'être humain en réaction à son environnement. Chaque acte correspond à une étape de la transformation, à la fois physiologique et psychologique.
</div>
<div class="us_description">
// Metamorphosis is a photographic project about human mutation caused by his environnement. Each act relates to a transformation step, both physiological and psychological.
</div>
CSS :
- .fr_description {
display:none;
}