html-lists

How to create two dimensional array to multi-level order list?

时光总嘲笑我的痴心妄想 提交于 2020-01-17 15:47:29
问题 I have an php array is below, $two_dimention = array( array("id"=>4, "name" => "Home", "parent" => 0, "depth" => 0), array("id"=>5, "name" => "Menu 1", "parent" => 0, "depth" => 0), array("id"=>6, "name" => "Menu 2", "parent" => 0, "depth" => 0), array("id"=>8, "name" => "Menu 2.1", "parent" => 6, "depth" => 1), array("id"=>10, "name" => "Menu 2.1.1", "parent" => 8, "depth" => 2), array("id"=>11, "name" => "Menu 2.1.2", "parent" => 8, "depth" => 2), array("id"=>9, "name" => "Menu 2.2",

How to show an ul when a particular li is clicked using jquery?

一个人想着一个人 提交于 2020-01-17 06:08:30
问题 I want to show the ul class of li which is clicked. My html is: <ul id="level1" class="category"> <li class="level1 inactive"> <a href="#">abc</a> <ul id="level2" style=" display:none;"> <li class="level2 inactive"><a href="#">Level2</a></li> <li class="level2 inactive"><a href="#">Level2</a></li> <li class="level2 inactive"><a href="#">Level2</a></li> </ul> </li> <li class="level1 inactive"> <a href="#">xyz</a> <ul id="level2" style=" display:none;"> <li class="level2 inactive"><a href="#"

How to show an ul when a particular li is clicked using jquery?

我与影子孤独终老i 提交于 2020-01-17 06:07:06
问题 I want to show the ul class of li which is clicked. My html is: <ul id="level1" class="category"> <li class="level1 inactive"> <a href="#">abc</a> <ul id="level2" style=" display:none;"> <li class="level2 inactive"><a href="#">Level2</a></li> <li class="level2 inactive"><a href="#">Level2</a></li> <li class="level2 inactive"><a href="#">Level2</a></li> </ul> </li> <li class="level1 inactive"> <a href="#">xyz</a> <ul id="level2" style=" display:none;"> <li class="level2 inactive"><a href="#"

Navigate through a ul with clicks on a div

痞子三分冷 提交于 2020-01-17 01:30:15
问题 Please take a look at this first: This is my JSFiddle to edit I need to put two div one to the left, one to the right, they will hold arrows (like this ones: imageRight, imageLeft), so when I click on one div left or right, it navigates through the ul accordingly. Please take in consideration that they could be more than two list elements. Seems easy, but I haven't been able to do it, nor find the right example. 回答1: ok, now I have the solution... I end up using a plugin called Awkward

Unordered list navigation with floating left and right elements

旧时模样 提交于 2020-01-16 18:48:25
问题 I have a simple navigation bar at the top of the page with several links – the first is floated to the left using li:first child, the last floated to the right using li:last child, with the remainder centered in the middle of the page. To all intents and purposes this works – but although the space between each of the navigation blocks is the same, the central block is actually positioned much further to the right. I presume this is because the links differ in length – ie 23 characters for

Unordered list navigation with floating left and right elements

夙愿已清 提交于 2020-01-16 18:47:49
问题 I have a simple navigation bar at the top of the page with several links – the first is floated to the left using li:first child, the last floated to the right using li:last child, with the remainder centered in the middle of the page. To all intents and purposes this works – but although the space between each of the navigation blocks is the same, the central block is actually positioned much further to the right. I presume this is because the links differ in length – ie 23 characters for

Unordered list navigation with floating left and right elements

最后都变了- 提交于 2020-01-16 18:47:19
问题 I have a simple navigation bar at the top of the page with several links – the first is floated to the left using li:first child, the last floated to the right using li:last child, with the remainder centered in the middle of the page. To all intents and purposes this works – but although the space between each of the navigation blocks is the same, the central block is actually positioned much further to the right. I presume this is because the links differ in length – ie 23 characters for

Excessive UL margin in Chrome and Firefox

你说的曾经没有我的故事 提交于 2020-01-16 03:53:11
问题 In my html, I have a generated ul element that hold li 's with img 's in them. I get a strange 3px (approx) excesive margin between my li 's in addition to css defined margin. Here is a Chrome debug console snapshot. A excessive area is outlined with red: A ul s style is the following: li 's style is: Exactly the same excessive margin appears in Firefox. Why is it there? How do I get rid of it? 回答1: Solved. It's how browsers render line breaks between li's. Had to force the html generator

How to keep checking for new <li> elements in a <div>?

妖精的绣舞 提交于 2020-01-16 00:43:47
问题 I want to keep checking for new li elements so that whenever there will be these new elements ,I would be getting new alerts? JS: $(function () { if ($('#div').find('<li></li>')) { alert('you just got new <li> elements'); } // it is just an examplory function which // will keep looking for only new <li> elements created by ol list })(); Js fiddle is here http://jsfiddle.net/younis764/rWcKu/3/ Please help. 回答1: A function like this should help you document.addEventListener("DOMNodeInserted",

Dragging and dropping a <li> id to a text input

两盒软妹~` 提交于 2020-01-15 12:19:07
问题 I've searched the interwebs, and I'm not working out how to do that. I would like to have something like a file list, and the drag and drop a file (a <li> element) and write it's id to a text field. Would it be possible ? 回答1: Yes it is possible using jQuery UI draggable and droppable plugins. You need to include jQuery UI script reference into your page. jQuery UI CDN - http://code.jquery.com/ui/1.11.4/jquery-ui.min.js Html <ul> <li id="li1">Li 1</li> <li id="li2">Li 2</li> <li id="li3">Li 3