Home >Web Front-end >JS Tutorial >jQuery implements beautiful and practical product picture tips prompt box effect (no picture arrow + shadow)_jquery
The example in this article describes the implementation of beautiful and practical product picture tips prompt box effect using jQuery. Share it with everyone for your reference, the details are as follows:
The screenshot of the running effect is as follows:
The specific code is as follows:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <script type="text/javascript" src="jquery-1.4.2.min.js"></script> <style type="text/css"> #tip {position:absolute;display:none;} #tip s {position:absolute;top:40px;left:-21px;display:block;width:0px;height:0px;font-size:0px;line-height:0px;border-color:transparent #BBA transparent transparent;border-style:dashed solid dashed dashed;border-width:10px;} #tip s i {position:absolute;top:-10px;left:-8px;display:block;width:0px;height:0px;font-size:0px;line-height:0px;border-color:transparent #fff transparent transparent;border-style:dashed solid dashed dashed;border-width:10px;} #tip .t_box {position:relative;background-color:#CCC;filter:alpha(opacity=50);-moz-opacity:0.5;bottom:-3px;right:-3px;} #tip .t_box div {position:relative;background-color:#FFF;border:1px solid #ACA899;padding:1px;top:-3px;left:-3px;} .tip {width:82px;height:82px;border:1px solid #DDD;} </style> <script type="text/javascript"> $(function () { $('.tip').mouseover(function () { var $tip = $('<div id="tip"><div class="t_box"><div><s><i></i></s><img src="' + this.src + '" /></div></div></div>'); $('body').append($tip); $('#tip').show('fast'); }).mouseout(function () { $('#tip').remove(); }).mousemove(function (e) { $('#tip').css({ "top": (e.pageY - 60) + "px", "left": (e.pageX + 30) + "px" }) }) }) </script> <p> </p> <a href="#" ><img class="tip" src="http://img04.taobaocdn.com/bao/uploaded/i4/T1dEBQXipuXXczdj2a_091642.jpg_310x310.jpg" /></a> <a href="#" ><img class="tip" src="http://img03.taobaocdn.com/bao/uploaded/i3/T1JrxRXhVjXXXPQgc2_044150.jpg_310x310.jpg" /></a> <a href="#" ><img class="tip" src="http://img03.taobaocdn.com/bao/uploaded/i3/T1tDNOXfNeXXXkeTI8_102031.jpg_310x310.jpg" /></a>
Readers who are interested in more jQuery related content can check out the special topics on this site: "JQuery switching effects and techniques summary", "jQuery drag effects and techniques summary", "JQuery extension skills summary", "jQuery common classic special effects summary", "jQuery animation and special effects usage summary", "jquery selector usage Summary " and "Summary of jQuery common plug-ins and usage "
I hope this article will be helpful to everyone in jQuery programming.