nards
nards

Reputation: 51

How to get window width within an iframe?

I want to get the width of the browser.

I have this code inside an iframe

alert($(document).width());

But it display the width of a <div> element instead.

I also try this code:

alert($(window).width());

But same results.

Upvotes: 2

Views: 1884

Answers (1)

coder
coder

Reputation: 13248

Try this;

parent.document.body.clientWidth

Upvotes: 4

Related Questions