小编ron*_*nni的帖子

如何按内容日期对div进行排序

我试图按内容日期排序div ...我得到的是排序.但不是按日期......

HTML

 <div id="all_elements">

            <!-- one element -->
            <div class="element">
                    <div class="display-number">02</div>
                    <div class="year">20-10-2011</div>
            </div><!-- element -->

            <!-- one element -->
            <div class="element">
                    <div class="display-number">03</div>
                    <div class="year">22-09-2011</div>
            </div><!-- element -->

            <!-- one element -->
            <div class="element">
                    <div class="display-number">01</div>
                    <div class="year">01-12-2011</div>
            </div><!-- element -->

            <!-- one element -->
            <div class="element">
                    <div class="display-number">04</div>
                    <div class="year">01-06-2011</div>
            </div><!-- element -->

            <!-- one element -->
            <div class="element">
                    <div class="display-number">05</div>
                    <div class="year">01-06-2010</div>
            </div><!-- element -->

        </div> <!--all_elements-->
Run Code Online (Sandbox Code Playgroud)

JQUERY

<script>
        function sortDescending(a, b) {
            return $(a).find(".year").text() …
Run Code Online (Sandbox Code Playgroud)

html sorting jquery date

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

如何将纯文本加载到另一页的div中

我正在尝试将其他页面div中的内容加载到另一个页面div中.

我得到了什么:

JQUERY:

$('#news_date-1').load('test.php .news_date-1');
Run Code Online (Sandbox Code Playgroud)

test.php的

<div class="news_date-1">20-11-2009</div>
Run Code Online (Sandbox Code Playgroud)

Destination.html

 <div id="news_date-1"></div>
Run Code Online (Sandbox Code Playgroud)

我得到的结果=

<div id="news_date-1"><div class="news_date-1">20-11-2009</div></div>
Run Code Online (Sandbox Code Playgroud)

我想要的结果=

<div id="news_date-1">20-11-2009</div>
Run Code Online (Sandbox Code Playgroud)

有人可以帮忙吗?

ajax jquery dom-manipulation

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

使用max-width容器在firefox中响应img

在具有最大宽度的容器内需要响应式img.

HTML:

<div class="center-content">
    <img src="assets/test-slider.png" alt="" />
</div>
Run Code Online (Sandbox Code Playgroud)

CSS:

/*center-content*/
.center-content{
    position:relative;
    max-width:1200px;
    margin:0 auto;}


/*img-fix*/
img{
    max-width: 100%;
    height: auto;
}
Run Code Online (Sandbox Code Playgroud)

这在-webkit中运行良好但在firefox中没有...

任何帮助,将不胜感激.

/ 编辑 /

http://jsfiddle.net/WKHHR/

检查Firefox和Chrome之间的区别

html css firefox responsive-design

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

将html元素添加到colorbox的jquery代码中

我想在jquery.colorbox.js中添加一个元素(想要做一些古怪的样式)但是我不放弃了解jquery的工作方式

链接到colorbox:http://www.jacklmoore.com/colorbox

当前输出示例:

<div id="cboxOverlay" style="display: block; opacity: 0.9; cursor: pointer;">
</div>

<div id="colorbox" class="" style="display: block; padding-bottom: 42px; padding-right: 42px; top: 0px; left: 456px; position: absolute; width: 871px; height: 646px;">
<div id="cboxWrapper" style="height: 688px; width: 913px;">
...
</div>
</div>
Run Code Online (Sandbox Code Playgroud)

期望的输出示例:

    <div id="cboxOverlay" style="display: block; opacity: 0.9; cursor: pointer;">
    </div>

<div id="colorbox_totalWrapper">
    <div id="colorbox" class="" style="display: block; padding-bottom: 42px; padding-right: 42px; top: 0px; left: 456px; position: absolute; width: 871px; height: 646px;">
    <div id="cboxWrapper" style="height: 688px; width: 913px;"> …
Run Code Online (Sandbox Code Playgroud)

html jquery object colorbox

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

从页面的href中加载div ..

我的页面有很多div <a href>用于打开modalboxes(colorbox).这些链接打开的页面有一个id="mainColumn".只需从此ID加载内容.

<div>                       
<a href="includes/page_1.html" class="pop"></a>
</div>

<div>                       
<a href="includes/page_2.html" class="pop"></a>
</div>

<div>                       
<a href="includes/page_3.html" class="pop"></a>
</div>


 $(".pop").colorbox({
    href: $(".pop").attr('href') + " #mainColumn"
    });
Run Code Online (Sandbox Code Playgroud)

在的人的href的<a>的变化进入第一个...

因此,将/ page_3.html更改为includes/page_1.html或换句话说:所有模态框都显示相同的内容...

$(this) 给我内容未定义

任何帮助都会感激,谢谢

jquery modal-dialog colorbox html-content-extraction

0
推荐指数
1
解决办法
134
查看次数