facebook

Custom Image Button with Alternative Touch Image

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #322997 Reply

    Hi,

    I am using an image button, however is there a way to get th image to change on touch of the button.

    I have tried using a second file e.g.

    settings.png
    settings_touch.png

    This does not work.

    Please advise.

    Kind Regards
    Julian

    #323000

    support-michael
    Keymaster

    @JulianMummery

    >I am using an image button, however is there a way to get th image to change on touch of the button.

    Is the idea to use a 2nd button to provide a touch/mouse-down only effect? That is the 2nd image is shown only while the button is being pressed? Or do you want to permanently change the button’s image?

    #323005

    Hi Wayne,

    I am only after the touch/mouse down effect, is this possible.

    Thanks
    Julian

    #323020

    support-michael
    Keymaster

    @JulianMummery

    Here is a css snippet (courtesy @support-vadim) to accomplish your goal of temporarily replacing an image-button’s image when pressed:

    #myimgbuttonid.m1-clicked{
    -webkit-border-image: url(<image-path) 1 1 1 1 stretch stretch;
    }

    1) #myimgbuttonid – replace with the id of your image-button
    2) <image-path> – replace with a relative path to your image
    3) add the new image to the -www codebase. Then when building an app or uploading as mobile webapp use the Files & Data wizard page to include the image in the app’s content

    Example:
    #m1-pressed-image1.m1-clicked{
    -webkit-border-image: url(res/images/pushButton_touch.png) 1 1 1 1 stretch stretch;
    }

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Custom Image Button with Alternative Touch Image

You must be logged in to post in the forum log in