Skip to content
Snippets Groups Projects
Commit 4a49109c authored by Manuel Herrmann's avatar Manuel Herrmann
Browse files

fixed jquery effect on index load

parent be1a92f6
No related branches found
No related tags found
No related merge requests found
...@@ -28,42 +28,53 @@ function Story(_storybox) ...@@ -28,42 +28,53 @@ function Story(_storybox)
{ {
this.storybox = _storybox; this.storybox = _storybox;
this.umleitung = $('#story_umleitung'); this.umleitung = $('#story_umleitung');
this.state = 0; this.state = -2;
this.basicData = null; this.basicData = null;
this.travelStart = null; this.travelStart = null;
} }
Story.prototype.next = function(bPrev) Story.prototype.next = function(bGoBack)
{ {
if (bPrev) var previousState = this.state;
{ if (!bGoBack)
this.state -= 1; this.state += 1;
if (this.state < 1)
this.state = 1;
}
switch(this.state) switch(this.state)
{ {
case -1:
this.initBeginButton();
break;
case 0: case 0:
if (previousState == -1)
this.storybox.children().remove();
this.initBasicData(); this.initBasicData();
break; break;
case 1: case 1:
this.initTravelStart(); this.initTravelStart();
this.travelStart.animate({left:bPrev?'900px':'0px'}, 1000); this.travelStart.animate({left:bGoBack?'900px':'0px'}, 1000);
this.basicData.animate({left:bPrev?'0px':'-900px'}, 1000); this.basicData.animate({left:bGoBack?'0px':'-900px'}, 1000);
break;
case 2:
break;
case 3:
break; break;
default:
if (bGoBack)
this.state += 1;
else
this.state -= 1;
} }
if (!bPrev) if (bGoBack)
this.state += 1; {
if (bPrev && this.state == 1) this.state -= 1;
if (this.state < 0)
this.state = 0;
}
if (bGoBack && this.state == 0)
this.umleitung.animate({bottom:'-70px'}, 500); this.umleitung.animate({bottom:'-70px'}, 500);
else if (!bPrev && this.state == 2) else if (!bGoBack && this.state == 1)
this.umleitung.animate({bottom:'0px'}, 500); this.umleitung.animate({bottom:'0px'}, 500);
} }
Story.prototype.initBeginButton = function()
{
this.storybox.append('<div style="cursor:pointer; text-decoration: underline" onclick="story.next()">Anmeldung starten (Story mode)</a>');
}
Story.prototype.initTravelStart = function() Story.prototype.initTravelStart = function()
{ {
if (this.travelStart) return; if (this.travelStart) return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment