-
Offline
lev
Активист
=> Cпециалист <=- Регистрация:
- 21.12.2007
- Сообщения:
- 687
- Симпатии:
- 40
- Пол:
- Мужской
Случайно наткнулся на такое сообщение
атрибут FRAMEBORDER в элементе IFRAME является устаревшим. Используйте CSS вместо этого.
здесь нашёл решение для HTML5
http://html.validator.pro/docs/the-frameborder-attribute-on-the-iframe-element-is-obsolete/
http://www.gtpdesigns.com/design-blog/view/w3c-valid-xthml-and-html5-youtube-iframe-embedsЕсли у вас:
-
<iframe src=»http://abc-septic-service/contact.html» frameborder=»1″></ifra
Используйте CSS:
Получаем:
-
<iframe src=»http://abc-septic-service/contact.html» style=»border-width:1px»></ifra
В плагине JoomlaWorks AllVideos Player v. 4.5.0 — такая же проблема
-
<iframe src=»http://www.youtube.com/embed/{SOURCE}» width=»{WIDTH}» height=»{HEIGHT}» frameborder=»0″ allowfullscreen title=»JoomlaWorks AllVideos Player»></iframe>
-
<iframe src=»http://player.vimeo.com/video/{SOURCE}» width=»{WIDTH}» height=»{HEIGHT}» frameborder=»0″ title=»JoomlaWorks AllVideos Player»></iframe>
-
<iframe src=»http://www.dailymotion.com/embed/video/{SOURCE}» width=»{WIDTH}» height=»{HEIGHT}» frameborder=»0″ title=»JoomlaWorks AllVideos Player»></iframe>
для XHTML 1.0 неподходит:
-
<iframe allowfullscreen></ifra
и такой тоже:
-
allowfullscreen=»allowfullscreen»
— остаётся только «allowfullscreen» удалить для XHTML 1.0
— такой вариант
-
<object width=»{WIDTH}» height=»{HEIGHT}»>
-
<param name=»movie» value=»http://www.youtube.com/v/{SOURCE}?version=3&hl=ru_RU»></param>
-
<param name=»allowFullScreen» value=»true»></param>
-
<param name=»allowscriptaccess» value=»always»></param>
-
<embed src=»http://www.youtube.com/v/{SOURCE}?version=3&hl=ru_RU» type=»application/x-shockwave-flash» width=»{WIDTH}» height=»{HEIGHT}» allowscriptaccess=»always» allowfullscreen=»true»></embed>
— работать будет с 7 ошибками валидата в XHTML 1.0
Самый лучший вариант для XHTML 1.0 и HTML5
-
<iframe src=»http://www.youtube.com/embed/{SOURCE}» width=»{WIDTH}» height=»{HEIGHT}» style=»border-width:1px» title=»Videos Player»></iframe>
-
<iframe src=»http://player.vimeo.com/video/{SOURCE}» width=»{WIDTH}» height=»{HEIGHT}» style=»border-width:1px» title=»Videos Player»></iframe>
-
<iframe src=»http://www.dailymotion.com/embed/video/{SOURCE}» width=»{WIDTH}» height=»{HEIGHT}» style=»border-width:1px» title=»Videos Player»></iframe>
Поделиться этой страницей
Использую готовый плагин для модальных окон(от MaxGraph). Проблема в том, что когда у меня открыто два модальных окна, для примера Форма + Политика конфендициальности, и мне нужно закрыть политику вместе с ней закрывается и другое модальное окно. В JS я не сильно разбираюсь(собственно из за этого и использую готовый плагин), можете помочь кто работал с этим плагином? Я примерно понимаю как он работает, но реализовать чтобы закрывалось только одно не получается.
<div class=»content»>
<button class=»modal-btn» data-path=»first» data-animation=»fadeInUp» data-speed=»1500″>Открыть окно 1</button>
</div>
<div class=»modal»>
<div class=»modal__wrapp» data-target=»first»>
<div class=»modal__content»>
<button class=»modal__close»>Закрыть</button>
модальное окно
<button data-path=»policy»>Политика</button>
</div>
</div>
<div class=»modal__wrapp» data-target=»policy»>
<div class=»modal__content»>
<button class=»modal__close»>Закрыть</button>
политика
</div>
</div>
</div>
.modal {
—transition-time: 0.3s;
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
z-index: 1000;
cursor: pointer;
overflow-y: auto;
overflow-x: hidden;
text-align: center;
opacity: 0;
visibility: hidden;
transition: opacity var(—transition-time), visibility var(—transition-time);
}
.modal__wrapp {
display: none;
cursor: default;
width: fit-content;
height: fit-content;
}
.modal__content{
position: absolute;
left: 500px;
width: 500px;
height: 500px;
display: flex;
color: white;
flex-direction: column;
text-align: left;
background-color: #000;
}
.modal__content button{
width: 200px;
height: 50px;
margin: 50px 0;
}
.modal.is-open {
opacity: 1;
visibility: visible;
transition: opacity var(—transition-time), visibility var(—transition-time);
}
.modal__wrapp.modal-open {
display: flex;
}
.disable-scroll {
position: relative;
overflow: hidden;
height: 100vh;
position: fixed;
left: 0;
top: 0;
width: 100%;
}
.fade {
opacity: 0;
transition: opacity var(—transition-time);
}
.fade.animate-open {
opacity: 1;
transition: opacity var(—transition-time);
}
.fadeInUp {
opacity: 0;
transform: translateY(vw(-100));
transition: opacity var(—transition-time), transform var(—transition-time);
}
.fadeInUp.animate-open {
opacity: 1;
transform: translateY(0);
transition: opacity var(—transition-time), transform var(—transition-time);
}
.modal__wrapp[data-target=»policy»] .modal__content{
left: 1050px;
background-color: #000;
opacity: .5;
}
class Modal {
constructor(options) {
let defaultOptions = {
isOpen: () => {},
isClose: () => {},
}
this.options = Object.assign(defaultOptions, options);
this.modal = document.querySelector(‘.modal’);
this.speed = false;
this.animation = false;
this.isOpen = false;
this.modalContainer = false;
this.previousActiveElement = false;
this.fixBlocks = document.querySelectorAll(‘.fix-block’);
this.focusElements = [
‘a[href]’,
‘input’,
‘button’,
‘select’,
‘textarea’,
‘[tabindex]’
];
this.events();
}
events() {
if (this.modal) {
document.addEventListener(‘click’, function(e){
const clickedElement = e.target.closest(‘[data-path]’);
if (clickedElement) {
let target = clickedElement.dataset.path;
let animation = clickedElement.dataset.animation;
if (clickedElement.classList.contains(‘modal-close’)) {
this.close();
}
let speed = clickedElement.dataset.speed;
this.animation = animation ? animation : ‘fade’;
this.speed = speed ? parseInt(speed) : 300;
this.modalContainer = document.querySelector(`[data-target=»${target}»]`);
this.open();
return;
}
if (e.target.closest(‘.modal__close’)) {
this.close();
return;
}
}.bind(this));
window.addEventListener(‘keydown’, function(e) {
if (e.keyCode == 27) {
if (this.isOpen) {
this.close();
}
}
if (e.keyCode == 9 && this.isOpen) {
this.focusCatch(e);
return;
}
}.bind(this));
this.modal.addEventListener(‘click’, function(e) {
if (!e.target.classList.contains(‘modal__wrapp’) && !e.target.closest(‘.modal__wrapp’) && this.isOpen) {
this.close();
}
}.bind(this));
}
}
open() {
this.previousActiveElement = document.activeElement;
this.modal.style.setProperty(‘—transition-time’, `${this.speed / 1000}s`);
this.modal.classList.add(‘is-open’);
this.disableScroll();
this.modalContainer.classList.add(‘modal-open’);
this.modalContainer.classList.add(this.animation);
setTimeout(() => {
this.options.isOpen(this);
this.modalContainer.classList.add(‘animate-open’);
this.isOpen = true;
this.focusTrap();
}, this.speed);
}
close() {
if (this.modalContainer) {
this.modalContainer.classList.remove(‘animate-open’);
this.modalContainer.classList.remove(this.animation);
this.modal.classList.remove(‘is-open’);
this.modalContainer.classList.remove(‘modal-open’);
this.enableScroll();
this.options.isClose(this);
this.isOpen = false;
this.focusTrap();
}
}
focusCatch(e) {
const focusable = this.modalContainer.querySelectorAll(this.focusElements);
const focusArray = Array.prototype.slice.call(focusable);
const focusedIndex = focusArray.indexOf(document.activeElement);
if (e.shiftKey && focusedIndex === 0) {
focusArray[focusArray.length — 1].focus();
e.preventDefault();
}
if (!e.shiftKey && focusedIndex === focusArray.length — 1) {
focusArray[0].focus();
e.preventDefault();
}
}
focusTrap() {
const focusable = this.modalContainer.querySelectorAll(this.focusElements);
if (this.isOpen) {
focusable[0].focus();
} else {
this.previousActiveElement.focus();
}
}
disableScroll() {
let pagePosition = window.scrollY;
this.lockPadding();
document.body.classList.add(‘disable-scroll’);
document.body.dataset.position = pagePosition;
document.body.style.top = -pagePosition + ‘px’;
}
enableScroll() {
let pagePosition = parseInt(document.body.dataset.position, 10);
this.unlockPadding();
document.body.style.top = ‘auto’;
document.body.classList.remove(‘disable-scroll’);
window.scroll({ top: pagePosition, left: 0 });
document.body.removeAttribute(‘data-position’);
}
lockPadding() {
let paddingOffset = window.innerWidth — document.body.offsetWidth + ‘px’;
this.fixBlocks.forEach((el) => {
el.style.paddingRight = paddingOffset;
});
document.body.style.paddingRight = paddingOffset;
}
unlockPadding() {
this.fixBlocks.forEach((el) => {
el.style.paddingRight = ‘0px’;
});
document.body.style.paddingRight = ‘0px’;
}
}
const modal = new Modal({
isOpen: (modal) => {
console.log(modal);
console.log(‘opened’);
},
isClose: () => {
console.log(‘closed’);
},
});
Problem
You’ve embedded a video from YouTube into your HTML using their embed code e.g.
<iframe width="560" height="315" src="https://www.youtube.com/embed/dNVpL2-8-BU"
frameborder="0" allowfullscreen></iframe>
You then validate your HTML and get the error:
there is no attribute «allowfullscreen»
Cause
As stated by the w3c validation tool, one of the likely causes is that you’re using a document type that does not support the «allowfullscreen» attribute for this element.
The w3c validation tool tells you which document type you’re using:
In this case, we’re using XHTML 1.0 Transitional which does not support allowfullscreen.
Solution 1
HTML5 does support the allowfullscreen attribute on the iFrame element so changing the doctype to HTML5 will fix this issue. You can try this from the w3c validation tool by changing the drop down just to the right of doctype from (detect automatically) to HTML5 (experimental).
To change the doctype in your HTML, simply edit the doctype element so it looks like this:
<!DOCTYPE HTML >
However, if you validate your HTML again, you now get a different error:
Error: The frameborder
attribute on the iframe
element is obsolete.
This one can be fixed by removing the frameborder attribute from the HTML and removing the border using CSS:
style="border-width: 0;"
Solution 2
Alternatively, you can use the attribute allow with the value fullscreen:
allow="fullscreen"
Popular posts from this blog
LG TV This app will now restart to free up more memory
This post describes how to fix the error «This app will now restart to free up more memory» which can occur when using apps such as Netflix on an LG TV after just a few minutes of use. Resolution To resolve the issue, unplug the TV then press the on/off button for 10 seconds. Wait a further 20 seconds then plug the TV back in and turn it back on. Apps should now run without the error. Edit: The on/off button on my LG TV is directly under the standby light on the bottom of the TV. Edit: I didn’t have to do this myself but one person who has left a comment said that clearing all browsing data worked for them. I have written a post explaining how to do this: LG TV Clear All Browsing History Data . Edit: A few other people have also suggested turning off quick start in settings (and if it’s already off, turn it on then off again). I have written a post explaining how to do this: LG TV turn off Quick Start in settings Related Posts — LG TV delete/remove/hide ch
LG TV Clear All Browsing History Data
This post describes how to clear all browsing history data from an LG TV. This is one way to resolve the error » This app will now restart to free up more memory » sometimes seen on LG TVs. Process The process to clear all browsing history data is as follows: 1. Press the Home button on the remote control and keep pressing right until you find the Web Browser then open it. 2. Scroll the wheel on the remote control to reveal the pointer on screen, then press the three dots stacked vertically (located in the top right of the screen, next to the close button) to open the Menu. 3. Select Settings from the Menu. 4. Scroll to the bottom of the Settings to reach the Clear Browsing Data section. 5. Press the Clear All Browsing Data button then press Yes to confirm. Related Posts — LG TV turn off Quick Start in settings — LG TV move or delete apps and shortcuts on home screen
LG TV turn off Quick Start in settings
This post describes how to turn off Quick Start on an LG TV. This is one way to resolve the error » This app will now restart to free up more memory » sometimes seen on LG TVs. Process The process to turn off Quick Start on my LG TV is as follows: 1. Press the Settings (cog icon) on the remote control, this opens the side settings menu on the right hand side of the TV screen. 2. Go down to All Settings (the three dots icon that turns into a cog icon on the screen) then click. 3. Go down until you reach General (the cog and spanner icon) 4. Press right then down until you reach Quick Start+ (note: you may need to select Additional Settings before doing this on some LG TVs). 5. Toggle Quick Start+ to the off position (the circle should slide to the left): Related Posts — LG TV Clear All Browsing History Data — LG TV move or delete apps and shortcuts on home screen