Reputation: 9543
I tried a lot of things, first in the css now with jquery but i can't get the z-index correct. The text should go over the image that is on the right side of it and not under it. If i check the z-index in the source then it's correct but still the text is on the back.
$(document).ready(function() {
var entries = $('.entrie').length;
$('.entrie').each(function(index){
//console.log(index);
var newIndex = entries-index;
console.log(newIndex);
$(this).css('z-index', newIndex);
});
});
here's a jsfiddle:
2nd (less important), when i make the window really small then the text goes under the image, how can i prevent this? I just want scrollbars when it gets to small.
Upvotes: 0
Views: 1261
Reputation: 1509
Give both elements you are applying z-index to a position:relative;
. z-index doesn't work on anything that doesn't have a position.
Upvotes: 1
Reputation: 2671
Add "position:absolute;" in entrieInfo class and "position:relative;" in entrieImage class.
DEMO: http://jsfiddle.net/cX8Fy/1/
Upvotes: 1