小编Mar*_*tin的帖子

如何使用包装器的整个高度浮动一个元素?

HTML:

<div class="wrapper">
    <div class="left">
        Foo
    </div>
    <div class="right">
        Text row 1
    </div>
</div>

<div class="wrapper">
    <div class="left">
        Foo Bar
    </div>
    <div class="right">
        Text row 1<br>
        Text row 2<br>
        Text row 3
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

CSS:

.wrapper {
    overflow:hidden;
}

.left {
    width:80px;
    float:left;
    height:100%;
}
Run Code Online (Sandbox Code Playgroud)

如何给浮动div提供包装器的整个高度(高度变化)?

没有jQuery可能吗?

测试:http://jsfiddle.net/Q6B43/

css floating css-float

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

PHP strtotime:上个月

可能重复:
如何使用strtotime和日期获得相对于今天的上个月和年份?

今天是12月31日但是strtotime("-1 months")12月返回:

echo date("Y-m", strtotime("-1 months"));
Run Code Online (Sandbox Code Playgroud)

同样的 strtotime("last month")

我怎样才能正确返回上个月(11月)?

测试:http://codepad.viper-7.com/XvMaMB

php date strtotime

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

CSS @supports(:: pseudo-element)

我想将区域更改为最大溢出:仅在::-webkit-scrollbar-thumb支持时滚动.

纯粹的CSS中有可能以某种方式吗?因为它似乎@supports只检查规则,没有选择器.

css css-selectors pseudo-element

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

jQuery:将文件类型类添加到任何文件类型的链接

$("a[href $='.pdf']" ).addClass("linkIconPDF");
$("a[href *='.pdf#']").addClass("linkIconPDF");
$("a[href *='.pdf;']").addClass("linkIconPDF");
$("a[href *='.pdf?']").addClass("linkIconPDF");

$("a[href $='.txt']" ).addClass("linkIconTXT");
$("a[href *='.txt#']").addClass("linkIconTXT");
$("a[href *='.txt;']").addClass("linkIconTXT");
$("a[href *='.txt?']").addClass("linkIconTXT");
Run Code Online (Sandbox Code Playgroud)

到目前为止一直很好,但如何简化以匹配任何文件类型?

是否可以进行一些正则表达式分组以匹配所有可能的文件类型?

$("a[href $='.([a-zA-Z0-9]{2,4})']" ).addClass("linkIcon$1");
Run Code Online (Sandbox Code Playgroud)

测试脚本:http://jsfiddle.net/k2jqn/

javascript regex jquery

8
推荐指数
1
解决办法
2412
查看次数

PHP:将html-entity编码的大写字符转换为小写

如何将大写的html实体字符转换为小写?

$str = "&#xC9;"; //É

$res = strtolower( $str );

echo $res;
Run Code Online (Sandbox Code Playgroud)

http://codepad.viper-7.com/Zf3RTe

php hex lowercase html-entities

7
推荐指数
2
解决办法
2891
查看次数

禁用APC调试?

是否真的需要APC调试模式?我该如何禁用它?我无法找到它的设置http://php.net/manual/en/apc.configuration.php

Version     3.1.9
APC Debugging   Enabled
MMAP Support    Enabled
MMAP File Mask no value
Locking type    pthread mutex Locks
Serialization Support   php
Revision    $Revision: 308812 $
Build Date  Jun 18 2011 18:33:59
Run Code Online (Sandbox Code Playgroud)

php apc

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

jQuery:使用类在元素内部获取标记

<div id="yes">
  <div class="wrapper">
    <something>...</else>
    <p>foobar</p>
  </div>
</div>
Run Code Online (Sandbox Code Playgroud)

我想让p-tag附加一个类名

$("div.wrapper", "#yes").addClass("newClassName");
Run Code Online (Sandbox Code Playgroud)

但是在哪里添加"p"?

jquery

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

按行中最后一个单元格的背景颜色对表进行排序

是否可以通过行中最后一个单元格的css属性对页面加载进行排序?我希望表行按其最后一个单元格的bg颜色排序.

表:

<table>
    <tr>
        <td>Foo</td>
        <td>Foo</td>
        <td style="font-weight:bold; background-color:#dee">Foo</td>
    </tr>
    <tr>
        <td>Foo</td>
        <td>Foo</td>
        <td style="background-color:#ffa">Foo</td>
    </tr>
    <tr>
        <td>put me on top</td>
        <td>Foo</td>
        <td style="background-color:#eee">Foo</td>
    </tr>
</table>
Run Code Online (Sandbox Code Playgroud)

我不知道从哪里开始,但我至少可以将颜色警告为RGB:

$("table tr").find("td:last").each(function(index) {
    alert($(this).css("background-color"));
});
Run Code Online (Sandbox Code Playgroud)

测试:http://jsfiddle.net/AqTTJ/6/

sorting jquery html-table

3
推荐指数
1
解决办法
1398
查看次数

jQuery - 检测通用平台Windows/Linux/Apple

这基于jQuery - 检测操作系统和操作系统版本

我只想测试Windows或Linux或Apple平台.这是对的吗?

var os = (function () {
    var ua = navigator.userAgent.toLowerCase();
return {
        isWindows: /(windows|win95|win32|win64)/.test(ua),
        isLinux: /(linux|freebsd|ssl-mm)/.test(ua),
        isApple: /(mac os|mac_powerpc)/.test(ua)
    };
}());
Run Code Online (Sandbox Code Playgroud)

测试:http://jsfiddle.net/k5mGC/4/

是否有完整的用户代理结果列表?我只找到了像http://user-agents.my-addr.com/user_agent_request/user_agent_examples-and-user_agent_types.php这样的示例列表

jquery operating-system detect

3
推荐指数
1
解决办法
1344
查看次数

jQuery:html()中的replace()

如何用html替换replace()

<div>
    <a href="http://www.google.com">google.com</a>
</div>
Run Code Online (Sandbox Code Playgroud)

JS:

var e = $("div"),
    fix = e.html().replace("google.com", "duckduckgo.com");
e.html(fix);
Run Code Online (Sandbox Code Playgroud)

我猜html()的工作方式不一样text()吗?

测试:http://jsfiddle.net/Hmhrd/

html jquery replace

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