博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
mootools_使用MooTools的Digg样式动态共享小部件
阅读量:2527 次
发布时间:2019-05-11

本文共 4130 字,大约阅读时间需要 13 分钟。

mootools

Digg Share Widget

I've always seen Digg as a very progressive website. Digg uses experimental, ajaxified methods for comments and mission-critical functions. One nice touch Digg has added to their website is their hover share widget. Here's how to implement that functionality on your site using MooTools.

我一直认为Digg是一个非常进步的网站。 Digg使用实验性的,简化的方法进行注释和执行关键任务。 Digg在其网站上添加的一个不错的功能是悬停共享小部件。 这是使用MooTools在您的网站上实现该功能的方法。

XHTML (The XHTML)

My Story 1

Mauris amet eu Vestibulum feugiat eget, est. senectus semper. tempor Pellentesque Aenean ante. quam egestas. ultricies fames sit ultricies sit placerat et ac Donec leo. morbi habitant mi eleifend tortor netus turpis libero et amet, tristique malesuada egestas quam, vitae, vitae. Mauris amet eu Vestibulum feugiat eget, est. senectus semper. tempor Pellentesque Aenean ante. quam egestas. ultricies fames sit ultricies sit placerat et ac Donec leo. morbi habitant mi eleifend tortor netus turpis libero et amet, tristique malesuada egestas quam, vitae, vitae.

You can display the article or post however you'd like but the Digg share widget should closely follow what I've used above, which comes directly from Digg.

您可以根据需要显示文章或帖子,但Digg共享小部件应紧跟我上面使用的(直接来自Digg)。

CSS (The CSS)

/* Storylist Share */.share-storylist { position:relative; float:left; }.share-hover { background:url(storylist-share.png) no-repeat; width:138px; height:106px; position:absolute; top:19px; left:-35px !important; z-index:100; display:none; }.share-diggbar-url { position:absolute; top:24px; left:14px; padding:5px; text-decoration:none; background:#fff; width:98px; border:1px solid #c6c6c6; -moz-border-radius:4px; -webkit-border-radius:4px; }.share-hover span { font-size:85%; font-weight:normal; color:#9ab9d5; display:block; margin-top:-1px; }ul.share actions, ul.share-actions li { list-style:none; }ul.share-actions li a { text-indent:-999px; width:40px; height:26px; position:absolute; top:63px;} .share-actions li.facebook a { left:48px; width:42px;}.share-actions li.email a {   left:7px;}.share-actions li.twitter a {left:91px; }/* Storylist Share Email Box */#share-dialog { display:none; }.share-email a.email-suggestion { background:#edf7e6 url(/img/lightbox-email-apps.png) 460px 7px no-repeat; display:block; margin:-16px -17px 15px; padding:15px 15px 15px 65px; font-size:1.15em; font-weight:bold; text-decoration:none; color:#64a715; border-bottom:1px solid #daecb0; }.share-email a.email-suggestion:hover { color:#000033; }.share-email label { float:left !important;  display:block; position:absolute;  color:#777; }.share-email input[type="text"] { padding:5px; -moz-border-radius:3px !important; -webkit-border-radius:3px !important; color:#777; margin:0 0 10px 0; width:490px; margin-left:50px; border:1px solid #ccc; font-size:1.1em; }.share-email textarea { width:530px; padding:10px; height:12em; margin:10px 0 5px 0; font-size:100%; background:#fffdea; border:1px solid #dcd069; color:#39340b; }.share-test-email .dialog-tray { text-align:left; }

This is the exact CSS from Digg -- nothing's been changed.

这是Digg的确切CSS,没有任何更改。

MooTools JavaScript (The MooTools JavaScript)

(function($){	window.addEvent('domready',function() {		$$('a.share').each(function(a){			//containers			var storyList = a.getParent();			var shareHover = storyList.getElements('div.share-hover')[0];			shareHover.set('opacity',0);			//show/hide			a.addEvent('mouseenter',function() {					shareHover.setStyle('display','block').fade('in');			});			shareHover.addEvent('mouseleave',function(){				shareHover.fade('out');			});			storyList.addEvent('mouseleave',function() {				shareHover.fade('out');			});		});	});})(document.id);

The JavaScript is a piece of cake using MooTools. Simple show and hide.

使用MooTools,JavaScript简直就是小菜一碟。 简单的显示和隐藏。

One way to improve your website is to check out what the large sites are doing. Feel like you have a lame sharing widget of your own? Duplicate what Digg has done!

改善您的网站的一种方法是查看大型网站在做什么。 感觉自己有一个la脚的共享小部件? 复制Digg所做的!

翻译自:

mootools

转载地址:http://cvpwd.baihongyu.com/

你可能感兴趣的文章
c语言单链表实现
查看>>
php无限极分类
查看>>
08——别让常逃离析构函数
查看>>
echarts.js中的图表大小自适应
查看>>
Linux总结
查看>>
llg的农场(farm)
查看>>
Delphi的FIFO实现
查看>>
Anti StrongOD Kernel Mode
查看>>
bootstrap字体图标在谷歌显示正常,在火狐显示异常的问题
查看>>
Luogu CF22C 【System Administrator】
查看>>
【原】使用less实现随机下雪动画
查看>>
Urozero Autumn 2016. UKIEPC 2016
查看>>
ActiveReport使用心得(四):WebForm下的显示类型及数据的导出
查看>>
《精通CSS:高级Web标准解决方案》学习笔记之二:可视化格式模型
查看>>
Flash调用Lua脚本: 五
查看>>
一次oracle大量数据删除经历
查看>>
npm重要知识点梳理
查看>>
Windows 7安装Service Pack 1失败问题
查看>>
How To Move Or Rebuild A Lob Partition
查看>>
请求的内容似乎是脚本,因而将无法由静态文件处理程序来处理解决方案
查看>>