Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/79.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
jQuery动画显示div的绝对位置不在IE 7中工作_Jquery_Internet Explorer_Animation - Fatal编程技术网

jQuery动画显示div的绝对位置不在IE 7中工作

jQuery动画显示div的绝对位置不在IE 7中工作,jquery,internet-explorer,animation,Jquery,Internet Explorer,Animation,以下代码由页面顶部的3个标记调用。页面是一系列缩略图,通过单击标签进行过滤http://parlaycreative.com/work. 此功能在Win和OSX上的SF和FF中正常工作,但在IE中不正常。在IE中,第一次单击a时,代码正常工作,但在第二次s已淡出时,代码不起作用。IE在选择显示为“无”的元素时有问题吗 jQuery(document).ready(function() { //Align objects in grid moveProjects('', 0); // f

以下代码由页面顶部的3个标记调用。页面是一系列缩略图,通过单击标签进行过滤http://parlaycreative.com/work. 此功能在Win和OSX上的SF和FF中正常工作,但在IE中不正常。在IE中,第一次单击a时,代码正常工作,但在第二次s已淡出时,代码不起作用。IE在选择显示为“无”的元素时有问题吗

jQuery(document).ready(function() {
//Align objects in grid
    moveProjects('', 0);

// filter project previews on click
jQuery('.category-filter').mouseup(function() {
    var filter_string = '';

    // toggle .active state of fitler links
    if ( jQuery(this).is('.active')) {
        jQuery(this).removeClass('active');
    } 
    else {
        jQuery(this).addClass('active');
    }

    jQuery('.category-filter').each(function(index) {
        if(jQuery(this).is('.active')) {
            filter_string += '.' + jQuery(this).text().toLowerCase() + ',';
        }
    });

    // Remove trailing comma
    filter_string = filter_string.substring(0, filter_string.length-1);

    // Fade .project-preview-wrapper if inactive types
    jQuery('.project-preview-wrapper').not(filter_string).fadeOut('fast');

    setTimeout(moveProjects, 250, filter_string, 500);
});

// Set aboslute position of .project-preview-wrapper in grid
function moveProjects (filter_string, time) {
    var cur_item = 0;
    var num_cols = 4;
    var num_rows = 0;
    var preview_width = 150;
    var preview_height = 150;
    var margin = 9;

    jQuery('.project-preview-wrapper').each(function (index) {
        var left_val = margin * (cur_item % num_cols) + preview_width * (cur_item % num_cols);
        var top_val = num_rows * (preview_height + margin);
        if (jQuery(this).css('display') != 'none') {
            jQuery(this).animate({'left':left_val,'top':top_val}, time);
            if (cur_item % num_cols == 3) {
                num_rows ++;
            }
            cur_item++;
        }
        else if (jQuery(this).is(filter_string) || filter_string == '') {
            jQuery(this).animate({'left':left_val,'top':top_val}, 0).delay(time).fadeIn('fast');
            if (cur_item % num_cols == 3) {
                num_rows ++;
            }
            cur_item++;
        }
     });
    num_rows = Math.ceil(cur_item / num_cols);
    jQuery('.view-id-work').animate({'height':(num_rows) * (preview_height + margin)},time);
};  
});