求大神帮我合并下这 2 个 jq 的$(document).ready(function()部分

2014-05-26 17:25:28 +08:00
 shpasspass
===================第一个是=====================
<script type="text/javascript">
$(document).ready(function(){
$(".logo a").hover(function(){
$(this).find(".shine").stop();
$(this).find(".shine").css("background-position","-177px 0");
$(this).find(".shine").animate({backgroundPosition: '177px 0'},600);
$(this).find(".title").stop().animate({left:'0px'},{queue:false,duration:450});
},function(){
$(this).find(".title").stop().animate({left:'-160px'},{queue:false,duration:200});
});
});
</script>
==============第2个是===========
<script type="text/javascript">
$(document).ready(function() {
$("#sfloat").scrollFollow({
bottomObj: '.index-w-box',
marginTop: 8,
marginBottom: 0
})
});
</script>
========================
主要是页面中有2个$(document).ready(function() 结果导致只有第2个生效,第一个不生效。谢谢了
3490 次点击
所在节点    问与答
7 条回复
JoyNeop
2014-05-26 17:34:24 +08:00
@Livid RSS 输出似乎过滤不严?http://joyneop.tumblr.com/post/86882431770
loading
2014-05-26 17:37:06 +08:00
<script type="text/javascript">
$(document).ready(function(){
$(".logo a").hover(function(){
$(this).find(".shine").stop();
$(this).find(".shine").css("background-position","-177px 0");
$(this).find(".shine").animate({backgroundPosition: '177px 0'},600);
$(this).find(".title").stop().animate({left:'0px'},{queue:false,duration:450});
},function(){
$(this).find(".title").stop().animate({left:'-160px'},{queue:false,duration:200});
});


$("#sfloat").scrollFollow({
bottomObj: '.index-w-box',
marginTop: 8,
marginBottom: 0
});

});
</script>



你是真的什么都不懂吗?
Paranoid
2014-05-26 17:38:05 +08:00
你确定不是代码的问题???? 2 个 $(document).ready(function(){}) 一点关系都没有 !!!!!
akfish
2014-05-26 17:38:53 +08:00
@loading via Android,ls对这种伸手党还真有耐心。。。。
loading
2014-05-26 17:42:19 +08:00
@akfish 是的,刚好无聊,我在看他发过的帖子,是不是要block掉
loading
2014-05-26 17:43:46 +08:00
@Paranoid 嘘!
shpasspass
2014-05-26 17:44:24 +08:00
jq是没学过,因为以前用网上找的js素材,也是这类问题,所以我想jq也应该是这类问题了。谢谢了

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/114337

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX