开发者

jquery wrap an iframe in div

开发者 https://www.devze.com 2023-03-04 15:54 出处:网络
How would I make jquery wrap an iframe in a div e.g if using a vimeo embed iframe, on load jquery wraps it in a div class:

How would I make jquery wrap an iframe in a div e.g if using a vimeo embed iframe, on load jquery wraps it in a div class:

<div class="iframe"><iframe src="http://player.vimeo.com/vi开发者_开发知识库deo/23358638?title=0&amp;byline=0&amp;portrait=0" width="500" height="300" frameborder="0"></iframe></div>    


Use jQuery wrap() function :

$("iframe").wrap("<div class='iframe'/>");
0

精彩评论

暂无评论...
验证码 换一张
取 消