4,476
edits
No edit summary |
No edit summary |
||
Line 2: | Line 2: | ||
console.log('JavaScript is working!'); | console.log('JavaScript is working!'); | ||
var communityFeatured = $('#community-featured'); | |||
var cards = $('.card'); | var cards = $('.card'); | ||
var showArticleWrapper = $('#show-article-wrapper'); | var showArticleWrapper = $('#show-article-wrapper'); | ||
if (communityFeatured.length && cards.length >= 2) { | |||
if ( | // Detach and insert the community featured element after the second card | ||
// | communityFeatured.detach(); | ||
cards.eq(1).after(communityFeatured); | |||
} | } | ||
Line 45: | Line 43: | ||
}); | }); | ||
} | } | ||
// Delegate the mousedown event to the '.card' elements inside the '#list' container | // Delegate the mousedown event to the '.card' elements inside the '#list' container | ||
$('#list').on('mousedown', '.card', function (event) { | $('#list').on('mousedown', '.card', function (event) { |