Multiple types of onmouseover=“bigImg(this)” one one sheet












0















I'm such a novice and I'm sure there is a simple solution so I humbly ask for your assistance.



I have a page that has two different types of image buttons; square and rectangle. The 'onmouseover="bigImg(this)"' works great with the square images but when it comes to the rectangular image button, it scrunches it up to try and make a square.



I know that the image size is defined like this:



function bigImg(x) {
x.style.height = "64px";
x.style.width = "64px";
}

function normalImg(x) {
x.style.height = "32px";
x.style.width = "32px";
}


My problem is that it applies to the rectangular image buttons too.



Question: Is there a way to make those "functions" into a class or id where I could specify it on the code...
OR is there a better solution?










share|improve this question























  • Please go read How to Ask and Minimal, Complete, and Verifiable example, and then edit your question accordingly. If you don’t want this function to be called for your rectangular images - then why do you put onmouseover="bigImg(this)" on those in the first place?

    – misorude
    Nov 20 '18 at 11:32











  • I found a sloppy solution where I resize my long button on Photoshop to work with the same heights as the other icons. I set the width = "auto". If any anyone has a more elegant solution, please, please, please let me know.

    – mhiga
    Nov 21 '18 at 8:32


















0















I'm such a novice and I'm sure there is a simple solution so I humbly ask for your assistance.



I have a page that has two different types of image buttons; square and rectangle. The 'onmouseover="bigImg(this)"' works great with the square images but when it comes to the rectangular image button, it scrunches it up to try and make a square.



I know that the image size is defined like this:



function bigImg(x) {
x.style.height = "64px";
x.style.width = "64px";
}

function normalImg(x) {
x.style.height = "32px";
x.style.width = "32px";
}


My problem is that it applies to the rectangular image buttons too.



Question: Is there a way to make those "functions" into a class or id where I could specify it on the code...
OR is there a better solution?










share|improve this question























  • Please go read How to Ask and Minimal, Complete, and Verifiable example, and then edit your question accordingly. If you don’t want this function to be called for your rectangular images - then why do you put onmouseover="bigImg(this)" on those in the first place?

    – misorude
    Nov 20 '18 at 11:32











  • I found a sloppy solution where I resize my long button on Photoshop to work with the same heights as the other icons. I set the width = "auto". If any anyone has a more elegant solution, please, please, please let me know.

    – mhiga
    Nov 21 '18 at 8:32
















0












0








0








I'm such a novice and I'm sure there is a simple solution so I humbly ask for your assistance.



I have a page that has two different types of image buttons; square and rectangle. The 'onmouseover="bigImg(this)"' works great with the square images but when it comes to the rectangular image button, it scrunches it up to try and make a square.



I know that the image size is defined like this:



function bigImg(x) {
x.style.height = "64px";
x.style.width = "64px";
}

function normalImg(x) {
x.style.height = "32px";
x.style.width = "32px";
}


My problem is that it applies to the rectangular image buttons too.



Question: Is there a way to make those "functions" into a class or id where I could specify it on the code...
OR is there a better solution?










share|improve this question














I'm such a novice and I'm sure there is a simple solution so I humbly ask for your assistance.



I have a page that has two different types of image buttons; square and rectangle. The 'onmouseover="bigImg(this)"' works great with the square images but when it comes to the rectangular image button, it scrunches it up to try and make a square.



I know that the image size is defined like this:



function bigImg(x) {
x.style.height = "64px";
x.style.width = "64px";
}

function normalImg(x) {
x.style.height = "32px";
x.style.width = "32px";
}


My problem is that it applies to the rectangular image buttons too.



Question: Is there a way to make those "functions" into a class or id where I could specify it on the code...
OR is there a better solution?







onmouseover






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 20 '18 at 11:30









mhigamhiga

14




14













  • Please go read How to Ask and Minimal, Complete, and Verifiable example, and then edit your question accordingly. If you don’t want this function to be called for your rectangular images - then why do you put onmouseover="bigImg(this)" on those in the first place?

    – misorude
    Nov 20 '18 at 11:32











  • I found a sloppy solution where I resize my long button on Photoshop to work with the same heights as the other icons. I set the width = "auto". If any anyone has a more elegant solution, please, please, please let me know.

    – mhiga
    Nov 21 '18 at 8:32





















  • Please go read How to Ask and Minimal, Complete, and Verifiable example, and then edit your question accordingly. If you don’t want this function to be called for your rectangular images - then why do you put onmouseover="bigImg(this)" on those in the first place?

    – misorude
    Nov 20 '18 at 11:32











  • I found a sloppy solution where I resize my long button on Photoshop to work with the same heights as the other icons. I set the width = "auto". If any anyone has a more elegant solution, please, please, please let me know.

    – mhiga
    Nov 21 '18 at 8:32



















