WordPress.org

Ready to get started?Download WordPress

Forums

changing div height using jquery (1 post)

  1. Mart89
    Member
    Posted 1 year ago #

    Hi, I have a simple bit of jquery I want to include in my site:

    $('#banner2').click(function(){
    $(this).animate({height:'300'})
    })

    as shown here:
    http://jsfiddle.net/tJugd/

    When i try to include this code in my header.php however, nothing seems to happen.

    I have another piece of jqeury in the header (for isotope), which seems to work fine, it all looks like this:

    <?php wp_head(); ?>

    <script type="text/javascript">
    jQuery(document).ready(function(){
    var mycontainer = jQuery('#isocontent');
    mycontainer.isotope({
    itemSelector: '.box'
    });

    // filter items when filter link is clicked
    jQuery('#options a').click(function(){
    var selector = jQuery(this).attr('data-filter');
    mycontainer.isotope({ filter: selector });
    return false;
    });

    $('#banner2').click(function(){
    $(this).animate({height:'300'})
    })

    });
    </script>

    I don't really understand jquery syntax, so I dont know if my use of '});' is correct, but ive tried a few different arrangements to no avail.

    Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic