2011-09-20 102 views
1

我想绝望地结合jParallax插件与jQuery循环插件。基本上,我想拥有一个围绕我所拥有的jParallax插件的“轨道”行星,或者至少在它之上,但是,每次我将正确的位置放在循环插件下面停止工作。当我把它放在jParallax代码下面(标签正上方)时,它可以正常工作,但jParallax停止工作!任何人都知道这里发生了什么?起初,我认为这是因为图层互相冲突,但只要行星不流通,jParallax仍然可以正常工作。任何回应将被“折服! ;)需要帮助与jParallax冲突的脚本

http://goatsy.me/parallax_circulatetest.html

下面的代码:

<html> 
<head> 
<script type="text/javascript" src="jquery-1.2.6.min.js"></script> 
<script type="text/javascript" src="jquery.jparallax.js"></script> 
<link rel="stylesheet" type="text/css" media="screen" href="style.css" /> 
<script type="text/javascript"> 
jQuery(document).ready(function(){ 
jQuery('#parallax').jparallax({}); 
}); 
</script> 
<meta name="robots" content="noindex, nofollow" /> 
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'></script> 
<script type='text/javascript' src='CIRCULATE/Circulate/js/jquery.easing.1.2.js' </script> 
<script type='text/javascript' src='CIRCULATE/Circulate/js/jquery.circulate.js' </script> 
<script type='text/javascript' src='CIRCULATE/Circulate/js/example.js'></script> 
<link rel='stylesheet' type='text/css' href='CIRCULATE/Circulate/css/style.css' /> 
</head> 

<body> 

<img src="CIRCULATE/Circulate/images/planetspin.gif" alt="A Friggin Unicorn, yo." id="unicorn" /> 
<p>&nbsp;</p> 
<p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p> 
<div id="page-wrap"> 
</div> 
<div id="contenttop"> 
<p>&nbsp;</p><p>&nbsp;</p> 
<div id="parallax"> 
<div style="width: 1174px; height: 481px;"> 
<img alt="" src="images/spacebg.png"/> 
</div> 
<div style="width: 1374px; height: 681px;"> 
<img style="position:absolute; top:-300px; left:-200px; bottom:0px;" alt="" src="images/planetbg.png"/> 
</div> 
<div style="width: 861px; height: 554px;"> 
<img style="position:absolute; top:200px; left:400px; bottom:0px;" alt="" src="images/rocketship.png"/> 
</div> 
<div style="width: 367px; height: 537px;"> 
<img style="position:absolute; top:50px; right:50px; bottom:0px;" alt="" src="images/astrogoat.png"/> 
</div> 

</div> 
</body> 
</html> 

回答

0

试着改变你的HTML head内容如下:

<meta name="robots" content="noindex, nofollow" /> 
<link rel="stylesheet" type="text/css" media="screen" href="style.css" /> 
<link rel='stylesheet' type='text/css' href='CIRCULATE/Circulate/css/style.css' /> 
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js'></script> 
<script type="text/javascript" src="jquery.jparallax.js"></script> 
<script type="text/javascript"> 
    jQuery(document).ready(function(){ 
     jQuery('#parallax').jparallax({}); 
    }); 
</script> 
<script type='text/javascript' src='CIRCULATE/Circulate/js/jquery.easing.1.2.js'></script> 
<script type='text/javascript' src='CIRCULATE/Circulate/js/jquery.circulate.js'></script> 
<script type='text/javascript' src='CIRCULATE/Circulate/js/example.js'></script> 

从我可以看到你的jQuery上包含了两次该页面,我已经删除了一个,并将新版本移至javascript包含的顶部。我也感动你linkmeta标签上面的标签script

+0

感谢你的帮助,但仍jParallax似乎并不奏效......难道这是因为“循环”脚本层层重叠的视差脚本? – Goatsy

+0

有可能是Circulate打破了jParallax。我不知道是否是因为我从未看过两个插件中的任何一个。 – Nalum

+0

嗯,确实有可能!我最终放弃了它!大声笑:P感谢您的帮助! :3 – Goatsy