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. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

JavaScript

Babel is required to process package imports. If you need a different preprocessor remove all packages first.

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

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="main">

<div id="left_side">
<div id="object1"><div class="numberPad">1</div></div>
<div id="object2"><div class="numberPad">2</div></div>
<div id="object3"><div class="numberPad">3</div></div>
<div id="object4"><div class="numberPad">4</div></div>
<div id="object5"><div class="numberPad">5</div></div>
<div id="object6"><div class="numberPad">6</div></div>
<div id="object7"><div class="numberPad">7</div></div>
<div id="object8"><div class="numberPad">8</div></div>
</div><!--end left-->

<div id="middle_side">
<div id="target1"></div>
<div id="target2"></div>
<div id="target3"></div>
<div id="target4"></div>
<div id="target5"></div>
<div id="target6"></div>
<div id="target7"></div>
<div id="target8"></div>
</div><!--end middle-->

<div id="right_side">
<div class="p1">Read the essay and underline important sentences and phrases.</div>
<div class="p2">Read the prompt.</div>
<div class="p3">Draft your essay.</div>
<div class="p4">Make a cluster or an outline of this is helpful.</div>
<div class="p5">Check grammar, mechanics, and spelling.</div>
<div class="p6">Decide on your position in response to the essay<br>and write your thesis statement.</div>
<div class="p7">Select evidence from the text of the essay to support your thesis.</div>
<div class="p8">Underline crucial words in the prompt.</div>
<div class="clear"></div>
</div><!--end right-->

<div class="clear"></div>

<div id="feedback"></div>

<div id="logo"><img src="https://ontrack-media.net/PSSC/images/PS_globe_icon.png" alt="logo" height="50px" width="50px"></div>

<div class="clear"></div>
</div><!--end main-->

<div id="complete">

<div id="left_side">
<div class="completeObject"><div class="numberPad">1</div></div>
<div class="completeObject"><div class="numberPad">2</div></div>
<div class="completeObject"><div class="numberPad">3</div></div>
<div class="completeObject"><div class="numberPad">4</div></div>
<div class="completeObject"><div class="numberPad">5</div></div>
<div class="completeObject"><div class="numberPad">6</div></div>
<div class="completeObject"><div class="numberPad">7</div></div>
<div class="completeObject"><div class="numberPad">8</div></div>
</div><!--end left-->

<div id="middle_side">
<div class="p1">Read the prompt.</div>
<div class="p2">Underline crucial words in the prompt.</div>
<div class="p3">Read the essay and underline important sentences and phrases.</div>
<div class="p4">Decide on your position in response to the essay<br>and write your thesis statement.</div>
<div class="p5">Select evidence from the text of the essay to support your thesis.</div>
<div class="p6">Make a cluster or an outline of this is helpful.</div>
<div class="p7">Draft your essay.</div>
<div class="p8">Check grammar, mechanics, and spelling.</div>
</div><!--end right-->

<div class="clear"></div>

<div id="feedback"></div>

<div id="logo"><button type="button" onclick="resetIt()">Reset</button></div>

<div class="clear"></div>
</div><!--end complete-->

<div class="clear"></div>
              
            
!

CSS

              
                body
{
margin: 0px;
padding: 0px;
}

.clear { clear: both; display: block; }
.f_right { float: right; }
.f_left { float: left; }
.hidden { display: none; }

/* i wanted to be exact */
.p1 { position: absolute; top: 30px; }
.p2 { position: absolute; top: 94px; }
.p3 { position: absolute; top: 155px; }
.p4 { position: absolute; top: 216px; }
.p5 { position: absolute; top: 278px; }
.p6 { position: absolute; top: 332px; }
.p7 { position: absolute; top: 402px; }
.p8 { position: absolute; top: 464px; }

#main
{
border: 2px ridge #78b7d5;
width: 680px;
height: 555px;
padding: 0px;
background-color: #ffffff;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
font-family:Arial, Helvetica, sans-serif;
}

#complete
{
border: 2px ridge #78b7d5;
width: 680px;
height: 555px;
padding: 0px;
background-color: #ffffff;
-webkit-border-radius: 15px;
-moz-border-radius: 15px;
border-radius: 15px;
font-family:Arial, Helvetica, sans-serif;
}

#left_side
{
width: 15%;	
border: 0px solid #00ff00;
text-align: center !important;
float: left;
margin: 0px auto 0px auto !important;
}

#middle_side
{
width: 15%;
border: 0px solid #0000ff;
text-align: center !important;
float: left;
margin: 0px auto 0px auto !important;
}

#right_side
{
width: 68%;
border: 0px solid #0000ff;
text-align: left;
float: right;
margin: 0px auto 0px auto;
}

#object1, #object2, #object3, #object4, #object5, #object6, #object7, #object8
{
background-color: #000000;
color: #ffffff;
cursor: pointer;
text-align: center;
font-size: 2em;
padding: 0px;
margin: 10px auto 0px auto;
border-radius: 100%;
height: 50px;
width: 50px;
border: 1px solid #000000;
}

.numberPad { padding-top: 8px; }

