Results 1 to 8 of 8
  1.    #1  
    simply, lets say i have a circle that's blue (using blue.png in the css as the background). i want to tap on the circle and have it turn to the red.png. now i currently have different classes set up so that i have the absolute positioning for each circle (there are a lot of circles). is there a way that i can just update the class i originally set up in the scene from the jsjsjs $in$ $the$ $assistant$ ($i$.$e$. $change$ $background$: $url$(...) $dynamically$ $in$ $js$)? $mucho$ $thanks$ $if$ $someone$ $can$ $help$!!!
    My site: Shanerooni, LLC
    Follow me on Twitter
    My apps: GuessWhat? | MazeHunter3D | Small Wonders | PhakePhoney | AutismAware | PicSketcher | Cubix | QuickSolve | QuickSpell | QuickTrace | QuickWhack | QuickSuite | Soccer Shots | Ballooning |
    Cubix
  2. #2  
    I'm not sure if this is 100% correct because inline scripting is bad practice, but it should be:

    Code:
    <tag onClick="this.style.backgroundImage='url(path/to/image.img)'"> </tag>
    I'm sure there is an easier and cleaner way to do event listening in Mojo. Try reading the documentation on Palm's Developer website as well as the documentation for PrototypeJS.
  3.    #3  
    thanks! i can do a mojo listen for a tap no problem. i'll try just using:

    Code:
    this.style.backgroundImage='url(path/to/image.img)'
    thanks again! i'll post back if it works...
    My site: Shanerooni, LLC
    Follow me on Twitter
    My apps: GuessWhat? | MazeHunter3D | Small Wonders | PhakePhoney | AutismAware | PicSketcher | Cubix | QuickSolve | QuickSpell | QuickTrace | QuickWhack | QuickSuite | Soccer Shots | Ballooning |
    Cubix
  4. #4  
    Instead, create two css classes. One for the size, and one for the background image.

    Then on your div, when you are ready to display it, use

    $("myDiv).addClassName( "blueCircle" );
  5.    #5  
    need a little more help...

    css:

    Code:
    .hole1 {
    	position:absolute;
    	left:1.5px;
    	top:5px;
    	height: 20px;
    	width: 20px;
    	background: url(../images/hole.png) no-repeat center ;
    }
    need to change hole.png to yellow.png within the jsjsjs $when$ $i$ $tap$ $on$ $the$ $div$. $what$ $i$ $mentioned$ $before$ $didn$'$t$ $work$. $thanks$ $for$ $any$ $help$!!!
    My site: Shanerooni, LLC
    Follow me on Twitter
    My apps: GuessWhat? | MazeHunter3D | Small Wonders | PhakePhoney | AutismAware | PicSketcher | Cubix | QuickSolve | QuickSpell | QuickTrace | QuickWhack | QuickSuite | Soccer Shots | Ballooning |
    Cubix
  6. #6  
    Hey Shanerooni, how about using the Prototype setStyle function? Try something like this in your listener (this assumes that the tag your are updating has an id of "elementID", be sure to update!):

    Code:
    this.controller.get('elementID').setStyle
    ({
    	position:absolute;
    	left:1.5px;
    	top:5px;
    	height: 20px;
    	width: 20px;
    	background: url(../images/yellow.png) no-repeat center
    });
    MoBill - Use your Authorize.net account to bill your customers with your webOS device!!
    MoJack - Track your lost or stolen webOS device from anywhere!
    Time to get VIRAL
  7.    #7  
    this at least got it to do something:

    Code:
    this.controller.get('hole1').setStyle
    ({
    	position:'absolute',
    	left:'1.5px',
    	top:'5px',
    	height: '20px',
    	width: '20px',
    	background: 'url(../images/yellow.png) no-repeat center'
    });
    but all it did was got rid of the image that was there (background is black, and my hole.png image just disappeared). had to modify yours to include quotes around the style settings, and commas instead of semicolons to get it to at least make the hole.png disappear.

    i also tried it with just the background setting to change the image, and i got the same disappearing result (i'd prefer to just change the image, otherwise i would have just as much code creating a different css class for each hole replacement (about 10 per hole, with a lot of holes)).
    My site: Shanerooni, LLC
    Follow me on Twitter
    My apps: GuessWhat? | MazeHunter3D | Small Wonders | PhakePhoney | AutismAware | PicSketcher | Cubix | QuickSolve | QuickSpell | QuickTrace | QuickWhack | QuickSuite | Soccer Shots | Ballooning |
    Cubix
  8. #8  
    I posted the entire thing because I wasn't sure if it would clear any properties that weren't set. So I'm guessing you now have:

    Code:
    this.controller.get('hole1').setStyle ({background: 'url(../images/yellow.png) no-repeat center'});
    This would seem odd if it's the case, but maybe the path to yellow.png should be from the assistants folder rather than from the CSS folder since you are changing the background property from there?!?!? Something like...

    Code:
    this.controller.get('hole1').setStyle ({background: 'url(../../images/yellow.png) no-repeat center'});
    MoBill - Use your Authorize.net account to bill your customers with your webOS device!!
    MoJack - Track your lost or stolen webOS device from anywhere!
    Time to get VIRAL

Posting Permissions