这里是我的网页的HTML,其中:我想一定的效果加入到我的网页,我不能把我的代码正确
<div id="container">
<div id="lineandbutton">
<div class="verticalline" style="display:none;"></div>
<div id="iwanimate" style="display:none;">
<div id="iwabutton">
<img src="siteimages/iwabutton.png" height="110px" width="110px">
</div>
</div>
</div>
<div id="titlesonly">
<div class="leftcontainer">
<div class="projects" style="display:none;">
<p id="projectstext"> <h2><a href="commercial/index.html" class="transition">PROJECTS</a></h2> </p>
</div>
</div>
<div class="rightcontainer">
<div class="company"style="display:none;">
<p id="projectstext"> <h2><a href="thecompany.html" class="transition">COMPANY</a></h2> </p>
</div>
</div>
</div>
现在,首先我想了slideDown的垂直线和淡入淡出iwabutton,然后单击iwabutton以显示项目和公司标题。我得到这个效果正确地把下面的代码放到头部分:
<script>
$(document).ready(function() {
$(".verticalline").slideDown("slow", "linear", function() {
$("#iwanimate").fadeIn(2000);
});
$("#iwabutton").click(function() {
$(".projects").fadeIn(2500);
$(".company").fadeIn(2500);
});
});
</script>
现在,我想的项目和公司职称淡出时,其中一个被点击和垂直线和iwabutton移动289px到左边,然后iwabutton应该减小100px并缩小到55px,相应的链接应该打开,当前页面淡出并且下一页缓慢淡入。
我写的代码如下:
<script type="text/javascript">
$(document).ready(function() {
$("a.transition").click(function(event){
event.preventDefault();
$("#titlesonly").fadeOut("slow",function(){$("#lineandbutton").animate({right:'289px',"slow",function(){$(#iwabutton").animate({bottom: '-=100px'}, "slow",function(){("#iwanimate").animate({height:'55px',width:'55px'});
linkLocation = this.href;
$("body").fadeout("slow",redirectPage);
});
function redirectPage() {
window.location = linkLocation;
}
});
</script>
我得到了我的第一个效应的权利,但第二个效果似乎不工作了。任何人都可以请我帮忙吗?我将非常感激。
这段代码正确地获得页面转换效果,但我无法移动verticalline和iwabutton。
<script type="text/javascript">
$(document).ready(function() {
$("body").css("display", "none");
$("body").fadeIn("slow");
$("a.transition").click(function(event){
event.preventDefault();
linkLocation = this.href;
$("body").fadeOut(1000, redirectPage);
});
function redirectPage() {
window.location = linkLocation;
}
});
</script>
请定义“似乎不起作用”。点击时究竟发生了什么?通过删除某些功能简化效果会发生什么? – Philipp
你能清理你的代码并发布你在JSFiddle上的东西吗? – Mataniko
你可以在http://iwarchitects.com/test2看到它 –