Location: PHPKode > scripts > CSS Crush > peteboere-css-crush-465ad01/plugins/ie-inline-block.php
<?php
/**
 * Simulate inline-block in IE < 8
 * 
 * @before 
 *     display: inline-block;
 * 
 * @after
 *     display: inline-block;
 *     *display: inline;
 *     *zoom: 1;
 */

csscrush_hook::add( 'rule_postalias', 'csscrush_display_inlineblock' );

function csscrush_display_inlineblock ( csscrush_rule $rule ) {
	if ( $rule->propertyCount( 'display' ) < 1 ) {
		return;
	}
	$new_set = array();
	foreach ( $rule as $declaration ) {
		$new_set[] = $declaration;
		$is_display = $declaration->property === 'display';
		if ( 
			$declaration->skip || 
			! $is_display || 
			$is_display && $declaration->value !== 'inline-block' ) {
			continue;
		}
		$new_set[] = new csscrush_declaration( '*display', 'inline' );
		$new_set[] = new csscrush_declaration( '*zoom', 1 );
	}
	$rule->declarations = $new_set;
}
Return current item: CSS Crush