小编Man*_*noz的帖子

在标题栏中添加图像

如何在标题栏中添加图像?

我有头衔 - "Webnet"

将其与FontAwesome Glyphicon的图标图像合并为 -

<title><i class="icon-user icon-black"></i>Webnet</title>
Run Code Online (Sandbox Code Playgroud)

我尝试用图像源替换它 -

<title><img src="assests/img/user-Hermosillo.png" ></img>Webnet</title>
Run Code Online (Sandbox Code Playgroud)

但标题显示innerHTML而不是在那里显示图像.

有帮助吗?

html css favicon font-awesome glyphicons

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

在css中选择多个孩子

我试图在css中为表格应用省略号类.所以有些列需要有这个省略号类.我在表中有多列.

我是通过nth-childcss中的属性来做这个,有没有其他方法来选择随机多个孩子?

我试过了-

.ListTaskTime tbody tr >td:nth-child(3) a
{
      text-overflow: ellipsis;
    width:150px;
    display: block;
    overflow: hidden;
    word-break:keep-all;
    zoom:normal;
    line-break:normal;
    white-space:pre;
}
Run Code Online (Sandbox Code Playgroud)

虽然同一个表还有一个列5th-child,但现在对于这个孩子,我需要创建一个单独的类,因此对于其他列.

我不想扩展我的CSS代码.还有其他解决方案吗?

html css css-selectors

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

用CSS创建一个三角形?

如何使用CSS创建以下形状?

在此输入图像描述

我试过这个解决方案:

 .triangle:after {
        position:absolute;
        content:"";
        width: 0;
        height: 0;
        margin-top:1px;
        margin-left:2px;
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-bottom: 10px solid white;
    }

    .triangle:before {
        position:absolute;
        content:"";
        width: 0;
        height: 0;
        border-left: 12px solid transparent;
        border-right: 12px solid transparent;
        border-bottom: 12px solid black;
    }
Run Code Online (Sandbox Code Playgroud)

你可以看到它在Triangle工作.这是有效的,但有一个边界的伎俩.还有其他办法吗?

使用SVG向量可以很容易地完成,但我不想那么漫长.

html css css-shapes

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

开/关:开关按钮引导程序

这是我的代码 -

<div id="normal-toggle-button" class="toggle-button" style="width: 100px; height: 25px;">
            <div style="left: 0px; width: 150px;"><input type="checkbox" checked="checked"><span class="labelLeft" style="width: 50px; height: 25px; line-height: 25px;">ON</span><label for="" style="width: 50px; height: 25px;"></label><span class="labelRight" style="width: 50px; height: 25px; line-height: 25px;">OFF </span></div>
        </div>
    </div>
Run Code Online (Sandbox Code Playgroud)

脚本-

$(document).ready(function() {
        $('#normal-toggle-button').toggleButtons();
    });
Run Code Online (Sandbox Code Playgroud)

我想在此页面上给出一个基本按钮 - 切换按钮

我做得很好.但我还是错过了一些东西.

在这里办理入住手续 - 小提琴

javascript jquery uiswitch twitter-bootstrap

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

在鼠标悬停时添加内容

我正在使用CSS制作动画,它几乎已经完成.现在我想要我有动画元素的区域应该自动说"悬停在这里".我怎么能用jquery做到这一点?

我的代码在这里 -

<!DOCTYPE html>
<html>
<head>
<style>
#D {
  background: #fff;
  height: 180px;
  position: justify;
border:1px dotted #ccc;

}

#S{
  font: 5em 'Bree Serif', Helvetica, sans-serif;
  margin: 50px;
  opacity: 0;
  text-transform: uppercase;
  position:absolute;
}
#S:nth-child(5) {
  -webkit-transition: all 2s ease-in-out ;
     -moz-transition: all 2s ease-in-out ;
       -o-transition: all 2s ease-in-out ;
      -ms-transition: all 2s ease-in-out ;
          transition: all 2s ease-in-out ;

}

#S:nth-child(4) {
  -webkit-transition: all 1s ease ;
     -moz-transition: all 1s ease ;
       -o-transition: all 1s ease ; …
Run Code Online (Sandbox Code Playgroud)

html jquery jquery-ui

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

使用regex c#验证密码

这一定很简单,我希望它以同样的方式工作,但它并没有帮助我.

using System;
using System.Text.RegularExpressions;
Run Code Online (Sandbox Code Playgroud)

