Hi i have a strange problem with wordpress. I have a short JQuery script. The script is working as long as the page is loading. But when the page is finished with loading it's not working anymore and I can't find the prolbem. I tried also to wrap the script in a noconflict wrapper didn't help.
Maybe some more informations... I try to show a title of a grid element in wordpress which i have set to display none.
Thanks for your help
Here some details: Wordpress 5.3.2 Highend Theme 3.6.4
jQuery(document).ready(function(){
jQuery(".apmstoriespic").mouseover(function(){
jQuery(this).next(".apmstoriestitle").show();
});
});
Hi i have a strange problem with wordpress. I have a short JQuery script. The script is working as long as the page is loading. But when the page is finished with loading it's not working anymore and I can't find the prolbem. I tried also to wrap the script in a noconflict wrapper didn't help.
Maybe some more informations... I try to show a title of a grid element in wordpress which i have set to display none.
Thanks for your help
Here some details: Wordpress 5.3.2 Highend Theme 3.6.4
jQuery(document).ready(function(){
jQuery(".apmstoriespic").mouseover(function(){
jQuery(this).next(".apmstoriestitle").show();
});
});
Share
Improve this question
edited Mar 30, 2020 at 5:30
Martin Körber
asked Mar 30, 2020 at 3:49
Martin KörberMartin Körber
11 bronze badge
1 Answer
Reset to default 0Hard to say what the problem is without seeing the html structure. Any error in your browser console log ? Might that another jQuery function is already bind to the ".apmstoriespic" class. Maybe try the below instead
jQuery(".apmstoriespic").on('hover',function(){
If you want to skip the jQuery route altogether, there is an easy way to achieve the same result with CSS only
.apmstoriespic + .apmstoriestitle {
display: none;
}
.apmstoriespic:hover + .apmstoriestitle {
display: block;
}
Hope this help !