Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- .ShowMe{display:block;}
- function(url)
- {
- document.getElementById('myIFrame').src = url;
- document.getElementById('myIFrame').className = ShowMe;
- }
- <script type="javascript">
- var iframe = document.createElement("myIFrame");
- iframe.src = url;
- if (navigator.userAgent.indexOf("MSIE") > -1 && !window.opera){
- iframe.onreadystatechange = function(){
- if (iframe.readyState == "complete"){
- //not sure if your code works but it is below for reference
- document.getElementById('myIFrame').class = ShowMe;
- //or this which will work
- //document.getElementById("myIFrame").className = "ShowMe";
- }
- };
- }
- else
- {
- iframe.onload = function(){
- //not sure if your code works but it is below for reference
- document.getElementById('myIFrame').class = ShowMe;
- //or this which will work
- //document.getElementById("myIFrame").className = "ShowMe";
- };
- }
- </script>
- window.onload = function () {
- window.frameElement.className = 'ShowMe'; // 'ShowMe' or what ever you have in ShowMe variable.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement