Close button bug

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
killzone54
New php-forum User
New php-forum User
Posts: 3
Joined: Wed Apr 11, 2018 9:26 am

Wed Apr 11, 2018 9:30 am

I have a floater ad on my website with a close button. This works fine with Google chrome but I found out today that it does not work when using the website on firefox.

Here is the code I am using.

<div id="juicyadsfloat" style="
position:fixed;
width:306px;height:256px;top:358px;left:5px;
padding:15px;background:#000000;
border:0px solid #2266AA;
z-index:100">
<iframe border=0 frameborder=0 marginheight=0 marginwidth=0 width=306 height=256 scrolling=no allowtransparency=true src=http://adserver.juicyads.com/adshow.php ... 4></iframe>
<p align="right" style="margin-top:0px; margin-bottom:5px; margin-left:2px; margin-right:2px;"><a href="
javascript:window.parent.document.getElementById('juicyadsfloat').parentNode.removeChild(window.parent.document.getElementById('juicyadsfloat'))" onclick="closebar(); return false"><strong><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif">Close [X]</font></strong></a></p>

User avatar
hyper
php-forum Fan User
php-forum Fan User
Posts: 761
Joined: Mon Feb 22, 2016 5:52 pm

Wed Apr 11, 2018 10:12 am

I'd start by validating the the source of the whole page first; there's not enough code there to say why ff doesn't like it, but I'm betting that it has a lot to do with the use of inline font tags - used in html 3, deprecated.

Why didn't you use a style sheet?

killzone54
New php-forum User
New php-forum User
Posts: 3
Joined: Wed Apr 11, 2018 9:26 am

Wed Apr 11, 2018 10:17 am

Hi,

Thanks for your reply, this is from a theme I bought and added in my part of the code after, (for the floater ad with close button) . On firefox when I click the close button I get the following error. [object HTMLDivElement]
I will add the entire code for this page, you will find the code I added for the close tab at the very bottom. Any help would be most welcome.

<a href="#" id="back-to-top" title="Back to top"><i class="fa fa-arrow-up" aria-hidden="true"></i></a>
<?php global $awpt; wp_footer(); ?>
<?php do_action( 'bestia_mobile_bottom_ad' ); ?>
<?php do_action( 'bestia_bottom_ads' ); ?>
<div id="foot">
<?php $footerwidgets = $awpt['mtn_footwidgets'];
if ($footerwidgets == "ftdisable") {
echo '<style>#foot{padding-top: 0 !important;}#foot .f1 {padding-top: 3px;}</style>';
} elseif (($footerwidgets == "fthome") || ( ! is_home() ) ){
get_template_part( 'inc/footer/footer-widgets', get_post_format() );
echo '<style>#foot{padding-top: 0 !important;}#foot .f1 {padding-top: 3px;}</style>';
} elseif ($footerwidgets == "ftdefault") {
get_template_part( 'inc/footer/footer-widgets', get_post_format() );
} ?>
<ul class="f1">
<?php wp_nav_menu( array( 'theme_location' => 'footer' ) ); ?>
</ul>
<?php do_action( 'bestia_footer_logo' ); do_action( 'bestia_RTA_option' ); ?>

<?php $copy = $awpt['footer_copyright']; if (!empty($copy)) { ?>
<p class="f3"><?php echo $copy; ?></p>
<?php } ?>

</div>
<div style="display: none;" class="mdlWrap">
<div class="mdlOverlay">&nbsp;</div>
</div>
<?php
get_template_part( 'inc/tools/google-plus', get_post_format() ); ?>
<?php do_action( 'bestia_lazyloading_type' ); ?>
<a href="#" class="scrollToTop"></a>
</div>
</div><!-- wrapper -->
</div><!-- -->
</div>
<div id="juicyadsfloat" style="
position:fixed;
width:306px;height:256px;top:358px;left:5px;
padding:15px;background:#000000;
border:0px solid #2266AA;
z-index:100">
<iframe border=0 frameborder=0 marginheight=0 marginwidth=0 width=306 height=256 scrolling=no allowtransparency=true src=http://adserver.juicyads.com/adshow.php ... 4></iframe>
<p align="right" style="margin-top:0px; margin-bottom:5px; margin-left:2px; margin-right:2px;"><a href="
javascript:window.parent.document.getElementById('juicyadsfloat').parentNode.removeChild(window.parent.document.getElementById('juicyadsfloat'))" onclick="closebar(); return false"><strong><font color="#FFFFFF" size="2" face="Verdana, Arial, Helvetica, sans-serif">Close [X]</font></strong></a></p>
</div>
</body></html>

User avatar
hyper
php-forum Fan User
php-forum Fan User
Posts: 761
Joined: Mon Feb 22, 2016 5:52 pm

Wed Apr 11, 2018 11:11 am

What errors did you get from the html validator?

killzone54
New php-forum User
New php-forum User
Posts: 3
Joined: Wed Apr 11, 2018 9:26 am

Wed Apr 11, 2018 11:44 am

Hyper, thanks again for the reply, truth be told I am a total noob with this. the thing is, when I use google chrome and close out the ad everything works fine, but when I go to close out the ad when using the website on firefox it redirects to a new page with [object HTMLDivElement]

I will add a couple screenshots that may help you understand my problem more. I just need to correct this or the ad company will remove their content on my website. I have to block out some stuff on the sites because of adult content.
Image
Image

Thanks again for any help in advance.

Post Reply