Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $hover = -50;
- $active = -100;
- $names = array(
- 'start' => 90,
- 'fotogalerie' => 120,
- 'videogalerie' => 44,
- 'magazyn' => 91,
- 'zlot' => 77,
- 'konkursy' => 41,
- 'kontakt' => 12
- );
- $prefix = '.top ul.menu li';
- $suffix = 'a';
- $padding = max(array_map('strlen', array_keys($names))) + strlen($prefix) + strlen($suffix) + 10;
- $current_width = 0;
- foreach($names as $name => $w)
- {
- echo str_pad($prefix.'.'.$name.' '.$suffix.' ', $padding, ' ', STR_PAD_RIGHT).' { background-position: ' . $current_width . 'px 0px; width: ' . $w . 'px; }'."\n";
- echo str_pad($prefix.'.'.$name.' '.$suffix.':hover ', $padding, ' ', STR_PAD_RIGHT).' { background-position: ' . $current_width . 'px ' . $hover . 'px;'."\n";
- echo str_pad($prefix.'.'.$name.' '.$suffix.'.active ', $padding, ' ', STR_PAD_RIGHT).' { background-position: ' . $current_width . 'px ' . $active . 'px;'."\n";
- echo "\n";
- $current_width -= $w;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement