Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using it's URL and the proper URL extention.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <div id="stage">
<div id="portrait"><img src="/wp-content/images/portrait.png" alt="" /></div>
<p id="p01">WHEN SHOULD WE RUN A SCHOOL CLINIC?</p>
<p id="p02" class="fontstyle">In what circumstances would it be appropriate to arrange a</p>
<p id="p03" class="fontstyle">School Clinic for a student with intellectual disability</p>
<p id="p04" class="fontstyle">in your care?</p>
<p id="p05" class="fontstyle">In order to get some ideas that might apply to your</p>
<p id="p06" class="fontstyle">situation, take a look at this short cartoon story about Max.</p>
<p id="p07" class="fontstyle">Max is a 12 year old autistic boy attending a</p>
<p id="p08" class="fontstyle">supported school.</p>
<p id="p09" class="fontstyle">He is having problems both at home with his family and</p>
<p id="p10" class="fontstyle">also at school. His behaviour is becoming more unruly,</p>
<p id="p11" class="fontstyle">and it is unclear what is causing this.</p>
<p id="p12" class="fontstyle">Click on the start button to learn a bit</p>
<p id="p13" class="fontstyle">about his story, how a multidisciplinary clinic</p>
<p id="p14" class="fontstyle">can work, and why this might be the right solution for your school. The story begins with Max
at home. You can see who all the characters are in Max's life in the cast list above.</p>

