Mobile Comment Point Save function

Source: Internet
Author: User

Mobile Comment Point Save function


Today we continue to share a comment on the function of saving, feel this functional logic is very interesting, organized down, the need for partners can learn together.

650) this.width=650; "class=" AlignCenter size-full wp-image-1411 "src=" http://www.aliyue.net/wp-content/uploads/ 2017/06/clike.gif "alt=" Clike "width=" 610 "height=" 537 "style=" height:auto;vertical-align:middle;border:0px; text-align:center;margin:0px auto; "/>

The function effect is like this, let's break down the code.

HTML section
<ul id= "Comments_list" >    <li class= "comments" >     <div class= "Com_top" >       <span class= "Photo" >                  </span>       <span class = "Name" > Wind-up </span>    </div>    <div class= "com_ Content ">        If we have a tacit understanding, that time long and what relationship. I like words that have feelings. Write the reality and warmth. Take your headphones and close your eyes and listen to this "let's be late together." And then for life. "    </div>    <div class=" >   "Com_bottom"      <span class= "Time" >2017-04-18</span>        <span class= "Useful" >           <span class= "Like_num" >1</span> useful        </span>     </div>    </li> </ul>
CSS Section
. com_bottom. useful{float:right;     font-size:10px;     Padding:0 15px;    Text-align:center;     line-height:20px;    border-radius:10px;    Color: #999999; border:1px solid #999999;}.     Com_bottom. Useful.usefulclick {color: #F32D27; border:1px solid #F32D27;}
JS section
Likes $ ("#comments_list li.comments. Useful"). Click (function () {var $likeNum = $ (this). Find ('. Like_num ');       var num = + $likeNum. Text () if (!$ (this). Hasclass (' Usefulclick ')} {$ (this). addclass (' Usefulclick ');    $likeNum. Text (++num);    }else{Console.log ("tag has Usefulclick"); } });

SOURCE download


This article is from the "Xiao Yue Blog" blog, please be sure to keep this source http://aliyue.blog.51cto.com/11564403/1942418

Mobile Comment Point Save function

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.