Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

jquery accordion toggle close open

$(".accordion__headline").click(function () {
       if($(this).parent('div').hasClass('expanded')) {
         $(this).next('div').slideUp();
         $(this).parent('div').removeClass('expanded');
         $(this).children('div + .accordion__close').text('раскрыть');
		 $(this).children('.icon-ArrowUp').hide();
		 $(this).children('.icon-ArrowDown').show();
        } else {
          $(this).parent('div').addClass('expanded');
          $(this).next('div').slideDown();
		  $(this).children('div + .accordion__close').text('скрыть');
		  $(this).children('.icon-ArrowDown').hide();
		  $(this).children('.icon-ArrowUp').show();
        }
});
Comment

PREVIOUS NEXT
Code Example
Javascript :: angular 14 new features 
Javascript :: js update query string without refresh 
Javascript :: get attribute 
Javascript :: combine csv files javascript 
Javascript :: frames[i] javascript 
Javascript :: js function run one another 
Javascript :: axios send payload in get request 
Javascript :: email validation in javascript 
Javascript :: number format reactjs 
Javascript :: jsonwebtoken 
Javascript :: Nodemailer Google Passport Oauth Strategy 
Javascript :: arrow functions syntax 
Javascript :: native stack vs stack 
Javascript :: why node_modules are not installed anymore 
Javascript :: dynamodb json to regular json 
Javascript :: react native image picker 
Javascript :: fastest way to check a number is palindrome 
Javascript :: new date javascript 
Javascript :: cast string to int angular 
Javascript :: function shorthand javascript 
Javascript :: node.js 
Javascript :: charat javascript 
Javascript :: event handler 
Javascript :: javascript in python 
Javascript :: pass array as argument javascript 
Javascript :: Set Default Parameter Value 
Javascript :: react catch error in component 
Javascript :: d3 js 
Javascript :: JavaScript Error Try Throw Catch 
Javascript :: nextjs amp 
ADD CONTENT
Topic
Content
Source link
Name
1+9 =