# 3in1 Wizard

Open me!

Demo View | Source Code (opens new window) | Download all widgets

Assets:

Images:

CSS:

JavaScripts:

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    	<title>3 in 1 wizard</title>
    	
    	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    	
    	<link type="text/css" rel="stylesheet"  href="style.css">
    	
        <script type="text/javascript" src="../core/lib/jquery-1.6.2.min.js"></script>
        <script type="text/javascript" src="../core/lib/jda-0.1.js"></script>
    	<script type="text/javascript" src="js/jda.ui.radiobuttons.js"></script>
    	<script type="text/javascript" src="js/3-in1-wizard.js"></script>
    </head>
    <body>
        <h1>3 in 1 wizard</h1>
    
    	<div class="content">
    		<div class="step-wrapper">
    			<span class="step step-1">Step 1</span>
    			<span class="step step-2">Step 2</span>
    			<span class="step step-3">Step 3</span>
    		</div>
    		
    		<img class="menu" src="../core/images/first.png" alt="" />
    	
    		<div class="first">
    			<select name="test" class="select-radio">
    				<option value="">-----</option>
    				<option value="1">value-1</option>
    				<option value="2">value-2</option>
    			</select>
    		</div>
    		
    		<div class="second">
    			<select name="test2" class="select-radio" multiple="multiple">
    				<option value="">-----</option>
    				<option value="1" selected="selected">value-1</option>
    				<option value="2">value-2</option>
    				<option value="3" selected="selected">value-3</option>
    				<option value="4">value-4</option>
    				<option value="5">value-5</option>
    			</select>
    			<div class="clear"></div>
    			<a class="submit_button" href="javascript: void(0);" class="left"></a>
    		</div>
    		
    		<div class="third">
    			<select name="test3" class="select-radio">
    				<option value="">-----</option>
    				<option value="1">value-1</option>
    				<option value="2">value-2</option>
    			</select>
    		</div>
    	</div>
    </body>
    </html>
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    .submit_button {
    	width: 206px;
    	height: 29px;
    	background: url("../core/images/button_submit.png") no-repeat;
    	margin-left: 240px;
    	display: block;
    }
    
    .submit_button:hover {
    	width: 206px;
    	height: 29px;
    	background: url("../core/images/button_submit_active.png") no-repeat;
    	margin-left: 240px;
    	display: block;
    }
    
    .clear {
    	clear: both;
    }
    
    .left {
    	float: left;
    }
    
    .da_ui-select-radio-list {
        width: 636px;
        padding: 10px 0 0 0;
    }
    
    .da_ui-select-radio-list li {
        list-style:none;
        display:block;
        background:url("../core/images/radio_b.png") no-repeat left center;
        width:551px;height:38px;
        line-height:38px;
        font-size:12px;
        padding:0 17px 0 68px;
        margin-bottom:8px;
        cursor:pointer;
    }
    
    .da_ui-select-radio-list li.da_ui-state-active {
        background: url("../core/images/radio_b_a.png") no-repeat left center !important;
        cursor: default;
    }
    
    .da_ui-select-radio-list li.da_ui-state-hover {
        background: url("../core/images/radio_b_g.png") no-repeat left center;
    }
    
    ul.da_ui-select-radio-multi-list {
        float: left;
    }
    
    .da_ui-select-radio-multi-list {
        width: 322px;
        padding: 15px 30px 0 0;
    }
    
    .da_ui-select-radio-last {
        padding-right: 0px;
    }
    
    .da_ui-select-radio-multi-list li {
        list-style: none;
        display: block;
        background: url("../core/images/checkbox_b.png") no-repeat left center;
        width: 322px;
        height: 37px;
        line-height: 37px;
        font-size: 12px;
        padding: 0 17px 0 68px;
        margin-bottom: 8px;
        cursor: pointer;
    }
    
    .da_ui-select-radio-multi-list li.da_ui-state-active {
        background: url("../core/images/checkbox_b_a.png") no-repeat left center !important;
    }
    
    .da_ui-select-radio-multi-list li.da_ui-state-hover {
    	background: url("../core/images/checkbox_b_g.png") no-repeat left center;
    }
    
    .step-wrapper {
        position: relative;
    }
    
    .step {
        position: absolute;
        top: 9px;
        color: #fff;
    }
    
    .step-1 {
        left: 70px;
    }
    
    .step-2 {
        left: 290px;
    }
    
    .step-3 {
        left: 520px;
    }
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    (function($) {
        var increment = 0;
    
        $.widgetda("da_ui.radioButtons", {
            version: "0.1",
            options: {
                multiple: false,
                column: 1
            },
            _create: function() {
                var self = this,
                    o = self.options,
                    el = self.element;
    
                o.multiple = (el.attr('multiple') == "multiple" ? true : false);
    
                increment++;
                
                this.element.css('display', 'none');
                this.tmplOptions = '<li data-value="%value%" class="%class%">%label%</li>';
    
                var listdata = el.children().map(
                    function() {
                        var $this = $(this);
                        return self._optionItem($this);
                    }).get();
    
                var selectname = el.attr("id");
                if(!selectname) {
                    selectname = "da_ui-select-radio-";
                    
                    if(o.multiple) {
                        selectname += "multi-";
                    }
                    selectname += increment + Math.floor(Math.random()*1000);
                }
    
                this.lists = this._listsColumn(listdata, selectname);
                this.block_list = $('<div class="da_ui-select-radio-block"></div>');
    
                for(var ii = 0; ii < this.lists.length; ii++) {
                    var list = this.lists[ii];
    
                    $("li", list).click(
                        function() {
                            self._selectOption(this, list);
                        }).bind("mouseenter", function() {
                            $(this).addClass("da_ui-state-hover");
                        }).bind("mouseleave", function() {
                            $(this).removeClass("da_ui-state-hover");
                        });
                    this.block_list.append(list);
                }
    
                this.block_list.children().insertAfter(el);
            },
            _optionItem: function(elem) {
                if(!elem.val()) {
                    return;
                }
                
                var selected = "", recordclass = elem.attr("class") || "";
                if(elem.attr("selected")){
                    recordclass = "da_ui-state-active " + recordclass;
                }
    
                var optionItem = this.tmplOptions
                    .replace("%value%", elem.val())
                    .replace("%class%",recordclass)
                    .replace("%label%", elem.text());
                    
                return optionItem;
            },
            _listsColumn: function(listdata, selectname) {
                var col_count = this.options.column;
                var div_list = parseInt(listdata.length / col_count),
                    mod_list = listdata.length % col_count,
                    objects_array = [], last = 0, start;
    
                for(var ii = 0; ii < col_count; ii++) {
                    start = last;
                    last = start + div_list;
                    if(ii < mod_list) last++;
    
                    objects_array.push(
                        $('<ul></ul>', {
                            'id': selectname + '-list-' + ii,
                            'class': (this.options.multiple?"da_ui-select-radio-multi-list":"da_ui-select-radio-list")
                        })
                        .data({
                            "element": this.element
                        })
                        .append(listdata.slice(start, last).join(""))
                    );
                }
                
                if(this.options.multiple) {
                    objects_array[0].addClass("da_ui-select-radio-first");
                    objects_array[objects_array.length-1].addClass("da_ui-select-radio-last");
                }
    
                return objects_array;
            },
            _selectOption: function(opt, list) {
                if(this.options.multiple) {
                    return this._selectOptionMultiple(opt);
                }
    
                $("li", list).removeClass("da_ui-state-active");
                $(opt).addClass("da_ui-state-active");
    
                this._emptySelected();
                var value = $(opt).attr("data-value");
                this.element.find("option[value='"+value+"']").attr("selected", "selected");
            },
            _selectOptionMultiple: function(opt) {
                var value = $( opt ).attr("data-value");
    
                if(!$(opt).hasClass("da_ui-state-active")) {
                    $(opt).addClass("da_ui-state-active");
                    this.element.find("option[value='"+value+"']").attr("selected", "selected");
                } else {
                    $(opt).removeClass("da_ui-state-active");
                    this.element.find("option[value='"+value+"']").removeAttr("selected");
                }
            },
            _emptySelected: function() {
                this.element.find("option:selected").each(function() {
                    this.selected=false;
                });
            }
        });
    })(jQuery);
    
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    $(function() {
        $(".select-radio[name=test]").radioButtons({});
        $(".select-radio[name=test3]").radioButtons({});
        $(".select-radio[name=test2]").radioButtons({column: 2});
    
        $(".second").hide();
        $(".third").hide();
    
        $(".first ul.da_ui-select-radio-list li").click(function() {
            $(this).parent().parent().prev().attr("src", "../core/images/second.png");
            $(this).parent().hide();
            $(".second").show();
        });
    
        $(".submit_button").click(function() {
            $(this).parent().prev().prev().attr("src", "../core/images/third.png");
            $(this).parent().hide();
            $(".third").show();
        });
    });
    
    
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    // Make sure to add code blocks to your code group
    Last Updated: 3/1/2021, 8:30:51 AM