jquery - Get iFrame container size in javascript -
i'm trying modify fitvid.js script.
i'm working on fragment:
$allvideos.each(function(count){ var $this = $(this); if($this.parents(ignorelist).length > 0) { return; // disable fitvids on video. } if (this.tagname.tolowercase() === 'embed' && $this.parent('object').length || $this.parent('.fluid-width-video-wrapper').length) { return; } if ((!$this.css('height') && !$this.css('width')) && (isnan($this.attr('height')) || isnan($this.attr('width')))) { $this.attr('height', 9); $this.attr('width', 16); } var height = ( this.tagname.tolowercase() === 'object' || ($this.attr('height') && !isnan(parseint($this.attr('height'), 10))) ) ? parseint($this.attr('height'), 10) : $this.height(); var width = !isnan(parseint($this.attr('width'), 10)) ? parseint($this.attr('width'), 10) : $this.width(); if ($this.attr('src').tolowercase().indexof("video.corriere.it") >= 0) { console.log($this.parent('.embeddedcontent')) console.log(height); console.log(width); height = height + 67; }
this line
console.log($this.parent('.embeddedcontent'))
return me in console:
[div.embeddedcontent, prevobject: jquery.fn.init[1], context: iframe] 0: div.embeddedcontent clientheight: 358 clientleft: 0 clienttop: 0 clientwidth: 572
i need "clientwidth". how can do?
Comments
Post a Comment