{"action":"opened","issue":{"url":"https://api.github.com/repos/desandro/masonry/issues/690","labels_url":"https://api.github.com/repos/desandro/masonry/issues/690/labels{/name}","comments_url":"https://api.github.com/repos/desandro/masonry/issues/690/comments","events_url":"https://api.github.com/repos/desandro/masonry/issues/690/events","html_url":"https://github.com/desandro/masonry/issues/690","id":69047601,"number":690,"title":"Bad masonry element: [object HTMLDivElement] ? I'm using document.querySelector not querySelectorAll","user":{"login":"Nomia","id":1707818,"avatar_url":"https://avatars.githubusercontent.com/u/1707818?v=3","gravatar_id":"","url":"https://api.github.com/users/Nomia","html_url":"https://github.com/Nomia","followers_url":"https://api.github.com/users/Nomia/followers","following_url":"https://api.github.com/users/Nomia/following{/other_user}","gists_url":"https://api.github.com/users/Nomia/gists{/gist_id}","starred_url":"https://api.github.com/users/Nomia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nomia/subscriptions","organizations_url":"https://api.github.com/users/Nomia/orgs","repos_url":"https://api.github.com/users/Nomia/repos","events_url":"https://api.github.com/users/Nomia/events{/privacy}","received_events_url":"https://api.github.com/users/Nomia/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-04-17T02:18:11Z","updated_at":"2015-04-17T02:18:11Z","closed_at":null,"body":"Hi,\r\n\r\nThanks for all your awesome work.\r\nIm using the masonry plugin recently, and did come into some headaches. Here is the code:\r\n\r\nHTML:\r\n<pre>\r\n&lt;body>\r\n    &lt;div id=\"img_container\">\r\n        &lt;div class=\"wrapper\">\r\n            &lt;div class=\"box\">...&lt;/div>\r\n            &lt;div class=\"box\">...&lt;/div>\r\n            &lt;div class=\"box\">...&lt;/div>\r\n                .......\r\n        &lt;/div>\r\n    &lt;/div>\r\n&lt;/body>\r\n</pre>\r\nJS:\r\nvar wrapper = document.querySelector('#img_container .wrapper'); (OR $('#img_container .wrapper').get(0))\r\nnew Masonry(wrapper,{columnWidth:300, itemSelector: \".box\"});\r\n\r\n\r\nSimple as above, it keeps giving an error:\r\n<pre>    Bad masonry element: [object HTMLDivElement]</pre>\r\n\r\nI've tried a lot ways to invoke masonry. Sometime it will work, but it doesn't select the items which I specified(\".box\"), instead it select the whole container as the item, and give the columnWidth to the whole container.\r\n\r\nThanks"}}