Append not working in jQuery -
Append not working in jQuery -
i'm trying append tp-lightboxactitem tp-lightboxcontainer. can 1 help me thing. it's not working, want lightbox activeitem comes within tp-lightboxcontainer , tp-lightboxactitem comes in center of .
$('body').append('<div id="tp-lightboxcontainer" class="'+opt.style+' lightboxitem"></div>'); var tp-lightboxcontainer=find('#tp-lightboxcontainer'); tp-lightboxcontainer.append('<div id="tp-lightboxactitem" class="'+opt.style+' lightboxitem"></div>'); $('<div id="tp-lightboxcontainer" class="'+opt.style+' lightboxitem"></div>') .appendto('body') .append('<div id="tp-lightboxactitem" class="'+opt.style+' lightboxitem"></div>');
you're working 1 object here, can in 1 line. jsfiddle
make container (target container) append<body> (still target container) append item container (still target container) ps: if want utilize container more things, sense free cache putting var whatever = in front end of it.
jquery append lightbox
Comments
Post a Comment