Using ASP.net mvc and bootstrap to quickly build personal blog articles to reward the function (vi) _ Practical skills

Source: Internet
Author: User

See Sina Weibo, Baidu hundreds of platforms with the article "Play rewards" function, feel very fresh, so also want to add "reward" function in their blog.

Of course, joining the rewards function is not really about wanting to be rewarded. Because only those articles that really resonate, thought-provoking and benefit people deserve to be rewarded, and worthy of praise.

And my blog post is just for taking notes, as a knowledge base (if you can inadvertently help others that is better).

Join the reward function is purely "feel fun", is so simple, Just have a fun! (Bo Lord like toss, see a cool function to want to achieve it)

Let's see what the icon looks like!

Click on "Play the icon" will pop up a two-dimensional code interface, you can choose to use the boss to pay treasure play rewards or micro-credit to play rewards:

The specific code is as follows: (Time in haste, and to extend it to plug-ins)

Html:

<!----> button
<div style= "margin-bottom:20px;" >
<a title= "reward, support" class= "Dashang" onclick= "Dashangtoggle ()" href= "javascript:void (0)" >
</a >
</div>

To reward mask Layer HTML:

<div class= "Content" > <div class= "Hide_box" ><!--mask--></div> <div class= "Shang_box" > <a class= "Shang_close" href= javascript:void (0) "onclick=" Dashangtoggle () "title=" Close ">  </a> <div class= "Shang_tit" > <p> Thank you for your support, I will continue to work hard!</p> </
div> <div class= "shang_payimg" >  </div> <div class= "Pay_explain" > Sweep code reward, you say how much </div> <div class= "Shang_payselect" > <div class= "Pay_item checked" data-id= "Alipay" > <span class= "radiobox" ></span> <span class= "Pay_logo" >  </span> </div> <div class= "Pay_item" Data-id= "Weixinpay" > <span class= "radiobox" ></span> <span class= "Pay_logo" >  </span> </div> </div><div class= "Shang_info" > <p> open <span id= "shang_pay_txt" > Pay treasure </span> Sweep, you can do a sweep code play rewards Oh </p> </div> </div> </div>

The main JS:

Play
JQuery (". Pay_item"). Click (function () {
jQuery (this). addclass (' checked '). Siblings ('. Pay_item '). Removeclass (' checked ');
var dataid = JQuery (this). attr (' Data-id ');
JQuery (". shang_payimg img"). attr ("src", "/content/dashangimg/" + dataid + "img.jpg");
JQuery ("#shang_pay_txt"). Text (Dataid = = "Alipay"?) "Alipay": "Micro-letter");
function Dashangtoggle () {
jQuery (". Hide_box"). Fadetoggle ();
JQuery (". Shang_box"). Fadetoggle ();

Incidentally provide CSS:

. hide_box {z-index:999 filter:alpha (opacity=50); background: #666; opacity:0.5;-moz-opacity:0.5; left:0; top:0;
height:99%;
width:100%;
position:fixed;
Display:none; }. shang_box {width:540px; height:540px padding:10px; Background-color: #fff; border-radius:10px; position:fixed; z
-index:1000;
left:50%;
top:50%;
Margin-left: -280px;
Margin-top: -280px;
border:1px dotted #dedede;
Display:none; }. shang_box img {border:none; border-width:0; dashang {display:block; margin:5px auto; text-align:center; trans
Ition:all 0.3s;
width:50px;
height:50px; Background:url (..
/dashangimg/dashang.png) no-repeat scroll 0% 0% transparent; }. Dashang:hover {Background:url (..
/dashangimg/dashanghover.png) no-repeat scroll 0% 0% transparent; }. shang_close {float:right; display:inline-block; shang_logo {display:block; text-align:center; margin:20px Aut
O }. shang_tit {width:100%; height:75px text-align:center; line-height:66px; color: #a3a3a3; font-size:16px; Background:url ('..
/dashangimg/cy-reward-title-bg.jpg ');
font-family: ' Microsoft Yahei ';
margin-top:7px;
margin-right:2px; }. shang_tit p {color: #a3a3a3; text-align:center; font-size:16px; shang_payimg {width:150px; height:150px; Borde
R:6PX solid #EA5F00;
margin:0 Auto;
border-radius:3px; }. shang_payimg img {display:block; text-align:center width:140px; height:140px;}. pay_explain {Text-align:center
;
margin:10px Auto;
font-size:12px;
Color: #545454; }. radiobox {width:16px; height:16px; Background:url ('..
/dashangimg/radio2.jpg ');
Display:block;
Float:left;
margin-top:5px;
margin-right:14px; }. Checked. radiobox {background:url ('.
/dashangimg/radio1.jpg '); 
}. shang_payselect {text-align:center; margin:0 auto; margin-top:40px; cursor:pointer; height:60px; width:280px;} . shang_payselect. pay_item {display:inline-block; margin-right:10px; float:left;}. shang_info {Clear:both;}. Shan G_info p,. Shang_info a {color: #C3C3C3; text-aliGn:center;
font-size:12px;
Text-decoration:none;
Line-height:2em; }

Finally, provide a few dozen rewards icon bar, like to collect the words:

The above is a small series to introduce the use of ASP.net mvc and Bootstrap quickly set up personal blog article play reward function (vi), I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.