Link to home
Start Free TrialLog in
Avatar of Squadless
Squadless

asked on

print only iframe content

I've the page where i have an iframe showing the main content along with the navigaiton in the document. when users print the page using control+p i only want to display the iframe content and simply hide the main parent page.

how do i capture ctrl+p in javascript if i can? If not is there any simpler way to accomplish this?
Avatar of Proculopsis
Proculopsis

//try using css media selectors to determine what gets displayed and what gets printed:

@media screen {
    iframe { display: none; }
}

@media print {    
    iframe { border: solid 2px red; }
}
Avatar of Squadless

ASKER

how about hiding the body but only showing iframe? cos if i hide body it's also hiding the iframe too
ASKER CERTIFIED SOLUTION
Avatar of TechHelpr08210
TechHelpr08210
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial