Advertisement
sharepoint2020

Jquery PDF iFrame Hover

Nov 4th, 2013
630
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. /*
  2. * Url preview script
  3. * powered by jQuery (http://www.jquery.com)
  4. *
  5. * written by Alen Grakalic (http://cssglobe.com)
  6. *
  7. * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
  8. *
  9. */
  10. this.screenshotPreview = function(){
  11. /* CONFIG */
  12.  
  13. xOffset = 10;
  14. yOffset = 30;
  15.  
  16. // these 2 variable determine popup's distance from the cursor
  17. // you might want to adjust to get the right result
  18.  
  19. /* END CONFIG */
  20. $("a.screenshot").hover(function(e){
  21. this.t = this.title;
  22. this.title = "";
  23. var c = (this.t != "") ? "<br/>" + this.t : "";
  24. $("body").append("<p id='screenshot'><iframe width ='200px' height='250px' scrolling='no' src='"+ this.rel +"#page=1&toolbar=0&scrollbar=0&navpanes=0&statusbar=0' ></iframe>"+ c +"</p>");
  25.  
  26. $("#screenshot")
  27. .css("top",(e.pageY - xOffset) + "px")
  28. .css("left",(e.pageX + yOffset) + "px")
  29. .fadeIn("fast");
  30. },
  31. function(){
  32. this.title = this.t;
  33. $("#screenshot").remove();
  34. });
  35. $("a.screenshot").mousemove(function(e){
  36. $("#screenshot")
  37. .css("top",(e.pageY - xOffset) + "px")
  38. .css("left",(e.pageX + yOffset) + "px");
  39. });
  40. };
  41.  
  42.  
  43. // starting the script on page load
  44. $(document).ready(function(){
  45. screenshotPreview();
  46. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement