SHARE
TWEET

Untitled

a guest Nov 28th, 2013 22 Never
  1. .ShowMe{display:block;}
  2.  
  3. function(url)
  4. {
  5. document.getElementById('myIFrame').src = url;
  6. document.getElementById('myIFrame').className = ShowMe;
  7. }
  8.        
  9. <script type="javascript">
  10.     var iframe = document.createElement("myIFrame");
  11.     iframe.src = url;
  12.  
  13.         if (navigator.userAgent.indexOf("MSIE") > -1 && !window.opera){
  14.                 iframe.onreadystatechange = function(){
  15.             if (iframe.readyState == "complete"){            
  16.                 //not sure if your code works but it is below for reference
  17.                   document.getElementById('myIFrame').class = ShowMe;
  18.                   //or this which will work
  19.                   //document.getElementById("myIFrame").className = "ShowMe";
  20.  
  21.                 }
  22.             };
  23.         }      
  24.         else
  25.         {
  26.             iframe.onload = function(){
  27.                   //not sure if your code works but it is below for reference
  28.                   document.getElementById('myIFrame').class = ShowMe;
  29.                   //or this which will work
  30.                   //document.getElementById("myIFrame").className = "ShowMe";
  31.             };
  32.         }
  33. </script>
  34.        
  35. window.onload = function () {
  36.     window.frameElement.className = 'ShowMe'; // 'ShowMe' or what ever you have in ShowMe variable.
  37. }
RAW Paste Data
Top