小编hen*_*ght的帖子

Twitter Bootstrap - 边框

我刚刚开始使用Twitter Bootstrap,我有一个关于如何最好地为父元素添加边框的问题?

例如,如果我有

 <div class="main-area span12">
    <div class="row">
       <div class="span9">
            //Maybe some description text
       </div>
       <div class="span3">
            //Maybe a button or something
       </div>
    </div>
 </div>
Run Code Online (Sandbox Code Playgroud)

如果我应用这样的边框:

.main-area {
    border: 1px solid #ccc;
}
Run Code Online (Sandbox Code Playgroud)

span3由于边框的宽度增加,网格系统将断开并下降到下一行......有没有一种好方法能够像父母<div>这样添加边框或填充等内容?

css twitter-bootstrap

69
推荐指数
2
解决办法
11万
查看次数

如何在Bootstrap 3中单击导航栏元素外部时关闭打开的折叠导航栏?

如何在单击导航栏元素外部时关闭打开的折叠导航栏?目前,打开或关闭它的唯一方法是单击navbar-toggle按钮.

请参阅此处获取示例和代码:

到目前为止,我已经尝试了以下似乎不起作用:

jQuery(document).click(function() {

});

jQuery('.navbar').click(function(event) {
    jQuery(".navbar-collapse").collapse('hide');
    event.stopPropagation();
});
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery twitter-bootstrap-3

39
推荐指数
5
解决办法
7万
查看次数

如何在关闭Bootstrap 3模式时重新加载页面

我的目标是在Bootstrap模式关闭时重新加载页面.用户可以通过单击关闭按钮或图标或单击远离模态来关闭模态.

到目前为止,我的代码非常标准.取自:http: //getbootstrap.com/javascript/#modals

<button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">
  Launch
</button>

<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title" id="myModalLabel">My title</h4>
      </div>
      <div class="modal-body">
        My content
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
        <button type="button" class="btn btn-primary">Save</button>
      </div>
    </div>
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

如何在关闭模式后重新加载页面?

更新:哇,来自每个人的惊人快速反应.谢谢

javascript jquery twitter-bootstrap twitter-bootstrap-3

33
推荐指数
3
解决办法
8万
查看次数

Android,抓住webview重定向网址

我的网页视图加载了一个网址 - 在完成加载后 - 更改为另一个网址.我怎样才能抓住新的网址.getURL()总是返回第一个网址而不是第二个网址.如果我使用浏览器,我可以看到新的URL但是我无法从webview获得.

android webview android-webview

25
推荐指数
2
解决办法
3万
查看次数

Twitter Bootstrap:如何实现始终折叠的导航栏下拉菜单?

我在Twitter Bootstrap中使用Navbar组件

http://getbootstrap.com/components/#navbar

我的目标是让导航栏始终折叠(即使在桌面大小的设备上查看).如何才能做到这一点?

到目前为止,我已经用我的代码创建了这个JSFIDDLE - 你会发现它非常标准.当结果窗口的大小很小时,下拉菜单将折叠.但是,如果放大结果窗口,则下拉列表不会折叠.

我已经准确地粘贴了JSFiddle中的内容以供参考:

<nav class="navbar navbar-default" role="navigation">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#">Brand</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
        <li class="active"><a href="#">Link</a></li>
        <li><a href="#">Link</a></li>
        <li class="dropdown">
          <a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a> …
Run Code Online (Sandbox Code Playgroud)

html javascript css twitter-bootstrap

21
推荐指数
2
解决办法
3万
查看次数

刷新plupload

我正在使用plupload.

传输队列完成后如何重置上传器,以便用户可以根据需要上传更多文件?

plupload

17
推荐指数
3
解决办法
2万
查看次数

默认情况下,如果Bootstrap 3下拉菜单位于折叠的导航栏中,则如何使其处于打开状态

我打算在打开折叠的导航栏时默认打开下拉菜单.到目前为止,这是显示我的代码的小提琴.

目前,如果您在折叠状态下单击导航栏,则会显示两个链接和一个下拉菜单.您必须再次单击才能打开下拉菜单.

我的目标是默认打开下拉菜单,并在a.dropdown-toggle打开折叠导航栏时隐藏元素.可视化我打开折叠导航栏时的外观:

  • 链接
  • 链接
  • 落下
  • 行动
  • 另一个动作
  • 还有别的什么
  • 分开的链接
  • 另一个分开的链接

我的第一个想法是使用display: none,a.dropdown-toggle但只是隐藏整个下拉菜单.希望有人能提出建议.我对jQuery和CSS解决方案都持开放态度.

我的加价:

<nav class="navbar navbar-default" role="navigation">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="#">Brand</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav …
Run Code Online (Sandbox Code Playgroud)

html javascript css jquery twitter-bootstrap-3

17
推荐指数
1
解决办法
5万
查看次数

Google应用引擎 - 使用Google,Facebook登录

我希望我的应用程序的用户在Google应用程序引擎中托管,使用我的Google帐户或Facebook帐户以与StackExchange相同的方式登录.

我对此有一些疑问:

  1. 我想看一些基本登录的教程
  2. 我想在社交登录(Google,Facebook等)上看到一些教程.

google-app-engine facebook login oauth

14
推荐指数
1
解决办法
1万
查看次数

文件上传:完成进度条的百分比

我正在尝试在BuddyPress中添加"到目前为止完成的百分比"进度条到头像上传.目的是阻止用户在上传完成之前导航离开页面.

上传过程在BuddyPress中通过bp_core_avatar_handle_upload()文件bp-core/bp-core-avatars.php处理.该功能通过检查文件是否已正确使用来启动bp_core_check_avatar_upload().然后它检查文件大小是否在限制范围内,并且它具有可接受的文件扩展名(jpg,gif,png).如果一切都结束,则允许用户裁剪图像(使用Jcrop),然后将图像移动到其真实位置.

实际上传由WordPress函数wp_handle_upload处理.

如何创建"完成百分比"进度条并在文件上传时显示?

javascript php wordpress jquery buddypress

13
推荐指数
2
解决办法
4万
查看次数

当输入被聚焦时,Internet Explorer 10和11会删除占位符文本

使用Internet Explorer 10和11时,如果使用该autofocus属性聚焦输入,则会删除输入占位符文本.例如:

<input type="textbox" value="" placeholder="Example text" autofocus>
Run Code Online (Sandbox Code Playgroud)

演示: https ://jsfiddle.net/ompkwtz5/

如何确保不删除占位符文本?

参考:https://connect.microsoft.com/IE/feedback/details/885747/ie-11-fires-the-input-event-when-a-input-field-with-placeholder-is-focused

html javascript internet-explorer

10
推荐指数
1
解决办法
9102
查看次数