使某些方法适用于$(window).on(“load”,function(){before load [英] Making Certain methods work for $(window).on("load", function () { before load

查看:807
本文介绍了使某些方法适用于$(window).on(“load”,function(){before load的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

示范 http://jsfiddle.net/FyrRm/1/

当您向下滚动时,您会注意到...滚动到文章标题< div class =share> < / div> 我正在显示分享小部件。我使用 $(window).on(load,function(){来确保背景图片首先加载, =http://stackoverflow.com/questions/20789245/jquery-scroll-with-positionfixed-css>我想要的方式到。

You will notice as we scroll down... After scrolling to the article headline to <div class="share"></div> I am showing a share widget. I am using $(window).on("load", function () { to make sure that the background image gets loaded first so that the script works the way I want it to.

但是问题是如果用户在图像完全加载之前滚动超过 .share ,则 share-active div

But the problem is if the user scrolls beyond .share before the image loads fully, then the share-active div is not loaded. How can I fix this ?

此外,有任何方法来添加任何效果,而分享小部件显示为一个摇摆等,所以用户的注意力被绘制使用jquery本身我不想使用jQ UI,因为它有一个巨大的文件沿着JQ

Also, is there any way to add any effect while the share widget gets displayed like a jiggle etc so the users attention is drawn to it using jquery itself. I don't want to use jQ UI since its a huge file along side with JQ

推荐答案

在您调用<$ c $之前,请放置共享widgit div 顶部(也) jquery c> $(window).on(load,function(){
包含特定的 JS 图像 div

Just put the jquery code for showing the share widgit div at top (also) before the you call $(window).on("load", function () { And include that particular JS file at top before the image div

对于某些动画访问 jQueryUi Effects

这篇关于使某些方法适用于$(window).on(“load”,function(){before load的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