Search code examples
javascripthtmlcssiframetumblr

Apply Attribute 'Scrolling=yes' to All iFrames


Currently working with a Tumblr theme. The theme has it set so that you can't scroll vertically, you can only scroll horizontally. The way this is set is by setting <iframe scrolling="no">. When I change it to scrolling=yes, it allows a vertical scroll. Unfortunately, the code for the iframes does not show up in the HTML editor for Tumblr. I can only change it in the Chrome JavaScript Editor.

Is there a way to change all iframe tags to include scrolling=yes directly from the HTML editor?

Note: the HTML editor also accepts CSS.


Solution

  • If you are OK with jquery solution then try this.

     $(document).ready(function() {
       $('iframe').each(function(){  
       $(this).attr('scrolling','yes');
       });
     })