有人能够指出一个"类似的"jquery插件的正确方向,例如,可以复制苹果的新搜索棒功能吗?
使用Safari或Chrome时,点击苹果全球导航中的搜索栏会增加尺寸.我想对我的一个项目加入同样的效果.
链接:http://www.apple.com/about/webbadges/
我感谢您的帮助!
埃文
我要说自己写吧!它并不像你想象的那么难.这可能有助于您入门:
<html><body>
<style>
#search {
background-color: #999;
width: 100px;
border: 1px solid #ddd;
outline: none;
}
</style>
<input id="search" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.10/jquery-ui.min.js"></script>
<script>
jQuery(function() {
jQuery('#search').focus(function() {
jQuery(this).animate({ width: '200px', backgroundColor: '#fff' });
}).blur(function() {
jQuery(this).animate({ width: '100px', backgroundColor: '#999' });
});
});
</script>
</body></html>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1331 次 |
| 最近记录: |