Here is the HTML for my page :
<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>
Now , first I wanted to slidedown the verticalline and fadein the iwabutton, then click the iwabutton to reveal the Projects and Company titles. I got this effect correctly by putting in the following code into the head section :
<script>
$(document).ready(function () {
$(".verticalline").slideDown("slow", "linear", function () {
$("#iwanimate").fadeIn(2000);
});
$("#iwabutton").click(function () {
$(".projects").fadeIn(2500);
$(".company").fadeIn(2500);
});
});
</script>
Now, I want the Project and Company titles to fadeout when one of them is clicked and the vertical line and iwabutton to move 289px to the left, the iwabutton should then go down by 100px and scale down to 55px and the corresponding link should open with the current page fading out and next page fading in slowly.
I wrote the code as follows :
<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>
I got my first effect right, but the second effect doesn't seem to work out. can anyone please help me out? I would be very much grateful.
This piece of code gets the page transition effect correctly but I am unable to move the verticalline and 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>