是否有可能在jQuery中動畫.attr
函數?我有一個基於點擊改變視頻寬度和高度的iframe。我必須使用.attr
來更改iframe的寬度和高度,因爲我有使iframe響應屏幕瀏覽器的css代碼。可以動畫嗎?
<iframe id="video-ply" src="<?php echo get_post_meta(get_the_ID(), 'video_embed_url', true) ;?>" frameborder="0" allowfullscreen="true" scrolling="no" width="615" height="346"></iframe>
的jQuery:
$("#video-ply").attr('width', '889px');
$("#video-ply").attr('height', '500px');