How to remove element focus for click event in AngularJs - javascript

on click(ng-click) of any element we will get blue border by default around that element. I don't want the border so, I tried giving css as follow:
div: focus {
outline: none;
border: 0;
}
It will work only on div element, But to reflect on all elements we need to give same css on all elements by doing this we'll increase css code. Is there any way to do that?

*:focus {
outline: none;
border: 0;
}

Related

How can I make a element show when hovering over another element, and hide it if not. And make it take up space the entire time

So I'm trying to make a header that when hovering over it, it will show a button. And if not, the button will disappear while still taking up space in the layout. I've tried,
.button {
visibility: hidden;
}
.heading:hover + .button {
visibility: visible
}
But the visibility attribute won't change when hovering over it.
I tried using
.button {
visibility: hidden;
}
.heading:hover + .button {
visibility: visible
}
But it didn't work. I expected the visibility attribute to change when hovering over an element with the class “heading”, but it didn't. I am sure that it has detected that I am hovering over it because in a past attempt I used the display attribute, and it worked, just that when I'm not hovering over the heading the button will not take up any space, mildly changing the layout of the page. Old code:
button {
display: none;
}
.heading:hover + .button {
display: block;
}
Also, in case you're confused, the “heading” class is applied in the heading element while the “button” class is applied for the button. I was thinking it might need to use JavaScript to make it work, so I added the JavaScript tag. jQuery could also work, but I think it uses the display attribute, which makes the element not take up space when hidden.
Without see the DOM structure I will suggest you the following css code.
.button {
opacity: 0;
pointer-events: none;
transition: opacity .3s;
}
.heading:hover .button {
opacity: 1;
pointer-events: visible;
}
Assuming that your HTML code is something like this:
<div class="heading">
YOUR BUTTON
</div>
If you add a + to your CSS selector, you are selecting the next element in the same hierarchy level. To select a child element, as i supose the button is, you have to let a blank space between .parent-element and .child-element as in the example above.

How to remove close button (x) border from google maps info window pop up?

Is there any way to get rid of the border around the close (x) button on google maps info windows?
Screenshot.
I have tried everything I can find on stack overflow.
This doesn't work:
.gm-style .gm-style-iw + div {
display: none; /* <-- this will generally work on the fly. */
visibility: hidden; /* this 2 lines below are just for hard hiding. :) */
opacity: 0;}
Nor does this:
.gm-style-iw + div {display: none;}
Maybe replacing the image in the info window would be an alternate solution? Is there any way to do that?
In my case was the button focus, solved like this:
.gm-style-iw button:focus {
outline: 0;
}
Based on the Infowindow documentation:
The InfoWindow class does not offer customization.
I would suggest that you use the customized popup as this doesn't contain the close button in the creation of the popup.
function Popup(position, content) {
this.position = position;
content.classList.add('popup-bubble');
// This zero-height div is positioned at the bottom of the bubble.
var bubbleAnchor = document.createElement('div');
bubbleAnchor.classList.add('popup-bubble-anchor');
bubbleAnchor.appendChild(content);
// This zero-height div is positioned at the bottom of the tip.
this.containerDiv = document.createElement('div');
this.containerDiv.classList.add('popup-container');
this.containerDiv.appendChild(bubbleAnchor);
// Optionally stop clicks, etc., from bubbling up to the map.
google.maps.OverlayView.preventMapHitsAndGesturesFrom(this.containerDiv);
}
You may see the example here
Note: Please don't forget to add your API key in the sample.
Right now there looks to be quite a bit of padding around the x in the screenshot. I'd inspect the element and see if there are any styles from parent elements or related classes overriding changes you make on its border or outline. If not, have you tried the following selectors?
outline: none
border-radius: 0
Try this, in side of InfoWindow.
<div style="position: absolute; top: 0px; right: 0px; width: 20px; height: 20px; background-color: white; z-index: 2;"></div>

angular-ui-select broken with bootstrap form-inline

There were several threads about getting inline-form label to be inline with angular-ui-select, and I have managed to get that label inline, but still looks like angular-ui-select width is broken in form-inline.
I have created Plnkr to demonstrate that.
I have added css code
.form-inline .ui-select-container .ui-select-toggle,
.form-inline .ui-select-container .ui-select-search {
width: 100%;
}
.form-inline .ui-select-container {
display: inline-block;
vertical-align: middle;
width: auto;
}
So that label is inline with select box, but select does not take same width as inputs, and if you press on select box, then select expands in same width as input bellow.
Question is, how to make angular-ui-select same width as input bellow, so there is no shrink/expand effect on select box, when activating it.
I will add screenshots, that shows, how it acts now:
Select in inactive state
Select in active state
As you can see, element width is changing on click, but how to make it same as input bellow, as input bellow is taking width dynamically ?
I had the same issue in some projects I developed and I was always setting a min-height. I think I found a solution.
Just added
.form-inline .ui-select-container input.form-control.ui-select-search.ng-hide {
display: block !important;
visibility: hidden;
height: 0;
border: 0;
padding: 0;
}
http://plnkr.co/edit/b1CfIHdDEu4qBsxHeEzc

How to disable temporary cursor with javascript?

Following my code:
HTML:
<div>test</div>
CSS:
div:hover{
background-color: black;
}
How to disable temporary cursor when the cursor is over (even ignoring :hover) the div and enter key is pressed and reenable when the cursor is moved with pure javascript?
Well you could use CSS pointer-events which will stop all mouse events working, which includes :hover.
CSS
div:hover {
background-color:black; /* will not happen */
}
div {
pointer-events: none;
}
Demo
You can force specific cursor shapes with the CSS cursor attribute.
div {
cursor: pointer; /* or any other shape available in the link above */
}
Create a transparent gif and use this code:
cursor: url("transparent.gif"), default;

jQuery UI Autocomplete - Custom style when we have jQuery UI Theme style sheet referenced

I am using jQuery UI Autocomplate plugin as it is on the first example. I also have jQuery UI Theme style sheet referenced for other plugins.
This is the input I am using with that:
CSS:
div.formvalue {
background-color: #eee;
border: 1px solid red;
padding: 10px;
margin: 0px;
}
div.paddedInput {
padding: 5px;
border: 1px solid black;
background-color: white;
}
div.paddedInput input {
border: 0px;
width: 100%;
outline:none;
}
HTML:
<div class="formvalue">
<div class="paddedInput"><input type="text" value="Padded!" /></div>
</div>
Here is my situation:
As the above div element serves as an input element (on the style perspective), the autocomplete list looks a little awkward because it sets itself for the input element.
I dug the source code which jQuery UI is creating for the autocomplete function and there is ui-autocomplete style class but as I said but I couldn't figure auto what should I override.
Any thoughts?
UPDATE:
Here is the jsfiddle sample:
http://jsfiddle.net/tugberk/YxRYe/4/
If you want to overwrite your style, you can use !important keyword as this code
div.paddedInput input {
border: 0px!important;
width: 100%;
outline:none;
}
I guess the main question here is why you would have the outer div element serve as an input element from a style perspective in the first place.
If this is not a requirement, just do this. Otherwise we'll have to use JS to set the width of the dropdown to the width of the div and adjust the position of the dropdown. A rather hacky solution i.m.o. I am not aware of a way to specify what element the dropdown should attach to since this is rarely what you want.

Categories