nk-o / jarallax

Parallax scrolling for modern browsers

Home Page:https://jarallax.nkdev.info

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add attribute to jarallax iframe?

DaveAda opened this issue · comments

I am trying to add a 'title' to my jarallax iframe video to meet ADA guidelines. I've tried adding via jquery, the traditional way, but it is not working. Was hoping you could provide some potential insight on how to do this.

Hey.

In the next Jarallax update will be available new method called onVideoInsert, which will help you recognize when the iframe is inserted on the page.

Usage example:

jarallax(document.querySelectorAll(".jarallax"), {
  onVideoInsert: function () {
    if (this.$video && this.$video.nodeName === "IFRAME") {
      this.$video.setAttribute("title", "HELLO");
    }
  },
});