123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152 |
- @{
- var u = ViewBag.UserRealName;
- var realName = ViewBag.UserRealName ?? ViewBag.UserName;
- var phone = !string.IsNullOrEmpty(ViewBag.UserWxPhone) ? ViewBag.UserWxPhone.Substring(ViewBag.UserWxPhone.Length - 4) : "";
- var text = realName + phone;
- }
- <style type="text/css" media="screen">
- .cover {
- position: absolute;
- left: 0;
- top: 0;
- z-index: 999999999999999;
- margin-right: 0px;
- margin-left: 0px;
- margin-top: 5px;
- margin-bottom: 140px;
- color: #fff;
- color: #ccc;
- display: block;
- padding: 2px 1px;
- font-family: '宋体';
- font-size: 16px;
- font-weight: bold;
- white-space: nowrap;
- text-shadow: 1px 0 0 #eee;
- transform: rotate(45deg);
- -ms-transform: rotate(45deg);
- -moz-transform: rotate(45deg);
- -webkit-transform: rotate(45deg);
- -o-transform: rotate(45deg);
- -moz-opacity: 0.3;
- opacity: 0.3;
- -ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.7071067811865474, M12=-0.7071067811865477, M21=0.7071067811865477, M22=0.7071067811865474, SizingMethod='auto expand')";
- }
- .cover-Blink-area {
- position: absolute;
- text-align: center;
- left: 0;
- top: 0;
- width: 100%;
- height: 100%;
- display: block;
- z-index: 999999999999999;
- pointer-events: none;
- overflow: hidden;
- }
- .cover-Blink {
- display: inline-block;
- margin-right: 50px;
- margin-left: 50px;
- margin-top: 50px;
- margin-bottom: 50px;
- color: red;
- padding: 2px 1px;
- font-size: 14px;
- color: #ccc;
- white-space: nowrap;
- transform: rotate(-20deg);
- -ms-transform: rotate(-20deg);
- -moz-transform: rotate(-20deg);
- -webkit-transform: rotate(-20deg);
- -o-transform: rotate(-20deg);
- opacity: 0.3;
- }
- </style>
- <script type="text/javascript">
- $(function () {
- waterMark$();
- });
- function waterMark$() {
- if (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.match(/11./i) != "11.") {
- $("p[name='p1$']").remove();
- var winwidth$ = document.body.scrollWidth - 17;
- var winheight$ = document.body.scrollHeight;
- $("body").append("<p id='waterSum_11' name='p1$' class='cover_through cover js-click-to-alert'>@text</p>");
- var fleft = Number($('#waterSum_11').css("margin-left").substring(0, $('#waterSum_11').css("margin-left").indexOf('p')));
- var ftop = Number($('#waterSum_11').css("margin-top").substring(0, $('#waterSum_11').css("margin-top").indexOf('p')));
- var perWidth = $("#waterSum_11").width();
- var perHeight = Number('140px'.substring(0, '140px'.indexOf('p'))) + 100;
- var lines = parseInt(winwidth$ / (perWidth + fleft));
- var rows = Math.round(winheight$ / (perHeight + ftop));
- var totalPWidth = perWidth * lines;
- var totalSpace = winwidth$ - totalPWidth;
- var perSpace = parseInt(totalSpace / (lines + 1));
- $('#waterSum_11').css("margin-left", perSpace);
- for (var i = 1; i <= rows; i++) {
- for (var j = 1; j <= lines; j++) {
- if (i == 1) {
- if (j <= lines - 1) {
- var p = "<p id='waterSum_" + i + "" + (j + 1) + "' name='p1$' class='cover_through cover js-click-to-alert'>@text</p>";
- var ileft = $('#waterSum_' + i + '' + j).css("margin-left").substring(0, $('#waterSum_' + i + '' + j).css("margin-left").indexOf('p'));
- var itop = $('#waterSum_11').css("margin-top").substring(0, $('#waterSum_11').css("margin-top").indexOf('p'));
- $("body").append(p);
- $('#waterSum_' + i + '' + (j + 1)).css("margin-left", Number(ileft) + Number(perWidth) + perSpace);
- $('#waterSum_' + i + '' + (j + 1)).css('margin-top', itop);
- }
- } else {
- var p = "<p id='waterSum_" + i + "" + j + "' name='p1$' class='cover_through cover js-click-to-alert'>${TmpContent}</p>";
- var ileft = $('#waterSum_' + (i - 1) + '' + j).css("margin-left").substring(0, $('#waterSum_' + (i - 1) + '' + j).css("margin-left").indexOf('p'));
- var itop = $('#waterSum_' + (i - 1) + '' + j).css("margin-top").substring(0, $('#waterSum_' + (i - 1) + '' + j).css("margin-top").indexOf('p'));
- $("body").append(p);
- $('#waterSum_' + i + '' + j).css("margin-left", Number(ileft));
- $('#waterSum_' + i + '' + j).css('margin-top', Number(itop) + Number(perHeight));
- }
- }
- }
- passThrough();
- } else {
- waterMarkNotIe$();
- }
- }
- function waterMarkNotIe$() {
- var winwidth$ = document.body.clientWidth;
- var winheight$ = document.body.scrollHeight;
- var waterSum$ = 100;
- var oldleft$ = 0;
- var maxI$ = 0;
- var k$ = 0;
- $("body").append("<div class='cover-Blink-area'> </div>");
- $('.cover-Blink-area').css('height', '500px');
- for (var i = 1; i <= waterSum$; i++) {
- $(".cover-Blink-area").append("<p id='waterSum_" + i + "' class='cover_through cover-Blink js-click-to-alert'>@text</p>");
- var left = Number(document.getElementById("waterSum_" + i).offsetLeft);
- if (left > oldleft$) {
- oldleft$ = left;
- maxI$ = i;
- }
- if (left < oldleft$ && k$ == 0) {
- var top = $("#waterSum_1").css("margin-top").substring(0, $("#waterSum_1").css("margin-top").indexOf('p'));
- var bottom = $("#waterSum_1").css("margin-bottom").substring(0, $("#waterSum_1").css("margin-bottom").indexOf('p'));
- var pHeight = $("#waterSum_1").height();
- var totalHeight = Number(top) + Number(pHeight) + Number(bottom);
- var Hnum = Math.round(500 / (totalHeight / 1.3));
- waterSum$ = Hnum * maxI$;
- k$++;
- }
- }
- }
- window.onresize = function () {
- waterMark$();
- }
- function passThrough() {
- $(".cover").mouseenter(function () {
- $(this).stop(true).fadeOut().delay(1500).fadeIn(50);
- });
- }
- </script>
|