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
20 changes: 19 additions & 1 deletion css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,25 @@
Author's custom styles
========================================================================== */


/* ============= LIKE BUTTON ============= */

/* jQuery Like Buttons */
.qty1 {
border: none;
width: 20px;
background: none;
text-align: center;
cursor: pointer;
}

/* JavaScript Like Button */
.counter {
border: none;
width: 20px;
background: none;
text-align: center;
cursor: pointer;
}



Expand Down
26 changes: 22 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,24 +67,42 @@ <h1>Hello, world!</h1>
<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 &raquo;</a></p>
<p>
<!-- jQuery Like Button -->
<a class="like btn btn-primary" role="button">
<span class="glyphicon glyphicon-thumbs-up"></span>
<input class="qty1" name="qty1" type="text" readonly="readonly" value="0"/>
</a>
<a class="btn btn-default" href="#" role="button">View details &raquo;</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 &raquo;</a></p>
<p>
<!-- jQuery Like Button -->
<a class="like btn btn-primary" role="button">
<span class="glyphicon glyphicon-thumbs-up"></span>
<input class="qty1" name="qty1" type="text" readonly="readonly" value="0"/>
</a>
<a class="btn btn-default" href="#" role="button">View details &raquo;</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 &raquo;</a></p>
<p>
<!-- JavaScript Like Button -->
<a class="btn btn-primary" role="button" onclick="buttonClick()">
<span class="glyphicon glyphicon-thumbs-up"></span>
<input id="clicks" type="text" readonly="readonly" value="0" class="counter"></input>
</a>
<a class="btn btn-default" href="#" role="button">View details &raquo;</a></p>
</div>
</div>

<hr>

<footer>
<p>&copy; Company 2015</p>
Copy link
Copy Markdown
Collaborator

@cherylac cherylac Mar 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with updating this to Nifty-Club 2019
(perhaps without the !)
😉

<p>&copy; Nifty-Club 2019</p>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with changing the footer to Nifty-Club 2019.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great eye!

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should add a "!" at the end of "Nifty-Club 2019" so it's "Nifty-Club 2019!"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than that change, I say ship it!

</footer>
</div> <!-- /container --> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/vendor/jquery-1.11.2.min.js"><\/script>')</script>
Expand Down
15 changes: 15 additions & 0 deletions js/main.js
Original file line number Diff line number Diff line change
@@ -1 +1,16 @@
////// LIKE BUTTON ////////

// jQUERY

$(function () {
$(".like").click(function() {
var input = $(this).find('.qty1');
input.val(parseInt(input.val())+ 1);
});
});

// JAVASCRIPT
var i = 0;
function buttonClick() {
document.getElementById('clicks').value = ++i;
}