小编1st*_*mas的帖子

cursor:指针不起作用:在元素之后?

我在Chrome中查看以下示例,似乎无法开始cursor: pointer使用该:after元素li.有办法解决这个问题吗?

http://jsfiddle.net/qKMPQ/2/

html css

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

获取函数的参数名称

在PHP中考虑这个函数:

function test($name, $age) {}
Run Code Online (Sandbox Code Playgroud)

我需要以某种方式提取参数名称(用于自动生成自定义文档),以便我可以执行以下操作:

get_func_argNames('test');
Run Code Online (Sandbox Code Playgroud)

它会返回:

Array['name','age']
Run Code Online (Sandbox Code Playgroud)

这在PHP中甚至可能吗?

php

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

Chrome版本58的Redactor编辑器文本格式问题

我们使用的是Redactor(https://imperavi.com/redactor/)版本10.1.1,由于对项目的依赖性很大,我们没有迁移到Redactor II.

最近我们在Chrome 58版本面临一个非常奇怪的问题.问题是:

- 无法为所选文本格式化粗体,斜体,下划线,sup,sub等

请告诉我们是否有任何解决方法.任何形式的帮助将不胜感激.

根据公认的解决方案更新:

// Provided solution is tested for Redactor version 10.1.1
createMarkers: function()
{
    this.selection.get();

    var node1 = this.selection.getMarker(1);

    this.selection.setMarker(this.range, node1, true);

    if (this.range.collapsed === false) {
        var node2 = this.selection.getMarker(2);
        this.selection.setMarker(this.range, node2, false);

        // Fix for Chrome58 Issues
        if (this.utils.browser('chrome')) {
              this.caret.set(node1, 0, node2, 0);
         }
         // End Chrome58 Issues
    }

    this.savedSel = this.$editor.html();
},
Run Code Online (Sandbox Code Playgroud)

wysiwyg google-chrome text-editor angularjs redactor.js

24
推荐指数
1
解决办法
2552
查看次数

未捕获的TypeError:无法读取null的属性'firstChild'(Google地图无法加载)

我想知道是否有人能够将他们的知识借给Google Maps API.我已经阅读了类似的问题,仍然无法得出答案.正如标题所示,我的浏览器控制台中显示的错误是:

Uncaught TypeError: Cannot read property 'firstChild' of null

我知道这意味着价值传递的方式存在问题; 以下是我sources在Chrome 中指向的相关代码段:

// --- Global Variable
var map;


// --- View Model.
function AppViewModel() {

  // Initial Map
  map = new google.maps.Map(document.getElementById('map'), {
    center: {lat: 39.305, long: -76.617},
    zoom: 12
  });


// --- Initalize Application.
function initApp() {
  ko.applybindings(new AppViewModel());
}
Run Code Online (Sandbox Code Playgroud)

当Google地图尝试加载时,似乎会抛出该错误.有没有人知道我在这里做错了什么?感谢您提供的任何帮助.

Html供参考:

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Bolton Hill Neighborhood Map</title>
  <link rel="stylesheet" href="static/main.css">
  <meta name="viewport" content"width=device-width, initial-scale=1">
</head>
<body>
 <div class='map'>maps error</div>

  <script …
Run Code Online (Sandbox Code Playgroud)

javascript jquery google-maps

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

绝对位置具有比固定位置更大的z指数

我有一个带有相对位置元素的问题.问题是我有一个固定位置的标题和相对定位的内容.如果我向下滚动内容,元素将放在标题前面.我尝试使用z-index,但我无法让它工作.我已经戴上z-index:999头了.

在这里你可以看到我的jsFiddle

这是一张图片: 在此输入图像描述

css

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

用PHP处理json请求

在进行ajax调用时,当contentType设置为application/json而不是默认的x-www-form-urlencoded时,服务器端(在PHP中)无法获取post参数.
在下面的工作示例中,如果我在ajax请求中将contentType设置为"application/json",则PHP $ _POST将为空.为什么会这样?如何在PHP中正确处理contentType为application/json的请求?

$.ajax({
    cache: false,
    type: "POST",
    url: "xxx.php",
    //contentType: "application/json",
    processData: true,
    data: {my_params:123},
    success: function(res) {},
    complete: function(XMLHttpRequest, text_status) {}
});
Run Code Online (Sandbox Code Playgroud)

php ajax json request mime-types

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

根据其属性查找xml元素并更改其值

我正在使用python xmlElementTree,并希望根据其属性分配或修改xml元素值.谁能让我知道如何做到这一点?

例如:这是一个xml文件,我需要根据属性"sys/phoneNumber/1","sys2/SMSnumber/1"等设置元素"number"的值.

<root>
    <phoneNumbers>
        <number topic="sys/phoneNumber/1" update="none" />
        <number topic="sys/phoneNumber/2" update="none" />
        <number topic="sys/phoneNumber/3" update="none" />
    </phoneNumbers>

    <gfenSMSnumbers>
        <number topic="sys2/SMSnumber/1" update="none" />
        <number topic="sys2/SMSnumber/2" update="none" />
    </gfenSMSnumbers>
</root>
Run Code Online (Sandbox Code Playgroud)

编辑:为XML文件中的标记根添加了闭包.

python xml xml-parsing

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

jQuery插件:在其他函数中获取"this"对象

我想创建一个全景滑块作为jQuery插件,我有以下代码:

 $.fn.panorama = function(settings) {

    var myPanorama = this;
    ..

    this.mousedown(function(e){

       //do stuff 
       $(this).css... //this all work
    }


    //Call mouseup on document in case user lets go of mouse outside draggable object
$(document).mouseup(function(){
    $(myPanorama).easeDragging(); //works but probably not the way to do it
    this.easeDragging(); //ideal but refers to wrong object
 });

    }
Run Code Online (Sandbox Code Playgroud)

我的问题是我如何引用通话中的this对象$(document).mouseup?

因为它认为this是文档本身而不是附加到插件的对象.

现在我只是制作一个变量而且它有效,但必须有更好的方法!

谢谢!

jquery plugins this

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

如果css类有display:none,则jQuery显示不起作用

我有一个名为loading的类,如下所示:

.loading {
   display: none;
   vertical-align: top; 
   margin: 0; 
   padding: 0; 
   background: url('../images/shared/loading_16x16.gif') center center no-repeat; 
   width: 16px; 
   height: 16px;
}
Run Code Online (Sandbox Code Playgroud)

使用以下html代码段:

<div id="loading" class="loading"></div>
Run Code Online (Sandbox Code Playgroud)

和我的jQuery代码(在文件就绪):

$.ajaxSetup({
    beforeSend: function () {
        $("#loading").show().children().show();
    },
    complete: function () {
        $("#loading").hide().children().hide();
    }
});
Run Code Online (Sandbox Code Playgroud)

但show()根本不工作.即使我从chrome开发人员窗口触发它.在Chrome开发人员窗口中,如果我取消选中display: none加载类,则会显示标记.

发生了什么?

html css jquery

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

在数据表中呈现的性能问题

我试图渲染大约2500行禁用排序和"bDeferRender":true.它需要大约40秒的铬(v27).我正在使用Datatables 1.9和jquery 2.有什么建议吗?

数据表的数据表settings:

var oSettings = {
    'bDestroy': true,
    "bInfo": true,
    "bProcessing": true,
    "bDeferRender": true,
    'iDisplayLength': 10,
    'sPaginationType': 'full_numbers',
    'sDom': '<"top"i> T<"clear">lfrtip',
    'sPageButtonActive': "paginate_active",
    'sPageButtonStaticDisabled': "paginate_button",
    "oLanguage": {
        "sSearch": "Futher Filter Search results:",
        "sInfo": "Got a total of _TOTAL_ results to show (_START_ to _END_)",
        "sLengthMenu": 'Show <select>' +
                '<option value="5">5</option>' +
                '<option value="10">10</option>' +
                '<option value="15">15</option>' +
                '<option value="20">20</option>' +
                '<option value="25">25</option>' +
                '</select> results'
    },
    "bSort": false
};
Run Code Online (Sandbox Code Playgroud)

jquery datatables

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