How to remove padding from jquery mobile checkbox - jquery-mobile

I am trying to remove padding from jquery mobile checkbox so that its align left: 0px however i cant get it to work. here is a JSFiddle of my problem: http://jsfiddle.net/jGhqS/4/
How do I align jquery mobile checkbox fully to the lefT?

The easiest way to find out how is to open up your console on your browser, inspect the checkbox and see what other styles are being applied to the checkbox
jQuery mobile created its fancy styles by appending and wrapping HTML around what you make, so your checkbox input and label become
<div class="ui-checkbox">
<input id="rememberCheck" type="checkbox" checked="">
<label id="rememberLb" for="rememberCheck" data-corners="true" data-shadow="false" data-iconshadow="true" data-wrapperels="span" data-icon="checkbox-off" data-theme="c" class="ui-btn ui-btn-corner-all ui-btn-icon-left ui-checkbox-on ui-btn-up-c">
<span class="ui-btn-inner ui-btn-corner-all">
<span class="ui-btn-text">CHECK BOX</span>
<span class="ui-icon ui-icon-shadow ui-icon-checkbox-on"> </span>
</span>
</label>
</div>
So to remove the spacing I copied jQuery mobile's style and changed the spacing to make the margin on the left smaller
.ui-checkbox .ui-btn-icon-left .ui-icon, .ui-radio .ui-btn-icon-left .ui-icon {
left: 5px;
}
Like this - http://jsfiddle.net/jGhqS/6/

Related

Bootstrap Bigger Icon

in the screenshot below, i have tried to add 2 button icons in 2 different columns which are also children of a row.
I want that buttons to fit as much as big they can in the column as you see.
Here is my code for that specific row;
<div class="row">
<div class="col-md-6 mb-3 text-start">
<label for="departure">VIP ($7000):</label>
<input type="number" class="form-control" id="departure" placeholder="0" value="" required>
</div>
<div class="col-md-3 align-self-center">
<i class="bi bi-plus-circle-fill"></i>
</div>
<div class="col-md-3 align-self-center">
<i class="bi bi-plus-circle-fill "></i>
</div>
I have tried some things but couldn't get the proper design
The font-size CSS options will work best.
So you could do.
i{
font-size: 50px;
}
The above will affect all icon tags and probably all HTML5 italic tags too.
Or you can add a Class to your icons. The CSS would be....
i .big-icon{
font-size: 50px;
}
With the HTML being....
<i class="bi bi-plus-circle-fill big-icon"></i>
Here is a link to the GetBootstrap Docs....
https://icons.getbootstrap.com/#styling

jquery mobile ui-input-btn custom icon

Using jquery mobile, ui-input-btn....
<div class="ui-input-btn ui-btn ui-icon-alert ui-btn-icon-top">
<div class="buttonText">Service<br/> Interruptions</div>
<input data-enhanced="true" value="Service Interruptions" type="button" id="service_interruptions">
</div>
I would like to use a custom icon.
Can this be done with this control?
If so, please provide a sample.
Thank you
Add a custom class to wrapping div and then override background-image and background-size of that class using :after pseudo selector.
<div class="ui-input-btn ui-btn ui-custom-icon ui-btn-icon-top">
<div class="buttonText">Service<br/>Interruptions</div>
<input data-enhanced="true" value="Service Interruptions" type="button" id="service_interruptions">
</div>
.ui-custom-icon:after {
background-image: url('icon.png');
background-size: 25px 25px;
}
Demo

Why copy paste option come when we tap the the button for 5 seconds?

Can you please tell me why copy, paste option appears after tapping the button for 5 seconds in jQuery mobile? Actually I am using jQuery mobile When I Add button and tap on that it show copy paste select all options?
<div class="ui-grid-c">
<div class="ui-block-a" style="width: 30%;" >
<input name="text-12" id="text-12" value="" type="text" autocorrect="off" class="searchbox">
</div>
<div class="ui-block-b">
Search
</div>
<div class="ui-block-c" style="margin-left: 5px;">
<a href="#" data-role="button" data-corners="false" data-inline="true" id="next" class="searchNext" disabled>Next</a>
</div>
<div class="ui-block-d" style="margin-left: 30px;">
<a href="#" data-role="button" data-corners="false" data-inline="true" id="prev" class="searchPrev" disabled>Previous</a>
</div>
Please Take a look On this link
Apache Cordova: remove tap-hold link menu
Disable copy on jquery mobile button over PhoneGap
Use This
* {
-webkit-touch-callout: none;
-webkit-user-select: none;
}
and only enable something you like:
input {
-webkit-user-select: auto;
}

