javascript 使用 Zurb Foundation 自动完成样式

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18167538/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-27 10:56:48  来源:igfitidea点击:

Style autocomplete with Zurb Foundation

javascriptcssjquery-uijquery-autocompletezurb-foundation

提问by HP.

What is the best practice to use Foundation features instead of jQuery CSS for Autocomplete?

使用 Foundation 功能而不是 jQuery CSS 进行自动完成的最佳实践是什么?

Here is my code: http://jsfiddle.net/qhoc/88kfb/

这是我的代码:http: //jsfiddle.net/qhoc/88kfb/

<div class="row">
 <form class="custom">
 <fieldset>
 <legend>Fieldset</legend>
 <div class="row">
  <div class="large-12 columns ui-widget">
   <label for="tags">Input Label</label>
    <input id="tags" type="text" placeholder="large-12.columns">
  </div>
 </div>
</div>   

I just don't like to include another .css file which is overhead on the page:

我只是不喜欢在页面上包含另一个 .css 文件:

<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />

So I guess I have two questions:

所以我想我有两个问题:

  1. Is there a way to use dropdownfrom Foundation or something? It seems like dropdownis only for topbarand its css screwed up outside that particular use case.

  2. What is some "standard" way to create the dropdown menu in Foundation? Please help with some example. Because I was thinking it's either bunch of rowsor it could be a tweak from dropdown

  1. 有没有办法dropdown从 Foundation 或其他地方使用?似乎dropdown只是为了topbar它的 css 在该特定用例之外搞砸了。

  2. 在 Foundation 中创建下拉菜单的“标准”方法是什么?请帮忙举一些例子。因为我在想它要么是一堆,rows要么可能是从dropdown

回答by vgarcias

You could try to add the 'f-dropdown' class via jquery to the :

您可以尝试通过 jquery 将“f-dropdown”类添加到:

 $('.ui-autocomplete').addClass('f-dropdown');

also set on the app.css o youystyle.css:

也在 app.css o youystyle.css 上设置:

.ui-helper-hidden-accessible{display:none}

.ui-helper-hidden-accessible{display:none}

I hope it helps... http://jsfiddle.net/vgarcias/WdncE/

我希望它有帮助... http://jsfiddle.net/vgarcias/WdncE/

回答by Vinay Raghu

Foundation is now trying to incorporate an auto complete by default, in its next version. You can find the entry in this

Foundation 现在正尝试在其下一个版本中默认包含自动完成功能。您可以在此找到条目

https://github.com/zurb/foundation/issues/3100

https://github.com/zurb/foundation/issues/3100