Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Apr 2013
    Posts
    30
    Thanks
    8
    Thanked 0 Times in 0 Posts

    how to resize script button?

    There is a service that allows you to have a "review this business" button on your website.
    They sent me a code for this button. The code is like this

    Code:
    <script> something.com/js/whtever.js </script>
    so when you place this code anywhere on your page, a clickable picture appears.

    I need to resize the picture. It's too big and I want to make it smaller. Is there anything I can do on my end? maybe I could use some css trick to force it to become smaller?

  • #2
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,989
    Thanks
    56
    Thanked 557 Times in 554 Posts
    you can maybe use css, depending on how the button is made. You would need to find the part of the script that makes the button (or in FF or Chrome right click>inspect element on the button) to figure out how to identify it in your css.

    Otherwise you may need to resize it using js. Or maybe you can't. Hard to say with the info given.

  • #3
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,103
    Thanks
    80
    Thanked 4,554 Times in 4,518 Posts
    Show us your site with the wrong size image. Should be easy enough to fix, but the fix depends on what they are generating as their code.

    Quite probably you don't need JavaScript to fix this.

    One example of a *START* on a fix:
    Code:
    <div id="fixImage">
    <script> something.com/js/whtever.js </script>
    </div>
    And then add to your CSS in the <head> of your page:
    Code:
    #fixImage img { width: 200px; height: 50px; }
    And that might be all you need, but we can't tell without seeing what is actually being generated. That is, incidentally, what the DEBUG tools (hit F12 in any modern browser) are for.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • #4
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    27,103
    Thanks
    80
    Thanked 4,554 Times in 4,518 Posts
    Ehhh...Xelawho: At *worst* you could find the <img> by looking for the image with a given src=xxx and then use JS to modify the style.

    But I'm betting that it can easily all be done with CSS.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •