<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Alternate Results Location - Google AJAX Search API Sample</title>
<!-- Replace with http://www.google.com/jsapi -->
<script src="http://www.google.com/jsapi" type="text/javascript"></script>
<script language="Javascript" type="text/javascript">//<![CDATA[
google.load('search', '1');
function OnLoad() {
// create a search control
var searchControl = new google.search.SearchControl();
// web search, open, alternate root
var options = new google.search.SearcherOptions();
options.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
options.setRoot(document.getElementById("somewhere_else"));
searchControl.addSearcher(new google.search.WebSearch(), options);
searchControl.setResultSetSize(google.search.Search.LARGE_RESULTSET);
var options = new google.search.SearcherOptions();
options.setExpandMode(google.search.SearchControl.EXPAND_MODE_OPEN);
searchControl.addSearcher(new google.search.VideoSearch(), options);
// tell the searcher to draw itself and tell it where to attach
searchControl.draw(document.getElementById("search_control"));
}
google.setOnLoadCallback(OnLoad);
//]]>
</script>
<style type="text/css">
body {font-size:12px;}
table {position:relative;margin-left:auto;margin-right:auto;border:solid px grey;}
.top {padding-top: 75px;}
.gs-result {padding: 6px;border: solid 1px #DCDEE0;background-color: #EDEFF0;}
.gs-result:hover { border: solid 1px #B9C3C9;}
.gs-text-box {margin-top: 10%;}#search_control { margin: 20px; }
</style>
</head>
<body>
<table width="700px">
<tr>
<td class="top" valign="top" width="400px">
<div id="somewhere_else">
Loading
</div>
</td>
<td valign="top" width="300px">
<div id="search_control">
Loading...
</div>
</td>
</tr>
</table>
</body>
</html>
如果你在你的瀏覽器中看到這個,你會看到大的塊,如果你把它們放在斜面上,斜紋的邊框會更暗。我想知道是否有一種方法可以選擇整個塊而不是該塊的href。我不認爲這可以用CSS來完成,我認爲JavaScript(更好的jQuery)是實現它的方法。 (很明顯,我現在不知道如何..)使整個塊可選
有點晚了,但謝謝:) – Youss 2011-07-20 14:59:50