Page 1 of 2

Changing the size of a list image (thumbnail) in Javascript

Posted: Sun Nov 24, 2013 7:14 pm
by Andy Parker

Hi,

I'm trying to shrink the size of a list element I have but I cannot seem to make the list smaller that the thumbnail.

Can you tell me the javascript code to adjust the size of the thumbnail as well please.

I am trying to adjust the list height with the following code:

Code: Select all

$("[dsid=list2]").css('height','1'); 

many thanks

Andy.


Changing the size of a list image (thumbnail) in Javascript

Posted: Sun Nov 24, 2013 7:32 pm
by Igor

Hello,

You can set component "Class Name" and use CSS to apply component style.
http://docs.appery.io/documentation/w...


Changing the size of a list image (thumbnail) in Javascript

Posted: Sun Nov 24, 2013 8:01 pm
by Andy Parker

yes, thanks, I realise that.

But I want to do this programmatically, with Javascript.

for example.

Rather than apply static height, I want to collapse the list using javascript so it can be done as an effect.


Changing the size of a list image (thumbnail) in Javascript

Posted: Mon Nov 25, 2013 5:19 am
by Illya Stepanov

Hi Andy,

Sorry for delay, can you provide some screenshots of your thumbnail image? Is it a custom one or are you using standard jQuery?


Changing the size of a list image (thumbnail) in Javascript

Posted: Mon Nov 25, 2013 8:03 am
by Andy Parker

Hi Illya,

Please see screen shot of list below with thumnails.
This is all built using standard Appery UI.
Image


Changing the size of a list image (thumbnail) in Javascript

Posted: Mon Nov 25, 2013 9:48 am
by Kateryna Grynko

Hi Andy,

Try the following JS code: preAppery("list2").find("img").css("height","1")/pre


Changing the size of a list image (thumbnail) in Javascript

Posted: Mon Nov 25, 2013 10:27 am
by Andy Parker

Thanks Katya, that shrunk the image - appreciate that.

Can you tell me why the actual list element doesn't shrink with the following code please? I presumed the image was stopping it, but now the image has shrink, I still cant seem to shrink the list item.

$("[dsid=list2]").css('height','1');


Changing the size of a list image (thumbnail) in Javascript

Posted: Mon Nov 25, 2013 1:26 pm
by Kateryna Grynko

Andy,

Add this CSS attribute to list:preoverflow: hidden;/pre


Changing the size of a list image (thumbnail) in Javascript

Posted: Mon Nov 25, 2013 1:46 pm
by Andy Parker

thanks Katya, still no good.

tried this several ways:

Javascript: $("[dsid=list2]").css('overflow','hidden'); //didn't work

direct CSS: .listhide_enable {overflow: hidden;} //didn't work

adding overflow as a parameter and hidden as it's value //didn't work

full code I'm using to try to achieve this:
Appery("list2").find("img").css("height","1")
$("[dsid=list2]").css("overflow","hidden");
$("[dsid=list2]").css("height","1");

All that happens is the thumbnail disappears......


Changing the size of a list image (thumbnail) in Javascript

Posted: Mon Nov 25, 2013 1:57 pm
by Kateryna Grynko

Andy,

Is list2 a list component? What do you need to do? Do you want to set height 1px?