.objectLanded
{
height: 50px;
width: 50px;
border: 2px dashed #1E90FF;
}

.completeObject
{
border: 1px solid #000000;
background-color: #000000;
color: #ffffff;
cursor: pointer;
text-align: center;
font-size: 2em;
padding: 0px;
margin: 10px auto 0px auto;
border-radius: 100%;
height: 50px;
width: 50px;
}

#target1, #target2, #target3, #target4, #target5, #target6, #target7, #target8
{
background-color: #555555;
color: #ffffff;
cursor: pointer;
text-align: center;
border: 4px solid #000000;
font-size: 2em;
padding: 0px;
margin: 10px auto 0px auto;
border-radius: 100%;
height: 44px;
width: 44px;
}

#feedback
{
border: 0px solid #ff0000;
float: left;
text-align: center;
padding: 10px 0px 0px 25%;
/*
background-color: #78b7d5;
*/
color: #000000;
font-size: 1.4em;
width: 50%;
}


#logo
{
border: 0px ridge #33ff00;
float: right;
width: 158px;
padding: 10px 0px 0px 0px;
line-height: 50%;
text-align: center;
}
              
            
!

JS

              
                
var objArray = ['#object1', '#object2', '#object3', '#object4', '#object5', '#object6', '#object7', '#object8'];
var targArray = ['#target1', '#target2', '#target3', '#target4', '#target5', '#target6', '#target7', '#target8'];
var startDrag = new String;
var resetter = 0;
//var draggable = ui.draggable;

//for the suggested order
j('#complete').hide();
//j('#main').hide();

//START ONDOC LOAD
var j = jQuery.noConflict();
j(document).ready(function()
{
//draggin
j('#object1, #object2, #object3, #object4, #object5, #object6, #object7, #object8').draggable
	({
	start: function(event,ui) { startDrag = ui.position; },
	containment: '#main',
	cursor: 'move',
	//snap: '#target1',
	//snapMode: 'inner',
	//snapTolerance: 35,
	//revert: wrong,//call the wrong function on revert
	//revert: true,
	revert: function(valid)
		{
		if(!valid)
			{
			//this.remove();
			j('#feedback').html('<span class="redtext">Try again.</span>');
			return true;
			}
		},	
	stack: 'div',//bring it to the top by adjusting z-index of the element
	drag: clearer,
	stop: function(event,ui)
		{
		
		}
	});
	
//droppables	
j('#target1').droppable
	({
	drop: right,
	accept: '#object3',
	//tolerance: intersect
	});
j('#target2').droppable
	({
	drop: right,
	accept: '#object1'
	});
j('#target3').droppable
	({
	drop: right,
	accept: '#object7'
	});
j('#target4').droppable
	({
	drop: right,
	accept: '#object6'
	});
j('#target5').droppable
	({
	drop: right,
	accept: '#object8'
	});
j('#target6').droppable
	({
	drop: right,
	accept: '#object4'
	});
j('#target7').droppable
	({
	drop: right,
	accept: '#object5'
	});
j('#target8').droppable
	({
	drop: right,
	accept: '#object2'
	});
});//end on doc load

//EXTERNAL METHODS
//clear the feedback div onDrag
function clearer(event, ui) { j('#feedback').html(''); }

//if the dropTarget is correct
function right(event, ui)
{
j('#feedback').html('<span class="greentext">Correct!</span>');
var draggable = ui.draggable;
draggable.draggable().removeClass('objectFilter');
draggable.draggable().addClass('objectLanded');
draggable.draggable('disable');
draggable.draggable('option', 'revert', false);//turn revert off
draggable.offset(j(this).offset());//lock it on top of the targets x and y
draggable.css('background-color','#6fff00');
//draggable.css('color','#fe0001');
resetter++;
if (resetter == 8)
	{
	j('#feedback').html('<span class="greentext">Congratulations! All correct!</span>');
	j('#logo').html('<button type="button" onclick="completeIt()">See suggested order</button>');
	}
else
	{
	//do nothing
	}
};

function completeIt()
{
j('#main').hide();
j('#complete').show();
}



//on reset button click
function resetIt() {
resetter = 0;
j('#complete').hide();
j('#main').show();
j('#feedback').html('');
j('#logo').html('<img src="https://ontrack-media.net/PSSC/images/PS_globe_icon.png" alt="logo" height="50px" width="50px">');
for (x = 0; x < objArray.length; x++)
	{
	//j('#object3').css({top : '0px', position : 'relative'});call multiples
	j(objArray[x]).css('left', '0');
	j(objArray[x]).css('top', '0');
	j(objArray[x]).css('background-color', '#000000');
	j(objArray[x]).removeClass('objectLanded');
	j(objArray[x]).addClass('objectFilter');
	j(objArray[x]).draggable('enable');//re-enable the draggable state
	j(objArray[x]).draggable({revert: function(valid) //gotta recall the revert function
		{
		if(!valid)
			{
			//this.remove();
			j('#feedback').html('<span class="redtext">Try again.</span>');
			return true;
			}
		}
		});
	};
};

              
            
!
999px

Console