-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
this.handle.offsetWidth is zero sometimes and this causes problems #97
Comments
I get your scenario, but I think it's outside the scope of Dragdealer to preload images. Dragdealer does indeed calculate the handle boundaries on initialization, and does not update if the contents of the handle change afterwards. You don't necessarily need to set the width/height through css, though. You can set the width/height on the DOM element directly. From what I remember, it is a general HTML best practice to always provide width/height to |
Sure I understand that, but a lot of the time img tags will not have width/height set, either by css or attributes. In my opinion there should at least be a side note about this in the docs to remind people to use width/height when using images as handles. This would have save me some hours of debugging. |
Can you think of a place in the current docs where you would place the On Thursday, June 25, 2015, Juha Tauriainen [email protected]
Best regards, |
Sure! I'll try to get something for you during the weekend :) |
I have a scenario where the handle is an image. Sometimes it takes a while to load that image and those times the handle is calculated outside of the container element.
For me, the fix was to set the handle image a width in css.
I'm not sure what the best approach for this would be, maybe mention this css width workaround in the docs?
One possible solution could be to check if the handle has an image in it, wait for it to load until calculating? But then again that would be a problem if the image is a css background for example.
Do you guys have any ideas for this?
The text was updated successfully, but these errors were encountered: