Event boxes behavior modified like pinterest style using a javascript