javascript, When right div is hidden left div has to be 100% width


fixed it by editing mplungjan's code to this:

$(function() {
    $("#foo").on("click",function() {
        if ($(this).is(':checked')) $('#checked-a').show('fast',function() {
        }) ;
        else $('#checked-a').show('fast',function(){


i would like to have the left div to be 100% (current 60%) when right div (40%) is hidden.

screenshot with checked checkbox:

screenshot with unchecked checkbox:

now i would like to make the left div cover the whole width of the page (100%).

here is my code:


      <script type="text/javascript">
    ($('input[name = "foo"]').is(':checked'))


    <div class="content2" id="checked-a">
    <%= yield %>

html input:

<input type="checkbox" checked="checked" name="foo" value="1" onclick="$(this).is(':checked') && $('#checked-a').slideDown('fast') || $('#checked-a').slideUp('fast');"/>

hope someone could help :)


Perhaps you mean this? DEMO

$(function() {
    $("#foo").on("click",function() {
        if ($(this).is(':checked')) $('#checked-a').slideDown('fast',function() {
        }) ;
        else $('#checked-b').slideUp('fast',function(){

Need Your Help

CSS3 Liner Gradient solid color size

html5 css3 gradient

I want to create liner gradient with different color with fixed width of each for for example :

Swiping between UITableViewController detail items

ios uinavigationcontroller uitableview

I have a UITableViewController derived class. In tableView:didSelectRowAtIndexPath:, I create a detail view controller vc and push it with [self.navigationController pushViewController: vc animated...