question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Caption for an iframe element?

See original GitHub issue

Has anybody gotten a caption on an iframe element to work?

I have tried various codes that I found here, even one by @dimsemenov (https://github.com/dimsemenov/Magnific-Popup/issues/262), but none seem to work.

Here’s my code which is based on the issue linked above:

jQuery(document).ready(function() {
    var url = 'http://google.com';
    var title= 'test';

    $.magnificPopup.open({
        items: { src: url },
        type: 'iframe',
        markup: '<div class="mfp-iframe-scaler">'+
        '<div class="mfp-close"></div>'+
        '<iframe class="mfp-iframe" frameborder="0" allowfullscreen></iframe>'+
        '<div class="mfp-bottom-bar">'+
        '<div class="mfp-title"></div>'+
        '</div>'+
        '</div>',
        titleSrc: function(item) {
            return title;
        },
    });
});

Issue Analytics

  • State:open
  • Created 9 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
petertwisecommented, Jan 16, 2018

You can take a look at the html I’m working with here: https://1beat.org/videos/

  • groups of links contained in a <div class="playlist_container"> open up youtube videos in an iframe
  • multiple series of these groups appear on the page, each series should be its own gallery; prev/next should not scroll through every item on the whole page
  • Title should always appear and should update when you use the prev/next gallery buttons.
0reactions
petertwisecommented, Nov 26, 2019

Sadly now there is less control over the youtube iframe display so you see the title on the video too. LOL…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Be Sure to Provide Titles for Iframes | Accessibility Tips
When an iframe is given a meaningful title, screen reader users can pull up a list of frames and identify the content or...
Read more >
Text after iframe? - javascript - Stack Overflow
Place the <iframe> in an element (I used a <figure> ) that is position ed relative . position: absolute for the <iframe> and...
Read more >
HTML iframe tag - W3Schools
Definition and Usage. The <iframe> tag specifies an inline frame. An inline frame is used to embed another document within the current HTML...
Read more >
<iframe>: The Inline Frame element - HTML - MDN Web Docs
Warning: Because each browsing context is a complete document environment, every <iframe> in a page requires increased memory and other ...
Read more >
HTML iframe title Attribute - Dofactory
HTML iframe title -- the best examples. The title attribute on an iframe element adds a tooltip with title text to that element....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found