The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Why on my page with youtube video scrolling of my page does not work?
nilovsergey
post Jul 16 2023, 09:23 AM
Post #1


Newbie
*

Group: Members
Posts: 10
Joined: 15-July 23
Member No.: 28,988



On my page I show youtube video by youtube_key field I got from server :
CODE
    <iframe
            src="https://www.youtube.com/embed/{{ $news->youtube_key }}"
            title="YouTube video player" frameborder="0"
            allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
            allowfullscreen></iframe>

and opened page show youtube video ok, but when I try to scroll up or down scrolling on my page does not work at all.
If I ckick out of video area then scrolling of my page works ok
If I ckick inside of video area then scrolling of my page DOES NOT work.
If there is a way to make scrolling of my page working always ?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post Jul 16 2023, 07:43 PM
Post #2


WDG Member
********

Group: Root Admin
Posts: 8,365
Joined: 4-August 06
From: Mountain View, CA
Member No.: 3



That's the way iframes work. When the focus is on the iframe, the iframe scrolls. When the focus is outside of the iframe, the page scrolls.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
nilovsergey
post Jul 16 2023, 11:18 PM
Post #3


Newbie
*

Group: Members
Posts: 10
Joined: 15-July 23
Member No.: 28,988



QUOTE(Darin McGrew @ Jul 16 2023, 07:43 PM) *

That's the way iframes work. When the focus is on the iframe, the iframe scrolls. When the focus is outside of the iframe, the page scrolls.

Thank you for your feedback! If there is a way to show youtube video without iframe? Maybe some external libraries compatible with jquery 3.6 ?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Jul 17 2023, 04:30 AM
Post #4


.
********

Group: WDG Moderators
Posts: 9,661
Joined: 10-August 06
Member No.: 7



QUOTE(Darin McGrew @ Jul 16 2023, 07:43 PM) *

That's the way iframes work. When the focus is on the iframe, the iframe scrolls.

But only if the iframe has scrollbars; if it's large enough to contain the framed content, no scrollbars will appear and the whole page should scroll even with the focus on the iframe (unless videos work different from framed pages?).

QUOTE(nilovsergey @ Jul 17 2023, 06:18 AM) *

If there is a way to show youtube video without iframe?

With the VIDEO element?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 27th April 2024 - 04:23 AM