Advertisement
DArcher

Image crossfader

Jun 7th, 2012
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function(){
  2.         $(".dropnavoption").mouseover(function(){
  3.             var oldimg = $('#swapme').css("background-image")
  4.             //alert(oldimg);
  5.             $('#swapmetoo').css('background-image', oldimg);
  6.             $('#swapmetoo').show();
  7.             $('#swapme').hide();
  8.             var image = $(this).attr('rel');
  9.             //alert(image);
  10.             $('#swapme').css("background-image", 'url('+image+')');
  11.             $('#swapme').show();
  12.             $('#swapmetoo').fadeOut('slow');
  13.         });
  14.     });
  15. //This assumes you have to divs set two absolute with same positioning
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement