JordyvD
JordyvD

Reputation: 1615

Bootstrap apply true full screen

My HTML

  <div class="container-fluid">
    <div class="row">
        <div class="col-md-3">
            <div class="left-top"><a>Aanmelden</a></div>
            <div class="left-bottom"><a>Inloggen</a></div>
        </div>
        <div class="col-md-6">
            <img src="http://placehold.it/350x310" alt="" class="welcome-image"/>
        </div>
        <div class="col-md-3">
            <div class="right-top"></div>
            <div class="right-bottom"></div>
        </div>
    </div>
</div>

<script>
    $(document).ready(function () {
        $('[class^=left], [class^=right]').on('click', function () {
            $(this).addClass('fullscreen');
        });
    });
</script>

Whenever a button is clicked I'd like the parent square to go fullscreen, problem is:

Fiddle

Is there any way to achieve full screen whilst keeping the rest intact ?

Thanks, g3

Upvotes: 2

Views: 765

Answers (1)

BENARD Patrick
BENARD Patrick

Reputation: 31005

Bootply : http://www.bootply.com/DfNnqvTcRL

JS :

$(document).ready(function () {
    $('[class^=left], [class^=right]').on('click', function () {
        $(this).parent().toggleClass('parent-fullscreen');
        $(this).toggleClass('fullscreen');
    });
});

Css:

.parent-fullscreen{
  position:absolute;
  z-index:2000;
  width:100%;
  height:100%;
}
.fullscreen {
  width: 100%;
  height: 100%;
  position:absolute;
  top:0px;
}

Upvotes: 3

Related Questions