Dynamically changing IFrame scrolling

Dynamically changing IFrame scrolling

Have you ever tried to change Iframe scrolling dynamically. Probably, you wondered why it does not work when you try to apply some javascript. Here is alive example and on later part, you can have a look at the code


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="iframescroll.aspx.cs" Inherits="myworks_iframescroll" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>Setting IFRAME Scrolling attribute using Javascript</title>

    <script type="text/javascript">
    function setIframeScroll(pge,iframeid, mode) { 
        // mode can be either "yes" or "no"
         var oldIframe = document.getElementById(iframeid);
         var newIframe = oldIframe.cloneNode(true);
         newIframe.setAttribute("scrolling", mode);
         oldIframe.parentNode.insertBefore(newIframe, oldIframe);
         newIframe.parentNode.removeChild(oldIframe);
         newIframe.src=pge;
    }
    </script>

</head>
<body>
    <div id="container">
        <div id="Div1">
            <iframe id="Iframe1" src="http://nazmulweb.com/" scrolling="yes" width="500" height="300">
            </iframe>
            <br />
            <input type="button" value="Set Scrolling Yes" onclick="setIframeScroll('http://nazmulweb.com/','myIframe','yes')" />
            <input type="button" value="Set Scrolling No" onclick="setIframeScroll('http://nazmulweb.com/','myIframe','no')" />
        </div>
    </div>
</body>
</html>

        

4 Responses to "Dynamically changing IFrame scrolling"

  1. play casino games online: https://www.bbdd66.com https://www.bbdd66.com/theking https://www.bbdd66.com/sands https://www.bbdd66.com/first https://www.bbdd66.com/yes https://www.bbdd66.com/super https://www.bbdd66.com/gatsby https://www.bbdd66.com/33 https://www.bbdd66.com/world https://www.bbdd66.com/merit https://www.omgab.com https://www.omgab.com/theking https://www.omgab.com/sands https://www.omgab.com/first https://www.omgab.com/yes https://www.omgab.com/super https://www.omgab.com/gatsby https://www.omgab.com/33 https://www.omgab.com/world https://www.omgab.com/merit https://www.omgqq.com https://www.omgqq.com/thekingcasino https://www.omgqq.com/sandscasino https://www.omgqq.com/firstcasino https://www.omgqq.com/yescasino https://www.omgqq.com/supercasino https://www.omgqq.com/gatsbycasino https://www.omgqq.com/33casino https://www.omgqq.com/worldcasino https://www.omgqq.com/merit
  2. I've found something for opera only. Try this... #abc{/* Your normal styles here for all browser */ } @media all and (-webkit-min-device-pixel-ratio:10000), not all and (-webkit-min-device-pixel-ratio:0) { head~body #abc { /* Your normal styles here for opera only*/ } }
  3. Still not working in opera. If you mouse over on the iframe area and scroll with the mouse button... It is scrolling.
  4. aNciex <a href="http://dntybqpzprke.com/">dntybqpzprke</a>, [url=http://scotsshviuld.com/]scotsshviuld[/url], [link=http://xazrropphqhl.com/]xazrropphqhl[/link], http://spifppfdyeju.com/

Leave a Reply