Hi, On Thu, May 21, 2015 at 4:40 AM, smallufo <[email protected]> wrote:
> 2015-05-20 23:27 GMT+08:00 Martin Grigorov <[email protected]>: > > > You can use AjaxBrowserInfoBehavior. > > > > > I think you mean AjaxClientInfoBehavior > http://www.wicket-library.com/wicket-examples-6.0.x/ajaxhellobrowser/?0 > > Thanks . it's working well ! > > But I have another question. > Please use a new thread for new questions. > > Is there any way to get the containing element's width ? > > for example : > > > *<div class="col-xs-12 col-sm-4"> <img wicket:id="img"/></div>* > > It will have different proportion in different width > for XS (extreme small) screen , it will be 100% width > and for SM (small) or larger screen , it will cover 1/3 width > Is it possible to dynamically get the width of the containing element ? > (so that I can generate correct width image ) > This is rather a JS/CSS question, not Wicket/Java. It is possible. You should use the computed style of the container element. Once you read the width/height you can use Wicket Ajax to send the data to the server. > > Thanks. >
