Home >Web Front-end >JS Tutorial >Sharp jQuery Chapter 3 Chapter Summary Example_jquery

Sharp jQuery Chapter 3 Chapter Summary Example_jquery

WBOY
WBOYOriginal
2016-05-16 18:31:391057browse
复制代码 代码如下:








<script> <br>var x = 10; <br>var y = 10; <br>$("a.tooltip").mouseover(function (e) { <br>this.myTitle = this.title; <br>this.title = ""; <br>this.imgTitle = this.myTitle ? this.myTitle : "无title"; <br>var tooltip = "<div id='tooltip'><img class='img1' src='" this.href "'/><div class='div1'>" this.imgTitle "</div></div>" <br>$("body").append(tooltip); <br>$("#tooltip").css({ <br>"top": (e.pageY y) "px", <br>"left": (e.pageX x) "px" <br>}).show("fast"); <br>}).mouseout(function () { <br>$("#tooltip").remove(); <br>this.title = this.myTitle; <br>}) <br></script>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn