问题
i start working on new project and i have task-make color for button, what have href on current page. Buttons there. And in that project that all buttons just image!
<map id="schemaMap" name="schemaMap">
<? for ($i=0;$i<3;$i++):?>
<area shape="<?php echo $shape ?>"
coords="<?php echo $coords[$i] ?>"
<? if ($curretAction == $action [$i]):?>
onclick ="return false;"
<? else: ?>
href ="<?php echo $links[$i] ?>"
<? endif; ?>
alt ="<?php echo $this->translate($alt[$i]); ?>"
/>
<? endfor;?>
</map>
And now i don't know how make that part of image with color. Any ideas?
回答1:
To change the colour of your buttons you'll need to create some new images with different colour buttons that you can substitute when the buttons are clicked.
You can create a whole new image with each button in a different colour as you need (slow!) or you can slice the image up into smaller parts and create new images just for the buttons.
Once done, and you have created HTML to reassemble the parts on the page you'll need some javascript to change the button images onClick, or your PHP will have to generate a new page with the right buttons.
Either way, start with the image and a graphics program.
As an afterthought, you might be able to do this with HTML Canvas elements, but that's a whole different approach!
来源:https://stackoverflow.com/questions/17078625/color-for-area-shape-php