by
3 7

При наведенні на картинку спливаюча підсказка

При наведенні на картинку спливаюча підсказка: 
hover_img.js
Copy Embed Code
<iframe id="embedFrame" style="width:600px; height:300px;"
src="https://www.snip2code.com/Embed/1411667/----------------------------------------?startLine=0"></iframe>
Click on the embed code to copy it into your clipboard Width Height
Leave empty to retrieve all the content Start End
//============ category proj hover img $(".product-categories li a").prepend("<img><div class='text-content'></div"); $(".product-categories li:first-child a img").attr("src", "/wp-content/themes/m2/img/icon-011.png"); $(".product-categories li.cat-item-53 a img").attr("src", "/wp-content/themes/m2/img/icon-012.png"); $(".product-categories li.cat-item-7 a img").attr("src", "/wp-content/themes/m2/img/icon-013.png"); $(".product-categories li.cat-item-52 a img").attr("src", "/wp-content/themes/m2/img/icon-014.png"); var dublicate_text = ""; $(".product-categories li").mouseenter(function(){ var i = $(this).index(); var link_text = $('.product-categories li:eq('+i+') a').text(); dublicate_text = $('.product-categories li:eq('+i+') a .text-content').text(link_text); $('.product-categories li:eq('+i+') a .text-content').css("display", "block"); }); $(".product-categories li").mouseleave(function(){ var i = $(this).index(); dublicate_text.text(""); $('.product-categories li:eq('+i+') a .text-content').css("display", "none"); });
If you want to be updated about similar snippets, Sign in and follow our Channels

blog comments powered by Disqus