wrapper - jQuery: How to create element then wrap this around another existing element? -
so know how use .wrap, .wrapinner , .wrapall wondering how use quick creation syntax introduced in jquery 1.4 , wrap function together.
basically want able use
var targetul = $(this), // populated script maxwidth = 1400; // populated script $('<div />', { 'id':'wrap', 'css': { 'width': maxwidth, 'overflow':'hidden' } }).wraparound(targetul); kinda .appendto method works wrapping stuff…
can done?
thanks.
targetul.wrap( $('<div />', { 'id':'wrap', 'css': { 'width': maxwidth, 'overflow':'hidden' } }) );
Comments
Post a Comment