WordPress.org

Ready to get started?Download WordPress

Forums

Twenty Twelve
Help - adding this JS (Rollover Text To Change Image ) to page (4 posts)

  1. kpenn
    Member
    Posted 1 year ago #

    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>
  2. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Are you using a Child Theme?

  3. kpenn
    Member
    Posted 1 year ago #

    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!

  4. kpenn
    Member
    Posted 1 year ago #

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

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic