collapsable menu and line spacing

majken / 2008-09-28 14:12:20   

Hi there,

a couple of questions I hope someone can help me out with:

I´ve made a collapsable menu: http://www.lab-land.dk/
but "Info" is allready expanded when the site is reloaded, why?

I want to change the line spacing of the exhibition, how to?

Thanks!

extrafunk / 2008-09-28 15:13:07   

your main page is open because that's what you want it to do. Try hidding it from the index. That could work.

Changing line spacing can be done in your style.css.

Hope that helps.

Mark

Vaska A / 2008-09-28 16:12:09   

Give this a try...replace the previous javascript for the menus with this...by default this closes ALL lists. It only requires one call at startup (instead of individuals ones for each section list).

  1. /*¬†¬†¬†¬†Expanding Menus for Indexhibit
  2.  *¬†¬†¬†¬†¬†¬†¬†¬†uses jquery
  3.  *
  4.  *¬†¬†¬†¬†Created by Ross Cairns  Mar 2008
  5.  *  Adapations by Vaska September 2008
  6. */
  7. function ndxz_expanding_loader()
  8. {
  9.  ¬†¬†¬†¬†var speed = 100;
  10. ¬†¬†¬†¬†var item_title = new Array();
  11. ¬†¬†¬†¬†var items = new Array();
  12. ¬†¬†¬†¬†var i = 0;
  13. ¬†¬†¬†¬†$("#menu ul").each(function()
  14.     {
  15. ¬†¬†¬†¬†¬†¬†¬†¬†items[i] = $("#menu ul").eq(i).children().filter(function (index) { return index > 0; });
  16. ¬†¬†¬†¬†¬†¬†¬†¬†/* v1 - hide items if not active */
  17. ¬†¬†¬†¬†¬†¬†¬†¬†//if (items[i].is(".active") == false) { items[i].hide(); }
  18. ¬†¬†¬†¬†¬†¬†¬†¬†/* v3 - hide all */
  19.         items[i].hide();
  20. ¬†¬†¬†¬†¬†¬†¬†¬†// apply the clicker
  21. ¬†¬†¬†¬†¬†¬†¬†¬†$(this).attr('id', 'c' + i);
  22. ¬†¬†¬†¬†¬†¬†¬†¬†$(this).children(":first").attr('onclick', "$('ul#c" + i + " li:gt(0)').toggle(" + speed + ");");
  23.         i++;
  24.     });
  25. }

Then, in your on.ready add:

  1. ndxz_expanding_loader();

Let me know how it goes.

(I had to rewrite this for another project...)

majken / 2008-09-28 16:32:48   

Thanks Vaska!

I'm not all that into code...so maybe you could give a few hints?

I guess the javascript goes in my "expandingMenues.js"?

But what about "ndxz_expanding_loader();"?

and should I change anything in the index.php:

$(document).ready(function()
{
    setTimeout('move_up()', 1);
    expandingMenu(0);
    expandingMenu(1);
    expandingMenu(2);
;
});

Vaska A / 2008-09-28 16:42:17   

In the index.php change it to...

  1. $(document).ready(function() 
  2. {
  3.     setTimeout('move_up()', 1);
  4.     ndxz_expanding_loader();
  5. });
Vaska A / 2008-09-28 16:55:24   

Line height:

  1. #menu ul li { line-height: 18px; }
  2. #menu ul li.section-title { line-height: 27px; margin-bottom: 6px; }

Be sure to get a credit link back to Indexhibit on your site...have a read of the forum rules.

majken / 2008-09-28 17:58:37   

hmm...don't konow that I'm doing wrong:

1. /* Expanding Menus for Indexhibit
2. * uses jquery
3. *
4. * Created by Ross Cairns Mar 2008
5. * Adapations by Vaska September 2008
6. */
7. function ndxz_expanding_loader()
8. {
9. var speed = 100;
10. var item_title = new Array();
11. var items = new Array();
12. var i = 0;
13. $("#menu ul").each(function()
14. {
15. items[i] = $("#menu ul").eq(i).children().filter(function (index) { return index > 0; });
16. /* v1 - hide items if not active */
17. if (items[i].is(".active") == false) { items[i].hide(); }
18. /* v2 - hide all */
19. //items[i].hide();
20. // apply the clicker
21. $(this).attr('id', 'c' + i);
22. $(this).children(":first").css({ cursor: 'pointer' }).attr('onclick', "$('ul#c" + i + " li:gt(0)').toggle(" + speed + ");");
23. i++;
24. });
25. }

I wan't to display the active section..

majken / 2008-09-28 18:02:51   

Of course I will link to indexhibit!

I'm just getting the design up and running before working on the content.

1. #menu ul li { line-height: 18px; }
2. #menu ul li.section-title { line-height: 27px; margin-bottom: 6px; }

doesen't do anything for the line spacing in the projects...just makes the space between the menues smaller

Vaska A / 2008-09-28 18:03:04   

Read the other thread I made on this subject...it's explained...

majken / 2008-09-30 20:00:38   

Great, thanks Vaska!

I wan't to display the active section...but "Info" is displayed all the time.

Why is that?

extrafunk / 2008-09-30 20:30:02   

because your main section is active when you try to open the site.. like i said before, try to hide it from the index. Whenever a link is active the menu open's its wings so to speak... by hiding it, the main page will still open, but won't be visible under your "info" section.

Cheers,

Mark

Mahtab_Hussain / 2010-06-13 12:33:54   

Dear all,

I have tried to use the js for the expanding menu, I assume I have make a new js and add this to in my site folder (which I have done) but nothing seems to be working.

I am also not sure what is meant by the following:

Then, in your on.ready add:

1. ndxz_expanding_loader();

Please can you help?

Thank you

Mahtab Hussain

www.mahtabhussain.com

Mahtab_Hussain / 2010-06-15 09:22:46   

Please help.

I tried to do the above and changed the index.php in the ndxz-studio folder but now I am getting a fatal error message:

Warning: require_once(defaults.php) [function.require-once]: failed to open stream: No such file or directory in /websites/123reg/LinuxPackage21/ma/ht/ab/mahtabhussain.com/public_html/index.php on line 23

Fatal error: require_once() [function.require]: Failed opening required 'defaults.php' (include_path='.:/usr/share/pear:/usr/share/php') in /websites/123reg/LinuxPackage21/ma/ht/ab/mahtabhussain.com/public_html/index.php on line 23

Please could you help rectify this I did replace the original file but am getting the same message.

Thank you so much for your help.

www.mahtabhussain.com

This thread has been closed, thank you.