如何在自动完成中制作过渡效果(幻灯片)
how to make transition effects(slide) in autocomplete
自动完成工作正常,但我需要在建议的菜单中有一个过渡效果(向下滑动),
我从这个网站推荐了 http://tutsforweb.blogspot.in/2012/05/auto-complete-text-box-with-php-jquery.html
我试过了
$(document).ready(function() {
$("#tag").autocomplete("autocomplete.php", {
selectFirst: true
});
});
.ac_results {
background-color: white;
border: 1px solid #5c5c5c;
left: 174.5px !important;
overflow: hidden;
padding: 0;
width: 247px !important;
z-index: 99999;
}
.ac_results ul {
width: 100%;
list-style-position: outside;
list-style: none;
padding: 0;
margin: 0;
}
.ac_results li {
margin: 0px;
padding: 2px 5px;
cursor: default;
display: block;
font-family: "armataregular";
font-size: 12px;
line-height: 16px;
overflow: hidden;
}
.ac_loading {
background: white url('indicator.gif') right center no-repeat;
}
.ac_odd {
background-color: #eee;
}
.ac_over {
background-color: #ccc;
color: black;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="listone">
<input type="text" placeholder="Enter Keyword" id="tag">
</div>
我在id="tag"
上添加了过渡属性,.ac_results
它不起作用, 请提出任何想法。
过渡通过侦听属性来工作,并在该属性更改时"动画化"。因此,在您的情况下,您需要添加对 #ac_results 的过渡。将 #ac_results 高度设置为 0,当找到结果时更改该元素的高度,它应该向下滑动
transition: height 0.5s ease-in-out;
height: 0;
这是一个快速示例(请注意,它不执行任何自动完成,只是在检测到输入时显示)
http://jsfiddle.net/schwqa7k/1/
相关文章:
- 滚动延迟页面过渡效果
- 如何根据上一个或下一个箭头为nivo滑块提供特定的过渡效果
- 如何在javascript中添加过渡效果
- 在它们停止工作后恢复过渡效果
- 如何在没有过渡效果的情况下使用fancybox调整大小
- 加载新页面时的过渡效果,AJAX
- 覆盖ColorBox打开/关闭过渡效果
- 带有onclick的CSS3过渡效果
- 当单击菜单时,应用过渡效果来减慢子菜单的打开速度
- 让 jquery 和 css 过渡效果协同工作
- 具有放大/缩小过渡效果的全屏滑块
- JQuery 移动版:仅在后退/前进按钮上禁用页面过渡效果
- 暂时禁用CSS过渡效果的最干净方法是什么
- 如何将引导程序的轮播过渡从幻灯片更改为淡入淡出
- 如何在自动完成中制作过渡效果(幻灯片)
- 隐藏 3 列并将其中一列扩展为 100% 行时的 jQuery 过渡效果
- CSS 切片/插槽过渡效果,用于/与 DIV 一起使用
- Vue.js具有CSS动画和过渡效果的待办事项任务
- 如何实现幻灯片过渡效果
- 如何通过jQuery在iphone应用程序中实现幻灯片过渡效果