jQuery UI & Datepicker: Dates in other months

This entry is part 5 of 14 in the series jQuery UI Datepicker

jQuery UI Datepicker – Dates in other months

The datepicker can show dates that come from other than the main month being displayed. These other dates can also be made selectable.

<!doctype html>
<html lang='en'>
<head>
    <meta charset='utf-8'>
    <title>jQuery UI Datepicker - Dates in other months</title>
    <link rel='stylesheet' href='//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css'>
    <script src='//code.jquery.com/jquery-1.10.2.js'></script>
    <script src='//code.jquery.com/ui/1.10.4/jquery-ui.js'></script>
    <link rel='stylesheet' href='https://codecrawl.com/code/jqueryui/jqueryui_style.css'>
    <script>
        $(function () {
            $('#datepicker').datepicker({
                showOtherMonths: true,
                selectOtherMonths: true
            });
        });
    </script>
</head>
<body>

<p>Date: <input type='text' id='datepicker'></p>

</body>
</html>
Try The Code Datepicker Widgets API Doc

jQuery UI & Datepicker: Datepicker with animations

This entry is part 3 of 14 in the series jQuery UI Datepicker

jQuery UI Datepicker – Animations

Use different animations when opening or closing the datepicker.

Choose an animation from the dropdown, then click on the input to see its effect.

You can use one of the three standard animations or any of the UI Effects.

<!doctype html>
<html lang='en'>
<head>
    <meta charset='utf-8'>
    <title>jQuery UI Datepicker - Animations</title>
    <link rel='stylesheet' href='//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css'>
    <script src='//code.jquery.com/jquery-1.10.2.js'></script>
    <script src='//code.jquery.com/ui/1.10.4/jquery-ui.js'></script>
    <link rel='stylesheet' href='https://codecrawl.com/code/jqueryui/jqueryui_style.css'>
    <script>
        $(function () {
            $('#datepicker').datepicker();
            $('#anim').change(function () {
                $('#datepicker').datepicker('option', 'showAnim', $(this).val());
            });
        });
    </script>
</head>
<body>

<p>Date: <input type='text' id='datepicker' size='30'></p>

<p>Animations:<br>
    <select id='anim'>
        <option value='show'>Show (default)</option>
        <option value='slideDown'>Slide down</option>
        <option value='fadeIn'>Fade in</option>
        <option value='blind'>Blind (UI Effect)</option>
        <option value='bounce'>Bounce (UI Effect)</option>
        <option value='clip'>Clip (UI Effect)</option>
        <option value='drop'>Drop (UI Effect)</option>
        <option value='fold'>Fold (UI Effect)</option>
        <option value='slide'>Slide (UI Effect)</option>
        <option value=''>None</option>
    </select>
</p>

</body>
</html>
Try The Code Datepicker Widgets API Doc

jQuery UI & Datepicker: Basic datepicker

This entry is part 1 of 14 in the series jQuery UI Datepicker

jQuery UI Datepicker – Default functionality

The datepicker is tied to a standard form input field. Focus on the input (click, or use the tab key) to open an interactive calendar in a small overlay.

Choose a date, click elsewhere on the page (blur the input), or hit the Esc key to close.

If a date is chosen, feedback is shown as the input’s value.

<!doctype html>
<html lang='en'>
<head>
    <meta charset='utf-8'>
    <title>jQuery UI Datepicker - Default functionality</title>
    <link rel='stylesheet' href='//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css'>
    <script src='//code.jquery.com/jquery-1.10.2.js'></script>
    <script src='//code.jquery.com/ui/1.10.4/jquery-ui.js'></script>
    <link rel='stylesheet' href='https://codecrawl.com/code/jqueryui/jqueryui_style.css'>
    <script>
        $(function () {
            $('#datepicker').datepicker();
        });
    </script>
</head>
<body>

<p>Date: <input type='text' id='datepicker'></p>

</body>
</html>
Try The Code Datepicker Widgets API Doc

jQuery UI & Menu: Menu with icons

This entry is part 2 of 2 in the series jQuery UI Menu

jQuery UI Menu – Icons

