what is the jquery selector syntax to select this LI item
- by Jonathan Lyon
hi all
I need to select each list item and change the background image of the parent div homepagecontainer but I can't even select the li element in my script. Here is the code:
<div class="transparent" id="programmesbox">
<ul id="frontpage">
<?php
query_posts('showposts=20&post_parent=7&post_type=page');
if (have_posts()) : while (have_posts()) : the_post();
?>
<li id="<?php the_id() ?>" ><a class="sprite" href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></li>
<?php endwhile; endif; ?>
</ul>
</div>
I need to do something like this
<script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
$('#frontpage li a').hover(function() {
alert('here');
//CHANGE BACKGROUND IMAGE OF 'homepage_container' to different image depending on which list item is hovered over
}
);
</script>
This is the URL of the site:-
http://www.thebalancedbody.ca/
Thanks so much!!
Jonathan