Note that there are some explanatory texts on larger screens.

plurals
  1. POWhen resize, the div's width back to normal
    primarykey
    data
    text
    <h2>The problem</h2> <p>I have two columns: the first has responsive width, while the other has fixed width. I am using a plug-in who needs the width of the responsive column, then I made this function to calculate the width:</p> <pre><code>$(".container-content").css( "width", $(".site-container").outerWidth() - $(".sidebar").outerWidth() ); </code></pre> <p>But when the page loads, the width isn't correct, I have to resize the window to get the width fixed.</p> <h2>A bit of my code</h2> <p><strong>CSS</strong></p> <pre class="lang-css prettyprint-override"><code>.site-container { width: 98%; background-color: #fff; box-shadow: #b8b8b8 0 2px 3px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; position: relative; left: 0; right: 0; margin: 0 auto; } .container-body .container-content { overflow-y: hidden; position: relative; } </code></pre> <p>Let me know if you need something more.</p> <h2>Update v1</h2> <p>I believe we are closer to the resolution of my problem. I have Isotope on my application to create a mosaic. When the page loads, Isotope is called. The structure of my mosaic is: <code>ul</code> > <code>li</code>. On CSS, <code>li</code> as defined as <code>display: none</code> to just display the mosaic's list after the page loader disappear.</p> <p>When jQuery displays the li's content (with <code>fadeIn()</code>), I think he doesn't calculate properly the width (or not fully).</p> <p>Follow the code:</p> <pre><code>// Isotope jQuery("ul.products-list").isotope({ itemSelector: "li", masonry: { gutterWidth: 15 } }, function () { $(this).parent().prepend("&lt;div class=\"products-loader\"&gt;&lt;p&gt;Loading application&lt;/p&gt;&lt;/div&gt;"); $(".products-loader").delay(1000).fadeOut(300, function () { $("ul.products-list li").fadeIn("slow", function () { $(".products-loader").remove(); $(".container-content").perfectScrollbar({ wheelSpeed: 100 }); }); }); }); </code></pre> <p>Any ideas?</p> <h2>Update v2 — I solved!</h2> <p>See my own answer.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload