May 25, 201016 yr Good Morning everyone, The problem I am having is with jQuery selectors. What I'm trying to do it's very complex I don't think but I am new to using jQuery so I've probably made some fundamental mistake. So basically what I am trying to achive is when the class .titleanddescription is clicked on the first time it changes the height of the .more class within .titleanddescription. And then changes it back on the Second click. So selecting a class within (this) is what I guess I am trying to achieve. I'm not using slidetoggle because there are other effects I want to add. Thankyou for any advice you can offer. jQuery: function serviceslide() { $(".titleanddescription").toggle( function () { alert ("First"); $(this).(".more").css("height":"750px"); }, function () { alert ("Second"); $(this).(".more").css("height":"0px"); } ); } HTML: <div class="serblock"> <div class="titleanddescription"> <h2 class="service">Title</h2> <p>Description</p> <p class="more">More Details</p> </div> </div>
Create an account or sign in to comment