Modifying a third-party/external Script (JS)

Asked

Viewed 165 times

1

I need to use an external script that generates a form (so far so good, it is working) ... Once the script is inserted into the page, I need the form Abels (generated by the script) to be responsive (I believe with a window onresize.) ... But how do I do that, since I don’t have access to the script that generates the form?

I put window.onresize on the page but it has no effect on the form.


Exemplo

I put in an HTML script that generates a form... The form itself works, but I needed to make his Abels responsiveis

I created a script for window.onresize and pointed out the getElementbyId for the ID of the script div I want to change, but error it

<script type="text/javascript">
window.onload = function(){
    document.getElementById('hot-spot-isc-0faaa9d5ee2e31146d01').innerHTML = document.body.offsetWidth;

}
window.onresize = function(){
    document.getElementById('hot-spot-isc-0faaa9d5ee2e31146d01').innerHTML = document.body.offsetWidth;

    var bodyWidth = document.body.offsetWidth;
    if( bodyWidth>800 )
        fs = ( bodyWidth-800 )/10;
    else
        fs = 0;

    document.getElementsByTagName('h1')[0].style.fontSize = (fs+20)+'px';
    document.body.style.fontSize = (fs+12)+'px';
}
</script>
  • 2

    Can you be more specific? without knowing which HTML is hard to help. Maybe you can only do this with CSS...

  • @Sergio answered from below

  • What’s the mistake that comes

  • I didn’t understand exactly what the mistake is. But use the Media Rule CSS can be a viable solution.

  • Wow, have you ever thought about using bootstrap to do all this work for you? If not, you get the tip: https://getbootstrap.com Strong hug.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.