hongkhanh / gridify

A lightweight script for creating a Pinterest-like grid using JQuery, pure javascript or YUI with image loaded
http://hongkhanh.github.io/gridify
MIT License
124 stars 33 forks source link

Could not place cross button and title over the image #3

Closed changeweb closed 9 years ago

changeweb commented 9 years ago

I'm using Handlebars.js template. Gridify only works for

 <div class="grid">
  {{#each img in images}}
   <img {{bind-attr src=img.src_path}}>
  {{/each}}
 </div>

But when I tried to use <span> for cross button, gridify doesn't allow the spans over images.

<div class="grid">
   {{#each img in images}}
   <img {{bind-attr src=img.src_path}}>
   <span style="position:absolute;top:0;left:80%;z-index:1;">x</span>
  {{/each}}
 </div>
hongkhanh commented 9 years ago

Hi, you should put your grid item into a container.

{{#each img in images}}
x
{{/each}}

On Thu, Jan 8, 2015 at 9:17 PM, Hasib Mahmud notifications@github.com wrote:

I'm using Handlebars.js template. Gridify only works for

{{#each img in images}} {{/each}}

But when I tried to use for cross button, gridify doesn't allow the spans over images.

{{#each img in images}} x {{/each}}

— Reply to this email directly or view it on GitHub https://github.com/hongkhanh/gridify/issues/3.

hongkhanh commented 9 years ago

As you use absolute position inside grid item, you should put it into a relative container as well.

{{#each img in images}}
x
```
``` {{/each}}

On Fri, Jan 9, 2015 at 8:40 AM, Nguyen Hong Khanh khanh0203@gmail.com wrote:

Hi, you should put your grid item into a container.

{{#each img in images}}
x
{{/each}}

On Thu, Jan 8, 2015 at 9:17 PM, Hasib Mahmud notifications@github.com wrote:

I'm using Handlebars.js template. Gridify only works for

{{#each img in images}} {{/each}}

But when I tried to use for cross button, gridify doesn't allow the spans over images.

{{#each img in images}} x {{/each}}

— Reply to this email directly or view it on GitHub https://github.com/hongkhanh/gridify/issues/3.

changeweb commented 9 years ago

Not working. All cross is positioned in top:0;left:80%;

hongkhanh commented 9 years ago

Gridify only arrange your grid item like pinterest. Basically, you have to create your own style for grid item. You should know how to use relative position and absolute position and absolute position in a relative container.