Jquery 徽标动画插入
我希望 Gone Freelancing 上的徽标能够通过 Jquery 在页面加载时以动画形式插入,就像当您单击模式的“更多”时一样。一旦我学会了如何做到这一点,我将为地图标记创建相同的效果,只是为了插入。有人能给我指出正确的方向吗?我搜索了谷歌,只能找到 fade's
非常感谢您的帮助!
预先感谢,罗伊 http://roybarber.com
Im wanting the logo on Gone Freelancing to be and animated drop in on page load by Jquery, like when you click more for the modal. Once i learn how to do this i will create the same effect for the map markers only to drop in. Can anyone point me in the right direction? Ive searched google and can only find fade's
Your help is much appreciated!
Thanks in advance, Roy
http://roybarber.com
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我意识到这是一个非常古老的线程,但有同样的问题,这个答案有效,OP提到
$("#logo").load(function()
部分不起作用,但 < code>document.ready遇到了同样的问题,所以我希望有人能解释为什么 .load 可能无法在OP接受的代码中执行。
I realize this is a very old thread but having the same question this answer worked however, the OP mentioned that the
$("#logo").load(function()
portion did not work but thedocument.ready
did.I encountered the same problem, so I am hoping someone might explain why the .load might be failing to execute in the code accepted by the OP.
您必须将其设为一个单独的对象(即绝对定位),该对象可以上下移动而不破坏页面的其余部分。当CSS“top”值看起来不错时,请记住它。这将是您将元素滑动到的值。
然后,将对象的“顶部”设置为某个负数(即 -500px),并使用此代码使 div(假设 id 为“logo”)向下滑动。
您可以在此处阅读有关 JQuery 自定义动画的更多信息:http://api.jquery.com/animate/
You will have to make it a separate object (i.e. absolute-positioned) that can move up and down without disrupting the remainder of the page. Remember the CSS "top" value when it looks all right. This will be the value where you slide the element to.
Then, set the "top" of the object to some negative amount (i.e. -500px) and use this code to make the div (with assumed id of "logo") slide down
You can read more about JQuery custom animations here: http://api.jquery.com/animate/
从概念上讲,设置您想要放入的徽标,例如
top:-1000px
,这足以使其远离可见屏幕。 (立场:绝对偏离路线)。进而Conceptually, set the logo you want to drop in like
top:-1000px
which is enough to stay off the visible screen. (position:absolute off course). And then