vForums Support > vForums :: Report a Bug :: Resolved Bugs :: > Hidden IFrames

Hidden IFrames - Posted By Charles Stover (gamechief) on 27th Jan 08 at 6:27pm
Code:
 
  1. function check_ads() {
  2.             var ads = document.getElementsByTagName('iframe');
  3.             var visible_ads = 0;
  4.             for(a=0; a<ads.length; a++) {
  5.                 visible_ads++;
  6.                 if(ads.item(a).style.display == 'none' || ads.item(a).style.visibility == 'hidden' || ads.item(a).parentNode.style.display == 'none' || ads.item(a).parentNode.style.visibility == 'hidden') {
  7.                     ads.item(a).style.display = 'block';
  8.                     ads.item(a).style.visibility = 'visible'
  9.                     ads.item(a).parentNode.style.display = 'block';
  10.                     ads.item(a).parentNode.style.visibility = 'visible';
  11.                 }
  12.             }
  13.             if(visible_ads == 0) {
  14.                 return ads_error();
  15.             }
  16.         }
 


The code makes it impossible to hide any iframes, instead of just the ads. My shoutbox uses IFrames for form submittal (too lazy to work on a cross-browser AJAX method). So, umm... can this be fixed, please?

Re: Hidden IFrames - Posted By Ross (admin) on 27th Jan 08 at 6:57pm
I've set it to check the iframe name so it'll only affect the google iframes.