我已将div设为var codes = activeCustomers.Where(x => x.Code.Any(n => !char.IsLetter(n)))
.Select(x => x.Code)
.ToArray();
。我的问题是,如何让它看起来从左向右滑动?
这是我尝试过但我需要让它从左向右滑动。
$('#myDiv').css('visibility', 'hidden');
答案 0 :(得分:0)
这可能是您的解决方案:
我可以单独使用每个功能,具体取决于你需要的东西:我用过2次切换。
HTML:
<div id="container">
<div id="content">
Place your content here
</div>
</div>
CSS:
#container{
width:0px;
overflow-x:hidden;
display:none;
background-color:blue;
color:white;
}
javascript / jQuery:
function show(el, width, speed, callback){
$(el).css({"display":"block"});
$(el).animate({"width":width}, speed, callback);
}
function hide(el, speed, callback){
$(el).animate({"width":"0px"}, speed, function(){
$(el).css({"display":"none"});
callback();
});
}
function toggle(el, width, speed, callback){
console.log($(el).css("width"));
if($(el).css("width")== "0px")
show(el,width, speed, callback);
else
hide(el, speed, callback);
}
toggle("#container", "150px", 500, null);
setTimeout(function(){toggle("#container", "150px", 500, null);}, 2000);