toggle $(this)
toggle $(this)
Hello,
I have what I think is a basic question. I will have multiple li's of the same structure below on the same page. I click "more" and then the overlay appears. The only issue is that it appears for each instance. I understand why but I don't understand how to use the $(this) to isolate the interaction. Any help would be appreciated, thanks!
- <li class="marketingItem">
- <div class="thumb">
- <?=img(array('src'=>'images/marketing/gil.jpg','alt'=>'Book 1'))?>
- <div>
- <div class="overlay">
- lorem ipsum overlaysum.
- </div>
- <div class="title">
- This is the Title<br />
- <a href="#" class="more">more</a>
- </div>
- </li>
- <script type="text/javascript">
- $(document).ready(function(){
- $('.more').click(function(){
- $('.overlay').toggle('slow');
- });
- });
- </script>