Forums

Using JQuery in wordpress (2 posts)

  1. eastsidedev
    Member
    Posted 2 years ago #

    I would like to build a page, with multiple areas. If I move the mouse over to area1, I would like to load some text in area2 and an image in area3. I was advised that JQuery would be the best way to do this. So far, I gathered that I need to include the following in the head section of the header.php file (from my theme):

    <?php
    wp_enqueue_script('jquery');
    ?>

    If this not wordpress, I would do something like this:

    $(document).ready(function(){
    $('#area1').moveover(function(){
    $('#area2').html('new text goes here.');
    $('#area3').html('<img src="img.jpg">');
    });
    });

    HTML code:

    <div id="area1">Area1</div>
    <div id="area2">Area2</div>
    <div id="area3">Area3</div>

    But this is wordpress. What do I include on my page?

  2. Mark / t31os
    Moderator
    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags