The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
untitled Javascript Code
Posted by: thijs | March 12, 2010 @ 9:18am
Javascript Code
[
Download
]
jQuery.fn.elementlocation = function() { var curleft = 0; var curtop = 0; var obj = this; do { curleft += obj.attr('offsetLeft'); curtop += obj.attr('offsetTop'); obj = obj.offsetParent(); } while ( obj.attr('tagName') != 'BODY' ); return ( {x:curleft, y:curtop} ); }; $(document).ready(function() { var close = true; var popup = $("#popup"); $(".zoekcloud a").each(function() { $(this).hover(function() { var location = $(this).elementlocation(); close = true; showPopup(popup, location, $(this)); }, function() { setInterval(checkClose(), 2000); }); }); function checkClose() { if (!close) { closePopup(popup); } } function showPopup(popup, e, obj) { popup.hover(function() { close = true; }, close = false); x = e.x; y = e.y; popup.html("Hallo Thijs"); popup.css('top', y+241); popup.css('left', x+300); popup.css('position', 'absolute'); popup.css('display', ''); popup.css('width', '300px'); popup.css('height', '0px'); popup.animate({ height: "200px", }, 500, 'linear'); } function closePopup(popup) { console.log('close'); popup.hide(200); } });
Syntax Highlighting
[
Open in new window
]
Author Comments
voro bart
Rating
4.68 / 8
62 Votes
http://codebin.yi.org/544
page generated in 0.00 seconds