That’s it. That’s all you have to do. It’s that simple.
I’ve tried other similar plugins but they didn’t perform reliably.
]]>analytics-talk-content-tracking.js:1 Uncaught TypeError: Cannot read properties of null (reading 'scrollTop')
at n (analytics-talk-content-tracking.js:1:593)
]]>I’d like to scroll automatic to top of the specific active panel that is open.
I use this code but it doesnt work.
<script>
jQuery( document ).ready( function( $ ) {
$( ‘.exad-accordion-title’ ).click( function( ) {
var pane = $(this);
setTimeout(function(){
var $panel = pane.closest(‘.exad-accordion-items’);
$(‘html,body’).animate({
scrollTop: $panel.offset().top
}, 500);
}, 300 );
});
});
</script>
I’m referring to the code in script.js on line 80, 101, 132, 216
]]>I had this perfectly working on my static html website, but I soon as I migrated it to wordpress, it stopped working. All my other js code works perfectly.. here is the part of code:
$(document).ready(function(){
$(window).scroll(function () {
var prevScroll;
var hidden = false;
var currentScroll = $(this).scrollTop();
if($("body").scrollTop() > 492){
if (prevScroll) {
console.log(currentScroll + " " + prevScroll);
console.log(hidden);
if (currentScroll < prevScroll && hidden) {
console.log('show');
$("#header-wrap").animate({marginTop: '0px'}, 200);
$("#menu").fadeIn("fast");
hidden=false;
} else if (currentScroll > prevScroll && !hidden) {
console.log(hidden);
console.log('hiding');
$("#header-wrap").animate({marginTop: '-60px'}, 200);
$("#menu").fadeOut("fast");
hidden=true;
}
} else if(!hidden){
console.log('first time');
$("#header-wrap").animate({marginTop: '-60px'}, 200);
$("#menu").fadeOut("fast");
hidden= true;
}
prevScroll = currentScroll;
}
else{
if(hidden){
console.log('show');
$("#header-wrap").animate({marginTop: '0px'}, 200);
$("#menu").fadeIn("fast");
hidden=false;
}
}
});
});
What is the problem with my code? I have it alongside all my js code in a script.js page.
Thanks
]]>https://www.ads-software.com/plugins/accordion-shortcode/
]]>This is not a problem with the plugin itself, but you may have an easy fix for me. I am a bit of a noob when it comes to javascript and I have installed your plugin to get a sidebar widget to stick to the top of the window when scrolled past.
This has worked great so far however I have recently created another Div that appears upon scrolling. (similar to a mashable post page where the share buttons appear upon scrolling)
I use the following javascript to get this to work:
var $j = jQuery.noConflict();
var startY = $j('.main-navigation').position().top + $j('.main-navigation').outerHeight();
$j(window).scroll(function(){
if( $j(this).scrollTop() > startY ){
$j('.floating-share-bar').slideDown();
}else{
$j('.floating-share-bar').slideUp();
}
});
This stops my sidebar widget from sticking and I presume it is because the plugin also uses .scrollTop.
Any ideas on how I could overcome this?I know it is nothing to do with the plugin but it might be useful for this forum if others wanted to do something similar.
James
https://www.ads-software.com/plugins/q2w3-fixed-widget/
]]>THanks in advance!
Fantastic plugin by the way!
Steve
https://www.ads-software.com/extend/plugins/ajaxify-wordpress-site/
]]>