WordPress.org

Support

Support » Themes and Templates » Twenty Twelve » Help – adding this JS (Rollover Text To Change Image ) to page

Help – adding this JS (Rollover Text To Change Image ) to page

  • Want rollover text (also link) to change image once rolled over.

    Found this and worked perfect in dreamweaver (html) but having a hard time in wordpress page. Anyone familiar with a quick / easy resolve?

    – Is there a good JS embed on page plugin?
    – Could someone map out where / how JS needs to be added in header,footer or function? (tried a bunch but…)
    FYI – Yes, using Twenty Twelve theme

    Again, this code works perfect but script not working in wordpress. Appreciate

    <html>
    <head>
    
    <SCRIPT LANGUAGE="JAVASCRIPT">
    <!--
    
    function roll(img_name1, img_src1)
    {
    document[img_name1].src = img_src1;
    }
    
    //-->
    </SCRIPT>
    </head>
    
    <body>
    
    <ul>
    <li><a href="1.htm" onmouseover="roll('poster', '1.gif')">111</a>
    <li><a href="2.htm" onmouseover="roll('poster', '2.gif')">222</a>
    <li><a href="3.htm" onmouseover="roll('poster', '3.gif')">333</a>
    </ul>
    
    <br><br><br><br>
    
    <p align="center"><img src="1.gif" name="poster"></p>
    
    </body>
    </html>

Viewing 3 replies - 1 through 3 (of 3 total)
  • WPyogi

    @wpyogi

    Forum Moderator

    Are you using a Child Theme?

    Thanks for responding – it’s appreciated.

    Yes, I am using a child theme.

    I just came across “Embed Javascript” plugin by Bogdan. So far so good – the images are finally changing when I rollover the text buttons.

    Do you know if using this plugin or any like it would be putting me at risk for future conflicts? Would I be better off with another approach?

    FYI – this only one that seemed to work for me so far BUT it hasn’t been updated in over 2 years

    Again, Thanks!

    Not sure about this plugin may need another approach – strips <p>,
    etc.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Help – adding this JS (Rollover Text To Change Image ) to page’ is closed to new replies.
Skip to toolbar