【问题标题】:Create sliding panel similar to Google Maps left-side navigation [closed]创建类似于谷歌地图左侧导航的滑动面板[关闭]
【发布时间】:2013-04-20 01:31:24
【问题描述】:

我需要编写一个与 Google 地图一模一样的左侧面板

例如,当我按下箭头时,它将最小化左侧面板。

所以当我点击箭头时,它会再次出现,我的内容会向右移动。

有什么帮助吗?

【问题讨论】:

  • 您可以查看 jQuery 的 showhide 方法。可能是一个好的开始。
  • $().toggle() 是你的朋友。

标签: c# jquery asp.net html visual-studio-2010


【解决方案1】:

这真的很容易实现。当然我的实现会很丑,但你只需要改变css。完整代码在这里:http://jsfiddle.net/YDukt/ HTML 如下所示:

<div id='leftSide'>
    Something here from google
</div>
<div id='click'>
    >
</div>

Javascript:

$('#click').click(function()
{
    $("#leftSide").animate({width:'toggle'},500);       
});

还有丑陋的 CSS:

#leftSide
{
     height: 500px;
     width: 200px;
     background: black;
     float: left;
     display: none;    
     color: white;
     font-size: xx-large;
}
#click
{
     height: 25px;
     width: 25px;
     background: aqua;
     float: left; 
     margin-top: 20px;
}

【讨论】:

  • 您好,由于我缺少 jquery.js,似乎无法工作。
  • 你用什么框架代替jquery?或者为什么你不能使用 jquery?
  • 我有以下代码
    这会给我一张地图图片,但不知何故箭头不在地图内
猜你喜欢
  • 1970-01-01
  • 2015-07-19
  • 1970-01-01
  • 1970-01-01
  • 2010-11-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多