How do I resize a javascript widget?

3.8k views Asked by At

I need to insert this javascript widget on my website. The fact is if I insert this script on the website, the height is too big and there is a lot of "wasted" space. I was wondering if I could resize it to an height of 215px.

I have tried to include it in a div or iframe, but my attempts were unsuccessful. Is there a quick way to do it?

Thanks

<script src="https://next.fatsoma.com/widgets/scripts/events.js" data-reference="1b98e59f-5e65-42ef-bf8c-e2c389ebbb54"></script>
2

There are 2 answers

0
Paradoxis On

Fixed it for you, Wrap it inside a div, specify a height and set overflow: hidden;

height: 215px;
overflow: hidden;

JSFiddle demo

0
The Mahahaj On

Using the same technique Paradoxis did with a div wrapped around your widget which is an iFrame you can do this in css if you have the following:

    <div class="test">
       <script src="https://next.fatsoma.com/widgets/scripts/events.js" data-reference="1b98e59f-5e65-42ef-bf8c-e2c389ebbb54"></script>
    </div>

You can do this in your css:

    div.test iFrame {
        width:215px!important; //!important is used because the width is set inline on the iframe
    }