Note that there are some explanatory texts on larger screens.

plurals
  1. POHow I can make this css style and jquery working with Clinic div like Doctor div?
    text
    copied!<p>How I can make this css style and jquery working with Clinic div like Doctor div? When I do the Clinic div like the Doctor div The Clinic div stopped but the Doctor div work normally so How I can make this css style and jquery working with Clinic div like Doctor div?</p> <p>The html code:</p> <pre><code>&lt;div id="wrap" class="sidebar" &gt; &lt;div id="sidebar" style="height: 150px;"&gt; &lt;span id="toggleBtn"&gt;Doctor&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; &lt;div id="cwrap" class="csidebar" &gt; &lt;div id="csidebar" style="height: 150px;"&gt; &lt;span id="ctoggleBtn"&gt;Clinic&lt;/span&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>The CSS code:</p> <pre><code>#wrap { border: solid 1px #ccc; width: 1355px; margin: 0 auto; overflow: hidden; margin-bottom: 20px; } #sidebar { width: 220px; position: fixed; top: 1em; right: 1em; border-radius: 5px 5px 5px 5px; } #wrap.sidebar #sidebar { right: -254px; } #wrap.sidebar #mainContent, #wrap.sidebar #sidebar { margin: 10px; padding: 10px; box-shadow: 0px 0px 4px #888; } .nosidebar #mainContent, #wrap #sidebar { margin: 10px; padding: 10px; box-shadow: 0px 0px 4px #888; } #wrap.nosidebar #sidebar { right: 0; } #sidebar #toggleBtn { width: 60px; height: 30px; line-height: 30px; background: #2191c0; color: white; cursor: pointer; position: absolute; top: 10px; left: -60px; text-align: center; border-radius: 5px 0 0 5px; } #sidebar #toggleBtn:hover { background: #6eac2c; } #cwrap { border: solid 1px #ccc; width: 1355px; margin: 0 auto; overflow: hidden; margin-bottom: 20px; } #csidebar { width: 220px; position: fixed; top: 1em; right: 1em; border-radius: 5px 5px 5px 5px; } #cwrap.csidebar #csidebar { right: -254px; } #cwrap.csidebar #cmainContent, #cwrap.csidebar #csidebar { margin: 10px; padding: 10px; box-shadow: 0px 0px 4px #888; } .cnosidebar #cmainContent, #cwrap #csidebar { margin: 10px; padding: 10px; box-shadow: 0px 0px 4px #888; } #cwrap.cnosidebar #csidebar { right: 0; } #csidebar #ctoggleBtn { width: 60px; height: 30px; line-height: 30px; background: #2191c0; color: white; cursor: pointer; position: absolute; top: 50px; left: -60px; text-align: center; border-radius: 5px 0 0 5px; } #csidebar #ctoggleBtn:hover { background: #6eac2c; } </code></pre> <p>The JQuery code:</p> <pre><code>$(document).ready(function() { // Variables var objMain = $('#wrap'); var objSidebar = $('#nosidebar'); var objContent = $('#mainContent'); // Show sidebar function showSidebar() { objMain.removeClass('nosidebar'); objMain.addClass('sidebar'); objSidebar.animate({ 'right' : '-254px'},'slow'); objContent.animate({ 'margin-right': 270}, 'slow'); $.cookie('sidebar-pref2', 'use-sidebar', { expires: 30 }); } // Hide sidebar function hideSidebar() { objMain.removeClass('sidebar'); objMain.addClass('nosidebar'); objSidebar.animate({ 'right' : '0'},'slow'); objContent.animate({ 'margin-right': 0}, 'slow'); $.cookie('sidebar-pref2', null, { expires: 30 }); } // Sidebar separator var objSeparator = $('#toggleBtn'); objSeparator.click(function(e) { e.preventDefault(); if ( objMain.hasClass('nosidebar') ){ showSidebar(); } else { hideSidebar(); } }); // Load preference if ( $.cookie('sidebar-pref2') == null ){ objMain.removeClass('sidebar'); } }); </code></pre>
 

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