iOS-like 1-n-level linkage Script II

Source: Internet
Author: User

One, picture

Two, Code 2.1,html script

var weekdayarr=[' Sunday ', ' Monday ', ' Tuesday ', ' Wednesday ', ' Thursday ', ' Friday ', ' Saturday '];
var Timearr = [' 08:30 ', ' 09:00 ', ' 09:30 ', ' 10:00 ', ' 10:30 ', ' 11:00 ', ' 11:30 ', ' 12:00 ', ' 12:30 ', ' 13:00 ', ' 13:30 ', ' 14:00 ', ' 14:30 ', ' 15:00 ', ' 15:30 ', ' 16:00 ', ' 16:30 ', ' 17:00 ', ' 17:30 ', ' 18:00 ', ' 18:30 ', ' 19:00 ', ' 19:30 ', ' 20:00 ', ' 20:30 ', ' 21:00 ' ];
var numarr=[' 1 ', ' 2 ', ' 3 ', ' 4 ', ' 5 '];

var uplinkdata =
[
{ID: ' 1 ', Value: ' Lamborghini '},
{
ID: ' 2 ',
Value: ' Rolls Royce ',
childs:[
{
ID: ' 1 ',
Value: ' Shadow '
},
{
ID: ' 2 ',
Value: ' Phantom ',
childs:[
{
ID: ' 1 ',
Value: ' Standard Edition '
},
{
ID: ' 2 ',
Value: ' Extended Version '
},
{
ID: ' 3 ',
Value: ' Peak Journey '
},
{
ID: ' 4 ',
Value: ' Streamer World '
},
{
ID: ' 5 ',
Value: ' The Metropolis Collector's Edition '
}
]
},
{
ID: ' 3 ',
Value: ' Ghost ',
childs:[
{
ID: ' 1 ',
Value: ' Extended Version '
},
{
ID: ' 2 ',
Value: ' Eternal love '
},
{
ID: ' 3 ',
Value: ' Ji '
},
{
ID: ' 4 ',
Value: ' Alpine collection '
}
]
},
{
ID: ' 4 ',
Value: ' Phantom ',
childs:[
{
ID: ' 1 ',
Value: ' Standard Edition '
},
{
ID: ' 2 ',
Value: ' Black Badge '
}
]
}
]
},
{
ID: ' 3 ',
Value: ' Bentley ',
childs:[
{
ID: ' 1 ',
Value: ' Mu Shang ',
childs:[
{
ID: ' 1 ',
Value: ' Standard Edition '
},
{
ID: ' 2 ',
Value: ' Extreme Edition '
}
]
},
{
ID: ' 2 ',
Value: ' Continental ',
childs:[
{
ID: ' 1 ',
Value: ' Premium Version '
},
{
ID: ' 2 ',
Value: ' Convertible standard Version '
},
{
ID: ' 3 ',
Value: ' Convertible Premium Edition '
}
]
}
]
},
{
ID: ' 4 ',
Value: ' Ferrari ',
childs:[
{
ID: ' 1 ',
Value: ' LaFerrari '
},
{
ID: ' 2 ',
Value: ' Ferrari 488 '
},
{
ID: ' 3 ',
Value: ' Gtc4lusso '
}
]
},
{
ID: ' 5 ',
Value: ' Maserati ',
childs:[
{
ID: ' 1 ',
Value: ' President '
},
{
ID: ' 2 ',
Value: ' Maserati GT '
},
{
ID: ' 3 ',
Value: ' Levante '
}
]
}
];


//----------------------------------------------------------

Only trigger and wheels are necessary parameters, others are optional parameters.
var mobileSelect1 = new Mobileselect ({
Trigger: ' #trigger1 ',
Title: ' Single Choice ',
Wheels: [
{Data:weekdayarr}
],
POSITION:[2]//Initialize which default is selected when the location is opened if not filled by default 0
});


var mobileSelect2 = new Mobileselect ({
Trigger: ' #trigger2 ',
Title: ' Double Choice ',
Wheels: [
{Data:weekdayarr},
{Data:timearr}
],
Position:[1, 2]
});


var mobileSelect3 = new Mobileselect ({
Trigger: ' #trigger3 ',
Title: ' Multiple Options ',
Wheels: [
{Data:numarr},
{Data:numarr},
{Data:numarr},
{Data:numarr},
{Data:numarr}
],
Position:[0, 1, 0, 1, 0],
Transitionend:function (Indexarr, data) {
},
Callback:function (Indexarr, data) {
}
});


var mobileSelect4 = new Mobileselect ({
Trigger: ' #trigger4 ',
Title: ' Region Selection ',
Wheels: [
{data:[
{
ID: ' 1 ',
Value: ' Nearby ',
childs:[
{ID: ' 1 ', Value: ' 1000 m '},
{ID: ' 2 ', Value: ' 2000 m '},
{ID: ' 3 ', Value: ' 3000 m '},
{ID: ' 4 ', Value: ' 5000 m '},
{ID: ' 5 ', Value: ' 10000 m '}
]
},
{ID: ' 2 ', Value: ' Upper Town '},
{ID: ' 3 ', value: ' Lower Town '},
{ID: ' 4 ', Value: ' Jianggan District '},
{ID: ' 5 ', Value: ' Gongshu District '},
{ID: ' 6 ', Value: ' West L. District '}
]}
],
Transitionend:function (Indexarr, data) {
Console.log (data);
},
Callback:function (Indexarr, data) {
Console.log (data);
}
});


var mobileSelect5 = new Mobileselect ({
Trigger: ' #trigger5 ',
Title: ' Model Selection ',
Wheels: [
{Data:uplinkdata}
],
Transitionend:function (Indexarr, data) {
Console.log (data);
},
Callback:function (Indexarr, data) {
Console.log (data);
}
});

iOS-like 1-n-level linkage Script II

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.