www.webdeveloper.com
Results 1 to 4 of 4

Thread: help with javascript hover over

  1. #1

    help with javascript hover over

    I have a script that works.

    Code:
    <script type="text/javascript">
    var imgs1 = new Array("http://mysite.com/upload/2485.jpg","http://mysite.com/upload/3282.jpg");
    var lnks1 = new Array("http://mysite.com/index.pl?session_key=&search_and_display_db_button=on&db_id=2485&query=retrieval","http://mysite.com/index.pl?session_key=&search_and_display_db_button=on&db_id=3282&query=retrieval");
    var alt1 = new Array("3 bedroom 1 bath on 3.5 acres $69,000.00 Price Reduced!"," 2 bed/1 bath House 450/mo 350/dep--will do Section 8");
    var imgsa = new Array("3 bedroom 1 bath on 3.5 acres \$69,000.00 <font color=#ff0000 size=3><b><i>Price Reduced!</i></b></font>","2 bed/1 bath House 450/mo 350/dep--will do Section 8");
    
    var currentAd1 = 0;
    var imgCt1 = 2;
    function cycle1() {
      if (currentAd1 == imgCt1) {
        currentAd1 = 0;
      }
    var banner1 = document.getElementById('adBanner1');
    var banner11 = document.getElementById('adBanner11');
    var link1 = document.getElementById('adLink1');
    banner1.src=imgs1[currentAd1]
      banner1.alt=alt1[currentAd1]
      document.getElementById('adLink1').href=lnks1[currentAd1]
      document.getElementById('adLinka').innerHTML = imgsa[currentAd1];
    currentAd1++;
    }
      window.setInterval("cycle1()",5000);
    </script>
    <b><a style="font-size:16px;color:#000080;font-family:MS SANS SERIF;"" id="adLinka" target="_top">3 bedroom 1 bath on 3.5 acres \$69,000.00 <font color=#ff0000 size=3><b><i>Price Reduced!</i></b></font></a>
    </b><br>
    
    <a href="http://mysite.com/index.pl?session_key=&search_and_display_db_button=on&db_id=2485&query=retrieval"" id="adLink1" target="_top">
    <img src="http://mysite.com/upload/2485.jpg" id="adBanner1" border="0" width="120" height="90"></a>


    i am trying to change so that I have a hover over with photo it works on 1st banner but has same photo on 2nd banner thanks for the help

    here is what I have

    Code:
    <script type="text/javascript">
    var imgs1 = new Array("http://mysite.com/upload/2485.jpg","http://mysite.com/upload/3282.jpg");
    var lnks1 = new Array("http://mysite.com/index.pl?session_key=&search_and_display_db_button=on&db_id=2485&query=retrieval","http://mysite.com/index.pl?session_key=&search_and_display_db_button=on&db_id=3282&query=retrieval");
    var alt1 = new Array("3 bedroom 1 bath on 3.5 acres $69,000.00 Price Reduced!"," 2 bed/1 bath House 450/mo 350/dep--will do Section 8");
    var imgsa = new Array("3 bedroom 1 bath on 3.5 acres \$69,000.00 <font color=#ff0000 size=3><b><i>Price Reduced!</i></b></font>","2 bed/1 bath House 450/mo 350/dep--will do Section 8");
    
    var currentAd1 = 0;
    var imgCt1 = 2;
    function cycle1() {
      if (currentAd1 == imgCt1) {
        currentAd1 = 0;
      }
    var banner1 = document.getElementById('adBanner1');
    var banner11 = document.getElementById('adBanner11');
    var link1 = document.getElementById('adLink1');
    banner1.src=imgs1[currentAd1]
      banner1.alt=alt1[currentAd1]
      document.getElementById('adLink1').href=lnks1[currentAd1]
      document.getElementById('adLinka').innerHTML = imgsa[currentAd1];
    currentAd1++;
    }
      window.setInterval("cycle1()",5000);
    </script>
    <b><a style="font-size:16px;color:#000080;font-family:MS SANS SERIF;"" id="adLinka" target="_top">3 bedroom 1 bath on 3.5 acres \$69,000.00 <font color=#ff0000 size=3><b><i>Price Reduced!</i></b></font></a>
    </b><br>
    
    <a href="http://mysite.com/index.pl?session_key=&search_and_display_db_button=on&db_id=2485&query=retrieval" id="adLink1" target="_top" onmouseover="Tip('<img src=&quot;http://mysite.com/upload/2485.jpg&quot; id=&quot;adBanner1&quot; border=&quot;0&quot; width=&quot;120&quot; height=&quot;90&quot;>')" onmouseout="UnTip()" id="adBanner1">
    <img src="http://mysite.com/upload/2485.jpg" id="adBanner1" border="0" width="120" height="90"></a>
    Winracer
    Jack of all trades master of none
    http://www.brownlows.net

    “Only a life lived for others is a life worth while” Albert Einstein
    “The golden rule for every business man is this: 'Put yourself in your customer’s place'” Orison Swett Marden
    “No person was ever honored for what he received; honor has been the reward for what he gave” Calvin Coolidge

  2. #2
    sorry here is the part of the code I think is giveing me trouble

    Code:
    <a href="http://mysite.com/index.pl?session_key=&search_and_display_db_button=on&db_id=2485&query=retrieval" id="adLink1" target="_top" onmouseover="Tip('<img src=&quot;http://mysite.com/upload/2485.jpg&quot; id=&quot;adBanner1&quot; border=&quot;0&quot; width=&quot;120&quot; height=&quot;90&quot;>')" onmouseout="UnTip()" id="adBanner1">
    Winracer
    Jack of all trades master of none
    http://www.brownlows.net

    “Only a life lived for others is a life worth while” Albert Einstein
    “The golden rule for every business man is this: 'Put yourself in your customer’s place'” Orison Swett Marden
    “No person was ever honored for what he received; honor has been the reward for what he gave” Calvin Coolidge

  3. #3
    where would i put this to make it chane id="adBanner1" ?
    Winracer
    Jack of all trades master of none
    http://www.brownlows.net

    “Only a life lived for others is a life worth while” Albert Einstein
    “The golden rule for every business man is this: 'Put yourself in your customer’s place'” Orison Swett Marden
    “No person was ever honored for what he received; honor has been the reward for what he gave” Calvin Coolidge

  4. #4
    any thoughts?
    Winracer
    Jack of all trades master of none
    http://www.brownlows.net

    “Only a life lived for others is a life worth while” Albert Einstein
    “The golden rule for every business man is this: 'Put yourself in your customer’s place'” Orison Swett Marden
    “No person was ever honored for what he received; honor has been the reward for what he gave” Calvin Coolidge

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles