我想检查一个 div 的类并在单击时将其更改为另一个。
我的 if 语句一定有问题。
我会很感激。
$("#mapresize").click(function() {
    if (this.className == "mapexpand width100") {
        $("div", this).attr('class', 'mapcollapse width100');
        $("#checkin-gmap").animate({
            height: '500px'
        }, 500, function() {
            google.maps.event.trigger(map, "resize");
        });
        // $(".checkinmap-control").show("500");
    } else {
        $(this).attr('class', 'mapexpand width100');
        $("#checkin-gmap").animate({
            height: '250px'
        }, 500, function() {
            google.maps.event.trigger(map, "resize");
        });
        // $(".checkinmap-control").hide("500");
    }
    return false;
});