【问题标题】:Search Image by specified size按指定尺寸搜索图片
【发布时间】:2019-10-26 16:23:45
【问题描述】:

不久前我得到了一些帮助,我做了一些东西,可以在谷歌上搜索预设大小的图像。现在我想知道是否可以更改此 HTML5,以便您可以输入自己的尺寸来使用而不是预设的尺寸。因此,如果我在一个标记为 width 的文本框中输入 54 并在一个标记为 height 的文本框中输入 10,我只会得到结果图像宽度为 54,高度为 10

<form action="https://www.google.com/search" method="get">
   <input name="tbm" value="isch" type="hidden">
   <input name="tbs" value="isz:ex,iszw:10328,iszh:7760" type="hidden">
   <input name="q" size="35" type="text" placeholder="zelda">
   <input type="submit" value="Find 10K images">
 </form>

【问题讨论】:

    标签: html image search google-image-search


    【解决方案1】:
    <script>
        function addSpecs() {
            document.getElementsByName("tbs")[0].value =
                "isz:ex,iszw:"
                + document.getElementById("w").value
                + ",iszh:"
                + document.getElementById("h").value;
        }
    </script>
    <form action="//www.google.com/search" method="get">
        <input type="hidden" name="tbm" value="isch" />
        <input type="hidden" name="tbs" value="" />
        w: <input type="text" id="w" /><br />
        h: <input type="text" id="h" /><br />
        <input type="text" name="q" size="35" /><br />
        <input type="submit" value="Find images" onclick="addSpecs();" />
     </form>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-12-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-03-02
      相关资源
      最近更新 更多