很多人在做遮罩层时,可能都会遇到一个问题,就是遮罩层中的文字会随着层的背景色一起被透明化。以前都是用并列的层通过设置z-index来解决这个问题,现在不同了,几乎所有的浏览器都支持rgba格式的背景色了,因此用rgba来做这个效果就非常简单:
例子: background-color:rgba(0,0,0,0.4);
通过指定rgba就可以了,不需要指定opacity,这样就不会影响层的前景色。
以前做长字符串截断显示时,通常用js做长度判断并截断,追加三个点表示未显示完全,然后用title提示显示全部内容,
今天发现了一个恒古存在的css样式处理的方法,真是郁闷啊,为什么以前不知道呢!!!
.autoBreak{text-overflow: ellipsis; overflow: hidden; word-break:keep-all; white-space:nowrap; text-align: center;}
<div class="autoBreak" style=" border: 1px solid #666; height: 22px; width: 150px; " title="0123456789测试0123456789测试">
0123456789测试0123456789测试
</div>
带检索条件的BCP:
bcp "select * from dbName.dbo.tableName where [id] between 'test201204250001' and 'test201205250001'" queryout D:\tmpData.txt -c -S192.168.1.105 -Uusername -Ppassword
mvc框架下的下载
public FileContentResult downLoadFile(string id)
{
Attachment at = repository.getAttachmentByID(id);
return File(at.Content, "appliction/octet-stream", at.NewName);
}
字符串分割、排序与还原:
string[] items = src.Split('&');
items.OrderBy(p=>p.Substring(0,1));//首字母排序
string data = string.Join("&", items);
动态sql语句分割字符串:
DECLARE @s VARCHAR(100),@sql VARCHAR(1000)
SET @s='1,2,3,4,5,6,7,8,9,10'
SET @sql='select col='''+ replace(@s,',',''' union all select ''')+''''
PRINT @sql
EXEC (@sql)
合并字段的典型语法:
SELECT DISTINCT
ds = (SELECT ',' + CAST(id AS VARCHAR)
FROM tableName
WHERE fid = t.id
AND status = 1
FOR XML PATH('')
)
FROM tableName t
WHERE parentId = 1
jquery抛物线移动某dom效果:
//clone()方法是重点啊。。。。
$('#addCart').on('click', function () {
var src = $('.product-detail');
src.clone().css({ position: 'absolute', left: 0, top: -10 }).appendTo(src)
.animate({ width: 10, height: 10, left: 780, top: -80 }, "slow", function () {
$(this).remove();
});
});
jquery 选择器 查找没有class的元素:
$("div:not([class])")
多行文字溢出边框时,尾部追加省略号的最简方法,本人发明的哦:
.item-desc {width:320px;height:36px; overflow:hidden;position:relative;}
.item-desc::after {content: " ... "; bottom:5px;right: 3px;position: absolute;background-color:#fff;}
sql分页查询语句:
模版:
-- 总数查询
select count(1) from [table_Name] where [whereString]
-- 分页数据查询
select * [select_ColumnName,....] from
(select row_number()over(order by [sort_ColumnName, ...]) idx,* from [table_Name] where [whereString] ) tmp
where idx > (([pageIndex] - 1) * [pageSize]) and idx =<([pageIndex] * [pageSize])
-- 举例
select count(1) from Blogs where Status = 1 and Content is not null
select idx, id, Author, Image, CreateTime, Content from
(select row_number()over(order by Author, CreateTime) idx, * from Blogs where Status = 1 and Content is not null) tmp
where idx > 4 and idx <= 8
sql server 2012之后的新分页方法:
SELECT * FROM tb ORDER BY sequence OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY
canvas绘图基础:https://www.cnblogs.com/charmingyj/p/5527223.html