主にWEB関連の覚え書き。たまに実験もしてみる。

2009年12月26日土曜日

画像検索API+タブ


Loading images...

ソース

<style type="text/css">
  @import url("http://www.google.com/uds/solutions/dynamicfeed/gfdynamicfeedcontrol.css");
</style>

<!--script src="http://www.google.com/jsapi?key=xxxx"></script-->
<script src="http://www.google.com/jsapi"></script>
<script type="text/javascript"><!--
/*
*  The Hello World of the AJAX Search API
*/

google.load('search', '1');

google.setOnLoadCallback(

function () {
  // Create a search control
  var searchControl = new google.search.SearchControl();
  var searchFormElement = document.getElementById("hani2-images");
  var drawOptions = new google.search.DrawOptions();
  var searchOptions = new google.search.SearcherOptions();


  searchOptions.setExpandMode(google.search.SearchControl.EXPAND_MODE_PARTIAL);
  searchControl.addSearcher(new google.search.ImageSearch(), searchOptions);
  
  drawOptions.setSearchFormRoot(searchFormElement);
  // drawOptions.setDrawMode(google.search.SearchControl.DRAW_MODE_LINEAR);
  drawOptions.setDrawMode(google.search.SearchControl.DRAW_MODE_TABBED);

  // tell the searcher to draw itself and tell it where to attach
  searchControl.draw(searchFormElement, drawOptions);

  // execute an inital search
  searchControl.execute("土偶");
  searchControl.execute("ハニー");
  searchControl.execute("ハニワ");
}


);
-->
</script>

<hr style="clear:both;">
<div id="hani2-images">Loading images...</div>
<hr style="clear:both;">

0 件のコメント:

コメントを投稿