SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Feb 2000
    Location
    xyz
    Posts
    158
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I am a complete idiot when it comes to JavaScript, so please excuse my ignorance

    What I want to make is a button that changes color when it is pointed at, but in that event also changes a picture elsewhere on the page. Is it possible to make?

  2. #2
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    you could either call your rollover script twice and pass it a different image to change each time. Simple to do but ineffective use of resources. You could also build your script so that the rollover takes 4 variables with the last two being optional (can javascript do this???) and have it rollover both images if all 4 parameters are there.



    ------------------
    Wayne Luke

    The Majormud Encyclopedia - www.bloodquest2.com
    Come Play one of the hottest games on the net.



  3. #3
    SitePoint Member
    Join Date
    Feb 2000
    Location
    Madawaska, ME, USA
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I know a different way to do this.

    <a href="index.htm"><img border="0" onmouseover="image100.src='nlt.gif'; image700.src='center1.gif'" onmouseout="image100.src='lt.gif'; image700.src='center8.gif'" src="lt.gif" name="image100" </a>

    Note the semicolon after my image100.src. As far as I know, you can change as many images as you like with the one onmouseover event.



    [This message has been edited by ryanc (edited February 20, 2000).]

  4. #4
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote/font><HR>&lt;img border="0" onmouseover="image100.src='nlt.gif'; image700.src='center1.gif'" onmouseout="image100.src='lt.gif'; image700.src='center8.gif'" src="lt.gif" name="image100"&gt;<HR></BLOCKQUOTE>

    That simple code should work but what happens when someone with an old version of IE 3.0 or Navigator 2.0 and all of a sudden there are lots of javascript errors because neither of those browser support the image collection? Not to mention the fact the preloading can't be utilized properly, there is no error-checking and many other features that are required in professional programming and becoming important even in Web Design today. As we move from hacked together static HTML into the world of Internet Programming with XML, CSS, DHTML, XHTML, ASP, PHP and many other fascinating technologies, we as developers need to make the user unaware of the trials and tribulations of making a great interactive experience. This means catching their mistakes and accounting for them before they make them.

    ------------------
    Wayne Luke
    Internet Media Provider

  5. #5
    SitePoint Guru
    Join Date
    Oct 1999
    Location
    New York, NY
    Posts
    826
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Maximar et al. --

    I know you posted this weeks ago but I just came across the post...

    Anyway, check out http://www.builder.com/Programming/K...398/index.html

    It is C|Net's Builder.com section where they not only will teach you how to do such a thing with using a mouseover effect to change another image as well, but will actualy generate the proper code for you to copy & paste.

    After reading the SuperScripter article, just click on Mouseover Machine link under "cool tools."

    Hope it helps!

    --Joshua


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
  •