1
81041
2019-06-20 ab3c4acf83f54f8449ca8664c4a2bb79bd30f297
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
function Search(search) {
    this.search = search;
}
 
Search.prototype.showSearch= function() {
    this.search.animate({height: '40px'});
}
 
Search.prototype.hideSearch = function() {
    this.search.animate({height: '0'});
}
 
function addSearchContent(container) {
    var searchDiv = $('<div class="search" style="position: absolute; top: 10px; left: 50%; margin-left: -200px; z-index: 99999; width: 500px; height: 0; overflow:hidden;"></div>');
    var inputDiv = $('<div style="float:left"><input type="text" style="width:300px; height: 28px; border:1px solid #ccc; border-right:none" class="pos-txt"></div>');
    var aDiv = $('<div style="float:left"><a href="javascript:;" style="display:block;height: 28px;line-height:28px;padding: 0 20px; border:1px solid #ccc; text-decoration:none; color:#FFFFFF;background-color:#3453F6" class="search-btn">搜索地址</a></div>');
    var aClose = $('<div style="float:left; margin-left: -20px;"><a href="javascript:search.hideSearch();" style="display:block;width: 20px;height: 20px;line-height:20px;text-align: center; border:none; text-decoration:none; color:#FFFFFF;background-color:none">X</a></div>')
    var clear = $('<div class="clear"></div>');
 
    searchDiv.append(inputDiv);
    searchDiv.append(aDiv);
    searchDiv.append(aClose);
    searchDiv.append(clear);
 
    container.prepend(searchDiv);
}
 
$(function() {
    $('#map').on('dblclick', '.search', function() {
        return false;
    });
});