I complied a script that tells multiple divs through this website http://www.martyregan.com/ to swap from the English div to the Japanese div by clicking the “Website Language” buttons.
It works the way I’d like it, though my client would like to know if it’s possible for the DIVs to stay on the Japanese DIV when going to another page.
The script currently tells the First Child class (of the two corresponding divs) to show and to hide any other sharing that class.
It also tells the first child class to be the active one, so I’d imagine there IS a way to implement some sort of cache/memory script to work with this.
$(function() {
$('#left-sidebar-inner .ddsmoothmenu-v, #right-sidebar-inner .ddsmoothmenu-v, #pb_sidebar .ddsmoothmenu-v, #main-content-inner .content, #main-content-inner .contact, #main-content-inner .right, #main-content-inner .program, #main-content-inner .worksnav, #main-content-inner .worksnav2, #main-content-inner .heading').hide();
$('#left-sidebar-inner .ddsmoothmenu-v:first, #right-sidebar-inner .ddsmoothmenu-v:first, #pb_sidebar .ddsmoothmenu-v:first, #main-content-inner .content:first, #main-content-inner .contact:first, #main-content-inner .right:first, #main-content-inner .program:first, #main-content-inner .worksnav:first, #main-content-inner .worksnav2:first, #main-content-inner .heading:first').show();
$('#language a:first').addClass('active');
$('#language a').click(function() {
if ($(this).hasClass('active') == true) {
return false;
}
else {
$('a.active').removeClass('active');
$(this).addClass('active');
$('#left-sidebar-inner .ddsmoothmenu-v, #right-sidebar-inner .ddsmoothmenu-v, #pb_sidebar .ddsmoothmenu-v, #main-content-inner .content, #main-content-inner .contact, #main-content-inner .right, #main-content-inner .program, #main-content-inner .worksnav, #main-content-inner .worksnav2, #main-content-inner .heading').fadeOut();
var contentToLoad = $(this).attr('href');
$(contentToLoad).fadeIn();
return false;
}
});
});
Any help would be greatly appreciated.
You can use cookies, sessions or even localstorage for example: