Search code examples
onmouseover

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?


Solution

  • 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.