Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9265437
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:04:08+00:00 2026-06-18T14:04:08+00:00

I complied a script that tells multiple divs through this website http://www.martyregan.com/ to swap

  • 0

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;
}
});
});

Here is the example I was given:

$('a.en').click(function(){
localStorage.setItem('language', 'en');
});

$('a.fr').click(function(){
localStorage.setItem('language', 'fr');
});

// to get the language value use getItem
localStorage.getItem('language');
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T14:04:09+00:00Added an answer on June 18, 2026 at 2:04 pm

    your question can be solved quickly,
    so instead of telling you once again that this can be solved by any freelancer
    i hope i just did it 😉

    this is untested, since it would be pretty too much effort to create the testenvironment,

    but it should work, IF you add an html id tag to the links of the language chooser,

    <div id="language">
        <a id="en" href="#mainnaven, #contenten, #contacten, #works_righten, #works_programen,  #worksnaven,  #worksnav2en, #works_headen" class="">
            <img src="http://www.martyregan.com/files/1413/5826/9756/en.png">
        </a>
        <a id="jp" href="#mainnavjp, #contentjp, #contactjp, #works_rightjp, #works_programjp, #worksnavjp, #worksnav2jp, #works_headjp" class="active">
            <img src="http://www.martyregan.com/files/5213/5826/9759/jp.png">
        </a>
    </div>
    

    notice the id=”en” and the id=’jp’ that i added to the divs.

    if thats not possible we will have to add a few more lines.

    the script then would be:

    jQuery(function($) {
      var language = localStorage.getItem('language');
    
      if(!language) {
        language = "en";
      }
    
      $('#left-sidebar-inner .ddsmoothmenu-v').fadeOut(function(){
    
        var link =  $('#'+language);
        var contentToLoad = link.attr('href');
    
        $('.active').removeClass('active');
        link.addClass('active');
    
        $(contentToLoad).fadeIn();
      });
    
    
      $('#left-sidebar-inner .ddsmoothmenu-v').show();
      $('#language a:first').addClass('active');
    
      $('#language a').live('click',function() {
    
        if ($(this).hasClass('active') == true) {
            return false;
        } else {
            $('a.active').removeClass('active');
            $(this).addClass('active');
    
            var language = 'jp';
            if($(this).attr('href').indexOf('mainnaven') > 0 ) {
              language = 'en'
            }
    
            localStorage.setItem('language', language);
    
            $('#left-sidebar-inner .ddsmoothmenu-v').fadeOut();
            var contentToLoad = $(this).attr('href');
    
            $(contentToLoad).fadeIn();
    
            return false;
        }
      });
    });
    

    have fun

    jascha

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I complied a script that tells multiple divs through this website http://www.martyregan.com/ to swap
I'd like to be able to run a script that parsed through the twitter
Given that: The asset pipeline is fairly complex (coming from ASP.NET MVC, this is
I was looking through some compiled coffee-script code, and I noticed something like the
I have a nant build script that specifies the compilation of various Visual Studio
I'm writing a Perl script that does date operations that need to take holidays
I have a script that compiles few programs and puts the output into a
I am currently trying to make a bash testing script that will... 1) Go
I am running Selenium Server. I'm also launching an automated test script that I
There is a view in my DB that someone defined with a * from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.