php - 如何在php网页中获取iframe的颜色?

标签 php jquery html iframe color-picker

我想创建颜色选择器,它将在 PHP 网页中点击时从其他网站选择颜色。

我已经提供了在我的网页中为颜色选择添加引用网站 url 的选项。我在 Iframe 中打开引用 URL,但在单击它时没有获得 iframe 的颜色。

<!DOCTYPE html>
<html>
    <head>

        <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js"></script>
        <script>
          $('iframe').load(function(){   $($("iframe")[0].contentWindow).on('click', function(event) {  alert('test'); });});
        </script>
    </head>
    <body>
        <iframe id="iframe" src="http://www.theuselessweb.com/" width="500px;" height="500px">
        </iframe>
        <br>
    </body>
</html>

最佳答案

我有其他选项可以从其他网站获取颜色。为了首先获得颜色,我使用 google pagespeed api 获取输入的 url 的屏幕截图,并从该图像中获取颜色代码

关于php - 如何在php网页中获取iframe的颜色?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40421191/

相关文章:

jquery - 如何使用动态ID获取多选选项值?

javascript - 如何将对象的键/值对写入页面

php - HighCharts Basic 线不显示线

php - 从多个用户提供的 MySQL 搜索提供 where 子句 - 修复和更好的算法

php - mysql分组选择最近的日期

php - Google + 合作伙伴插入事件

javascript - 图表在 Chrome 中呈现,但在 FF 和 IE 中不呈现

php - 合并多个关联数组并使用默认值添加缺失的列

javascript - 如何在 jquery 中检测 php 循环内单击了哪个按钮元素?

javascript - 可以在页面加载时自动登录或自动提交表单吗?