A menu with the default configuration, showing how to use a menu with icons.

<!doctype html>
<html lang='en'>
<head>
    <meta charset='utf-8'>
    <title>jQuery UI Menu - Icons</title>
    <link rel='stylesheet' href='//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css'>
    <script src='//code.jquery.com/jquery-1.10.2.js'></script>
    <script src='//code.jquery.com/ui/1.10.4/jquery-ui.js'></script>
    <link rel='stylesheet' href='https://codecrawl.com/code/jqueryui/jqueryui_style.css'>
    <script>
        $(function () {
            $('#menu').menu();
        });
    </script>
    <style>
        .ui-menu {
            width: 150px;
        }
    </style>
</head>
<body>

<ul id='menu'>
    <li><a href='#'><span class='ui-icon ui-icon-disk'></span>Save</a></li>
    <li><a href='#'><span class='ui-icon ui-icon-zoomin'></span>Zoom In</a></li>
    <li><a href='#'><span class='ui-icon ui-icon-zoomout'></span>Zoom Out</a></li>
    <li class='ui-state-disabled'><a href='#'><span class='ui-icon ui-icon-print'></span>Print...</a></li>
    <li>
        <a href='#'>Playback</a>
        <ul>
            <li><a href='#'><span class='ui-icon ui-icon-seek-start'></span>Prev</a></li>
            <li><a href='#'><span class='ui-icon ui-icon-stop'></span>Stop</a></li>
            <li><a href='#'><span class='ui-icon ui-icon-play'></span>Play</a></li>
            <li><a href='#'><span class='ui-icon ui-icon-seek-end'></span>Next</a></li>
        </ul>
    </li>
</ul>

</body>
</html>
Try The Code

jQuery UI & Menu: Basic menu

This entry is part 1 of 2 in the series jQuery UI Menu

jQuery UI Menu – Default functionality

jQuery UI really makes it easy to design menu items.  Here a menu with the default configuration, disabled items and nested menus.

A list is transformed, adding theming, mouse and keyboard navigation support. Try to tab to the menu then use the cursor key to navigate.

<!doctype html>
<html lang='en'>
<head>
    <meta charset='utf-8'>
    <title>jQuery UI Menu - Default functionality</title>
    <link rel='stylesheet' href='//code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css'>
    <script src='//code.jquery.com/jquery-1.10.2.js'></script>
    <script src='//code.jquery.com/ui/1.10.4/jquery-ui.js'></script>
    <link rel='stylesheet' href='https://codecrawl.com/code/jqueryui/jqueryui_style.css'>
    <script>
        $(function () {
            $('#menu').menu();
        });
    </script>
    <style>
        .ui-menu {
            width: 150px;
        }
    </style>
</head>
<body>

<ul id='menu'>
    <li class='ui-state-disabled'><a href='#'>Aberdeen</a></li>
    <li><a href='#'>Ada</a></li>
    <li><a href='#'>Adamsville</a></li>
    <li><a href='#'>Addyston</a></li>
    <li>
        <a href='#'>Delphi</a>
        <ul>
            <li class='ui-state-disabled'><a href='#'>Ada</a></li>
            <li><a href='#'>Saarland</a></li>
            <li><a href='#'>Salzburg</a></li>
        </ul>
    </li>
    <li><a href='#'>Saarland</a></li>
    <li>
        <a href='#'>Salzburg</a>
        <ul>
            <li>
                <a href='#'>Delphi</a>
                <ul>
                    <li><a href='#'>Ada</a></li>
                    <li><a href='#'>Saarland</a></li>
                    <li><a href='#'>Salzburg</a></li>
                </ul>
            </li>
            <li>
                <a href='#'>Delphi</a>
                <ul>
                    <li><a href='#'>Ada</a></li>
                    <li><a href='#'>Saarland</a></li>
                    <li><a href='#'>Salzburg</a></li>
                </ul>
            </li>
            <li><a href='#'>Perch</a></li>
        </ul>
    </li>
    <li class='ui-state-disabled'><a href='#'>Amesville</a></li>
</ul>

</body>
</html>
Try The Code