Setting jquery.attr to scroll iframe = yes

I have an iframe with "scrolling =" no "and a button that sets the iframe attribute to scroll =" yes "when necessary.

$("#button3").click(function(){ $( "#iframe_id" ).attr( "scrolling", "yes" );}); 

But the scrollbar does not appear when I press button 3, only after updating the iframe. How to make srcoll panel appear instantly?

How it works now: http://jsfiddle.net/77van/k8GhZ/1/

+4
source share
2 answers

Now jquery sets .attr to scrolling="yes" and reloads the iframe!

 $(document).ready(function () { $("#button3").click(function () { $("#iframe_id").attr("scrolling", "yes"); $('#iframe_id').attr("src", $('#iframe_id').attr("src")); }); }); 

http://jsfiddle.net/77van/k8GhZ/10/

+5
source

Believe me, you cannot do this with an iframe. It will not work in Chrome or IE. I played a lot with iFrame in the past, and such things have never worked for me.

iFrame just doesn't accept any changes after loading

+1
source

Source: https://habr.com/ru/post/1500002/


All Articles