- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
请在思考错误之前阅读所有问题。
我正在尝试实现类似 Facebook 的通知系统,但我需要一些帮助来设计它。我已经发出通知,后端工作完美,但我正在使用样式的解决方法 - 相信我,这很慢,丑陋并且无法为我提供样式源的好方法。
我确切地说的是发生在“用户点击通知”和“用户接收加载的通知”之间的 Action 。我说的是这部分的风格。诸如“我怎样才能打开一个装有通知的盒子?”之类的东西。单击按钮/div/图像/文本后。
好的,让我们继续。现在我正在使用 Fancybox创建我的通知框 - 是的,FANCYBOX!以下是单击“通知”按钮(“0”)后我使用 Fancybox 获得的视觉效果:
这对你来说可能看起来很漂亮,但对我来说它很丑——而且这真的非常慢。为了解决这个问题,我禁用了 Fancybox 的图像,所以当它加载时,它加载时没有黑色背景、关闭窗口的“X”和其他东西。以下是我的代码。
<!-- This is the html generated by Ruby on Rails,number is dynamic-->
<a href="/notifications/index" class="various fancybox.ajax">0</a>
<script>
$(document).ready(function(){
$(".various").fancybox({
openEffect: 'none',
closeEffect: 'none',
prevEffect: 'none',
nextEffect: 'none',
fitToView : false,
autoSize: false,
scrolling: 'auto',
maxWidth:300,
maxHeight:500,
padding: 0,
leftRatio: 0.86,
topRatio: 0.18
});
});
</script>
<div class="post group">
<div class="notifications-content">
<div class="group" id="notification-0">
<div class="post-middle">
<div class="notifications-title">
<b>Bruno postou:</b>
</div>
<div class="post-middle-text">
ADO
</div>
<div class="post-middle-actions with-dots">
<label> Postado às 12:34 de 17 de October</label>
</div>
</div>
</div>
</div>
<div class="notifications-content">
<div class="group" id="notification-1">
<div class="post-middle">
<div class="notifications-title">
<b>Fernando Paladini postou:</b>
</div>
<div class="post-middle-text">
hummmmmmmmm #boilo
</div>
<div class="post-middle-actions with-dots">
<label> Postado às 12:36 de 17 de October</label>
</div>
</div>
</div>
</div>
<div class="notifications-content">
<div class="group" id="notification-2">
<div class="post-middle">
<div class="notifications-title">
<b><a href="#">@Ramon Diogo</a> postou:</b>
</div>
<div class="post-middle-text">
http://www.youtube.com/watch?v=A3zPI-DBf7U
</div>
<div class="post-middle-actions with-dots">
<label></label>
<label>Comentado às 12:47 de 17 de October</label>
</div>
</div>
</div>
</div>
</div>
我如何仅使用 HTML、CSS 和 jQuery/JS 来做到这一点?我的意思是,这种效果是单击按钮时打开一个包含加载内容的“框”,而单击关闭时关闭“框”。我真的,真的不知道怎么做。实际上我正在使用 Fancybox 打开一个模式,但我不想打开一个模型,我想让它像 Facebook 和像 Trello 这样的网站那样做——只是 css/jquery。
请注意,我不是在要求代码,我需要帮助,因为我不知道如何做到这一点。我想要说明:单击按钮时我需要做什么,打开通知框。或者当单击外部通知框时,关闭通知框。这背后的概念,但如果您也发布一些代码,我会考虑,因为这将帮助我学习。
最佳答案
您可以通过在包含您的通知的 div 上进行绝对定位来做到这一点。
它应该作为默认行为隐藏,您可以使用 javascript 使其在点击时可见。
这将帮助您:http://net.tutsplus.com/tutorials/html-css-techniques/how-to-create-a-drop-down-nav-menu-with-html5-css3-and-jquery/但是您应该更改行为以对单击事件而不是 mouseenter 使用react(脚本部分的第 14 行)。用类似的东西替换那部分:
$(this).click(function(e) {
$(this).find("ul").stop(true, true).slideDown();
e.preventDefault();
});
注意“preventDefault部分?就是避免浏览器在你点击的时候进入链接。”
关于javascript - 如何制作像 Facebook 通知这样的东西?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19461449/
我为我们的业务创建了一个 Facebook 页面,我创建了一个 Facebook 应用程序来获取 AppID,以便在 Facebook 插件中使用它。 我注意到 Facebook 应用程序的页面看起来
是否有可能知道哪个 Facebook 用户点击了我的应用用户在 Facebook 上分享的链接? 为了清楚起见,让我改写一下:我想知道我的应用用户的哪些 friend 点击了他的共享链接。 感谢任何提
我正在浏览 facebook pixel,对 facebook pixel 如何知道哪个转化来自哪个 facebook 广告感到很困惑? 假设我有这个 url http://example.com安装
我正在开发 sucsongmoi.net(越南语),当浏览者从他们的墙上分享网站链接时,一些链接 facebook 获得描述和图像,一些链接 facebook 无法获得描述和图像。 例如:分享 suc
一位同事错误地设置了个人 Facebook 页面;它应该是一个企业 Facebook 页面。 个人页面上有几个 friend 需要重定向到正确的 Facebook 业务页面。 我可以将用户从错误的个人
在 Facebook 上,当您转到“编辑我的个人资料”>“艺术和娱乐”时,会有一个“电影”自动完成小部件,它会在您输入电影时推荐电影。 因此,如果您输入“Jones”,它将开始建议: 印第安纳琼斯 布
我在我的网页上使用 Facebook 登录。首次登录时,Facebook 登录应用程序会请求获取用户数据的权限。 有什么方法可以改善这个问题,以请求喜欢我的 Facebook 页面的许可?用户点击后,
我需要知道是否可以将现有的 Facebook 页面(类别:应用程序页面)链接到 Facebook 应用程序?当我进入 Facebook 应用程序设置时,他们建议创建一个新页面。但我需要的只是链接到现有
我的网站应用程序具有通过 Facebook 登录进行登录的功能。为此,我的应用程序出现在 Facebook 上。使用 Facebook 登录工作正常。 但应用程序具有将 Facebook 帐户链接和取
我正在制作一个应用程序,让人们可以在 Facebook 上与特定的 friend 分享内容。示例:Alice 使用我的应用程序,她与 Bob 分享了一篇文章,Bob 是她的 Facebook 好友。现
我正在按照列出的说明进行操作 http://docs.appcelerator.com/platform/latest/#!/api/Modules.Facebook 并查看 Arrow 示例目录中的
假设我有一个餐厅的商业网站,一位顾客为一大群人预订了一张 table 。有没有一种方法可以让客户有机会在餐厅网站上创建 Facebook 事件,作为预订流程的一部分。我知道客户必须以某种方式从餐厅网站
我想让我的用户将他们的用户帐户与 Facebook 或 Twitter 相关联,并允许他们使用他们的 Facebook/Twitter 帐户登录我的服务器,而不是使用传统的用户名/密码。与StackO
我们有一个面子书页面。我们添加了一个自定义 FBML 选项卡。现在我们要添加评论面子书插件。我尝试添加一个脚本,我从 Face book Social Plug in .代码是 之后我将此脚本放入自
大家好 请帮我找到关于以下的官方信息: 1) 什么是“FaceBook 登录” 2) 什么是“FaceBook Connect” 谢谢 最佳答案 你可以在那里找到你需要的一切: http://deve
这是最奇怪的事情。我有非常简单的 CF 代码,查看 cgi.HTTP_REFERER。简单地说,它查看推荐人。如果链接是从我们的主要网站域之外单击的,它会显示一些内容。否则,什么也不会发生。所以,如果
我还是 Facebook Graph API 的新手,正在尝试开始使用 Facebook 地点搜索。 (按位置搜索地点) https://graph.facebook.com/search?type=
我不想开设 Facebook 帐户,但我被要求为需要使用 Facebook API 的应用程序开发功能。有没有一种方法可以开发这些功能并使用 Facebook API,而无需开设个人 Facebook
我已经按照指示实现了 DotNetOpenAuth 提供的示例应用程序 here . 正如您在下面看到的,这要求用户安装此 facebook 应用程序。 我只是想让用户使用他们的 Facebook 登
我的主页上有标准的 Facebook 登录按钮,我不希望人们仅在用户单击登录按钮时使用他们的 Facebook 帐户自动登录我的网站。 如果用户未登录 Facebook,将出现一个弹出窗口询问他的凭据
我是一名优秀的程序员,十分优秀!