1

I am using jquery.mobile-1.1.0 for a PhoneGap application. I am getting issue in button css. Jquery has its own button styling but I don't want to use that and want have my own button css. I am also using few jQuery components like tabs, form-search that use jQuery-mobile css so I have to include it in my application.

Here is my html code:

    <div data-role="content">
    <div class="signup">
    <form action="#" id="loginForm">
    <fieldset>
    <ul>
    <li class="first">
    <label><span>Email*</span></label>
    <input name="loginemail" type="text" id="loginemail" class="input" placeholder="Enter Full Name"  />
    </li>

    <li>
    <label><span>Password*</span></label>
    <input name="loginpassword" id="loginpassword" type="text" class="input" placeholder="Pick A Password" />
    </li>

    <li>
    <input name="" type="submit" id="loginSubmit" class="button" value="Login"   />
    </li>
    </ul>

    </fieldset>
    </form>
    </div> <!-- signup- div -->
    </div><!-- - content -->
    </div> <!-- end login page -->

Source while doing inspect element in Firebug jQuery creates an outer layer against that button that eventually disturb my whole button css.

    <li><div aria-disabled="false" class="ui-btn ui-shadow ui-btn-corner-all 
    ui-fullsize ui-btn-block ui-btn-up-c" data-mini="false" data-inline="false" 
    data-theme="c" data-iconpos="" data-icon="" data-wrapperels="span"   
    data-iconshadow="true" data-shadow="true" data-corners="true">
    <span class="ui-btn-inner ui-btn-corner-all">
    <span class="ui-btn-text">Login</span>
    </span>
    <input aria-disabled="false" name="" id="loginSubmit" 
    class="button ui-btn-hidden" value="Login" type="submit"></div></li>

Here is my customized button class for css

  .button{ width:100% !important; height:69px !important; 
    float:left !important;
    font-size:24px !important;
    font-family:"MyriadPro-BoldCond_0",Arial, Helvetica, sans-serif !important; 
    color:#FFFFFF !important; text-align:center; 
    background:#ca2c00 !important; border:none !important; 
    background:-moz-linear-gradient(#ca2c00, #7a1a00) !important;
    background: -webkit-gradient(linear, left top, left bottom, from(#ca2c00), to(#7a1a00)) !important; 
   -pie-background: linear-gradient(#ca2c00, #7a1a00) !important;
    background: -o-linear-gradient(#ca2c00, #7a1a00) !important; 
   -moz-border-radius:0 0 7px 7px !important;
  -webkit-border-radius:0 0 7px 7px !important; 
   border-radius:0 0 7px 7px !important; behavior: url(PIE.htc) !important;   
   position:relative !important;
   cursor:pointer !important;} 

Please help. How can I stop jQuery from creating an outer shell around the button and allow it to pick my customized css. Thanks

2 Answers 2

1

In jquery mobile ,Input-based buttons and button elements are auto-enhanced, no data-role required. So you have two options to overcome this issue.

  1. Edit the jquery mobile theme, or rather create a customized theme using Theme Roller. You can find the themeroller tool here.

  2. Second option is to set data-role of the input button to none. Ex <input type="button" data-role="none" id="btnId" class="button">.

Hope it helped you.

-- MEJO

Sign up to request clarification or add additional context in comments.

Comments

0

The .button class is used by jQuery Mobile, try to use another class name.

1 Comment

I have changed to mybutton doesn't reflect anything ...still the same

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.