Yapapaya / jquery-cloneya

A jquery plugin to clone DOM elements
MIT License
76 stars 28 forks source link

Run function with created clone id #10

Closed jenseo closed 10 years ago

jenseo commented 10 years ago

Hi! Right now I'm having the following code:

$('#formclone').cloneya({
            limit       : 20,
            cloneThis       : '.formPack',
            valueClone      : false,
            dataClone       : false,
            deepClone       : false,
            cloneButton     : '.clone',
            deleteButton    : '.delete',
            clonePosition   : 'after',
            serializeID         : true
        }).on('clone_after_append', function(event, toclone, newclone) {
            $(toclone).children('.tab-container').hide();
            $(toclone).children('.preview').show().effect('highlight', {}, 1000);
            var idNum = $(newclone).children('.preview').attr('id').replace(/preview/, '');
            $('#tab-container' + idNum).tabs();
   });

What I'm trying to do with the lines:

var idNum = $(newclone).children('.preview').attr('id').replace(/preview/, '');
            $('#tab-container' + idNum).tabs();

is to get the id of the .preview div of the new clone (for example #preview1), strip out the preview part and this way get the id of the clone.

Then I would like to run the tab function with this container id.

Not getting it to work though.

Is there another way I should do this, or another way I can get the id?

Thanks! // Jens.

actual-saurabh commented 10 years ago

I'm really sorry but issues are meant for pointing out issues with the plugin. It is not for usage support.

There are other spaces for getting help with such things like StackExchange.

(On a side note, I don't have the resources to help with this, right now. Sorry!)