Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

Untitled

By: a guest on Nov 28th, 2013  |  syntax: None  |  size: 1.24 KB  |  views: 22  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  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. }
clone this paste RAW Paste Data