#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    14
    Rep Power
    0

    Applying a style to a onmouseover event


    Hi

    Just one question. How do you apply a style to an onmouseover event?


    Thanks.
  2. #2
  3. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,129
    Rep Power
    4304
    You need to give more detail for anyone to be able to answer your question.

    *** Thread Moved to JavaScript forum ***
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    14
    Rep Power
    0

    Style effect on mouseover event


    Hi

    Just a question. How do I get an effect from a style to a mouseover event?

    Here is my code (?)



    Code:
    <img id="mediamenu" onMouseOver="  document.all['mediamenu'].this.style.position='absolute'; document.all['mediamenu'].this.style.top='0%'; document.all['mediamenu'].this.style.left='0%'; this.src='mediamenu.jpg'" onMouseOut="this.src='mediaoption.jpg'" src='mediaoption.jpg'" width="207" height="55"/></p>
  6. #4
  7. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,129
    Rep Power
    4304
    "document.all" is obsolete. It was an IE4 feature.

    The DOM2 standard supported by modern browsers is this:
    Code:
    document.getElementById('mediamenu')
    However, your code doesn't make much sense. You don't need either:
    Code:
    onMouseOver=" this.style.position='absolute'; this.style.top='0%'; this.style.left='0%'; this.src='mediamenu.jpg'"
    P.S. Why did you close the thread?

    EDIT: I've now merged the two threads.
    Last edited by Kravvitz; April 24th, 2013 at 02:06 AM.
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    14
    Rep Power
    0

    style of mouseover event


    Hi

    I am having problems with applying a style to position a submenu.
    The submenu is mediamenu.jpg.
    Here is what I have done so far.

    Code:
    <a href=""><img src="mediaoption.jpg" onFocus="window.status='focussed'" onClick="window.status="false"" onMouseOver="this.style.top="434px";this.style.left="55px";this.src='mediamenu.jpg'" onMouseOut="this.src='mediaoption.jpg'"  /></a>
    Thanks.

IMN logo majestic logo threadwatch logo seochat tools logo