facebook

How can I disable a button

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

    shahin
    Member

    I am trying to disable or change the background of the button but non of them work. I do this:

    $(‘#m1-masterMenu-pushUnreads’).css(“background-color”, “black”);

    or

    $(‘#m1-masterMenu-pushUnreads’).attr(“disabled”, “disabled”);

    I cant get it to function but if I do

    $(‘#m1-masterMenu-pushUnreads’).hide() ;

    it works

    #347828 Reply

    Hi shanin,

    This example should be helpful for you, it also includes how to enable/disable radio buttons and checkboxes:
    http://www.genuitec.com/support-genuitec/viewtopic.php?p=9861#p9861

    #347829 Reply

    shahin
    Member

    Octavio,

    Thanks for the reply, but it does not work on MobiOne simulator..!!I havt tried on Android yet. Any idea why?

    #347830 Reply

    shahin
    Member

    el.css(‘color’, ‘grey’); is changing the font color, el.css(‘background-color’, ‘grey’); is not changing the background color…any idea why?

    #347833 Reply

    support-michael
    Keymaster

    @shahin

    > el.css(‘background-color’, ‘grey’); is not changing the background color…any idea why?

    Yes, this is because push buttons use an image background (see screenshot below). You would need to change the image src as well for a fully gray look.

    You can switch to a custom-button. But also with the custom-button if you use a background style other than a solid color, e.g., default is a color gradient, then you can not simply change the background color as it is a gradient.

    If you are running your project in the simulator, use f12 to open the inspector and you can see the css for every element in the dom. Then you can experiement by disable/enable diff styles in the hierarchy to see which to override for your purpose. See attachment disable-button-inspector.png

    Attachments:
    You must be logged in to view attached files.
Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: How can I disable a button

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