Is it required to use bootbox.alert("message",function(){example.show("another message")};or bootbox.prompt/confirm to use show? Also is there a way to change the position of where show displays? By default it displays close to the bottom right.
If I'm correct, show is just to get the Example object to show itself (jquery show ). If that is the case, no you do not need to use the bootbox methods to use show as it is a method found in jquery. As to whether the position the Example object is displayed, it is definitely possible. I'm not sure but one way could be to write custom css. When I check the style for the 'show', this is what came up:
.bb-alert {
position: fixed;
bottom: 25%;
right: 0;
margin-bottom: 0;
font-size: 1.2em;
padding: 1em 1.3em;
z-index: 2000;
}
You could change the position of the Example object by changing the 'bottom' or the 'right' elements in the css.
Related
I'm trying to implement some functions that use ion-range as input. The functions are okay, my problem is related to the aesthetic issue of the ion-range element. Although there is this option to implement ticks in the documentation, they are the same height as the bar, making them very difficult to see if the primary color of the app is not dark enough.
I managed to modify it through the dev console and was able to acquire the style I wanted. I tried to modify the .range-tick class that is created, but to no avail. I saw a similar question that change the style of the range pin, but how can access this options for the range-tick?
I dev console I can see that style is currently this way:
.range-tick {
position: absolute;
top: calc((var(--height) - var(--bar-height)) / 2);
width: var(--bar-height);
height: var(--bar-height);
background: var(--bar-background-active);
z-index: 1;
pointer-events: none;
}
From this question suggestion I tried to add the currently empty variable --bar-height in my :root (src/theme/variables.scss), but this don't change anything.
I want to modify the class to include this options:
.range-tick {
position: absolute;
top: 25%; // <-- Changed
width: var(--bar-height);
height: 20px; // <-- Changed
background: var(--bar-background-active);
z-index: 1;
pointer-events: none;
}
I also tried to modify the range.md.css and range.ios.css files located in project_folder/node_modules/#ionic/core/dist/collection/components/range/, which looks exactly what I can see in dev console. After modify the class and recompile nothing has changed, in dev console Inspector I can see that the class is still using the initial class and not the modified one.
I read some comments of people in ionic forum saying that this can only be changed by Ionic team, so I created a new issue.
You can use CSS Shadow Parts.
To set the style for all non active ticks
ion-range::part(tick){
height: 10px;
width: 10px;
top: 16px;
border-radius: 50%;
}
To set the style of all active ticks
ion-range::part(tick-active){
height: 10px;
width: 10px;
top: 16px;
border-radius: 50%;
}
For more you can refer https://ionicframework.com/docs/api/range#css-shadow-parts
I want create a drop down menu or popover within ionic toolbar. I tried with several ways but can not solve. Its always hidden like bellow,
I trying css like bellow,
.popover{
border: 1px solid black;
height: 350px;
width: 150px;
position: absolute;
z-index: 99999999;
background: yellow;
}
ion-header{
contain: none;
}
ion-toolbar{
contain: none;
}
Please give me a suggestion or an alternative idea. Please do not give any predictive answer if you are not familiar with ionic.
I don't know about Ionic 4 but on Ionic 5, a solution would be this when you debug on the console :
ion-toolbar {
contain: none;
.toolbar-container {
overflow: visible;
contain: none;
}
}
However, the .toolbar-container is an element in the shadow dom of the <ion-toolbar> component and its overflow and contain properties are not css variables and there is no part attribute on this element neither. So there is actually no way to override those properties.
I'm considering using this package, but for me it seems like overkill to use js and timeout for setting a pretty simple style... :
https://www.npmjs.com/package/shadow-dom-inject-styles
I had a similar problem when I had to make a searchbar overflow underneath the header (design thing). I was struggling a while and it popped in place suddenly when I place the searchbar outside of the toolbar and gave it position absolute:
<ion-head>
<ion-toolbar>
<!-- My stuff here -->
</ion-toolbar>
<ion-searchbar></ion-searchbar>
<ion-header>
My css looks like this:
ion-toolbar {
display: flex; // I need this for something else, but maybe has an influence
}
ion-searchbar {
padding: 0 1em .5em 1em;
transform: translateY(-50%);
z-index: 99999;
position: absolute;
}
Hope it helps somebody.
In case anyone is still looking for the solution. Here is how I managed to fixed it in react. It's a bit hacky solution, but most likely the only one ATM.
First we need to style the toolbar (pass a className or style to component:
.your-toolbar-classname {
overflow: visible!important;
contain: none!important;
}
Then we have to also style the shadow-root parts. Se we can use the useEffect after the header is mounted and set the style
// Header.tsx
...
useEffect(() => {
const style = document.createElement('style');
style.innerHTML =
'.toolbar-container { overflow: visible!important; contain: none!important; }';
toolbarRef.current.shadowRoot.appendChild(style);
}, []);
...
Just use ion-menu, its a build in ionic component
https://ionicframework.com/docs/api/menu
There is also ion-popover
You should look at the ionic docs before posting on stack
I have a simple problem, but I may be asking for the impossible.
I want to style my html form elements as parallelograms without skewing the contained text. I would normally do this by applying the transform to a parent div and applying the reverse transform to the content:
http://jsfiddle.net/ExUs9/3/
form {
background:#62CAD9;
padding:10px;
}
div {
background: white;
height: 30px;
margin: 10px;
width:300px;
transform:skewX(30deg);
-ms-transform:skewX(30deg);
-webkit-transform:skewX(30deg);
}
input {
background: none;
width: 100%;
height: 100%;
border: none;
transform:skewX(-30deg);
-ms-transform:skewX(-30deg);
-webkit-transform:skewX(-30deg);
}
My problem with the above is the focus property is still applied to the unskewed input box and displays as rectangular. The focus effect is only skewed if the input box itself is skewed:
http://jsfiddle.net/kdqKX/
form {
background:#62CAD9;
}
input {
margin: 20px;
background: white;
width:300px;
border: none;
height: 30px;
transform:skewX(30deg);
-ms-transform:skewX(30deg);
-webkit-transform:skewX(30deg);
}
The problem here is that the text is skewed.
I know I could just remove the focus outline, but is there any way to either:
Skew the input box--but not the contained text--without skewing via a parent div
Apply the border to the parent div when the child input box is focused
I don't know js or any scripts well, so a script free solution is preferred. I do, though, suspect this is impossible in pure css, so let me know any possible solutions.
Thank you, you brave internet geniuses,
Dalton
The easy solution would be a background image.
CSS gradient can fake this.
background-image:linear-gradient(45deg, #62cad9 0 , #62cad9 2em , transparent 2em ,transparent 230px, #62cad9 230px );
Try it without transform. http://jsfiddle.net/khGDj/
other easy way, would have been width pseudo-element and borders/blue/transparent. input do not take it as far as i know.
I have been using the following css code:
#MainBox
{ width: 488px;
height: 181px;
position: absolute;
left: 50%;
top: 236px;
margin-left: -244px; //this being half the width
}
To ensure that the items on the page are centred. The problem is, when viewing this on an iphone (and i'm assuming similar on other smartphones) the left hand side of the page is chopped off! Does anyone know how I can resolve this issue and bring everything into fit?
Thank you!
You're moving the element to the left by 244px with that CSS, and the iphone screen being so small this is causing it to be cut off. Try this:
#MainBox{
width: 488px;
height: 181px;
margin: 236px auto 0 auto;
}
The technique above to center a div is a little obsolete.
Use margin: auto, width to a fixed value (which you already have), and make the parent position:relative.
In GWT, how do you set the position of an Image object after it was added to a Panel? There does not seem to be a method to set the Image top and left positions. Do we have to remove the image from the Panel and add it again using the desired left and top values? What is the best approach?
If you set absolute positions, you can
int top = myPanel.getAbsoluteTop();
int left = myPanel.getAbsoluteLeft();
myImage.getElement().getStyle().setTop(top + 100, Unit.PX);
myImage.getElement().getStyle().setLeft(left + 100, Unit.PX);
Alternatively, you can set "position: relative" style on your image. Then you can set "top" and "left" on an image, and it would position itself relative to its parent element.
From the way your questions is asked, I assume that you are trying to use GWT as you would use Swing or SWT from Java. This is not the way GWT is ment to used and leads to very bad code and very bad projects most of the time.
GWT is not about hiding the browser. So if you want to change the postion of an element you would do that mostly with CSS.
Simply add two css classes to your project
.before{
position: relative;
top: 0px;
left: 0px;
}
.after{
position: relative;
top: 100px;
left: 100px;
}
at first give your image the first class:
image.addStyleName("before");
and later:
image.addStyleName("after");
If you really need to make this dynamically (some calculated size) you can just set the style property of the element:
image.getElement().getStyle().setLeft(value, Unit.PX);
image.getElement().getStyle().setTop(value, Unit.PX);
What I did was simply:
absolutePanel.setWidgetPosition(myImage, newXvalue, newYvalue);
Assuming that 'myImage' was a child of absolutePanel.