小编mrk*_*rks的帖子

固定背景滚动效果

简短的问题:如何用css实现这种滚动效果? - >

http://focuslabllc.com/

我已经尝试过了:

#one {
    background: url(http://images.buzzillions.com/images_products/07/02/iron-horse-    maverick-elite-mountain-bike-performance-exclusive_13526_100.jpg);
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment:fixed;
}

#two {
    background: url(http://img01.static-nextag.com/image/GMC-Denali-Road-Bike/1/000/006/107/006/610700673.jpg);
    background-repeat: no-repeat;
    background-position: center center;
    background-attachment:fixed;
}
Run Code Online (Sandbox Code Playgroud)

谢谢!:)

css scroll background css3

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

PHP:xpath由于意外的"["而无法在php5.3上运行

我在PHP5.4上运行以下行没有任何问题:

$lstContent = $data->xpath("/response/lst[@name='highlighting']")[0]->lst[$i]->arr->str;
Run Code Online (Sandbox Code Playgroud)

但是现在在PHP5.3(生产系统)上我收到以下错误:

解析错误:语法错误,第153行的/var/www/html/upload/inc_suche_code.php中的意外'['

有什么想法快速解决?更新PHP对我不起作用.

php xpath php-5.3

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

打字稿和猫鼬:“文档”类型上不存在属性“x”

这是我与 TypeScript 一起使用的 Mongoose 模型:

import mongoose, { Schema } from "mongoose";

const userSchema: Schema = new Schema(
  {
    email: {
      type: String,
      required: true,
      unique: true,
      lowercase: true,
    },
    name: {
      type: String,
      maxlength: 50,
    },
    ...
    ...
  }
);

userSchema.method({
  transform() {
    const transformed = {};
    const fields = ["id", "name", "email", "createdAt", "role"];

    fields.forEach((field) => {
      transformed[field] = this[field];
    });
    return transformed;
  },
});

userSchema.statics = {
  roles,
  checkDuplicateEmailError(err: any) {
    if (err.code === 11000) {
      var …
Run Code Online (Sandbox Code Playgroud)

javascript mongoose typescript mongoose-schema

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

将桑基图节点从低到高排序

const dataSeries = [{
        "name": "Containerburg"
      },
      {
        "name": "HTCont1"
      },
      {
        "name": "Kranstrom"
      },
      {
        "name": "Wago3"
      },
      {
        "name": "Wago5"
      },
      {
        "name": "Wago2"
      },
      {
        "name": "Heinrich Campus "
      },
      {
        "name": "SubCont1"
      },
      {
        "name": "Heinrich Campus"
      }
    ];

    const seriesLinks = [{
        "source": "Containerburg",
        "target": "HTCont1",
        "value": 20.874000000000024
      },
      {
        "source": "Kranstrom",
        "target": "Wago3",
        "value": 44.253999999999905
      },
      {
        "source": "Containerburg",
        "target": "Wago5",
        "value": 126.2489999999998
      },
      {
        "source": "Kranstrom",
        "target": "Wago2",
        "value": 151.63200000000006
      },
      {
        "source": …
Run Code Online (Sandbox Code Playgroud)

javascript charts echarts apache-echarts

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

在 React HOC 中渲染数组中的对象

我有以下 React 类:

import React from 'react';
import { withTranslation, WithTranslation } from 'react-i18next';

interface State {
    payouts: any;
}

interface Props extends WithTranslation {}

class Payout extends React.Component<Props, State> {
    constructor(props: Props) {
        super(props);
        this.state = {
            payouts: [
                {id: 'PO_3', owner: 'OWNER1', amount: 89},
                {id: 'PO_3', owner: 'OWNER2', amount: 150},
                {id: 'PO_4', owner: 'OWNER3', amount: 135}
            ]
        };
    }

    render() {
        return (
            <div>
                {
                    this.state.payouts.map((payout:any) => (
                        Object.entries(payout).map((val: any)=> (
                            <li>{val.id} - {val.owner} - {val.amount}</li>
                        ))
                    )) …
Run Code Online (Sandbox Code Playgroud)

javascript reactjs

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

除最后一个索引外,用 null 填充数组

我需要找到一种方法来用特定数量的空值填充数组,并且只用特定数字替换最后一个值。

我的想法是创建一个空数组,设置 Array.length = desiredLength 并设置 Array[lastElement] = value。但是剩下的怎么填呢?

例子:

输入:数组的长度five应该是,最后一个值应该是123

输出: [null, null, null, null, 123]

javascript arrays

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