Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

Referencing an object on a particular page that has the same name across all pages

Hi,

I have 2 screens in my app, both screens have common components, but laid out differently.

This works fine when these components are formatted with CSS, as I have different CSS for each component.

However, the CSS I have used doesn't work below Android 4.4, so, to get around this, I have programatically created JS to format the page if required.

So, is there any way to position objects with the same name on different screens differently with JS?

my thoughts would be somehow a derivative using:
Appery("object1 on screen1").css("top","20px");
Appery("object1 on screen2").css("top","100px");

I just need to know if there is a way of addressing the object within a page.

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Referencing an object on a particular page that has the same name across all pages

Hello Andy,

Please run different JS on page show events of different pages.

on screen1:
Appery("object1").css("top","20px");

on screen2:
Appery("object1").css("top","100px");

Andy Parker
Posts: 0
Joined: Wed Mar 27, 2013 10:21 am

Referencing an object on a particular page that has the same name across all pages

ah, I wish it would be that easy.

These settings are called when orientation changes, so I wanted a
"catch-all" to perform just once when we get an orientation change, rather than ever time the page is displayed.

I presume then, there is no way of addressing items a page that are not being currently displayed?

Serhii Kulibaba
Posts: 150
Joined: Tue Aug 27, 2013 1:47 pm

Referencing an object on a particular page that has the same name across all pages

I got it.

Please use JS code like this:

pre$("#screen1 [name=object1]").css("top","20px"); /pre

Return to “Issues”