Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP Forum - onMouseOver

    I am not sure wether this falls into JavaScript or PHP, probably PHP.
    Alright well here is what I got right now:
    PHP Code:
    {$this->table}
      <
    tr>
        <
    td>{$this->lang->topic_pages}:
          {
    $pagelinks}
        </
    td>
        <
    td align='right'>
          {
    $replylink}
          <
    a href='{$this->self}?a=post&amp;s=topic&amp;f={$topic['topic_forum']}'><img src='./skins/{$this->skin}/images/newtopic.gif' alt='{$this->lang->topic_create_topic}' /></a>
          <
    a href='{$this->self}?a=post&amp;s=poll&amp;f={$topic['topic_forum']}'><img src='./skins/{$this->skin}/images/newpoll.gif' alt='{$this->lang->topic_create_poll}' /></a>
        </
    td>
      </
    tr>
    {
    $this->etable
    I need a onMouseOver and onMouseOut effect that will switch between alternate images. Anyone know what I might do?

  • #2
    Regular Coder Tyree's Avatar
    Join Date
    Sep 2003
    Posts
    254
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Definitely a javascript question. PHP isn't going to change anything unless the page refreshes so the server can reprocess the code. If you want dynamic client-side changes, you have to use a client-side language.

    There are many ways to do what you're asking about with javascript. Unfortunately, I don't know javascript very well! I just use the script that Dreamweaver uses!

  • #3
    New to the CF scene
    Join Date
    Dec 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Alright well in JavaScript I think you have to make an array and use onMouseOver and stuff. Anyone correct me or show me an example how to do this?

  • #4
    New Coder
    Join Date
    Jul 2006
    Posts
    26
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Ok here is what you need.. allright.

    PHP Code:
    <SCRIPT LANGUAGE="JAVASCRIPT">
    <!--

    function 
    roll(img_name1img_src1img_name2img_src2)
       {
       
    document[img_name1].src img_src1;
       
    document[img_name2].src img_src2;
       }

    //-->
    </SCRIPT>

    <A HREF="LINK TO W/E HERE!" 
    onmouseover="roll('sub1', 'FIRST IMAGE NAME', 'sub1', 'SECOND IMAGE NAME')">
    <IMG SRC="FIRST IMAGE NAME" NAME="sub1" WIDTH="WIDTH" 
    HEIGHT="HEIGHT" BORDER="0">
    </A> 
    Basically make sure where it says FIST IMAGE NAME, that it sthe same image name for each of those, and then for the rollover image, make that in the SECOND IMAGE NAME position. And the LINK TO W/E HERE! should be where they are going once they click on the image. Also, don't forget ot change the HEIGHT and WIDTH.


  •  

    Posting Permissions

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