我如何从左侧 whitout jquery-ui 进行切换 [英] How do i make toggle from left whitout jquery-ui
本文介绍了我如何从左侧 whitout jquery-ui 进行切换的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在不使用 jquery-ui 的情况下从左侧进行切换
How do i make toggle from left without using jquery-ui
Javascript
$(document).ready(function(){
$("button").click(function(){
$("#content").slideToggle();
});
});
HTML
<div id="content">This is a paragraph.</div>
<button>my toggle</button>
CSS
#content {
background:khaki;
padding:10px;
}
推荐答案
这是我想到的... 小提琴.我重新插入了 '<div id="toggle_text"></div>
' 中的段落并使用 jQuery 的 'animate()
' 方法来改变它的 left
位置,使其看起来从左方向滑动.希望它对你有用.
Here is what I came up with... fiddle. I have reinserted the paragraph within '<div id="toggle_text"></div>
' and used jQuery's 'animate()
' method to alter its left
position so that it appears to be sliding from left direction. Hope it works for you.
这篇关于我如何从左侧 whitout jquery-ui 进行切换的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文