Доработка Query скрипта

Все блоги / DLE движок для сайтов 29 мая 2013 0   
Здравствуйте парни, есть у меня скрипт которые отвечает за меню "акордеон", но он по умолчанию открывает первую вкладку. Пожалуйста подскажите, как подправить скрипт, чтобы по умолчанию открывалась последняя вкладка.

Вот код скрипта
$(function() {
  // Hide all the content except the first
  $('.accordian li:odd:gt(0)').hide();
  

  // Add the dimension class to all the content
  $('.accordian li:odd').addClass('dimension');
  
  // Set the even links with an 'even' class
  $('.accordian li:even:even').addClass('even');
  
  // Set the odd links with a 'odd' class
  $('.accordian li:even:odd').addClass('odd');
  
  // Show the correct cursor for the links
  $('.accordian li:even').css('cursor', 'pointer');
  
  // Handle the click event
  $('.accordian li:even').click( function() {
    // Get the content that needs to be shown
    var cur = $(this).next();
    
    // Get the content that needs to be hidden
    var old = $('.accordian li:odd:visible');
    
    // Make sure the content that needs to be shown
    // isn't already visible
    if ( cur.is(':visible') )
      return false;
    
    // Hide the old content
    old.slideToggle(500);
    
    // Show the new content
    cur.stop().slideToggle(500);
  } );
});


 Источник:dle-faq.pro, DLE

Похожие публикации

@
  • bowtiesmilelaughingblushsmileyrelaxedsmirk
    heart_eyeskissing_heartkissing_closed_eyesflushedrelievedsatisfiedgrin
    winkstuck_out_tongue_winking_eyestuck_out_tongue_closed_eyesgrinningkissingstuck_out_tonguesleeping
    worriedfrowninganguishedopen_mouthgrimacingconfusedhushed
    expressionlessunamusedsweat_smilesweatdisappointed_relievedwearypensive
    disappointedconfoundedfearfulcold_sweatperseverecrysob
    joyastonishedscreamtired_faceangryragetriumph
    sleepyyummasksunglassesdizzy_faceimpsmiling_imp
    neutral_faceno_mouthinnocent

Архив публикаций