How do i make toggle from left whitout jquery-ui

送分小仙女□ 提交于 2019-12-11 03:49:54

问题


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;
}

jsfiddle


回答1:


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.



来源:https://stackoverflow.com/questions/28322098/how-do-i-make-toggle-from-left-whitout-jquery-ui

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!