Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
assignment_jq_dom_sprint
========================

...that DOM, D-DOM DOM DOOOOM...
by Brennan Fulmer

https://brennanfulmer.github.io/assignment_jq_dom_sprint/
6 changes: 4 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
<!doctype html>
<html>
<head>
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="styles.css">
<script src="jquery-3.2.1.min.js"></script>
<script src="jq_warmup.js"></script>
</head>
<body>
<header>
Expand Down Expand Up @@ -55,4 +57,4 @@ <h3>

</body>

</html>
</html>
44 changes: 44 additions & 0 deletions jq_warmup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@

$( document ).ready(function() {

// Change the <h1> to something cheeky
$( "h1" ).html( "Something Cheeky" );

/* Inside the container for "Upcoming Traversals", create and insert an
ordered list of upcoming traversals.*/
var $box = $( ".info-box" );
$box.css( "text-align", "center" )
$box.append("<ol>");
$box.append("<li> H1 changed to something cheeky");
$box.append("</li>");
$box.append("<li> Sad classes become happy");
$box.append("</li>");
$box.append("<li> Popup stops linking to evil, and instead links to cats");
$box.append("</li>");
$box.append("<li> Second to last suggested topic becomes quality queries");
$box.append("</li>");
$box.append("<li> Form input changed to textarea, replacing text input");
$box.append("</li>");
$box.append("</ol>");

// Make all sad classes into happy ones.
$( ".sad" ).attr( "class", "happy" );

// Make the annoying popup link point instead to http://www.cashcats.biz.
$( "a[href='http://www.evilwebsite.com']" ).attr( "href", "http://www.cashcats.biz" );

/* Change the positioning of the annoying popup so it is on the right side of
the screen (it's okay to use direct CSS here). Make it 30 pixels lower than
its current position by utilizing its current top value. */
$( "#annoying-popup" ).css( { "top": "40px", "margin-left": "calc(100% - 231px)" } );

/*Replace the ellipsis ... in one of the suggested topics with the content of
your choice -- but do so by traversing from a different element. */
var $listItem = $( "ul li:nth-child(7)" );
$listItem.html( "Quality queries" );

/* Replace the form input with a <textarea> instead of a <input type="text">. */
var $text = $( "input" ).first();
$text.replaceWith( "<textarea></textarea>" );

});
4 changes: 4 additions & 0 deletions jquery-3.2.1.min.js

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion styles.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
* {
font-family: sans-serif;
}

h1,h2,h3,h4,p{
text-align: center;
}
Expand Down Expand Up @@ -41,4 +45,4 @@ form{
}
#annoying-popup a{
color: white;
}
}