颜色为区域形状php [英] color for area shape php

查看:91
本文介绍了颜色为区域形状php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开始从事新项目,并且我为按钮设置了任务颜色,即当前页面上的href. 此处的按钮.在该项目中,所有按钮都只是图像!

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?

推荐答案

要更改按钮的颜色,您需要创建一些具有不同颜色的按钮的新图像,这些颜色可以在单击按钮时替换.

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.

完成后,您已经创建了HTML以重新组装页面上的各个部分,您将需要一些JavaScript来更改onClick上的按钮图像,否则您的PHP必须使用正确的按钮来生成一个新页面.

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.

事后考虑,您也许可以使用HTML Canvas元素执行此操作,但这是一种完全不同的方法!

As an afterthought, you might be able to do this with HTML Canvas elements, but that's a whole different approach!

这篇关于颜色为区域形状php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