Page 2 of 2
how to change size of element according to screen size
Posted: Fri Feb 20, 2015 11:33 am
by Evgene Karachevtsev
Hello Ellen,
Please clarify - do you want to change width of your select menu one time and it will have such width always? Or you need to change width of your select menu automatically, when some event happens?
how to change size of element according to screen size
Posted: Fri Feb 20, 2015 3:15 pm
by Ellen Schlechter
I want it to always have the same width depending on screen size. I would want it to be about 25% of the page.
how to change size of element according to screen size
Posted: Tue Feb 24, 2015 9:06 pm
by Evgene Karachevtsev
Hello Ellen,
Please add custom CSS and create there such class
pre.ui-select {
width: 25%
}/pre
It should resolve your problem
how to change size of element according to screen size
Posted: Sun Mar 08, 2015 10:19 pm
by Ellen Schlechter
I have it in a grid so so it makes it 25% of the grid. Can I made a grid 25% of the width? I can't add a class to it.
how to change size of element according to screen size
Posted: Tue Mar 10, 2015 2:57 am
by Yurii Orishchuk
Hi Ellen,
Nope. CSS works relative to the first sized parent. This parent in your case is grid cell.
Regards.
how to change size of element according to screen size
Posted: Tue Mar 10, 2015 2:59 am
by Ellen Schlechter
Is there any way to adjust the screen size??
Or as an alternative is there a way to have two select menus right beside eachother in the header without the grid?
how to change size of element according to screen size
Posted: Wed Mar 11, 2015 2:28 pm
by Ellen Schlechter
how to change size of element according to screen size
Posted: Thu Mar 12, 2015 2:38 am
by Yurii Orishchuk
Hi Ellen,
Yes you can use custom JS code which is:
Get document size(width).
Calculate needed select width(using document with and some logic).
Set width of the select. Here is an example code:
pre
Apperyio("mobileselectmenu_30").closest('[data-role="fieldcontain"]').width(400);
/pre
Regards.
how to change size of element according to screen size
Posted: Thu Mar 12, 2015 5:01 pm
by Ellen Schlechter
The builder doesn't seem to like that code.
how to change size of element according to screen size
Posted: Thu Mar 12, 2015 6:30 pm
by Ellen Schlechter
Update: I used the code below as a little bit of a model along with yours.
var documentWidth = jQuery(document).width();
alert(documentWidth);
var goalWidth=(documentWidth)*(25)/100;
alert(goalHeight);
$("mobilegridcell_438").attr('style', 'width:'+goalWidth+'px !important');
This is what I used but I got the same error as in my previous comment.