mmenu searchfield:搜索形式和位置
mmenu searchfield: search form and position
我正在为我的网站使用 mmenu jquery 插件。
现在我注意到最新版本中的搜索字段可以配置为搜索表单。
1.How我知道吗?
我的正常搜索表单如下所示:
<form action="search.html" method="post">
<input type="text" name="item" id="searchform" placeholder="Search" />
<button type="submit" name="submit" id="searchbutton">Search</button>
<input type="hidden" name="do" value="search" />
<input type="hidden" name="searchin" value="all" />
<input type="hidden" name="send" value="1" />
</form>
我试过这个,但它不起作用:
$("#menu").mmenu({
navbars: { content: [ "prev", "searchfield", "close" ] },
searchfield: {
search: false,
form: {
action: "search.html",
method: "post" },
input: {
type: "text",
name: "item",
id: "searchform" },
input: {
type: "hidden",
name: "do",
value: "search" },
input: {
type: "hidden",
name: "searchin",
value: "all" },
input: {
type: "hidden",
name: "send",
value: "1" }
}
});
2.Is 可以将搜索字段向下移动到菜单末尾吗?
谢谢!
我知道这是一个旧话题,但如果有人也在寻找答案
为了在搜索字段中使用自定义表单,您需要添加配置,而不是选项。所以,正确的格式是:
$("#menu").mmenu({
navbars: { content: [ "prev", "searchfield", "close" ] },
searchfield: {
search: false
}
},{
"searchfield": {
form: {
action: "search.html",
method: "post"
},
input: {
type: "text",
name: "item",
id: "searchform"
}
}
});
您可以更改导航栏位置:
"navbars": [
{
"position": "bottom",
"content": [
"searchfield"
]
}
]
我正在为我的网站使用 mmenu jquery 插件。 现在我注意到最新版本中的搜索字段可以配置为搜索表单。
1.How我知道吗?
我的正常搜索表单如下所示:
<form action="search.html" method="post">
<input type="text" name="item" id="searchform" placeholder="Search" />
<button type="submit" name="submit" id="searchbutton">Search</button>
<input type="hidden" name="do" value="search" />
<input type="hidden" name="searchin" value="all" />
<input type="hidden" name="send" value="1" />
</form>
我试过这个,但它不起作用:
$("#menu").mmenu({
navbars: { content: [ "prev", "searchfield", "close" ] },
searchfield: {
search: false,
form: {
action: "search.html",
method: "post" },
input: {
type: "text",
name: "item",
id: "searchform" },
input: {
type: "hidden",
name: "do",
value: "search" },
input: {
type: "hidden",
name: "searchin",
value: "all" },
input: {
type: "hidden",
name: "send",
value: "1" }
}
});
2.Is 可以将搜索字段向下移动到菜单末尾吗?
谢谢!
我知道这是一个旧话题,但如果有人也在寻找答案
为了在搜索字段中使用自定义表单,您需要添加配置,而不是选项。所以,正确的格式是:
$("#menu").mmenu({ navbars: { content: [ "prev", "searchfield", "close" ] }, searchfield: { search: false } },{ "searchfield": { form: { action: "search.html", method: "post" }, input: { type: "text", name: "item", id: "searchform" } } });
您可以更改导航栏位置:
"navbars": [ { "position": "bottom", "content": [ "searchfield" ] } ]