<div id="buttstart"></div>
<div id="scene1layer001"><img src="/wp-content/images/scene1layer001.jpg" alt="" /></div>
<div id="scene1layer002"><img src="/wp-content/images/scene1layer002.png" alt="" /></div>
<div id="scene1layer003"><img src="/wp-content/images/scene1layer003.png" alt="" /></div>
<div id="scene1layer004"><img src="/wp-content/images/scene1layer004.png" alt="" /></div>
<div id="scene1layer005"><img src="/wp-content/images/scene1layer005.png" alt="" /></div>
<div id="scene1layer006"><img src="/wp-content/images/scene1layer006.png" alt="" /></div>
<div id="scene1layer007"><img src="/wp-content/images/scene1layer007.png" alt="" /></div>
<div id="scene1layer008"><img src="/wp-content/images/scene1layer008.png" alt="" /></div>
<div id="scene1layer009"><img src="/wp-content/images/scene1layer009.png" alt="" /></div>
<div id="scene2layer002"><img src="/wp-content/images/scene2layer002.jpg" alt="" /></div>
<div id="scene2layer001"><img src="/wp-content/images/scene2layer001.png" alt="" /></div>
<div id="scene2layer003"><img src="/wp-content/images/scene2layer003.png" alt="" /></div>
<div id="scene2layer004"><img src="/wp-content/images/scene2layer004.png" alt="" /></div>
<div id="scene2layer005"><img src="/wp-content/images/scene2layer005.png" alt="" /></div>
<div id="scene2layer006"><img src="/wp-content/images/scene2layer006.png" alt="" /></div>
<div id="scene2layer007"><img src="/wp-content/images/scene2layer007.png" alt="" /></div>
<div id="scene2layer008"><img src="/wp-content/images/scene2layer008.png" alt="" /></div>
<div id="scene2layer009"><img src="/wp-content/images/scene2layer009.png" alt="" /></div>
<div id="scene3layer003"><img src="/wp-content/images/scene3layer003.jpg" alt="" /></div>
<div id="scene3layer001"><img src="/wp-content/images/scene3layer001.png" alt="" /></div>
<div id="scene3layer002"><img src="/wp-content/images/scene3layer002.png" alt="" /></div>
<div id="scene3layer004"><img src="/wp-content/images/scene3layer004.png" alt="" /></div>
<div id="scene3layer005"><img src="/wp-content/images/scene3layer005.png" alt="" /></div>
<div id="scene3layer006"><img src="/wp-content/images/scene3layer006.png" alt="" /></div>
<div id="scene3layer007"><img src="/wp-content/images/scene3layer007.png" alt="" /></div>
<div id="scene3layer008"><img src="/wp-content/images/scene3layer008.png" alt="" /></div>
<div id="scene3layer009"><img src="/wp-content/images/scene3layer009.png" alt="" /></div>
<div id="scene4layer003"><img src="/wp-content/images/scene4layer003.jpg" alt="" /></div>
<div id="scene4layer001"><img src="/wp-content/images/scene4layer001.png" alt="" /></div>
<div id="scene4layer002"><img src="/wp-content/images/scene4layer002.png" alt="" /></div>
<div id="scene4layer004"><img src="/wp-content/images/scene4layer004.png" alt="" /></div>
<div id="scene4layer005"><img src="/wp-content/images/scene4layer005.png" alt="" /></div>
<div id="scene4layer006"><img src="/wp-content/images/scene4layer006.png" alt="" /></div>
<div id="scene4layer007"><img src="/wp-content/images/scene4layer007.png" alt="" /></div>
<div id="scene4layer008"><img src="/wp-content/images/scene4layer008.png" alt="" /></div>
<div id="scene5layer001"><img src="/wp-content/images/scene5layer001.jpg" alt="" /></div>
<div id="scene5layer003"><img src="/wp-content/images/scene5layer003.png" alt="" /></div>
<div id="scene5layer005"><img src="/wp-content/images/scene5layer005.png" alt="" /></div>
<div id="scene5layer007"><img src="/wp-content/images/scene5layer007.png" alt="" /></div>
<div id="scene5layer002"><img src="/wp-content/images/scene5layer002.png" alt="" /></div>
<div id="scene5layer004"><img src="/wp-content/images/scene5layer004.png" alt="" /></div>
<div id="scene5layer006"><img src="/wp-content/images/scene5layer006.png" alt="" /></div>
<div id="scene5layer008"><img src="/wp-content/images/scene5layer008.png" alt="" /></div>
<div id="scene5layer009"><img src="/wp-content/images/scene5layer009.png" alt="" /></div>
<div id="scene5layer010"><img src="/wp-content/images/scene5layer010.png" alt="" /></div>
<div id="scene5layer011"><img src="/wp-content/images/scene5layer011.png" alt="" /></div>
<div id="scene6layer001"><img src="/wp-content/images/scene6layer001.jpg" alt="" /></div>
<div id="scene6layer002"><img src="/wp-content/images/scene6layer002.png" alt="" /></div>
<div id="scene6layer003"><img src="/wp-content/images/scene6layer003.png" alt="" /></div>
<div id="scene6layer004"><img src="/wp-content/images/scene6layer004.png" alt="" /></div>
<div id="scene7layer001"><img src="/wp-content/images/scene7layer001.jpg" alt="" /></div>
<div id="scene7layer002"><img src="/wp-content/images/scene7layer002.png" alt="" /></div>
<div id="scene7layer003"><img src="/wp-content/images/scene7layer003.png" alt="" /></div>
<div id="scene7layer004"><img src="/wp-content/images/scene7layer004.png" alt="" /></div>
<div id="scene7layer005"><img src="/wp-content/images/scene7layer005.png" alt="" /></div>
<div id="scene7layer006"><img src="/wp-content/images/scene7layer006.png" alt="" /></div>
<div id="scene7layer007"><img src="/wp-content/images/scene7layer007.png" alt="" /></div>
<div id="scene8layer001"><img src="/wp-content/images/scene8layer001.jpg" alt="" /></div>
<div id="scene8layer002"><img src="/wp-content/images/scene8layer002.png" alt="" /></div>
<div id="scene8layer003"><img src="/wp-content/images/scene8layer003.png" alt="" /></div>
<div id="scene8layer004"><img src="/wp-content/images/scene8layer004.png" alt="" /></div>
<div id="scene8layer005"><img src="/wp-content/images/scene8layer005.png" alt="" /></div>
<div id="scene8layer006"><img src="/wp-content/images/scene8layer006.png" alt="" /></div>
<div id="scene8layer007"><img src="/wp-content/images/scene8layer007.png" alt="" /></div>
<div id="scene8layer008"><img src="/wp-content/images/scene8layer008.png" alt="" /></div>
<div id="scene8layer009"><img src="/wp-content/images/scene8layer009.png" alt="" /></div>
<div id="scene8layer010"><img src="/wp-content/images/scene8layer010.png" alt="" /></div>
<div id="scene9layer001"><img src="/wp-content/images/scene9layer001.jpg" alt="" /></div>
<div id="scene9layer002"><img src="/wp-content/images/scene9layer002.png" alt="" /></div>
<div id="scene9layer003"><img src="/wp-content/images/scene9layer003.png" alt="" /></div>
<div id="scene9layer004"><img src="/wp-content/images/scene9layer004.png" alt="" /></div>
<div id="scene9layer005"><img src="/wp-content/images/scene9layer005.png" alt="" /></div>
<div id="scene9layer006"><img src="/wp-content/images/scene9layer006.png" alt="" /></div>
<div id="watchagain"></div>
<div id="buttback"></div>
<div id="buttnext"></div>
</div>


              
            
