My HTML code is mentioned below. It is working fine on IE and chrome
browser. But in Mozilla, when focus occurs on DIV having class=""mejs-
button mejs-volume-button mejs-mute" it selects the unwanted width.
Is it possible that on Tab press focus only occurs on Anchor elements and
we can skip main outer DIV. I have tried by using Tabindex="-1". But then
focus will not reflect on anchor elements.Issue occurring only in latest Mozilla.
The issue is related to HTML5 Video plugin. I have used 'mediaelementplayer-min.js'.
<div class="mejs-button mejs-volume-button mejs-mute">
<button type="button" aria-controls="mep_0" title="Mute"
aria-label="Mute"></button>
<a tabindex="0" role="slider" aria-valuetext="10%" aria-valuenow="10" aria-valuemax="100" aria-valuemin="0" aria-label="volumeSlider" style="display: none;" href="javascript:void(0);" class="mejs-volume-slider">
<span class="mejs-offscreen">Use Up/Down Arrow keys to increase or
decrease volume.</span>
<div class="mejs-volume-total"></div>
<div style="height: 10.3833px; top: 97.6167px;"class="mejs-volumme-current"></div>
<div style="top: 95px;" class="mejs-volume-handle"></div></a>
</div>
Related
I have a function of code that loads a card with an iframe when a button is clicked. Here's a small snippet of it:
document.getElementById("apps").innerHTML += `
<div id="${appname}" class="app" style="display:block;">
<div id="${appname}header" class="card ${object[appname].color}" style="width: ${object[appname].cardw}; height: ${object[appname].cardh};">
<div class="card-content white-text">
<span class="card-title center black-text">${object[appname].name}</span>
<iframe id="${object[appname].repo}frame" src="custom/${object[appname].repo}/index.html" scrolling="no" style="width: ${object[appname].framew}; height: ${object[appname].frameh}; transform: scale(${object[appname].scale});
transform-origin: 0 0;"></iframe>
</div>
</div>
</div>
`;
The problem is, apps contains multiple iframes, and when i add a new one all the other ones reload. This is a very big deal, as i am using a text editor and i dont want it to reload. I'd prefer a simple solution, but i can be hacky too. How would I stop the iframe from reloaded when another iframe is added to the parent?
I have a button that wraps around an input to upload files to my angular app, I want to add a click event to listen for when the button is clicked and hide it, so every time the button is clicked to upload a file it gets hidden because I intend to replace it with a progress bar.
Here is the code I tried :
<div (click)="fileField.click()" (fileDropped)="upload($event)">
<div *ngIf="this.isButtonVisible">
<button
class="button is-primary mt-2"
(click)="this.isButtonVisible = false"
>
<input
type="file"
name="txts"
#fileField
(change)="upload($event.target.files)"
hidden
multiple
/>
Upload
</button></div>
<!-- Progress Bar -->
<div *ngIf="progress">
<div class="progress is-primary form-group">
<div
class="progress-bar progress-bar-striped bg-success"
role="progressbar"
[style.width.%]="progress"
></div>
</div>
</div>
</div>
I get the following error Property 'fileField' does not exist on type 'SourceComponent'. it has to do with the ngIF how do I fix it?
Thank you in advance.
You're right the issue has to do with the *ngIf. One way of fixing the error is by using the hidden directive to hide the div instead:
<div [hidden]="!this.isButtonVisible">
StackBlitz example
This is my first time publishing a question, so forgive me if there's something wrong with it.
I'm currently working on a three-slide custom carousel ad template, using amp-carousel from project AMP.
I've made my template available to you via this link: https://jsfiddle.net/mlealrinaldi/6hvx15gb/
Among the premises of the project, there are two that are mandatory:
1) The second carousel slide has to be partially visible on the right corner when the first slide is displayed (to arouse the user's curiosity when seeing the ad).
2) In the desktop version, when using the 'next' and 'prev' buttons, the carousel should scroll to the center of the next or previous image in the sequence.
The problem I found was that type="carousel" allows me to partially display the next slide, but when I click the 'next' button, it does not scroll to the center of the next slide. It scrolls past beyond the center instead.
And when I use the type="slides", the navigation buttons scroll correctly to the center of the next slide but does not allow me to display part of the next slide (only one slide at the time).
I'm looking for a solution that contemplates these two requirements. For reference, here's a link to amp-carousel documentation: https://www.ampproject.org/docs/reference/components/amp-carousel#type
This is the part of the HTML that contains the carousel:
<amp-carousel height="245" layout="fixed-height" type="carousel">
<div class="slide" id="slide1" style="margin-left: 20px">
<img height="170" width="200" src="slide0.png"/>
<div>
<div class="cta" style="float:left"><p>São 100 carros todos os dias</p></div>
<div style="float:left;margin-top: 10px">
Participe
</div>
</div>
</div>
<div class="slide" id="slide2">
<img height="170" width="200" src="slide1.png"/>
<div>
<div class="cta" style="float:left"><p>Se ligar, é seu!</p></div>
<div style="float:left;margin-top: 10px">
Participe
</div>
</div>
</div>
<div class="slide" id="slide3">
<img height="170" width="200" src="slide0.png"/>
<div>
<div class="cta" style="float:left"><p>Faça o teste drive.</p></div>
<div style="float:left;margin-top: 10px">
Participe
</div>
</div>
</div>
</amp-carousel>
I've also tried to look into the .js AMP functions that listen to the click on the navigation buttons, and make the carousel work, but my limited knowledge only took me so far.
On my React site, I have a profile/account dropdown (similar to Github's, where you click on your profile picture and a dropdown appears). On most browsers, it works correctly. When the div is clicked, it applies the dropdown--active class to itself. This dropdown--active class contains a rule for the child element, dropdown__content, to change its display from none to block, thereby toggling the display of the dropdown content on click.
Before click:
<div class="dropdown account-dropdown">
<a href="/#" class="dropdown__trigger ">
<span class="account-dropdown--name">admin</span>
</a>
<div class="dropdown__content">
<div class="account-dropdown--identity account-dropdown--segment">
Signed in as admin
</div>
</div>
</div>
After click:
<div class="dropdown dropdown--active account-dropdown">
<a href="/#" class="dropdown__trigger ">
<span class="account-dropdown--name">admin</span>
</a>
<div class="dropdown__content">
<div class="account-dropdown--identity account-dropdown--segment">
Signed in as admin
</div>
</div>
</div>
However, the only way I can get it to display in Microsoft Edge is to click some where else on the screen after I've already clicked the parent element. With Inspect Element open, I can tell that the class is in fact being applied immediately after click, but the child element is not redrawn/reevaluated until some where else on the screen is clicked. Alternatively, tabbing to the element and clicking "enter" does not cause this problem.
Works in Chrome, IE 11, Firefox fine though.
I've discovered that my iPad (iOS 7) doesn't disable <button> elements even when they have the disabled attribute on them. They are disabled on every other browser I've tried on my OS (Windows 7): FF, Chrome, Safari.
If I take the same html and simply replace the <button> and with an <input type="button">, the input becomes disabled as you'd expect. The reason I want to keep it as a <button> is because I want to put an img inside and that doesn't seem to work with an input. So how do you disable <button> on iOS Safari? Here is a jsfiddle that can reproduce this issue:
<div id="hero-1" class="hero">
<button disabled="" class="go-to-hero">
<div style="background-image: url('https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR-oWvCrkzPjX9VBkJavc48RfBP1mSLPYMUIe8FpSaNzpgWWEL55A');background-position: -399px -42px;width: 13px;height: 15px">
</div>
</button>
</div>
<div id="hero-2" class="hero">
<input type="button" disabled="" class="go-to-hero">
<div style="background-image: url('https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcR-oWvCrkzPjX9VBkJavc48RfBP1mSLPYMUIe8FpSaNzpgWWEL55A');background-position: -399px -42px;width: 13px;height: 15px">
</div>
</input>
</div>
When I view this in my iPad, the first button is enabled and the second is disabled. I want them to both be disabled.