小编Arr*_*und的帖子

全页水平滚动问题

完整页面滚动的其他选择吗?

整页滚动的示例

http://jscrollpane.kelvinluck.com/fullpage_scroll.html

步骤1通过单击"还原"按钮使窗口宽度变小.

步骤2向右滚动

步骤3现在,通过单击最大化按钮使窗口宽度更大.

现在,页面左对齐

jQuery的

 $(function()
{
    var win = $(window);

    win.bind(
        'resize',
        function()
        {

                var container = $('#full-page-container');

                container.css(
                    {
                        'width': 1,
                        'height': 1
                    }
                );

                container.css(
                    {
                        'width': win.width(),
                        'height': win.height()
                    }
                );
                isResizing = false;
                container.jScrollPane(
                    {
                        'showArrows': true
                    }
                );

        }
    ).trigger('resize');


    $('body').css('overflow', 'hidden');


    if ($('#full-page-container').width() != win.width()) {
        win.trigger('resize');
    }


});
Run Code Online (Sandbox Code Playgroud)

CSS

html
{
    overflow: auto;
}
#full-page-container
{
    overflow: auto;
}
Run Code Online (Sandbox Code Playgroud)

javascript jquery scroll jscrollpane

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

jquery-ui autocomplete:通过回调函数设置源不起作用

链接到小提琴:http://jsfiddle.net/nEapJ/(工作)

var items = [{
   label : 'a',
   value : 'a',
},{
   label : 'b',
   value : 'b',
},{
   label : 'c',
   value : 'c',
}];

$('input').autocomplete({
    source : items
});?
Run Code Online (Sandbox Code Playgroud)

这段代码有效,但是当我想通过回调函数设置源代码时,它无法正常工作

链接到小提琴:http://jsfiddle.net/B3RWj/(不工作)

$('input').autocomplete({
    source : function(request, response){
            response(items);
          }
});?
Run Code Online (Sandbox Code Playgroud)

当我输入'a'然后它给a,b,c作为结果.

那么,我错过了什么?

提前致谢.

jquery jquery-ui autocomplete

7
推荐指数
1
解决办法
6036
查看次数

在jquery拖动停止之后在铬的表边界问题

position: relative:拖动时使用td 更新

在此输入图像描述

jquery拖动后表边框消失

在此输入图像描述

在mozila工作正常,但不是铬

jsfiddle 在这里

HTML

<table>
    <tr>
        <th>id</th>
        <th>name</th>
        <th>city</th>
    </tr>
      <tr class="person">
        <td>1</td>
        <td>abc</td>
        <td>abc</td>
    </tr>
      <tr class="person">
       <td>2</td>
        <td>xyz</td>
        <td>xyz</td>
    </tr>
</table>
Run Code Online (Sandbox Code Playgroud)

CSS

table{
    border-collapse : collapse;
}

td, th{
    border : 1px solid #000;
    padding : 5px 20px;
}

th{
    background-color : #f3f3f3;
}

.drag {
    background-color : #f3f3f3;
    height : 20px;
    width : 100px;
}
Run Code Online (Sandbox Code Playgroud)

JS

$('.person').draggable({
    helper : function(){
        return $('<div class="drag">Drag me</div>')
    },
    cursor : 'crosshair',
    cursorAt : {left : …
Run Code Online (Sandbox Code Playgroud)

html css jquery google-chrome jquery-ui

6
推荐指数
1
解决办法
893
查看次数

jQueryUI droppable:遍历回调触发顺序混乱

更新

js小提琴(更新)在这里

我想知道,拖动元素是否在任何列内?

拖动时对我有用,Left to right但是拖动时不起作用right to left

在此处输入图片说明

S

var isOutside = true;

$('.drag').draggable({
    helper : 'clone',
    drag : function(e, ui){
        if(isOutside)    
           return;
        //here is my code;
    },
});

$('.column').droppable({

    over : function(){
        isOutside = false;
        $('p').text('dragging inside');
    },
    out : function(){
         isOutside = true;
         $('p').text('dragging outside');
    }
});
Run Code Online (Sandbox Code Playgroud)

jquery jquery-ui jquery-ui-droppable

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

删除所有以“font-”开头的内联样式属性

如何删除以“font-”开头的所有内联样式属性?

输入

<div style="font-size:3px;color:red;">
  <p style="font-size:5px;"></p>
</div>
Run Code Online (Sandbox Code Playgroud)

输出

<div style="color:red;">
  <p style=""></p>
</div>
Run Code Online (Sandbox Code Playgroud)

html javascript css regex jquery

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

正则表达式,用于检查URL是否为主URL

我正在寻找一个正则表达式来检查URL是否是主页URL.

有效

http://example.com
https://example1.com
https://example2.com/
http://anything.com/?test=12
http://anything.com?test=12
Run Code Online (Sandbox Code Playgroud)

无效

http://example.com/path
https://example.com/path1/path2
https://example.com/path1?test=123
Run Code Online (Sandbox Code Playgroud)

javascript regex url

2
推荐指数
1
解决办法
74
查看次数