
// 搜索框的变化
$(".administer-head input").focus(function(){
    $('.administer-head input').css({"transition":"all ease-in .5s","width":"84.85%"});
    $(this).siblings('.head-serach').css({"right":'3.2%'});
    var re_length = $(this).val().length;
    if(re_length >=1 ){
        $(".administer-head").find('.head-remove').css({"opacity":'1'});
    }
}).blur(function(){
    var sd_width = Math.ceil($('.administer-head .head-serach').width())+10;
    $('.administer-head input').css({"transition":"all ease-in .5s","width":"100%"});
    $(this).siblings('.head-serach').css({"right":-sd_width+'px'});
    $(".administer-head").find('.head-remove').css({"opacity":'0'});
});
$(".administer-head").find('input').on('input propertychange',function(){
    var re_length = $(this).val().length;
    if(re_length >=1 ){
        $(".administer-head").find('.head-remove').css({"opacity":'1'});
    }else{
        $(".administer-head").find('.head-remove').css({"opacity":'0'});
    }
});

$(".administer-head .head-remove").click(function () {
    $(this).siblings('input').val('').focus();
});

// 具体地址填写
var specific_height = parseInt($('.specific-address').height()/2);
$('.specific-address').css({"margin-top":-specific_height+"px"});
$('#specific').click(function () {
    $('.specific-address').show();
    $('.specific-address textarea').val($(this).text());
    $('.specific-address textarea').focus();
    $('.block-mask').show();
});
$('.specific-address button.cancel').click(function () {
    $('.specific-address').hide();
    $('.block-mask').hide();
    $('.specific-address textarea').val(" ");
});
$('.specific-address button.bao').click(function () {
    $('.specific-address').hide();
    $('.block-mask').hide();
    var text_sd = $('.specific-address textarea').val();
    $('#specific').text(text_sd);
    $('#ju-address').val(text_sd);
    $('.specific-address textarea').val(" ");
});

$('.exhibition-cont input.wed').click(function () {
    po_Last(this);
})
//定位input、textarea
function po_Last(obj) {
    obj.focus();//解决ff不获取焦点无法定位问题
    if (window.getSelection) {//ie11 10 9 ff safari
        var max_Len=obj.value.length;//text字符数
        obj.setSelectionRange(max_Len, max_Len);
    }
    else if (document.selection) {//ie10 9 8 7 6 5
        var range = obj.createTextRange();//创建range
        range.collapse(false);//光标移至最后
        range.select();//避免产生空格
    }
}
