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

查看:22
本文介绍了区域形状 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天全站免登陆