input fields in jquery mobile dont expand to fill the screen

As the title says,
When i use a input field in a jquery mobile page, it doesnt expand the input fields to the full width of the screen.
If you use a small screen device, it fits fine but when you view the page in a desktop browser, the input fields only appears 2/3 of the width of the browser.
Is there a way to set it to expand to whatever the browser/screens width is?
here is my code:
http://jsfiddle.net/B8JDt/2/
<body>
<div data-role="page" id="page" onLoad="initialiseFields()">
<div data-role="header" data-position="fixed" data-theme="b" data-tap-toggle="false" data-transition="none" > Back
<h1>New Claim</h1>
</div>
<div data-role="content">
<ul class="ui-li" data-role="listview" id="list" data-inset="true" data-scroll="true">
<li data-role="list-divider">
<h2 id="itemTitle">Title</h2>
</li>
<li>
<h3>Journey From:</h3>
<div data-role="fieldcontain">
<input type="text" name="claimTitle" id="textFieldJourneyFrom" value="" />
</div>
</li>
<li>
<h3>Journey To:</h3>
<div data-role="fieldcontain">
<input type="text" name="claimTitle" id="textFieldJourneyTo" value="" />
</div>
</li>
</ul>
<div data-role="navbar">
<ul>
<li>Save</li>
</ul>
</div>
</div>
</div>
</body>
jQuery Mobile has a buggy implementation of box-resizing CSS3 rule.
To fix this problem use this CSS:
#media all and (min-width: 28em){
.ui-input-text {
box-sizing: none !important;
-moz-box-sizing: none !important;
-webkit-box-sizing: none !important;
width: 100% !important;
display: inline-block !important;
}
}
Fist box-sizing: none don't exist but it will override default value and it is better to override it like this then to remove it manually from a css file.
Working example: http://jsfiddle.net/B8JDt/3/

How do I use jQueryUI's ui-states with JSF2's h:messages?

It seems like it should be very simple to specify that the h:messages generated by JSF should be styled using jQueryUI's nice ui-states. But sadly I can't make it fit. It seems that the jQueryUI states require several elements (div,div,p,span) in order to make it work.
So taking inspiration directly from the jQueryUI theme demo page:
<!-- Highlight / Error -->
<h2 class="demoHeaders">Highlight / Error</h2>
<div class="ui-widget">
<div class="ui-state-highlight ui-corner-all" style="margin-top: 20px; padding: 0 .7em;">
<p><span class="ui-icon ui-icon-info" style="float: left; margin-right: .3em;"></span>
<strong>Hey!</strong> Sample ui-state-highlight style.</p>
</div>
</div>
<br/>
<div class="ui-widget">
<div class="ui-state-error ui-corner-all" style="padding: 0 .7em;">
<p><span class="ui-icon ui-icon-alert" style="float: left; margin-right: .3em;"></span>
<strong>Alert:</strong> Sample ui-state-error style.</p>
</div>
</div>
and trying to jam the css class details into my h:message as best I can:
<div class="ui-widget">
<h:messages globalOnly="true" errorClass="ui-state-error ui-corner-all ui-icon-alert" infoClass="ui-state-highlight ui-corner-all ui-icon-info"/>
</div>
I don't get the icon or sufficient padding etc but the colours make it through. So, the styles are being applied but they aren't working as intended.
Any idea how I can make this work?
On that element, you need a class that gives display: block; to get the position characteristics you want, like this:
<div class="ui-widget">
<h:messages globalOnly="true" errorClass="ui-state-error ui-corner-all ui-icon-alert block" infoClass="ui-state-highlight ui-corner-all ui-icon-info block"/>
</div>
CSS:
.block { display: block; }
Also if you're interested, here's a listing of all the classes jQuery UI uses for CSS and what they mean.

Resources