O'Reilly logo

jQuery 1.3 with PHP by Kae Verens

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Sorting trees

In the last section, we discussed one-dimensional lists. However, websites are not always that simple.

When there are many pages in a website, the most common method of organization is to use a hierarchical "tree" to contain the pages.

As this will be more complex than the simple list we just did, let's start a new demo for this one.

Client-side code

We'll start off again by creating a simple HTML example:

<html> <head> <script src="../jquery.min.js"></script> <script src="../jquery-ui.min.js"></script> <script src="sorting-trees.js"></script> <style type="text/css"> @import '../jquery-ui.css'; ul{ list-style:none; max-width:160px; margin:0; padding:0; border:1px solid #000;} li{ padding: 2px 0 0 10px; margin:0; } li span{ float:left; ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required