2011-09-20 104 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