小编Mer*_*ial的帖子

如何更改textarea的边框颜色:焦点

原谅我这是一个愚蠢的问题,但我需要帮助.我想在焦点上改变TEXTAREA的边框颜色.但我的代码似乎没有正常工作.

请查看小提琴上的代码.

<form name = "myform" method = "post" action="insert.php"  onsubmit="return validateform()" style="width:40%">
        <input type="text" placeholder="Enter Name." name="name" maxlength="300" class="input">
        <input type="email" placeholder="Enter E-mail." name="address" maxlength="300" class="input">
        <textarea placeholder="Enter Message." name="descrip" class="input" ></textarea>    
<br>
<input class="button secondary" type=submit name="submit" value="Submit" >
</form>
Run Code Online (Sandbox Code Playgroud)

这是CSS

.input {
border:0; 
padding:10px; 
font-size:1.3em; 
font-family:"Ubuntu Light","Ubuntu","Ubuntu Mono","Segoe Print","Segoe UI";
color:#ccc; 
border:solid 1px #ccc; 
margin:0 0 20px; 
width:300px;
-moz-box-shadow: inset 0 0 4px rgba(0,0,0,0.2); 
-webkit-box-shadow: inset 0 0 4px rgba(0, 0, 0, 0.2); 
box-shadow: inner …
Run Code Online (Sandbox Code Playgroud)

html css

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

如何在div标签上添加有边框的三角形

我有一个div标签,

 __________
|          |    
|          |    
|          |    
|__________|
Run Code Online (Sandbox Code Playgroud)

我想在它上面添加一个小三角形.

 _______/\_
|          |    
|          |    
|          |    
|__________|
Run Code Online (Sandbox Code Playgroud)

注意:我希望我的div标签具有某种颜色的边框,而另一种颜色则是div.比方说,我的div背景是白色的,边框应该是蓝色的.请看到这个. http://fiddle.jshell.net/pausP/

html css css3

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

动态更改android通知文本

我正在尝试通过控件为音乐播放器发出通知.我正在成功地听取按钮单击事件并且正在正常触发功能.我遇到的唯一问题是更改这些点击事件的通知文本.这就是我想要的.

这是接收器成功接收呼叫并完美地触发每一行.但我不能改变文本.我想我必须将内容视图重置为通知.如果是这样,我该怎么做?

@Override
public void onReceive(Context context, Intent intent) {
   String action = intent.getAction();
    if (action.equals("stop")) {
        ABCFragment.stopSong();
        Log.d("Notification","Stopping");
    }else if (action.equals("play")) {
        ABCFragment.togglePlayPause();
        Log.d("Notification","Toggle Play/Pause");
        RemoteViews contentView = new RemoteViews(context.getPackageName(),R.layout.notification_layout);
        contentView.setTextViewText(R.id.songName, "SOME NEW SONG");
    }else if (action.equals("next")) {
        ABCFragment.playNextSong();
        Log.d("Notification","Next");
    }
}
Run Code Online (Sandbox Code Playgroud)

方案:

我更新了我的Notification类构造函数以传递额外的参数并使其正常工作!

@Override
public void onReceive(Context context, Intent intent) {
   String action = intent.getAction();
    if (action.equals("stop")) {
        ABCFragment.stopSong();
        Log.d("Notification","Stopping");
    }else if (action.equals("play")) {
        ABCFragment.togglePlayPause();
        Log.d("Notification","Toggle Play/Pause");
        new ABCNotification(context, "SOME NEW SONG");
    }else if (action.equals("next")) {
        ABCFragment.playNextSong();
        Log.d("Notification","Next"); …
Run Code Online (Sandbox Code Playgroud)

android android-notifications android-remoteview

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

使用jquery或javascript更改CSS根变量

我在我的网页中使用CSS变量并制作一种主题颜色,

:root {
    --themeColor: #0afec0;
    --hoverColor: #fff;
    --bodyColor:  #EEF1EF;
}
Run Code Online (Sandbox Code Playgroud)

现在我已经var(--themeColor)到处使用,我想--themeColor在每次重新加载时分配一个随机颜色.这可能吗?

css jquery css3

6
推荐指数
2
解决办法
5956
查看次数

Angular / RXJS-跟踪陷入重试模式的HTTP请求

我有一个为我处理多个API请求的函数,如果失败,则将每个请求置于重试模式。现在,如果一个请求已经在Retry循环中,并且同一API调用的另一个实例到达,则我的函数无法跟踪此请求,并再次在retry循环中添加冗余API调用。

Assuming i am placing a call to
/api/info/authors

What is happening

1stREQ| [re0]------>[re1]------>[re2]------>[re3]------>[re4]------>[re5]
2ndREQ|                         [re0]------>[re1]------>[re2]------>[re3]------>[re4]------>[re5]


What should happen,

1stREQ| [re0]------>[re1]------>[re2]------>[re3]------>[re4]------>[re5]
2ndREQ|                         [re0]/ (MERGE)
Run Code Online (Sandbox Code Playgroud)

以下是我的服务重试功能,

Assuming i am placing a call to
/api/info/authors

What is happening

1stREQ| [re0]------>[re1]------>[re2]------>[re3]------>[re4]------>[re5]
2ndREQ|                         [re0]------>[re1]------>[re2]------>[re3]------>[re4]------>[re5]


What should happen,

1stREQ| [re0]------>[re1]------>[re2]------>[re3]------>[re4]------>[re5]
2ndREQ|                         [re0]/ (MERGE)
Run Code Online (Sandbox Code Playgroud)

注意:

有人提出了建议shareReplay(),因此我尝试实现它,但是它无法处理来自其他两个组件/源的相同请求。

紧随其后的应该是6,而不是在快速调用两个调用相同API的按钮(缩放持续时间为1000ms)时为12。

在此处输入图片说明

注意:

FLAGS在我看来,请避免使用它是最终的核武器。

httprequest observable rxjs angular

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

如何修改/重新转换JSON数组结构

[{"id":"15","heading":"Post1","content":"Post 1 Content","date":"2016-11-09 08:51:37"},
{"id":"16","heading":"Post2","content":"Post 2 Content","date":"2016-11-09 08:52:09"},
{"id":"17","heading":"Post3","content":"Post 3 Content","date":"2015-06-09 08:52:09"}]
Run Code Online (Sandbox Code Playgroud)

我有JSON数组.我试图将其转换为JSON对象

2016
    Nov
        Post1
        Post2
2015
   June
        Post3
Run Code Online (Sandbox Code Playgroud)

我能够在PHP中实现这一目标

while ($row = mysqli_fetch_row($result)) {
    $year = date('Y', strtotime($row['2']));
    $month = date('M', strtotime($row['2']));
    $navarray[$year][$month][] = array($row[0], $row[1], $row[3]);
}
Run Code Online (Sandbox Code Playgroud)

但是无法在JS中弄明白.

javascript jquery json

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

如何在中心对齐ul标签内容

我一直在试图对齐的内容#referul使用CSS屏幕的中心内容.

<div id="refer" style="border:1px solid red">
    <ul>
        <li><a href="#" class="circlelink">One</a>
        </li>
        <li><a href="#" class="circlelink">Two</a>
        </li>
        <li><a href="#" class="circlelink">Three</a>
        </li>
    </ul>
</div>



.circlelink {
    display:block;
    width:100px;
    height:100px;
    border-radius:50px;
    font-size:20px;
    color:#fff;
    line-height:100px;
    text-align:center;
    text-decoration:none;
    background:linear-gradient(to bottom, #719ECE, #719FCE);
}

.circlelink:hover {
    text-decoration:none;
    background:#719ECE;
    box-shadow: 0 0 8px rgba(0, 0, 0, .8);
    -webkit-transform: scale(1.05, 1.07);
    -moz-transform: scale(1.05, 1.07);
}

#refer {
    position:absolute;
    top:20%;
    width:100%;
    margin-left:auto;
    margin-right:auto;
}

#refer ul {
    clear:both;
    margin: 0;
    padding: 0;
}

#refer ul li …
Run Code Online (Sandbox Code Playgroud)

css html-lists centering

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