打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
实现左右滑动
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jquery实现左右滑动的问题</title>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
</head>

<body>

<script>
$(document).ready(function(){
  $("#hide").click(function(){
  if($("#left").css('width') == '200px'){
  $("#left").animate({width:0},"slow");
  $("#hide").val('显示');
}else{
$("#left").animate({width:200},"slow");
$("#hide").val('隐藏');
}
 

  });
});
</script>

<div id="left" style="width:200px; background-color:#009900; float:left;"> </div>
<div id="right" style="width:400px; background-color: #FF0000; float:left;"> </div>
<div style="float:left">
<input id="hide" type="button" value="隐藏" />
</div>
</body>
</html>
本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
css+div 浮动分块
默识| 博客模板布局的基本知识
让两个Div并排显示
基于CSS的DIV网页设计 - 通过浮动容器来完整填充网页 - 三栏
CSS清除浮动常用方法小结_经验交流_脚本之家
古筝名曲欣赏
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服