Skip to content
Draft
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: 2 additions & 2 deletions 04 Working-with-DOM /index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ <h1>JQuery Play</h1>
<p>This is the code I created when learning jQuery at <a href="http://try.jquery.com/">http://try.jquery.com/</a></p>

<ul>
<li class="vacation onsale" data-price='199.99'>
<li class="vacation" data-price='199.99'>
<h2>Hawaiian Vacation</h2>
<button>Get price</button>
</li>
<!-- <li class="vacation expiring onsale" data-price='299.99'>
<!-- <li class="vacation expiring" data-price='299.99'>
<h2>Hawaiian Vacation</h2>
<button>Get price</button>
</li>
Expand Down
4 changes: 2 additions & 2 deletions 05 Acting on interaction/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ <h1>JQuery Play</h1>
<p>This is the code I created when learning jQuery at <a href="http://try.jquery.com/">http://try.jquery.com/</a></p>

<ul>
<li class="vacation onsale" data-price='199.99'>
<li class="vacation" data-price='199.99'>
<h2>Hawaiian Vacation</h2>
<button>Get price</button>
</li>
<li class="vacation expiring onsale" data-price='299.99'>
<li class="vacation expiring" data-price='299.99'>
<h2>Hawaiian Vacation</h2>
<button>Get price</button>
</li>
Expand Down
4 changes: 2 additions & 2 deletions 06 Data tags/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ <h1>JQuery Play</h1>
<p>This is the code I created when learning jQuery at <a href="http://try.jquery.com/">http://try.jquery.com/</a></p>

<ul>
<li class="vacation onsale" data-price='199.99'>
<li class="vacation" data-price='199.99'>
<h2>Hawaiian Vacation</h2>
<button>Get price</button>
</li>
<li class="vacation expiring onsale" data-price='299.99'>
<li class="vacation expiring" data-price='299.99'>
<h2>Hawaiian Vacation</h2>
<button>Get price</button>
</li>
Expand Down
8 changes: 0 additions & 8 deletions 07 Event delegation/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ $(document).ready(function() {
$(this).remove();
});

// This event handler waits for a click event on any element with class onsale-filter inside the id filters before executing the code inside
$('#filters').on('click', '.onsale-filter', function() {
// This removes any existing highlights first before applying the highlighting
$('.highlighted').removeClass('highlighted');
// Here we add a class highlighted to the class .onsale with any element with class vacation
$('.vacation').filter('.onsale').addClass('highlighted');
});

// This event handler waits for a click event on any element with class expiring inside the id #filters before executing the code inside
$('#filters').on('click', '.expiring-filter', function() {
// This removes any existing highlights first before applying the highlighting
Expand Down
5 changes: 2 additions & 3 deletions 07 Event delegation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,15 @@
<h1>JQuery Play</h1>
<p>This is the code I created when learning jQuery at <a href="http://try.jquery.com/">http://try.jquery.com/</a></p>
<div id="filters">
<button class="onsale-filter">On Sale Now</button>
<button class="expiring-filter">Expiring</button>
</div>

<ul>
<li class="vacation onsale" data-price='199.99'>
<li class="vacation" data-price='199.99'>
<h2>Hawaiian Vacation</h2>
<button>Get price</button>
</li>
<li class="vacation expiring onsale" data-price='299.99'>
<li class="vacation expiring" data-price='299.99'>
<h2>Hawaiian Vacation</h2>
<button>Get price</button>
</li>
Expand Down
4 changes: 2 additions & 2 deletions 08 Hover and click events/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ <h3>Hover event</h3>

<button class="expiring-filter">Click event</button>
<ul class="ticket">
<li class="vacation onsale" data-price='199.99'>
<li class="vacation" data-price='199.99'>
<h2>Hawaiian Vacation</h2>
</li>
<li class="vacation expiring onsale" data-price='299.99'>
<li class="vacation expiring" data-price='299.99'>
<h2>Hawaiian Vacation</h2>
</li>
<li class="vacation expiring" data-price='399.99'>
Expand Down