!

CSS

              
                @charset "utf-8";
/* CSS Document */

#stage {
	margin: 0px;
	padding: 0px;
	height: 500px;
	width: 900px;
	position: relative;
}
#portrait, #p01, #p02, #p03, #p04, #p05, #p06, #p07, #p08, #p09, #p10, #p11, #p12, #p13, #p14, #buttstart, #scene1layer001, #scene1layer002, #scene1layer003, #scene1layer004, #scene1layer005, #scene1layer006, #scene1layer007, #scene1layer008, #scene1layer009, #scene2layer001, #scene2layer002, #scene2layer003, #scene2layer004, #scene2layer005, #scene2layer006, #scene2layer007, #scene2layer008, #scene2layer009, #scene3layer001, #scene3layer002, #scene3layer003, #scene3layer004, #scene3layer005, #scene3layer006, #scene3layer007, #scene3layer008, #scene3layer009, #scene4layer001, #scene4layer002, #scene4layer003, #scene4layer004, #scene4layer005, #scene4layer006, #scene4layer007, #scene4layer008, #scene5layer001, #scene5layer002, #scene5layer003, #scene5layer004, #scene5layer005, #scene5layer006, #scene5layer007, #scene5layer008, #scene5layer009, #scene5layer010, #scene5layer011, #scene6layer001, #scene6layer002, #scene6layer003, #scene6layer004, #scene7layer001, #scene7layer002, #scene7layer003, #scene7layer004, #scene7layer005, #scene7layer006, #scene7layer007, #scene8layer001, #scene8layer002, #scene8layer003, #scene8layer004, #scene8layer005, #scene8layer006, #scene8layer007, #scene8layer008, #scene8layer009, #scene8layer010, #scene9layer001, #scene9layer002, #scene9layer003, #scene9layer004, #scene9layer005, #scene9layer006, #watchagain, #buttback, #buttnext {
	position:absolute;
	display:none;
	opacity:0;
}
#scene1layer001, #scene1layer002, #scene1layer003, #scene1layer008 {
	top:30px;
	left:30px;
}
#portrait {
	top:30px;
	left:0px;
}
#p01 {
	top:35px;
	left:320px;
	font-family:'Kalam', cursive;
	font-size:22px;
	font-weight:700;
	color:#242261;
}
.fontstyle {
	font-family:'Kalam', cursive;	
	font-size:18px;
}
#p02 {
	top:71px;
	left:320px;
}
#p03 {
	top:97px;
	left:340px;
}
#p04 {
	top:127px;
	left:355px;
}
#p05 {
	top:163px;
	left:365px;
}
#p06 {
	top:191px;
	left:370px;
}
#p07 {
	top:227px;
	left:370px;
}
#p08 {
	top:255px;
	left:365px;
}
#p09 {
	top:291px;
	left:355px;
}
#p10 {
	top:319px;
	left:335px;
}
#p11 {
	top:347px;
	left:310px;
}
#p12 {
	top:383px;
	left:285px;
}
#p13 {
	top:411px;
	left:240px;
}
#p14 {
	top:439px;
	left:0px;
	line-height:28px;
}
#buttstart {
	width:150px;
	height:108px;
	background:transparent url(/wp-content/images/startpixy.png) no-repeat left top;
	top:360px;
	left:680px;
	cursor:pointer;
}
#scene1layer004 {
	top:40px;
	left:247px;
}
#scene1layer005 {
	top:50px;
	left:537px;
}
#scene1layer006 {
	top:115px;
	left:715px;
}
#scene1layer007 {
	top:115px;
	left:313px;
}
#scene1layer009 {
	top:440px;
	left:638px;
}
#scene2layer001, #scene2layer002, #scene2layer003, #scene2layer004, #scene3layer001, #scene3layer002, #scene3layer003, #scene3layer004, #scene4layer001, #scene4layer002, #scene4layer003, #scene5layer001, #scene5layer003, #scene5layer005, #scene5layer007, #scene6layer001, #scene7layer001, #scene7layer002, #scene8layer001, #scene8layer002, #scene8layer003, #scene8layer004, #scene8layer005, #scene9layer001 {
	top:0px;
	left:0px;
}
#scene2layer005 {
	top:48px;
	left:10px;
}
#scene2layer006 {
	top:27px;
	left:275px;
}
#scene2layer007 {
	top:8px;
	left:610px;
}
#scene2layer008 {
	top:190px;
	left:610px;
}
#scene3layer005 {
	top:8px;
	left:120px;
}
#scene3layer006 {
	top:217px;
	left:0px;
}
#scene3layer007 {
	top:23px;
	left:470px;
}
#scene3layer008 {
	top:160px;
	left:565px;
}
#scene2layer009, #scene3layer009, #scene4layer008 {
	top:422px;
	left:588px;
}
#scene4layer004 {
	top:11px;
	left:187px;
}
#scene4layer005 {
	top:243px;
	left:130px;
}
#scene4layer006 {
	top:10px;
	left:475px;
}
#scene4layer007 {
	top:60px;
	left:470px;
}
#scene5layer002 {
	top:100px;
	left:470px;
}
#scene5layer004 {
	top:200px;
	left:470px;
}
#scene5layer006 {
	top:300px;
	left:470px;
}
#scene5layer008 {
	top:45px;
	left:520px;
}
#scene5layer009 {
	top:215px;
	left:220px;
}
#scene5layer010 {
	top:213px;
	left:630px;
}
#scene5layer011 {
	top:423px;
	left:580px;
}
#scene6layer002 {
	top:10px;
	left:10px;
}
#scene6layer003 {
	top:10px;
	left:275px;
}
#scene6layer004 {
	top:10px;
	left:555px;
}
#scene7layer003 {
	top:10px;
	left:10px;
}
#scene7layer004 {
	top:50px;
	left:60px;
}
#scene7layer005 {
	top:10px;
	left:330px;
}
#scene7layer006 {
	top:90px;
	left:410px;
}
#scene7layer007 {
	top:200px;
	left:408px;
}
#scene8layer006 {
	top:15px;
	left:10px;
}
#scene8layer007 {
	top:10px;
	left:165px;
}
#scene8layer008 {
	top:10px;
	left:333px;
}
#scene8layer009 {
	top:10px;
	left:500px;
}
#scene8layer010 {
	top:10px;
	left:665px;
}
#scene9layer002 {
	top:45px;
	left:10px;
}
#scene9layer003 {
	top:15px;
	left:220px;
}
#scene9layer004 {
	top:13px;
	left:350px;
}
#scene9layer005 {
	top:9px;
	left:505px;
}
#scene9layer006 {
	top:10px;
	left:650px;
}


