Infinite Scroll and Image Hover plugin don't really like each other

孤街醉人 提交于 2019-12-11 06:16:42

问题


After incredibly much effort I finally made infinite scroll (via the plugin) work with my theme. Now I got this little riddle for you sherlocks and watsons, which I hope you can solve:

Infinite scroll works, but on the pages infinite scroll adds when scrolling down, my image hover plugin doesn't appear anymore. (and image hover is quite important to my site!!)

When using your browser's dev tools, you will see, that at least the class wp.imagehoverlite is applied to the freshly loaded images, which is probably a good sign.

Still- no social hover buttons... Link to my Website

In infinite scroll plugin's settings then I discovered this box called callback:

Screenshot

That's a hot lead !

I did my research and found this page which explains it's function.

"Since Infinite Scroll dynamically adds new content to the page, sometimes you have to execute additional code to reinitialize those plugins."

This is how I add the hovering effect inside the wordpress loop:

                 <div class="gridly-image">

            <img class="wpimagehover alignnone wp-image-<?php echo get_post_thumbnail_id() ?>" src="<?php echo $image_attributes[0]; ?>" alt="" width="300" height="250" data-fburl="<?php the_permalink() ?>" data-tweeturl="<?php the_permalink() ?>" data-pinurl="<?php the_permalink() ?>" data-stumbleuponurl="<?php the_permalink() ?>" data-sstyle="circle" data-sharetxt="<?php echo get_the_excerpt(); ?>" data-animation="fade" /> 

            </div>

Now we just need to find out, what the heck I need to enter in this big box. OR - find a way to get social buttons on image hover without the plugin.

I really really really appreciate your help. :)

来源:https://stackoverflow.com/questions/26611734/infinite-scroll-and-image-hover-plugin-dont-really-like-each-other

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!