mirror of
https://github.com/wu736139669/vczero.github.io.git
synced 2026-08-05 06:23:38 +00:00
add search list
This commit is contained in:
+27
-6
@@ -2,16 +2,37 @@
|
||||
define('home/search', function(require, exports, module){
|
||||
var $ = require('lib/zepto_pj');
|
||||
var input = $('#search_input_text');
|
||||
var router = [
|
||||
'上海 到 扬州 两日游',
|
||||
'上海 到 常州 一日游',
|
||||
'上海 到 衢州 一日游'
|
||||
];
|
||||
var tpl = $('#tpl_search').html();
|
||||
var container = $('#SEARCH_TPL');
|
||||
|
||||
|
||||
var data = {
|
||||
items:[
|
||||
{
|
||||
router: '上海到扬州',
|
||||
desc: '两日游'
|
||||
},
|
||||
{
|
||||
router: '上海到常州',
|
||||
desc: '一日游'
|
||||
},
|
||||
{
|
||||
router: '上海到衢州',
|
||||
desc: '两日游'
|
||||
},
|
||||
{
|
||||
router: '郑州到青岛',
|
||||
desc: '三日游'
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
|
||||
//focus事件
|
||||
input.on('focus', function(){
|
||||
|
||||
var html = _.template(tpl)(data);
|
||||
container.html(html);
|
||||
container.fadeIn();
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user