April 20, 2012

Jquery clone item

Question by Kobjir

I’m studying the interactive-image-vamp-up with jquery css3 and php script from http://tympanus.net/codrops/2010/03/22/interactive-image-vamp-up-with-jquery-css3-and-php/

My question, how to make items clone and get the clone position?

thanks in advance

Answer by Starx

var cloned = $("#itemtoclown").clone(); //clone an element
$("body").append(cloned); //Insert it into DOM

//Access the positions like with
var positions = cloned.position();
console.log(positions.top); //Access the top

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!