webOS Nation Forums >  webOS apps and software >  webOS development > swapping style sheets between pixi and pre
swapping style sheets between pixi and pre

  Reply
 
LinkBack Thread Tools Display Modes
Old 05/11/2010, 08:42 AM   #1 (permalink)
Member
 
Join Date: Jun 2009
Posts: 32
Likes Received: 0
Thanks: 2
Thanked 38 Times in 3 Posts
Default swapping style sheets between pixi and pre

Hello,

I am having a bit of trouble right now getting the style sheets working for both the pre and pixi. I have an alternative style sheet defined and wish to use it for the pixi. In my code, I have a check (which it does hit) for if its running within the pre emulator, then basically do something along the lines of (i dont have the exact code in front of me)

prestylesheet.disabled=true;
pixistylesheet.disabled=false;

It will disable the pre style sheet but it will not enable the pixi style sheet. Is there a standard way of doing this within webos? Is this the best way to do it? Please let me know.

Thanks!
__________________
http:/www.codeofdoom.com/wordpress

Five or More for the Palm Pre and Palm Pixi
tont0r is offline   Reply With Quote
Old 05/13/2010, 10:12 AM   #2 (permalink)
Member
 
unfairSurprisery's Avatar
 
Join Date: Nov 2009
Location: Utah
Posts: 261
Likes Received: 0
Thanks: 7
Thanked 65 Times in 56 Posts
Default

Both stylesheets should be loaded and enabled in your index.html at start, before your javascript code even begins. Your check should then disable the appropriate one. Also, what are the differences in your css? If you're just shifting elements due to screen size, it's generally better if you use a calculated position and set it in your scene's setup method. That way it can be ready for screen resolutions that aren't available yet.
unfairSurprisery is offline   Reply With Quote
Reply

 

Tags
css

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0