Jump to content
php.lv forumi
  • 0

li:gt


anonīms

Question

Sveiki ir piemēram šāda izvēlnes struktūra

 

- menu

 

 

- menu

- submenu

- submenu

- submenu

- menu

- menu

- menu

- menu

- submenu

- menu

 

function hideMenu() {
 $('.menu-block-1 .menu_less').slideUp();
 $('.menu-block-1 .menu li:gt(8)').hide();
 alert($('.menu-block-1 .menu').height());
 //$('#block-simplenews-9, #block-yahoo_weather_forecast-0, #block-views-Banners-block_1, .menu_more').slideDown();
$('.menu-block-1 .menu li:nth-child(9)').after('<a href="javascript:void(1);" onclick="showMenu();" class="menu_more">'+Drupal.t("more")+'</a>');

return false;
}
function showMenu() {
 $('.menu_more').hide();
 $('.menu-block-1 .menu li').slideDown();
 $('.menu-block-1 .menu:first').after('<a href="javascript:void(1);" onclick="hideMenu();" class="menu_less">'+Drupal.t("less")+'</a>');
 //$('#block-views-Banners-block_1').slideUp();
 $('.menu_more').remove();
 return false;
}

 

Pašlaik ir tā, ka ir galvenās izvēlnes teiksim 8 vaļā, vai cits skaitlis un atverot kādu parādas apakšsadaļas kā expanded. (pēc refresha lapas)

 

Problēma ir tur, ka tiek skaitīti šie 10 vai cik elementi un tad uzspiežot "less" daļa submenu tiek nogriezti, ja ir par daudz. Kā šo varētu labot?

 

edit: neiet tabi quotē ;[

Edited by anonīms
Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...