jQuery UI & Tabs: Vertical tabs

This entry is part 2 of 7 in the series jQuery UI Tabs

jQuery UI Tabs – Vertical Tabs functionality

Click tabs to swap between content that is divided into logical sections.

<!doctype html>
<html lang='en'>
<head>
    <meta charset='utf-8'>
    <title>jQuery UI Tabs - Vertical Tabs 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 () {
            $('#tabs').tabs().addClass('ui-tabs-vertical ui-helper-clearfix');
            $('#tabs li').removeClass('ui-corner-top').addClass('ui-corner-left');
        });
    </script>
    <style>
        .ui-tabs-vertical {
            width: 55em;
        }

        .ui-tabs-vertical .ui-tabs-nav {
            padding: .2em .1em .2em .2em;
            float: left;
            width: 12em;
        }

        .ui-tabs-vertical .ui-tabs-nav li {
            clear: left;
            width: 100%;
            border-bottom-width: 1px !important;
            border-right-width: 0 !important;
            margin: 0 -1px .2em 0;
        }

        .ui-tabs-vertical .ui-tabs-nav li a {
            display: block;
        }

        .ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active {
            padding-bottom: 0;
            padding-right: .1em;
            border-right-width: 1px;
            border-right-width: 1px;
        }

        .ui-tabs-vertical .ui-tabs-panel {
            padding: 1em;
            float: right;
            width: 40em;
        }
    </style>
</head>
<body>

<div id='tabs'>
    <ul>
        <li><a href='#tabs-1'>Pitbull</a></li>
        <li><a href='#tabs-2'>Sean Kingston</a></li>
        <li><a href='#tabs-3'>Taylor Swift</a></li>
    </ul>
    <div id='tabs-1'>
        <h2>Content heading 1</h2>

        <p>Pitbull is a Cuban–American recording artist and Latin Grammy winning rapper from Miami, Florida.</p>
    </div>
    <div id='tabs-2'>
        <h2>Content heading 2</h2>

        <p>Sean Kingston pursued a music career and debuted in 2007 with the album Sean Kingston.</p>
    </div>
    <div id='tabs-3'>
        <h2>Content heading 3</h2>

        <p>Taylor Swift, raised in Wyomissing, Pennsylvania. She moved to Nashville, Tennessee at the age of
            fourteen.</p>

        <p>She is known for her narrative songs about her personal experiences.</p>
    </div>
</div>

</body>
</html>
Try The Code

jQuery UI & Slider: Vertical range slider

This entry is part 4 of 11 in the series jQuery UI Slider

jQuery UI Slider – Vertical range slider

Change the orientation of the range slider to vertical.

Assign a height value via .height() or by setting the height through CSS, and set the orientation option to “vertical.”

<!doctype html>
<html lang='en'>
<head>
    <meta charset='utf-8'>
    <title>jQuery UI Slider - Vertical range slider</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 () {
            $('#slider-range').slider({
                orientation: 'vertical',
                range: true,
                values: [ 17, 67 ],
                slide: function (event, ui) {
                    $('#amount').val('$' + ui.values[ 0 ] + ' - $' + ui.values[ 1 ]);
                }
            });
            $('#amount').val('$' + $('#slider-range').slider('values', 0) +
                    ' - $' + $('#slider-range').slider('values', 1));
        });
    </script>
</head>
<body>

<p>
    <label for='amount'>Target sales goal (Millions):</label>
    <input type='text' id='amount' style='border:0; color:#f6931f; font-weight:bold;'>
</p>

<div id='slider-range' style='height:250px;'></div>


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

jQuery UI & Slider: Vertical slider

This entry is part 11 of 11 in the series jQuery UI Slider

jQuery UI Slider – Vertical slider

Change the orientation of the slider to vertical.

Assign a height value via .height() or by setting the height through CSS, and set the orientation option to “vertical.”

<!doctype html>
<html lang='en'>
<head>
    <meta charset='utf-8'>
    <title>jQuery UI Slider - Vertical slider</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 () {
            $('#slider-vertical').slider({
                orientation: 'vertical',
                range: 'min',
                min: 0,
                max: 100,
                value: 60,
                slide: function (event, ui) {
                    $('#amount').val(ui.value);
                }
            });
            $('#amount').val($('#slider-vertical').slider('value'));
        });
    </script>
</head>
<body>

<p>
    <label for='amount'>Volume:</label>
    <input type='text' id='amount' style='border:0; color:#f6931f; font-weight:bold;'>
</p>

<div id='slider-vertical' style='height:200px;'></div>

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

jQuery Mobile: Vertically Grouped Checkbox

This entry is part 15 of 73 in the series jQuery Mobile

Usually, we have the checkboxes arranged in vertical group format.

To integrate multiple checkboxes into a grouped button set, we put data-role=’controlgroup’ attribute on the fieldset.

Vertically Grouped Checkbox
<!DOCTYPE html>
<html>
<head>
    <link href='http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.css' rel='stylesheet'/>
    <script src='http://code.jquery.com/jquery-1.10.2.min.js'></script>
    <script src='http://code.jquery.com/mobile/1.4.0/jquery.mobile-1.4.0.min.js'></script>
    <title>Upwhere</title>
</head>
<body>
<div data-role='page'>
    <div data-role='header'><h1>Vertical Group Checkbox</h1></div>
    <br>

    <p>Vertical Group Check Box</p>
    <form>
        <fieldset data-role='controlgroup'>
            <input type='checkbox' name='checkbox-v-2a' id='checkbox-v-2a'>
            <label for='checkbox-v-2a'>One</label>
            <input type='checkbox' name='checkbox-v-2b' id='checkbox-v-2b'>
            <label for='checkbox-v-2b'>Two</label>
            <input type='checkbox' name='checkbox-v-2c' id='checkbox-v-2c'>
            <label for='checkbox-v-2c'>Three</label>
        </fieldset>
    </form>
  
    <div data-role='footer' data-position='fixed'>
        <h1>Footer</h1>
    </div>
</div>
</body>
</html>
Try The Code