#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    94
    Rep Power
    0

    Faq Question not working here !


    Code:
    $(document).ready(function() {
        $('.ans').hide();
    	$('.faq h2.ques').toggle(function(){
    		$(this).next('.ans').fadeIn();
    		$(this).addClass('plus');
    		},
    		function(){
    		$(this).next('.ans').fadeOut();
    		$(this).removeClass('minus');
    			});//toggle
    });//ready
    Code:
    <div class="faq">
    <h2 class="ques">Is javascript a OOP language</p>
    <p class="ans">Yes, Its a OOP language but in a different Style ! </p>
    
    <h2 class="ques">Is javascript a Loose language</p>
    <p class="ans">Yes, Its a Loose language but in a different Style ! </p>
    
    </div>

    This line is hiding everything why ?? $('.faq h2.ques').toggle(function()
    Last edited by ionezation; December 28th, 2013 at 05:10 PM.
  2. #2
  3. Lord of the Dance
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Oct 2003
    Posts
    3,577
    Rep Power
    1906
    the h2 elements are not closed correctly. You have closed them with </p> instead of </h2>
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2013
    Posts
    94
    Rep Power
    0
    errrrrrrr

IMN logo majestic logo threadwatch logo seochat tools logo