I want to implement a coverflow using the plugin found at this link:
Here is an example of how it can be done:
<div class="coverflow">
<div class="cover">A</div>
<div class="cover">B</div>
...
<div class="cover">Y</div>
<div class="cover">Z</div>
</div>
<script>
$(function() {
$('.coverflow').coverflow();
});
</script>
The above code works well for manually created elements. However, when creating elements programmatically like this:
var el = {
newDiv: $("<div>", { class: "cover newDiv"}),
newElt: $("<div>", { class: "cover newDiv"})
}
$("#preview-coverflow").append(el.newDiv);
$("#preview-coverflow").append(el.newElt);
The newly added divs are displayed vertically instead of horizontally. Is there a difference between these two methods of element creation? I am trying to create empty divs and append them to the parent. Am I missing something here?
In my stylesheet, I have defined the style for the empty divs as follows:
.newDiv {
background-color:red
}