Results 1 to 2 of 2

Thread: drop downs and rollovers together

  1. #1
    Join Date
    Feb 2006
    Location
    Mesquite, NV
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry drop downs and rollovers together

    I am trying to get a dropdown script and a rollover script to work together...they each work perfectly seperate, but when I try to get them together they do nothing. I am assuming there is something I need in the head where the javascript is. I am just learning, so pardon my ignorance if this is a stupid question...I would REALLY appreciate some help~

    Again...two javascripts, how do you get them to work together!?

    Thanks

    Stacy

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    There are at least several ways a drop down can be coded to activate and likewise a rollover. If you are lucky and both scripts use onmouseover and onmouseout events in the HTML portion of the page to do this, integration may be fairly easy. That is unless both scripts use the onload event of the page as well, then things get a bit more complex. Adding another layer of complexity would be if one or both scripts writes its own events to the HTML elements involved.

    Unfortunately, to make matters less straightforward, there are other possible variations that may look less complex than they actually are.

    However, if everything is as simple as it could possibly be, correctly combining the onmouseover and onmouseout events would be all that is necessary. Say, your image has a rollover and is a link's (that has a drop down) activating element:

    HTML Code:
    <a href="#" onclick="return false;" onmouseover="dropdown('something');" onmouseout="hide('something');"><img onmouseover="rollover(this);" onmouseout="rollback(this);" src="whatever.jpg"></a>
    Then, the two can often be combined, like so:

    HTML Code:
    <a href="#" onclick="return false;"><img onmouseover="rollover(this);dropdown('something');" onmouseout="rollback(this);hide('something');" src="whatever.jpg"></a>
    If you need more help, we need to see your code:

    PLEASE: Include the URL to your problematic webpage that you want help with.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

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