小编use*_*063的帖子

用CSS改变JUST背景的亮度

我想改变DIV背景的亮度,而不影响div中的其他内容.

当我在div上应用悬停亮度过滤器时,其中的其他元素也会受到影响.我不想要的.

我的另一个解决方案就是用照片编辑的替换div的背景.但是要求存储量增加一倍,我不喜欢.

有没有办法改变背景图像的亮度?

的jsfiddle

    <div id="replace">
    <div id="transparent">
        <span id="text">Random unaffected text</span>
    </div>
</div>

    <div id="brightnessfilter">
    <div id="transparent">
        <span id="text">Random AFFECTED text (it glows)</span>
    </div>
</div>

#replace {
width:700px;
height:465px;
background-image:url('http://i42.tinypic.com/351dff5.jpg');
}

#brightnessfilter {
    width:700px;
    height:465px;
    background-image:url('http://i42.tinypic.com/351dff5.jpg');
}

#brightnessfilter:hover {
     -webkit-filter: brightness(1.3);
-moz-filter: brightness(1.3);
-o-filter:  brightness(1.3);
-ms-filter:  brightness(1.3);
}

#transparent {
    position:relative;
    top:400px;
    width:700px;
    height:65px;
    background-color:rgba(0,0,0,.5);
    border-radius:8px;
}

#text {
    color:white;
    font-weight:bold;
    position:relative;
    top:9px;
    left:9px;
    font-size:16px;
}

#replace:hover {
    background-image:url('http://i40.tinypic.com/2cft7dl.jpg');
}
Run Code Online (Sandbox Code Playgroud)

上面是我用两次尝试创造所需效果的小提琴的链接.但两者都有使用它的缺点.

提前致谢!

html css background brightness

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

狗的速度相同

我正在开发第一个C#头实验室.我在程序中遇到了一个问题,那就是狗的速度相同.我无法弄清楚他们为什么会这样做,因为在我看来,每个对象实例都会在其X位置添加一个随机的1到5个像素.这种随机性应该足以产生差异.

所以,因为我不想发布我的整套实验室1类,我重新创建了一个小型独立版本,只有两只狗赛车,没有下注方面.

Form1.Designer包含: - 两个带有猎犬的图片框.-a开始按钮

Greyhound.cs类:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Drawing;

namespace test
{
    public class Greyhound
    {
        public int DogID;
        public PictureBox myPictureBox;
        public Point StartingPosition;
        public Point CurrentPosition;
        public Random Randomizer;

        public bool Run()
        {
            int AddDistance = Randomizer.Next(1, 7);
            CurrentPosition.X += AddDistance;
            myPictureBox.Location = CurrentPosition;

            if (CurrentPosition.X > 600)
            {
                return true;
            }
            else
            {
                return false;
            }
        }

        public void ReturnToStart()
        {
            CurrentPosition = StartingPosition;
            myPictureBox.Location = StartingPosition;
        } …
Run Code Online (Sandbox Code Playgroud)

c# random performance

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

C#如果Equals Case不敏感

以下代码将打开一个包含单词"Fail"的消息框.

有没有办法使if语句不区分大小写,以便if语句传递并打开一个包含"Pass"的mbox而不将字符/字符串转换为大写/小写?

这是代码:

public partial class Form1 : Form
    {
        string one = "A";
        string two = "a";

        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if (one == two)
            {
                MessageBox.Show("Pass");
            }
            else
            {
                MessageBox.Show("Fail");
            }
        }
    }
Run Code Online (Sandbox Code Playgroud)

提前致谢

c# if-statement boolean case

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

C#List删除Case-Insensitive

我想从列表中删除一个单词.问题是要删除的单词是用户输入,它应该不区分大小写.

我知道如何进行不区分大小写的比较.但这似乎不起作用.

List<string> Words = new List<string>();
Words.Add("Word");
Words.Remove("word", StringComparer.OrdinalIgnoreCase);
Run Code Online (Sandbox Code Playgroud)

有没有办法做到这一点?

提前致谢

c# compare list case

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

获取当前文件名PHP

如何使用PHP获取当前文件名?

如果我在URL上:

website.com/content/content.php
or
website.com/content/content.php?get=get
Run Code Online (Sandbox Code Playgroud)

我想简单地得到:

content.php
Run Code Online (Sandbox Code Playgroud)

没有更多或更少的东西.但我找到的所有内容都会返回: - "website.com/content/content.php"
- "/ content/content.php"

提前致谢.

php filenames file

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

标签 统计

c# ×3

case ×2

background ×1

boolean ×1

brightness ×1

compare ×1

css ×1

file ×1

filenames ×1

html ×1

if-statement ×1

list ×1

performance ×1

php ×1

random ×1