color for area shape php

≡放荡痞女 提交于 2019-12-11 20:34:28

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!