Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/394.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/86.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 如何更改google cse中的默认优化标签?_Javascript_Jquery_Google Custom Search - Fatal编程技术网

Javascript 如何更改google cse中的默认优化标签?

Javascript 如何更改google cse中的默认优化标签?,javascript,jquery,google-custom-search,Javascript,Jquery,Google Custom Search,我一直在到处寻找一种方法,可以将默认选项卡“All”更改为搜索结果中可供选择的标签 到目前为止,这是我从“”中发现的,但我不认为这是为了我的特定目的 var customSearchOptions = { 'defaultToRefinement' : 'refinement_label_name' }; var customSearchControl = new google.search.CustomSearchControl('YOUR_CSE_ID', customSearch

我一直在到处寻找一种方法,可以将默认选项卡“All”更改为搜索结果中可供选择的标签

到目前为止,这是我从“”中发现的,但我不认为这是为了我的特定目的

var customSearchOptions =
{ 'defaultToRefinement' : 'refinement_label_name' };

var customSearchControl =
    new google.search.CustomSearchControl('YOUR_CSE_ID', customSearchOptions);
我还偶然发现了一篇文章,其中有一个无关的主题,似乎已经完成了它-只需运行代码片段并单击搜索按钮,看看我的意思:-我已经对它进行了研究,发现它与引擎ID相关,在那个例子中是:“017643448806904610:4gvhea_mvga”


如何将默认的“全部”选项卡更改为其他选项卡,同时仍然可以使用其他选项卡?

我似乎已经用CSS解决了这个问题

div > div.gsc-tabHeader:nth-child(1) {
    visibility: hidden;
}

div > div.gsc-tabHeader:nth-child(1):after {
    content: "Insert_NewTab_Name";
    visibility: visible;
}

.gsc-tabHeader.gsc-tabhActive:after {
    border: 1px solid Insert_border_color;
    border-bottom-color: #fff !important;
    padding: 7px;
    visibility: visible;
}