Assignment said:
- Add a new div with id promotiediv and put it next to the 2 other columns using float. To do this correctly, you need to calculate the available width in the container. Do this dynamically! This means that when you adjust values in the CSS file, your code won't fall apart. Use the correct methods to determine the width and don't forget about the margins!!!!
- The new div contains an h3 with text 'promoties' and also a list where the elements are taken from an array. The initial values of this array are: 'Moestuinartikelen', 'Harken', 'Gras zaadjes', 'Veel meer...'. The list type is unordered.
- The new div contains an h3 with text 'promoties' and also a list where the elements are taken from an array. The initial values of this array are: 'Moestuinartikelen', 'Harken', 'Gras zaadjes', 'Veel meer...'. The list type is unordered.
Here's what I made of it so far:
$(document).ready(function() {
$("#container").append($("<div>").attr("id", "promotiediv").append($("<h3>").text("promoties")).append($("<ul>")));
var array = new Array("Moestuinartikelen", "Harken", "Gras zaadjes", "Veel meer...");
for (var i = 0; i < array.length; i++) {
$("#promotiediv ul").append($("<li>").text(array[i]));
}
});
I'm having trouble positioning this new div. I think I may have to use css("float", "right") to put it next to the 2 other columns, but then it's still located at the bottom of the page. I'm stuck! How can I successfully finish this assignment?
EDIT: You can download my source files here:
Greeny_Grass.zip (228.98K)
Number of downloads: 291
This post has been edited by skater_00: 20 February 2009 - 10:08 AM

New Topic/Question
Reply



MultiQuote


|