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 8165835
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:39:33+00:00 2026-06-06T19:39:33+00:00

ok so im having a hard time hiding some layout sections (divs in my

  • 0

ok so im having a hard time hiding some layout sections (divs in my layout page and im using mvc3).

I have this js fragment which is basically the main logic:

$('.contentExpand').bind('click', function () {
            $.cookie('right_container_visible', "false");
        });

        //Cookies Functions========================================================
        //Cookie for showing the right container
        if ($.cookie('right_container_visible') === 'false') {
            if ($('#RightContainer:visible')) {
                $('#RightContainer').hide();
            }
            $.cookie('right_container_visible', null);
        } else {
            if ($('#RightContainer:hidden')) {
                $('#RightContainer').show();
            }
        }

as you can see, im hidding the container whenever i click into some links that have a specific css. This seems to work fine for simple tests. But when i start testing it like

.contentExpand click –> detail button click –> .contentExpand click –> [here unexpected issue: the line $.cookie(‘right_container_visible’, null); is read but it doesnt set the vaule to null as if its ignoring it]

Im trying to understand whats the right logic to implement this. Anyone knows how i can solve this?

  • 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-06T19:39:34+00:00Added an answer on June 6, 2026 at 7:39 pm

    The best thing that worked for me was to create an event that can catch the resize of an element. I got this from another post but I dont remember which one. Anyway here is the code for the event:

    //Event to catch rezising============================================================================
    (function () {
    var interval;
    jQuery.event.special.contentchange = {
        setup: function () {
            var self = this,
            $this = $(this),
            $originalContent = $this.text();
            interval = setInterval(function () {
                if ($originalContent != $this.text()) {
                    $originalContent = $this.text();
                    jQuery.event.handle.call(self, { type: 'contentchange' });
                }
            }, 100);
        },
        teardown: function () {
            clearInterval(interval);
        }
    };
    })();
    //=========================================================================================
    
    //Function  to resize the right container============================================================
    (function ($) {
    $.fn.fixRightContainer = function () {
    
        this.each(function () {
    
            var width = $(this).width();
            var parentWidth = $(this).offsetParent().width();
            var percent = Math.round(100 * width / parentWidth);
            if (percent > 62) {
                $('#RightContainer').remove();
            }
        });
    };
    })(jQuery);
    //===================================================================================================
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having hard time with this project, I'm building a boat configurator which is
I'm having hard time getting this snippet to work. I have made a minimal
I'm having hard time wrapping my head around this. I have an array called
I'm having hard time with this simple ajax call function sendreq() { $.ajax({ dataType:
I'm having hard time trying to force https (ssl) to particular page on codeiginiter
I am having hard time digesting this syntax: void* operator new[](std::size_t, const std::nothrow_t&) throw();
I'm having hard time getting my head wrapped around this one - and it
im having hard time with this one, i want to create folder with write
I'm having hard time deciding which name to choose for my method. I think
I having hard time understanding importance and benefits of Annotations and so have two

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.