一個簡單簡潔的社交媒體共用菜單

來源:互聯網
上載者:User
效果預覽

如上, 也可以看線上的效果

live demo.

實現過程1.  建立菜單像的html
<div id="social_nav_horizontal">  <h3> Bookmark or Share This Post </h3>  <ul>    <li><a class="delicious" href="http://del.icio.us/post?url=Your website title" title="Bookmark on del.icio.us">Delicious</a>    <li><a class="facebook" href="http://www.facebook.com/sharer.php?u=http://yourwebsite.com"  title="Share this on Facebook" >Facebook</a></li>    <li><a class="stumbleupon" href="http://www.stumbleupon.com/submit? url=http://www.yoursite.com/" title="Stumble This Page" > Stumble</a></li>    <li><a class="twitter" href="http://twitter.com/home?status=Your Website Title- http://yourwebsite.com@TwitterUserName" title="Tweet This Page" >Twitter</a></li>  </ul></div>

2.  添加CSS樣式(水平樣式的)

#social_nav_horizontal {  margin-left: 100px;  font-family: Futura, Verdana, Sans-Serif;  font-size: 18px;  color: #8e9090;}#social_nav_horizontal h3 {  display:inline;  padding: 0px 10px;  border-bottom:dashed 1px #ccc;}#social_nav_horizontal ul {  margin: 0;  padding: 0;  margin-top:20px;}#social_nav_horizontal ul li {  float: left;  padding: 5px 0 0 5px;  margin-left: 5px;  list-style-type: none;}#social_nav_horizontal ul li a {  padding: 4px 0 0 28px;  height: 32px;  color: #999;  text-decoration: none;  line-height: 1.45em;}

3. 給每個連結添加圖片

.delicious {  background:url(images/delicious.png) no-repeat;  background-position:0px -1px;}.facebook {  background:url(images/facebook.png) no-repeat;  background-position:0px -1px;}.stumbleupon {  background:url(images/stumbleupon.png) no-repeat;  background-position:0px -1px;}.twitter {  background:url(images/twitter.png) no-repeat;  background-position:0px -1px;}

4. 使用JQuery 方式添加,mouse on 的動畫效果

$(document).ready(function() {  $('#social_nav_vertical li a').hover(  // on mouse over move to left  function() {    $(this).stop().animate({ marginLeft: '20px' },300);  },  // on mouse out, move back to original position  function() {    $(this).stop().animate({ marginLeft: '0px' }, 300);  });});
完整

social-share-css-jquery (ZIP, 0.017 MB)

譯自:  http://sixrevisions.com/tutorials/web-development-tutorials/social-media-share-css-jquery/

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.