22 users online (0 members and 22 guests)  

Thread: Please Help


  Results 1 to 6 of 6
  1. #1
    socrates's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2004
    Posts
    5

    Unhappy Please Help

    I have been working on this script for three days now and I have run out of things to try. Here is the problem.

    I downloaded this "mouseover" script to make this new web page. I have a row of five buttons on the page. The script said to do more than one button just copy the code and change the source and id values. I did that. Now when I move the mouse over the first button in the row the alternate picture replaces the last button instead of the first....very wierd. And so on and so forth with the other three buttons. The last button works properly. I am pulling my hair out with this one. Please help. I am in a major time crunch. Thanks. Here is the script and code.


    <HEAD>
    <script language="javascript">
    <!--

    /*Visit A1javascripts.com for more neat scripts*/

    a1=new Image(83, 39)
    a1.src="Efund Job Search for Job Seekers; HR Software for Employers_files/nav_top_solutions_f2.gif"
    b1=new Image(83, 39)
    b1.src="Efund Job Search for Job Seekers; HR Software for Employers_files/nav_top_about.gif"
    c1=new Image(83, 39)
    c1.src="Efund Job Search for Job Seekers; HR Software for Employers_files/nav_top_contact.gif"
    d1=new Image(83, 39)
    d1.src="Efund Job Search for Job Seekers; HR Software for Employers_files/nav_top_support.gif"
    e1=new Image(83, 39)
    e1.src="Efund Job Search for Job Seekers; HR Software for Employers_files/nav_top_globalsites.gif"


    a2=new Image(83, 39)
    a2.src="Efund Job Search for Job Seekers; HR Software for Employers_files/nav_top_solutions.gif"
    b2=new Image(83, 39)
    b2.src="Efund Job Search for Job Seekers; HR Software for Employers_files/nav_top_about2.gif"
    c2=new Image(83, 39)
    c2.src="Efund Job Search for Job Seekers; HR Software for Employers_files/nav_top_contact2.gif"
    d2=new Image(83, 39)
    d2.src="Efund Job Search for Job Seekers; HR Software for Employers_files/nav_top_support2.gif"
    e2=new Image(83, 39)
    e2.src="Efund Job Search for Job Seekers; HR Software for Employers_files/nav_top_globalsites2.gif"


    //-->
    </script>
    <script>
    <!--
    function filter(imagename,objectsrc){
    if (document.images)
    document.images[imagename].src=eval(objectsrc+".src")
    }
    //-->
    </script>
    </HEAD>


    <TD><a href="yoururl.htm"
    onmouseover="filter('img1','a2'); window.status='Status Message';return true;"
    onmouseout="filter('img1','a1'); window.status='';return true;" onclick="window.focus()">
    <img src="Efund Job Search for Job Seekers; HR Software for Employers_files/nav_top_solutions_f2.gif" name="img1" border=0 width=83 height=39></a> </TD>
    <TD><IMG height=1
    src="Efund Job Search for Job Seekers; HR Software for Employers_files/shim.gif"
    width=8></TD>
    <TD><a href="yoururl.htm"
    onmouseover="filter('img1','b2'); window.status='Status Message';return true;"
    onmouseout="filter('img1','b1'); window.status='';return true;" onclick="window.focus()">
    <img src="Efund Job Search for Job Seekers; HR Software for Employers_files/nav_top_about.gif"

    name="img1" border=0 width=83 height=39></a> </TD>
    <TD><IMG height=1
    src="Efund Job Search for Job Seekers; HR Software for Employers_files/shim.gif"
    width=8></TD>
    <TD><a href="yoururl.htm"
    onmouseover="filter('img1','c2'); window.status='Status Message';return true;"
    onmouseout="filter('img1','c1'); window.status='';return true;" onclick="window.focus()">
    <img src="Efund Job Search for Job Seekers; HR Software for Employers_files/nav_top_contact.gif"

    name="img1" border=0 width=83 height=39></a> </TD>
    <TD><IMG height=1
    src="Efund Job Search for Job Seekers; HR Software for Employers_files/shim.gif"
    width=8></TD>
    <TD><a href="yoururl.htm"
    onmouseover="filter('img1','d2'); window.status='Status Message';return true;"
    onmouseout="filter('img1','d1'); window.status='';return true;" onclick="window.focus()">
    <img src="Efund Job Search for Job Seekers; HR Software for Employers_files/nav_top_support.gif"

    name="img1" border=0 width=83 height=39></a> </TD>
    <TD><IMG height=1
    src="Efund Job Search for Job Seekers; HR Software for Employers_files/shim.gif"
    width=8></TD>
    <TD><a href="yoururl.htm"
    onmouseover="filter('img1','e2'); window.status='Status Message';return true;"
    onmouseout="filter('img1','e1'); window.status='';return true;" onclick="window.focus()">
    <img src="Efund Job Search for Job Seekers; HR Software for

    Employers_files/nav_top_globalsites.gif" name="img1" border=0 width=83 height=39></a>
    </TD>


    Sorry of the length but I thought the more you had the easier it would be to help.

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Hiya,

    The onMouseOver and onMouseOut code is

    filter('img1','d1');

    the 'img1' part is telling it to change the picture with the name of img1. However, they are all called img1 and every image tells it to change img1 to a new picture.
    Each of the hrefs needs a different name, with the

    filter('img1','d1');

    changed to match this name.

    Hope that helps.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    socrates's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2004
    Posts
    5

    Unhappy

    Quote Originally Posted by QuietDean
    Hiya,

    The onMouseOver and onMouseOut code is

    filter('img1','d1');

    the 'img1' part is telling it to change the picture with the name of img1. However, they are all called img1 and every image tells it to change img1 to a new picture.
    Each of the hrefs needs a different name, with the

    filter('img1','d1');

    changed to match this name.

    Hope that helps.
    Hey Thanks for the reply. I think that I am getting closer to understanding you but I am fairly new to this so bare with me.

    Not do you mean that I need to do some thing like this:

    filter('img1','a1');
    filter('img2','b1');
    filter('img3','c1');
    filter('img4','d1');
    filter('img5','e1');

    or

    filter('solutions.gif','a1');
    filter('about.gif','b1');
    filter('support.gif','c1');
    filter('contact.gif','d1');
    filter('globalsites.gif','e1');

    I am trying to understand what exaclt "img1" references to and how I am to distinguish each. I have to add that I have tried both of these combnations and a couple of others and none have worked. Thanks for all the help.

  4. #4
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Sure,

    look for, in the <img> tags - name="img1"

    Thats what denotes 'img1' in the function call. So not only much your functions change and all hav different names, but the name="img1" must change in each img tag to match (eg img2, img3)
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  5. #5
    socrates's Avatar
    New User

    Status
    Offline
    Join Date
    Jan 2004
    Posts
    5
    Quote Originally Posted by QuietDean
    Sure,

    look for, in the <img> tags - name="img1"

    Thats what denotes 'img1' in the function call. So not only much your functions change and all hav different names, but the name="img1" must change in each img tag to match (eg img2, img3)
    Got it. Things seem so simple in hind sight. That's for the awesome help. I would have been stuck on this for weeks without your help. Thanks again.

  6. #6
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    np, your welcome.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?