navya kodali
Posts: 0
Joined: Wed Jan 22, 2014 6:47 am

how to set width, height for input component,buttons?

Hi,

i want to set width for an input component.
how to do that?
i have adjusted input component margin left,right values. but its not properly viewed in other orientations and other screen sizes.

please guide me...

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

how to set width, height for input component,buttons?

Hi Navya,

You can use this CSS: pre[name=labelName]{
width: 100px;
height:100px;
}/pre
Or the following JS:preAppery("labelName").css("width", "100px");
Appery("labelName").css("height", "100px");/preWhere 'labelName' is a name of a Label component.

navya kodali
Posts: 0
Joined: Wed Jan 22, 2014 6:47 am

how to set width, height for input component,buttons?

thanks for your reply...

on which event i have to write this code.

if i use this code may i get component center of the page irrespective of the screen size.for 320x480,768x1024 and 768x1024

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

how to set width, height for input component,buttons?

Navya,

If you want to use CSS, you would need to create custom CSS code.
If you choose JavaScript, run the code on page Load event.

navya kodali
Posts: 0
Joined: Wed Jan 22, 2014 6:47 am

how to set width, height for input component,buttons?

if i use this code may i get component center of the page irrespective of the screen size.for 320x480,768x1024 and 768x1024
how to place a component center of the screen with dome dimensions?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

how to set width, height for input component,buttons?

Navya,

This code is to align horizontally:preAppery('labelName').css('margin-left', 'auto');
Appery('labelName').css('margin-right', 'auto');
Appery('labelName').css('align', 'center');
Appery('labelName').css('width', '100px');/pre

To align vertically add the following custom code:prejQuery.fn.verticalAlign = function ()
{
return this
.css("margin-top",($(this).parent()
.height() - $(this).height())/2 + 'px' )
};/preThen on Page Show event run:preAppery("labelName").verticalAlign();/pre

Joe Sharples
Posts: 0
Joined: Mon Aug 18, 2014 1:31 pm

how to set width, height for input component,buttons?

I used the initial code to change the height which worked, although the text is in the centre, how can i change this so it's at the top?

Image

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

how to set width, height for input component,buttons?

Hi Joe,

Please use Textarea component instead of Input to enable multi-line text.

Joe Sharples
Posts: 0
Joined: Mon Aug 18, 2014 1:31 pm

how to set width, height for input component,buttons?

I feel extremely stupid now, that is obviously the better component to use.

Thank you.

EJLD
Posts: 0
Joined: Sun Jun 08, 2014 11:03 pm

how to set width, height for input component,buttons?

basic but still helpful. thks

Return to “Issues”