I am trying to insert a box strip in between rows of divs, how can I target the end of each row's div?
Here's a JSFiddle of the divs: http://jsfiddle.net/5Sn94
Here's the code:
<div>
<img src="//placehold.it/50x50">
</div>
<div>
<img src="//placehold.it/50x50">
</div>
<div>
<img src="//placehold.it/50x50">
</div>
After a while, the divs will go onto the next line, creating a new 'row'. How can I insert a div which spans across the full page width, underneath a row of divs.
To show you what I want to achieve, visit this link on Google: http://bit.ly/1329rDn
And then you'll see if you click any image, it will open that new image bigger inbetween the div rows, how was this achieved? And how can I do the same?
I think this can help you in your investigations:
http://jsfiddle.net/5Sn94/14/
.expander
is a div which needs to be inserted after target (hovered in my example) element. It has 100% width to occupy whole horizontal space.To insert
expander
after hovered div I used this javascript (insidefor
loop):You can insertAfter in jQuery, etc.
Using jQuery, you can use the
last-child
selector: http://jsfiddle.net/5Sn94/1/You can use
document.getElementsByTagName
but it will only work if you don't have any other divs on the page http://jsfiddle.net/5Sn94/2/