Hi all ,
Past couple of days am very much struggled for this effect ,
At last yesterday night i got the solution ,
But this same solution may available in Google , but is sure this JQUERY BASKET SNIPPET surly different one in functionality view ,I take this snippet demo from jquery fly to basket site,
I customized based on my requirement ,
Code description :
Basically this is e-commerce application ,
Assume using coming to our shopping portal ,
Assume they click the Add To Cart
Then the image mirror will be fly to cart and
then the cart count get contents ,
Just try this...
Use full one ...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Image Fly To Basket</title>
<script src="http://code.jquery.com/jquery-latest.js"> </script>
<script type="text/javascript">
$(document).ready(function(){
$("#add_to_basket").click(function(){
var productY = "56";
var productX = "277.5";
var basketY = "91";
var basketX = "926.5";
var gotoY = "35";
var gotoX="649";
var newImageWidth= "23.66666666666667";
var newImageHeight= "44";
$("#imagepreivew" + " img")
.clone()
.prependTo("#imagepreivew")
.css({'position' : 'absolute'})
.animate({opacity: 0.4}, 100 )
.animate({opacity: 0.1, marginLeft: gotoX, marginTop: gotoY, width: newImageWidth, height: newImageHeight}, 1200, function() {
$(this).remove();
});
});
});
</script>
</head>
<body>
<div id="imagepreivew"><img src="http://t2.gstatic.com/images?q=tbn:Bm9iOrDIO8DuXM:http://www.globwon.com/images/nokia%25205800.jpg" border="0" /></div>
<div id="add_to_basket" style="background-color:#666666; color:#FFFFFF; font-weight:bold; width:90px; height:30px; vertical-align:middle; text-align:center;">Add to cart</div>
</body>
</html>
Thanks
No comments:
Post a Comment