0

ie8 I では、次のメッセージがスローされています

「このページのスクリプトが Internet Explorer の実行速度を低下させています」

これは、次のコードをトリガーする選択ボックスを変更するときに発生します。php でこれを行う方がよいことは承知していますが、残念ながらそれはオプションではありません。

コードは、ドロップダウンから選択された会場で渡されたイベントを示しています。会場を選択すると、その会場にないすべてのイベントが非表示になります。

コードが実行されているページはhttp://sussexpast.co.uk.blueplanetdns.com/eventsです

ありがとう

jQuery(function($) {

    function hideMonths(){
        var months = new Array('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
        for( var i = 0; i < months.length; i++ ){
            //alert(months[i]);
            $('.events-list .post:visible .event-month:contains('+months[i]+')').not(':first').css('visibility','hidden');
        }
    }

    $(document).ready(function(){
        hideMonths();
    });

    $('.event-location-filter select').change( function() {
        var selectedProperty = $(this).val();
        //alert(selectedProperty);
        $('.post').each( function(){
            $(this).show()
            var eventProperty = $(this).find('.venue a').text();
            //alert(eventProperty);
            if( selectedProperty == 'Select a location' ){
                $(this).show()
                hideMonths();
            }
            else{
                if( eventProperty !== selectedProperty ){
                    $(this).hide()
                    $('.events-list .event-month').css('visibility','visible');
                    hideMonths();
                }
            }
        });
    });

});
4

1 に答える 1