Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show page differently (css) if within iframe

Tags:

Is there any way to, as the title says "Show page differently (css) if within iframe". I'm looking for a jQuery / JavaScript method to potentially use a different css stylesheet if the site is within an iframe. Any ideas?

like image 968
ThomasReggi Avatar asked Dec 04 '10 14:12

ThomasReggi


1 Answers

You can inject a different stylesheet if the window is not the top window.

if (window.top!=window.self) {   // In a Frame or IFrame } else {   // Not in a frame }  
like image 92
Oded Avatar answered Sep 20 '22 21:09

Oded