jquery定位弹出

时间:2012-10-23 03:51:23

标签: jquery html css

当我点击英文按钮弹出窗口时,我只能在向下滚动后看到弹出窗口的全部内容... 有什么方法可以看到弹出的全部内容而不向下滚动

我在下面提供我的代码 http://jsfiddle.net/6QXGG/130/

原始代码

http://www.teslamotors.com/

js代码存在一些问题

    // locale selector actions
    $('#region-picker').click(function(){
        var foot_height = $('#footer').innerHeight();
        var foot_height_css = foot_height-1;
        var select_position = '-=' + (Number(400)+18);
        console.log("hallo"+select_position);
        var $selector = $('#locale-select');
        $('#locale_pop').fadeOut();
        $selector.css({top:foot_height_css});
        $selector.fadeIn(function(){
            $(this).addClass('open');
            $(this).animate({top:select_position}, 1000);
            });
    });
    $('#select-tab').click(function(e){
        e.stopPropagation()
        closeSelector('slide');
        });
    // don't hide when clicked within the box
    $('#locale-select').click(function(e){
        e.stopPropagation();
    });
    $(document).click(function(){ 
        if ($('#locale-select').hasClass('open')) {
            closeSelector('disappear');
        }
    });

    $('.locale-link').click(function(){
        var desired_locale = $(this).attr('rel');
        createCookie('desired-locale',desired_locale,360);
        createCookie('buy_flow_locale',desired_locale,360);
        closeSelector('disappear');
    })

    $('#locale_pop a.close').click(function(){
        var show_blip_count = readCookie('show_blip_count');
        if (!show_blip_count) {
            createCookie('show_blip_count',3,360);
        }
        else if (show_blip_count < 3 ) {
            eraseCookie('show_blip_count');
            createCookie('show_blip_count',3,360);
        }
        $('#locale_pop').slideUp();
        return false;
    });

function closeSelector(hide_type){
    var foot_height = $('#footer').innerHeight();
    var select_position = '+=' + (Number(400)+20);
    if (hide_type == 'slide') {
        $('#locale-select').animate({top:select_position}, 1000, function(){
        $(this).removeClass('open');
        $(this).fadeOut()
        });
    }
    else if (hide_type == 'disappear'){
        $('#locale-select').fadeOut('fast');
        $('#locale-select').removeClass('open');
    }
}

1 个答案:

答案 0 :(得分:0)

弹出窗口非常大,因此根据显示器的大小,它可能不会同时适合屏幕。但是,您可以通过更改来提高它:

var select_position = '-=' + (Number(400)+18);

为:

var select_position = '-=' + (Number(700)+18);

updated fiddle