Multiple types of onmouseover=“bigImg(this)” one one sheet
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
add a comment |
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
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 putonmouseover="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
add a comment |
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
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
onmouseover
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 putonmouseover="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
add a comment |
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 putonmouseover="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
add a comment |
2 Answers
2
active
oldest
votes
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.
add a comment |
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.
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
answered Nov 21 '18 at 10:49
mhigamhiga
14
14
add a comment |
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
edited Nov 22 '18 at 2:39
answered Nov 21 '18 at 10:58
mhigamhiga
14
14
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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