Using the if (self==top) method, or, better if (self==parent), you can check if your page is in an <iframe> and remove the desired element afterwards.
To implement this behavior you'll need some distinguishable id or class to find the elements to remove, and also load the script after them, so maybe at the end of your body.
Here's an example:
In your HTML page you'll add some class to the elements you don't want to be shown in a frame, like this:
<body>
<div class="noframe"></div>
<!-- I don't want this to be shown in a frame! -->
<script src="script.js"></script>
</body>
In your script.js file you'll simply remove the elements:
if (self != parent) {
var toRemove = document.querySelectorAll('.noframe');
// Remove the elements you don't want in the iframe
for (var i=0; i < toRemove.length; i++) {
toRemove[i].parentElement.removeChild(toRemove[i]);
}
}