Please go read How to Ask and Minimal, Complete, and Verifiable example, and then edit your question accordingly. If you don’t want this function to be called for your rectangular images - then why do you put onmouseover="bigImg(this)" on those in the first place?

– misorude
Nov 20 '18 at 11:32





Please go read How to Ask and Minimal, Complete, and Verifiable example, and then edit your question accordingly. If you don’t want this function to be called for your rectangular images - then why do you put onmouseover="bigImg(this)" on those in the first place?

– misorude
Nov 20 '18 at 11:32













I found a sloppy solution where I resize my long button on Photoshop to work with the same heights as the other icons. I set the width = "auto". If any anyone has a more elegant solution, please, please, please let me know.

– mhiga
Nov 21 '18 at 8:32







I found a sloppy solution where I resize my long button on Photoshop to work with the same heights as the other icons. I set the width = "auto". If any anyone has a more elegant solution, please, please, please let me know.

– mhiga
Nov 21 '18 at 8:32














2 Answers
2






active

oldest

votes


















0














I found a sloppy solution where I resize my long button on Photoshop to work with the same heights as the other icons. I set the width = "auto".



If any anyone has a more elegant solution, please, please, please let me know.



Thank you.






share|improve this answer































    0














    As a newbie, I find a lot of answers here. Thank you all for your posts.



    On this one, I just showed you all how much of a newbie I am...



    BigImg is just a name, not a function. I just changed BigImg to BigButton and I was able to isolate the buttons from everything else.



    Hope this helps anyone else that was in my shoe.






    share|improve this answer

























      Your Answer






      StackExchange.ifUsing("editor", function () {
      StackExchange.using("externalEditor", function () {
      StackExchange.using("snippets", function () {
      StackExchange.snippets.init();
      });
      });
      }, "code-snippets");

      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "1"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53392064%2fmultiple-types-of-onmouseover-bigimgthis-one-one-sheet%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      0














      I found a sloppy solution where I resize my long button on Photoshop to work with the same heights as the other icons. I set the width = "auto".



      If any anyone has a more elegant solution, please, please, please let me know.



      Thank you.






      share|improve this answer




























        0














        I found a sloppy solution where I resize my long button on Photoshop to work with the same heights as the other icons. I set the width = "auto".



        If any anyone has a more elegant solution, please, please, please let me know.



        Thank you.






        share|improve this answer


























          0












          0








          0







          I found a sloppy solution where I resize my long button on Photoshop to work with the same heights as the other icons. I set the width = "auto".



          If any anyone has a more elegant solution, please, please, please let me know.



          Thank you.






          share|improve this answer













          I found a sloppy solution where I resize my long button on Photoshop to work with the same heights as the other icons. I set the width = "auto".



          If any anyone has a more elegant solution, please, please, please let me know.



          Thank you.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 21 '18 at 10:49









          mhigamhiga

          14




          14

























              0














              As a newbie, I find a lot of answers here. Thank you all for your posts.



              On this one, I just showed you all how much of a newbie I am...



              BigImg is just a name, not a function. I just changed BigImg to BigButton and I was able to isolate the buttons from everything else.



              Hope this helps anyone else that was in my shoe.






              share|improve this answer






























                0














                As a newbie, I find a lot of answers here. Thank you all for your posts.



                On this one, I just showed you all how much of a newbie I am...



                BigImg is just a name, not a function. I just changed BigImg to BigButton and I was able to isolate the buttons from everything else.



                Hope this helps anyone else that was in my shoe.






                share|improve this answer




























                  0












                  0








                  0







                  As a newbie, I find a lot of answers here. Thank you all for your posts.



                  On this one, I just showed you all how much of a newbie I am...



                  BigImg is just a name, not a function. I just changed BigImg to BigButton and I was able to isolate the buttons from everything else.



                  Hope this helps anyone else that was in my shoe.






                  share|improve this answer















                  As a newbie, I find a lot of answers here. Thank you all for your posts.



                  On this one, I just showed you all how much of a newbie I am...



                  BigImg is just a name, not a function. I just changed BigImg to BigButton and I was able to isolate the buttons from everything else.



                  Hope this helps anyone else that was in my shoe.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Nov 22 '18 at 2:39

























                  answered Nov 21 '18 at 10:58









                  mhigamhiga

                  14




                  14






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Stack Overflow!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53392064%2fmultiple-types-of-onmouseover-bigimgthis-one-one-sheet%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      'app-layout' is not a known element: how to share Component with different Modules

                      android studio warns about leanback feature tag usage required on manifest while using Unity exported app?

                      WPF add header to Image with URL pettitions [duplicate]