#buttback {
	width:50px;
	height:38px;
	background:transparent url(/wp-content/images/backpixy.png) no-repeat right top;
	top:420px;
	left:30px;
	cursor:pointer;
}
#buttnext {
	width:100px;
	height:61px;
	background:transparent url(/wp-content/images/nextpixy.png) no-repeat right top;
	top:406px;
	left:790px;
	cursor:pointer;
}
#watchagain {
	width:100px;
	height:71px;
	background:transparent url(/wp-content/images/watchAgain.png) no-repeat left top;
	top:375px;
	left:660px;
	cursor:pointer;
}
              
            
!

JS

              
                // JavaScript Document
(function($) {

	var stage = $('#stage'),
		portrait = $('#portrait'),p01 = $('#p01'),p02 = $('#p02'),p03 = $('#p03'),p04 = $('#p04'),p05 = $('#p05'),p06 = $('#p06'),p07 = $('#p07'),p08 = $('#p08'),p09 = $('#p09'),p10 = $('#p10'),p11 = $('#p11'),p12 = $('#p12'),p13 = $('#p13'),p14 = $('#p14'),
		buttstart = $('#buttstart'),
		layer11 = $('#scene1layer001'),layer12 = $('#scene1layer002'),layer13 = $('#scene1layer003'),layer14 = $('#scene1layer004'),layer15 = $('#scene1layer005'),layer16 = $('#scene1layer006'),layer17 = $('#scene1layer007'),layer18 = $('#scene1layer008'),layer19 = $('#scene1layer009'),layer21 = $('#scene2layer001'),layer22 = $('#scene2layer002'),layer23 = $('#scene2layer003'),layer24 = $('#scene2layer004'),layer25 = $('#scene2layer005'),layer26 = $('#scene2layer006'),layer27 = $('#scene2layer007'),layer28 = $('#scene2layer008'),layer29 = $('#scene2layer009'),layer31 = $('#scene3layer001'),layer32 = $('#scene3layer002'),layer33 = $('#scene3layer003'),layer34 = $('#scene3layer004'),layer35 = $('#scene3layer005'),layer36 = $('#scene3layer006'),layer37 = $('#scene3layer007'),layer38 = $('#scene3layer008'),layer39 = $('#scene3layer009'),layer41 = $('#scene4layer001'),layer42 = $('#scene4layer002'),layer43 = $('#scene4layer003'),layer44 = $('#scene4layer004'),layer45 = $('#scene4layer005'),layer46 = $('#scene4layer006'),layer47 = $('#scene4layer007'),layer48 = $('#scene4layer008'),layer51 = $('#scene5layer001'),layer52 = $('#scene5layer002'),layer53 = $('#scene5layer003'),layer54 = $('#scene5layer004'),layer55 = $('#scene5layer005'),layer56 = $('#scene5layer006'),layer57 = $('#scene5layer007'),layer58 = $('#scene5layer008'),layer59 = $('#scene5layer009'),layer510 = $('#scene5layer010'), layer511 = $('#scene5layer011'),layer61 = $('#scene6layer001'),layer62 = $('#scene6layer002'),layer63 = $('#scene6layer003'),layer64 = $('#scene6layer004'),layer71 = $('#scene7layer001'),layer72 = $('#scene7layer002'),layer73 = $('#scene7layer003'),layer74 = $('#scene7layer004'),layer75 = $('#scene7layer005'),layer76 = $('#scene7layer006'),layer77 = $('#scene7layer007'),layer81 = $('#scene8layer001'),layer82 = $('#scene8layer002'),layer83 = $('#scene8layer003'),layer84 = $('#scene8layer004'),layer85 = $('#scene8layer005'),layer86 = $('#scene8layer006'),layer87 = $('#scene8layer007'),layer88 = $('#scene8layer008'),layer89 = $('#scene8layer009'),layer810 = $('#scene8layer010'),layer91 = $('#scene9layer001'),layer92 = $('#scene9layer002'),layer93 = $('#scene9layer003'),layer94 = $('#scene9layer004'),layer95 = $('#scene9layer005'),layer96 = $('#scene9layer006'),
		buttback = $('#buttback'),
		buttnext = $('#buttnext'),
		watchagain = $('#watchagain');
		
	var master = new TimelineMax();

	function intro() {
		var introscene = new TimelineMax();
		introscene.to(stage,0,{opacity:1})
		.staggerTo([portrait,p01,p02,p03,p04,p05,p06,p07,p08,p09,p10,p11,p12,p13,p14,buttstart],0.5, {left:"+=50px",opacity:1,display:'block',ease:Back.easeOut},0.1)
		.add( function(){ console.log("within introscene stage " + $('#stage').css('opacity'))} )
		.add( function(){ console.log("within introscene p14 " + $('#p14').css('opacity'))} )
		return introscene;
	}
	
	function scene1() {
		var familyscene = new TimelineMax();
		familyscene.to(buttback,0,{left:30,top:420})
		.to(buttnext,0,{left:790,top:406})
		.staggerTo([layer11,layer18,layer12,layer13,layer14,layer15,layer16,layer17,layer19,buttnext,buttback],0.5, {opacity:1,display:'block'},0.25)
		return familyscene;
	}
	
	function scene2() {
		var hospitalscene = new TimelineMax();
		hospitalscene.to(buttback,0,{left:2,top:390})
		.to(buttnext,0,{left:745,top:386})
		hospitalscene.staggerTo([layer21,layer22,layer23,layer24,layer25,layer26,layer27,layer28,layer29,buttnext,buttback],0.5, {opacity:1,display:'block'},0.25);
		return hospitalscene;
	}
	
	function scene3() {
		var ngoscene = new TimelineMax();
		ngoscene.staggerTo([layer31,layer32,layer33,layer34,layer35,layer36,layer37,layer38,layer39,buttnext,buttback],0.5, {opacity:1,display:'block'},0.25);
		return ngoscene;
	}
	
	function scene4() {
		var schoolscene = new TimelineMax();
		schoolscene.staggerTo([layer41,layer42,layer43,layer44,layer45,layer46,layer47,layer48,buttnext,buttback],0.5, {opacity:1,display:'block'},0.25);
		return schoolscene;
	}
	
	function scene5() {
		var clinicscene1 = new TimelineMax();
		clinicscene1.staggerTo([layer51,layer52,layer53,layer54,layer55,layer56,layer57,layer58,layer59,layer510,layer511,buttnext,buttback],0.5, {opacity:1,display:'block'},0.25);
		return clinicscene1;
	}
	
	function scene6() {
		var clinicscene2 = new TimelineMax();
		clinicscene2.staggerTo([layer61,layer62,layer63,layer64,layer511,buttnext,buttback],0.5, {opacity:1,display:'block'},0.4);
		return clinicscene2;
	}
	
	function scene7() {
		var clinicscene3 = new TimelineMax();
		clinicscene3.staggerTo([layer71,layer72,layer73,layer74,layer75,layer76,layer77,layer511,buttnext,buttback],0.5, {opacity:1,display:'block'},0.25);
		return clinicscene3;
	}
	
	function scene8() {
		var clinicscene4 = new TimelineMax();
		clinicscene4.staggerFromTo([layer81,layer82,layer83,layer84,layer85,layer86,layer87,layer88,layer89,layer810,layer511,buttnext,buttback],0.5, {opacity:0,display:'none',x:'+20'},{opacity:1,display:'block',x:'-0'},0.25);
		return clinicscene4;
	}
	
	function scene9() {
		var clinicscene5 = new TimelineMax();
		clinicscene5.staggerTo([layer91,layer92,layer93,layer94,layer95,layer96,watchagain,buttback],0.5, {opacity:1,display:'block'},0.25);
		return clinicscene5;
	}
	
	
	var last = 1
	//setAllToNone();
	
	master
		.add(intro(), "scene1")
		.addPause("+=0", function() {
			last = 1;
			console.log("paused at scene1");
		})
		.add( function(){ console.log("surely " + $('#p14').css('opacity'))} )
		.to(stage,0,{opacity:1})
		.add( function(){ console.log("surely " + $('#p14').css('opacity'))} )
		.add(scene1(), "scene2")
		.addPause("+=0", function() { 
			last = 1;
			console.log("paused at scene2");
			console.log("Stage and p14 after scene2 pause");
			console.log($('#stage').css('opacity'));
			console.log($('#p14').css('opacity'));
		})
		.to(stage,0,{opacity:1})
		.add(scene2(), "scene3")
		.addPause("+=0", function() { 
			last = 2;
			console.log("paused at scene3")
		})
		.to(stage,0,{opacity:1})
		.add(scene3(), "scene4")
		.addPause("+=0", function() { 
			last = 3;
			console.log("paused at scene4")
		})
		.to(stage,0,{opacity:1})
		.add(scene4(), "scene5")
		.addPause("+=0", function() { 
			last = 4;
			console.log("paused at scene5")
		})
		.to(stage,0,{opacity:1})
		.add(scene5(), "scene6")
		.addPause("+=0", function() { 
			last = 5;
			console.log("paused at scene6")
		})
		.to(stage,0,{opacity:1})
		.add(scene6(), "scene7")
		.addPause("+=0", function() { 
			last = 6;
			console.log("paused at scene7")
		})
		.to(stage,0,{opacity:1})
		.add(scene7(), "scene8")
		.addPause("+=0", function() { 
			last = 7;
			console.log("paused at scene8")
		})
		.to(stage,0,{opacity:1})
		.add(scene8(), "scene9")
		.addPause("+=0", function() { 
			last = 8;
			console.log("paused at scene9")
		})
		.to(stage,0,{opacity:1})
		.add(scene9(), "scene10")
		.addPause("+=0", function() { 
			last = 9;
			console.log("paused at scene10")
	});


	buttback.hover(function(){
		$(this).css("background-position", "left top");
	}, function(){
		$(this).css("background-position", "right top");
	});
	buttback.click(function() {
		console.log("when back clicked, last is " +last);
		var temp = new TimelineMax();
		temp.to(stage,0.5,{opacity:0,onComplete:setAllToNoneAndGoBack})
	});
	buttnext.hover(function(){
		$(this).css("background-position", "left top");
	}, function(){
		$(this).css("background-position", "right top");
	});
	buttnext.click(function() {
		console.log("scene2layer001 " + $('#scene2layer001').css('opacity'));
		var temp = new TimelineMax();
		temp.to(stage,0.5,{opacity:0,onComplete:setAllToNoneAndGo})
		console.log("scene2layer001 " + $('#scene2layer001').css('opacity'));
	});
	buttstart.hover(function(){
		$(this).css("background-position", "right top");
    }, function(){
		$(this).css("background-position", "left top");
	});
	buttstart.click(function() {
		console.log("p14 " + $('#p14').css('opacity'));
		var temp = new TimelineMax();
		temp.to(stage,0.5,{opacity:0,onComplete:setAllToNoneAndGo})
		console.log("p14 " + $('#p14').css('opacity'));
	});
	watchagain.hover(function(){
		$(this).css("background-position", "right top");
    }, function(){
		$(this).css("background-position", "left top");
	});
	watchagain.click(function() {
		//console.log("p14 " + $('#p14').css('opacity'));
		var temp = new TimelineMax();
		temp.to(stage,0.5,{opacity:0,onComplete:setAllToNoneAndStart})
		console.log("p14 " + $('#p14').css('opacity'));
	});
	
	/*document.getElementById("next").onclick = function(){master.play()};

	document.getElementById("prev").onclick = function(){
		// master.reverse()
		master.play("scene" + last);
	};*/
	
	function setAllToNone() {
		console.log("setAllToNone");
		var allItems = document.getElementById('stage').children;
		for(var i = 0; i < allItems.length; i++) {
			allItems[i].style.opacity = 0;
			allItems[i].style.display = "none";
		};
		console.log("stage " + $('#stage').css('opacity'));
		console.log("p14 " + $('#p14').css('opacity'));
	}
	
	function setAllToNoneAndGo() {
		console.log("setAllToNoneAndGo");
		var allItems = document.getElementById('stage').children;
		for(var i = 0; i < allItems.length; i++) {
			allItems[i].style.opacity = 0;
			allItems[i].style.display = "none";
		};
		master.play();
		setAllToNone();
	}
	function setAllToNoneAndStart() {
		console.log("setAllToNoneAndGo");
		last = 1;
		var allItems = document.getElementById('stage').children;
		for(var i = 0; i < allItems.length; i++) {
			allItems[i].style.opacity = 0;
			allItems[i].style.display = "none";
		};
		console.log("stage " + $('#stage').css('opacity'));
		console.log("p14 " + $('#p14').css('opacity'));
		master.play(0);
		setAllToNone();
	}
	function setAllToNoneAndGoBack() {
		console.log("setAllToNoneAndGoBack");
		var allItems2 = document.getElementById('stage').children;
		for(var i = 0; i < allItems2.length; i++) {
			allItems2[i].style.opacity = 0;
			allItems2[i].style.display = "none";
		};
		console.log("just before play, last is " +last);
		//setTimeout(function() {alert();},4250);
		master.play("scene" + last);
		setAllToNone();
	}

})(jQuery);
              
            
!
999px

Console