Created
November 23, 2013 02:34
-
-
Save keshavsaharia/7610053 to your computer and use it in GitHub Desktop.
product 1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function() { | |
$('#productList').empty(); | |
for (var i in products) { | |
var product = products[i]; | |
$('#productList').append( | |
$('<div></div>') // make a div | |
.addClass('col-md-4 portfolio-item') | |
.append( | |
$('<a></a>') | |
.attr('href', 'linktome.html') | |
.append( | |
$('<img>') | |
.attr('style', 'width:100%') | |
.attr('src', product.image) | |
) | |
) | |
.append( | |
$('<h3></h3>') | |
.append( | |
$('<a></a>') | |
.attr('href', 'test.html') | |
.html(product.name) | |
) | |
) | |
.append( | |
$('<p></p>') | |
.html(product.description) | |
) | |
.append( | |
$('<h3></h3>') | |
.html('$' + product.price) | |
.append( | |
$('<button></button>') | |
.attr('class', 'btn btn-success') | |
.attr('style', 'float:right') | |
.append('buy now') | |
) | |
) | |
); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment