Tagged: x
-
AuthorPosts
-
November 13, 2016 at 6:44 am #1255168
RadModeratorHi there,
Please change it to this,
jQuery( function($){ var the_interval = 0; the_interval = setInterval( function() { $('body').stop().animate( { 'margin-top' : $('#cp-cp_id_1b4a0:visible').height() } ); if ( $('#cp-cp_id_1b4a0:visible').height() <=0) clearInterval( the_interval ); } , 1000 ); $('.ib-close').on('click', function(){ clearInterval( the_interval ); $('body').stop().animate( { 'margin-top' : 0 } ); } ); } );That should do it now. Cheers!
November 13, 2016 at 3:24 pm #1255488
SEVEROParticipantYou’re a genius! The gap below the ad isn’t closed instantly when resizing like it was but pretty damn good!
I have two more questions regarding the Info Bar.
1. If the Info Bar is empty, is there a way to detect that with a script?
2. In the Info Bar settings you have Behahavior > Repeat Control > Do Not Show After Closing. If I set this for 1 day the ad will disappear for 24hrs which is fine but is there a way to keep ‘Enable Toggle Button’ to stay there when the ad isn’t? Because the moment you enable ‘Do Not Show After Closing’ you lose it.Should I start a new thread?
November 13, 2016 at 11:07 pm #1255864
RadModeratorHi there,
You can change the value 1000, it’s equivalent to 1 second (1000ms). It’s the delay so it won’t freeze, but you can lower its value like 500 or 300 to make it instant. Don’t lower it to lower than 300 or it will freeze.
1. Depending on what content to check, usually it can be detected by this condition
if ( $('.the_selector:empty').length > 0 ) { //It's empty }2. You’ll have to add your own custom trigger, example let’s say you created this button
<a href="#open_ads" class="open_ads">Open Ads</a>Then in your info bar setting under Behavior > Manual Display > Launch With CSS Class, add open_ads. Then just style your button to appear on top. Like this
.open_ads { position: absolute; top: 10px; right: 10px; z-index: 9999999; }Hope this helps.
November 15, 2016 at 7:06 pm #1258751
SEVEROParticipantHi there, figured out another solution regarding the toggle button and that was to run two Info Bars. One with the settings of ‘Do Not Show After Closing for 1 day’ and the other with the ‘Initially Display Toggle Button’ loaded.
The resizing has been working on and off for me and now it doesn’t seem to be working at all.
November 16, 2016 at 6:08 pm #1260155
RadModeratorHi there,
There are 10 javascript errors in which weren’t there before. Would you mind removing all other custom javascript, this should remain there
jQuery( function($){ var the_interval = 0; the_interval = setInterval( function() { $('body').stop().animate( { 'margin-top' : $('#cp-cp_id_1b4a0:visible').height() } ); if ( $('#cp-cp_id_1b4a0:visible').height() <=0 ) clearInterval( the_interval ); } , 1000 ); $('.ib-close').on('click', function(){ clearInterval( the_interval ); $('body').stop().animate( { 'margin-top' : 0 } ); } ); } );I added it on developer console and it’s perfectly working, there are other javascripts that affects this one.
Thanks!
November 16, 2016 at 6:15 pm #1260160
SEVEROParticipantHi there, yes had tried that with no success. I’ve left only the code above so you can see
November 16, 2016 at 10:04 pm #1260500
RadModeratorHi there,
Thanks, and finally, this is the one that causing it
<script> addToHomescreen({ startDelay: 5 }); </script>The addToHomescreen is not defined, not even existing from this file http://www.mad-daily.co.nz/add2home.js
You may correct or remove them. Thanks!
November 16, 2016 at 11:10 pm #1260547
SEVEROParticipantHi there, little confused to why it was working fine before. Have removed that script and no joy 🙁
November 17, 2016 at 2:28 am #1260687
RadModeratorHi there,
I checked and it’s now working after removing it. Please clear your browser cache before testing.
There are 6 other errors which are connected to youtube media element. But it shouldn’t affect your site’s functionality.
I went ahead and changed the code to this,
jQuery( function($){ var the_interval = 0; the_interval = change_height(); $('.ib-close').on('click', function(){ clearInterval( the_interval ); $('body').stop().animate( { 'margin-top' : 0 } ); } ); $('.cp-ifb-toggle-btn').on('click', function() { the_interval = change_height(); } ); function change_height () { return setInterval( function() { if ( $('#cp-cp_id_1b4a0:visible').height() <=0 ) $('body').stop().animate( { 'margin-top' : 0 } ); else $('body').stop().animate( { 'margin-top' : $('#cp-cp_id_1b4a0:visible').height() } ); } , 300 ); } } );The issue was that your newly added toggle doesn’t re-initialize the interval. The code should fix it all.
Cheers!
November 17, 2016 at 2:43 pm #1261522
SEVEROParticipantThank you so much for your time. Works perfectly 🙂
November 17, 2016 at 4:56 pm #1261697
NicoModeratorHappy to hear that.
Feel free to ask us again.
Thanks.
November 21, 2016 at 3:10 pm #1265952
SEVEROParticipantHi there, seem to having an issue with the Scroll Top Anchor. When I remove the code above it works fine. Any solutions around this?
Thanks
November 22, 2016 at 12:08 am #1266454
RadModeratorHi there,
Yes, the code disables all scrolling with 300ms interval,
$('body').stop()Unfortunately, you can’t have both, since stopping the scrolling is required for smooth transition of your ads.But, you may try removing the stop(). Example, from this
$('body').stop().animateto this
$('body').animateHope this helps.
December 4, 2016 at 3:33 am #1280345
SEVEROParticipantHi there, yes unfortunately these don’t work together. Will have to disable the Scroll Top Anchor 🙁
December 4, 2016 at 3:46 am #1280357
SEVEROParticipantNow this code isn’t working. Not resizing??
jQuery( function($){
var the_interval = 0;
the_interval = change_height();
$(‘.ib-close’).on(‘click’, function(){
clearInterval( the_interval );
$(‘body’).stop().animate( { ‘margin-top’ : 0 } );
} );
$(‘.cp-ifb-toggle-btn’).on(‘click’, function() {
the_interval = change_height();
} );
function change_height () {
return setInterval( function() {
if ( $(‘#cp-cp_id_1b4a0:visible’).height() <=0 ) $(‘body’).stop().animate( { ‘margin-top’ : 0 } );
else $(‘body’).stop().animate( { ‘margin-top’ : $(‘#cp-cp_id_1b4a0:visible’).height() } );} , 300 );
}
} );
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1240219 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
