Designing solutions through programming - January 12 2017 Lesson Notes: Difference between revisions
Mr. MacKenty (talk | contribs) |
Mr. MacKenty (talk | contribs) |
||
(13 intermediate revisions by the same user not shown) | |||
Line 6: | Line 6: | ||
# We will configure our IDE's | # We will configure our IDE's | ||
# we will learn basic terminology about javascript | # we will learn basic terminology about [https://www.youtube.com/watch?v=ZyXuwTTKKM0 javascript] | ||
# you will be exposed to bootstrap | # We will learn about [https://www.youtube.com/watch?v=GBKwdFEyJks DOM] | ||
# We will work through very basic examples of javascript events [http://www.w3schools.com/js/js_events_examples.asp using these examples]. | |||
# you will be exposed to [https://www.youtube.com/watch?v=V7x_hosDoIo bootstrap] | |||
# Another excellent bootstrap tutorial can be found https://www.youtube.com/watch?v=314m7YBRFvQ by clicking this link] | |||
<syntaxhighlight lang= | |||
# you will use the following code snippets to START exploring javascript: | |||
<syntaxhighlight lang='html' line='line'> | |||
<!DOCTYPE html> | <!DOCTYPE html> | ||
<html> | <html> | ||
<body> | <body> | ||
<h1> | <h1>A javascript example</h1> | ||
<p id=" | <p id="demo1">JavaScript can change content inside a defined ID or even CLASS.</p> | ||
<button type="button" onclick="document.getElementById(' | <button type="button" onclick="document.getElementById('demo1').innerHTML = 'I love computer science!'">Click Me!</button> | ||
</body> | </body> | ||
Line 25: | Line 32: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang= | <syntaxhighlight lang='html' line='line'> | ||
<!DOCTYPE html> | |||
<html> | |||
<body> | |||
<p>This example demonstrates how to assign an "onmouseover" and "onmouseout" event to a h1 element.</p> | |||
<h1 id="demo" onmouseover="mouseOver()" onmouseout="mouseOut()">Mouse over me</h1> | |||
<script> | |||
function mouseOver() { | |||
document.getElementById("demo").style.color = "red"; | |||
} | |||
function mouseOut() { | |||
document.getElementById("demo").style.color = "black"; | |||
} | |||
</script> | |||
</body> | |||
</html> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</td> | </td> | ||
Line 43: | Line 61: | ||
==[[file:homework.png]] What is our homework? == | ==[[file:homework.png]] What is our homework? == | ||
# Please review, | # Please create a webpage on our webserver called "template.php". | ||
# please use the code below for your template | |||
# Please review some other components of bootstrap by [http://getbootstrap.com/components/ clicking this link] | |||
<syntaxhighlight lang='html'> | |||
<!DOCTYPE html> | |||
<html lang="en"> | |||
<head> | |||
<meta charset="utf-8"/> | |||
<meta http-equiv="X-UA-Compatible" content="IE=edge"/> | |||
<meta name="viewport" content="width=device-width, initial-scale=1"/> | |||
<meta name="description" content=""/> | |||
<meta name="author" content=""/> | |||
<title>Starter Template for Bootstrap</title> | |||
<!-- Bootstrap Core CSS --> | |||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"/> | |||
<!-- Custom CSS --> | |||
<style> | |||
body { | |||
padding-top: 50px; | |||
} | |||
.starter-template { | |||
padding: 40px 15px; | |||
text-align: center; | |||
} | |||
</style> | |||
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> | |||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// --> | |||
<!--[if lt IE 9]> | |||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script> | |||
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script> | |||
<![endif]--> | |||
</head> | |||
<body> | |||
<!-- Navigation --> | |||
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"> | |||
<div class="container"> | |||
<div class="navbar-header"> | |||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target=".navbar-collapse"> | |||
<span class="sr-only">Toggle navigation</span> | |||
<span class="icon-bar"></span> | |||
<span class="icon-bar"></span> | |||
<span class="icon-bar"></span> | |||
</button> | |||
<a class="navbar-brand" href="#">Project name</a> | |||
</div> | |||
<div class="collapse navbar-collapse"> | |||
<ul class="nav navbar-nav"> | |||
<li class="active"><a href="#">Home</a></li> | |||
<li><a href="#about">About</a></li> | |||
<li><a href="#contact">Contact</a></li> | |||
</ul> | |||
</div> | |||
<!--/.nav-collapse --> | |||
</div> | |||
<!-- /.container --> | |||
</nav> | |||
<!-- Page Content --> | |||
<nav class="navbar navbar-inverse navbar-fixed-top"> | |||
<div class="container"> | |||
<div class="navbar-header"> | |||
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> | |||
<span class="sr-only">Toggle navigation</span> | |||
<span class="icon-bar"></span> | |||
<span class="icon-bar"></span> | |||
<span class="icon-bar"></span> | |||
</button> | |||
<a class="navbar-brand" href="#">Project name</a> | |||
</div> | |||
<div id="navbar" class="navbar-collapse collapse"> | |||
<form class="navbar-form navbar-right"> | |||
<div class="form-group"> | |||
<input type="text" placeholder="Email" class="form-control"> | |||
</div> | |||
<div class="form-group"> | |||
<input type="password" placeholder="Password" class="form-control"> | |||
</div> | |||
<button type="submit" class="btn btn-success">Sign in</button> | |||
</form> | |||
</div><!--/.navbar-collapse --> | |||
</div> | |||
</nav> | |||
<!-- Main jumbotron for a primary marketing message or call to action --> | |||
<div class="jumbotron"> | |||
<div class="container"> | |||
<h1>Hello, world!</h1> | |||
<p>This is a template for a simple marketing or informational website. It includes a large callout called a jumbotron and three supporting pieces of content. Use it as a starting point to create something more unique.</p> | |||
<p><a class="btn btn-primary btn-lg" href="#" role="button">Learn more »</a></p> | |||
</div> | |||
</div> | |||
<div class="container"> | |||
<!-- Example row of columns --> | |||
<div class="row"> | |||
<div class="col-md-4"> | |||
<h2>Heading</h2> | |||
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p> | |||
<p><a class="btn btn-default" href="#" role="button">View details »</a></p> | |||
</div> | |||
<div class="col-md-4"> | |||
<h2>Heading</h2> | |||
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. </p> | |||
<p><a class="btn btn-default" href="#" role="button">View details »</a></p> | |||
</div> | |||
<div class="col-md-4"> | |||
<h2>Heading</h2> | |||
<p>Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.</p> | |||
<p><a class="btn btn-default" href="#" role="button">View details »</a></p> | |||
</div> | |||
</div> | |||
<hr> | |||
<footer> | |||
<p>© 2016 Company, Inc.</p> | |||
</footer> | |||
</div> <!-- /container --> | |||
<!-- /.container --> | |||
<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script> | |||
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script> | |||
</body> | |||
</html> | |||
</syntaxhighlight> | |||
</td> | </td> | ||
</tr> | </tr> |
Latest revision as of 15:52, 12 January 2017
|
|
|
|
||
|
|
|
|