我需要在password validation regular expression某些条件下 -

1)必须至少包含一个数字

2)一个大写字母

3)长8个字符.

public class Program
{
     public static bool IsValidPassword(string plainText) {
            Regex regex = new Regex(@"^(.{0,7}|[^0-9]*|[^A-Z])$");
            Match match = regex.Match(plainText);
            return match.Success;
}
    public static void Main()
    {
        Console.WriteLine(IsValidPassword("shing"));    //logs 'True' always
    }
}
Run Code Online (Sandbox Code Playgroud)

我已经采取了正则表达式从这个源- 密码必须为8个字符,包括1个大写字母,特殊字符,字母数字字符

问题是它总是返回'True'并且我发送给方法的字符串无效.

如果我正在使用正则表达式做错了,请帮助我.

请在这里玩 - https://dotnetfiddle.net/lEFYGJ

c# regex

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

如何在输入标签内显示div?

我正在尝试为我的网站创建像stackoverflow这样的标签,我网站上的用户将创建用于过滤结果的标签或许多其他操作,如搜索,专业知识等.

我能够创建标签,但不能像在stackoverflow中那样在输入框中显示它,标签之间的边距有问题.每当我创建标签时,它都是对齐的,但没有空格或边距.目前,它显示内联所有标签,没有任何空格.

jQuery我试过 -

$(function () {        
    $("#inputtext").keypress(function (e) {
        var valueofinput = $(this).val();
        if (e.which == 13) {
            $('.tag').html(valueofinput);
            $('.tag').show();
        }
    });

    $('.tag').click(function () {
        $(this).hide();
    });        
});    
Run Code Online (Sandbox Code Playgroud)

但是我尝试在输入标签中显示它,如下所示 -

if(e.which==13)
{
$("#inputtext").val().addClass('tag').css('display','inline-block');
}
if(e.which==32)     //for space
{
$('.tag').css('margin-left','5px');
}
Run Code Online (Sandbox Code Playgroud)

但这不起作用.

的jsfiddle

javascript css jquery

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

如何检查谓词表达式是否已更改?

 var predicate = PredicateBuilder.True<o_order>();
Run Code Online (Sandbox Code Playgroud)

这是我的谓词表达式,在某些条件下,我会用它附加表达式.

同样

 if (!string.IsNullOrEmpty(param.sSearch))
                predicate = predicate.And(s => s.OrderID.ToString().Contains(param.sSearch));
Run Code Online (Sandbox Code Playgroud)

现在我的问题是,如果这个表达式没有通过这个条件,那么会有任何表达式吗?我怎么知道它是否没有返回表达式.

我只想做 -

if(predicate==null) 要么 if(predicate contains no expression)

c# linq asp.net-mvc predicatebuilder linqkit

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

$rootScope.$broadcast 不工作

我试图让 $rootScope.$broadcast 刷新我的视图。服务是——

var app = angular.module("productsApp", [])
    .service("serviceProvider", function ($http) {
        this.getDatas = function getDatas(data) {
            return $http({
                method: 'POST', url: serviceUrl + '/GetProductsByCategoryOrName', headers: {
                    'Authorization': apiKey
                },
                data: data
            })
        }
        return this
    }).factory("sharedService", function ($rootScope) {

        var mySharedService = {};

        mySharedService.values = [];

        mySharedService.passData = function (newData) {
            mySharedService.values = newData;
            $rootScope.$broadcast('dataPassed', newData);
        }

        return mySharedService;
    });
Run Code Online (Sandbox Code Playgroud)

通过控制器调用-

function searchProductsController($scope, $window, serviceProvider, sharedService) {
    $scope.submit = function () {
        var data = { "query": $scope.searchText, "categoryId": …
Run Code Online (Sandbox Code Playgroud)

angularjs angularjs-directive angular-broadcast

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

:nth-​​child()选择器,多个nth-child

我试图在表头上获取click事件,使用jQuery很容易.我希望点击事件在除第一个标题之外的所有标题上都是活动的.

我正在使用CSS的nth-child()属性转义第一个标头.

这就是我在做的事情 -

$(function(){
$('th:nth-child(2 3 4 5)').click(function(){
$(this).CSS("font-weight","bolder");
});
});
Run Code Online (Sandbox Code Playgroud)

我没有得到结果.有没有更好的方法可以自己做到这一点:nth-child()

css jquery css-selectors jquery-selectors

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