How to fit the size of transform scale in the browser size?

1.8k views Asked by At

I am using skrollr to create scrolling animation effects. My problem is in my page there is a horizontal scrollbar at the bottom. My findings is this happens because of my translate:scale(). It creates a margin.

Here's my sample output

enter image description here

As you can see my page doesn't fit in browser because of the scale maybe.

Here's my sample code:

<div class="rows">
    <div class="col-md-6 left_detail_field" data-1600="opacity: 0; transform:scale(0);" data-2000="opacity: 1; transform: scale(1)">
        <h1 class="text-left">SERVICES</h1>

        <p>We promote qualitative transformations of the system trustee business (hardware, software, and infrastructure), and we provide independent system services in processor peripheral field.</p>

        <a href="#" class="pull-right link-btn">VIEW DETAILS > </a>
        <div class="clearfix"></div>
    </div>
    <div class="col-md-6 right_kanji_field">
        <img src="images/line-2-kanji.png" class="img-responsive" data-1800="opacity: 0; transform: scale(2);" data-1900="opacity: 1; transform: scale(1);"  /> <!-- this is the scale that creates the margin gap -->
    </div>
</div>

Then this one is the image that has a scale

<img src="images/line-2-kanji.png" class="img-responsive" data-1800="opacity: 0; transform: scale(2);" data-1900="opacity: 1; transform: scale(1);"  /> 

Can you help me?

1

There are 1 answers

3
Mohod Sandhya On

You need to use jquery of resize and change transform scale as per window resize. Example:

$(window).on('load', function(){  
    var win = $(this); 
    if (win.width() < 769) { 
        $(element).css('transform','scale(0.2)');
    } 
}