Posted By

onefastsnail on 05/24/12


Tagged


Versions (?)

popup ajax


 / Published in: Other
 

  1. $('[rel=popup]').hover(function(event)
  2. {
  3. event.preventDefault();
  4.  
  5. var ajax_load = "<img src='../images/ajax-loader.gif' alt='loading...' />";
  6.  
  7. var loadUrl = "http://" + location.hostname + "/stock.php";
  8.  
  9. $("#item-stock").html(ajax_load).load(loadUrl);
  10.  
  11. var position = $(this).offset();
  12. var input_width = $(this).width();
  13.  
  14. $("#item-stock").stop(true, true).fadeIn(300);
  15.  
  16. var new_left = parseInt(position.left)-45;
  17. var new_top = parseInt(position.top)-68;
  18.  
  19. $("#item-stock").offset({left: new_left, top: new_top});
  20. },function()
  21. {
  22. $('#item-stock').mouseleave(function(event){
  23. $('#item-stock').fadeOut(300);
  24. });
  25. });

Report this snippet  

You need to login to post a comment.