Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I have here two items, when I swipe right I would like the items to appear on a

ID: 3732821 • Letter: I

Question

I have here two items, when I swipe right I would like the items to appear on a different page or wish list. I can get it to link to a different page when i swipe right but I am unsure how to get the items to appear on another page. Please see code below:

$(document).ready(function () {

var cards =[

new Tindercardsjs.card(1, 'Converse', 'shoes, $40.', 'converse.jpg'),

new Tindercardsjs.card(0, 'Nike', 'shoes, $55', 'nike.jpg'),

];

Tindercardsjs.render(cards, $('#main'), function (event) {

if(event.direction === 'right' && event.cardid==0){

window.location.href = 'Wish list';

}

else if(event.direction === 'right' && event.cardid==1){

window.location.href = 'Wish list';

} else{

"";

}

Explanation / Answer

<script>

$(document).ready(function () {

  

// Define cards

var cards =[

new Tindercardsjs.card(1, 'Converse', 'shoes, $40.', 'converse.jpg'),

new Tindercardsjs.card(0, 'Nike', 'shoes, $55', 'nike.jpg'),

];

  

// Render cards

Tindercardsjs.render(cards, $('#main'), function (event) {

if(event.direction === 'right' && event.cardid==0){  

window.location.href = 'https://www.nike.com';

}else if(event.direction === 'right' && event.cardid==1){

window.location.href = 'https://www.converse.com';

}

  

});

});

</script>