1

I wonder if it is possible to have a top bar which acts like a bar followed by an iframe with any page content. Basically, what many websites do is the following:

http://jsfiddle.net/dotwired/e9n5z/

<style>
body {
    height: 100%;
}
#bar {
    height: 30px;
    background: #000;
}
iframe {
    box-sizing: border-box;
    width: 100%;
    height: 100%;
}
</style>
<div id="bar"></div>
<iframe src="http://apple.com" frameborder="0"></iframe>

I really want the bar generated by HTML / CSS / JavaScript or whatever else, but I do not want to load the DOM initially with an iframe, but have the same unobtrusive behavior from the bar (that means not overlay popups or anything shall overlay the bar and also the bar itself doesn't hide any part of the page).

I am interested in such a solution mainly because it will change the url in contrast to the iframe solution if some link is clicked. Any approach which will enable this url change is welcome.

// edit: As an more precise example, visit e.g. http://demo2.woothemes.com/?name=hub (the "top" bar in this case is at the bottom but the position doesn't really matter). When I click a link in the theme demo the URL will not change, so if I send that link to a friend he will see the frontpage of the template though I may have intended to see him some other concrete subpage.

I want to have such a bar which optimally is generated by JavaScript and is executed on the same demo page and not outside an iframe.

Maxim Zubarev
  • 2,127
  • 1
  • 26
  • 44
  • I think I don't understand what you want... You want a solution like what you posted, but without an iframe? – Cedric Reichenbach Dec 20 '13 at 13:58
  • Could you maybe post your attempt so we can better understand what it is you're trying to do? – Shafiq Jetha Dec 20 '13 at 14:07
  • @CedricReichenbach without an initially loaded iframe at least. I have thought about wrapping the whole page content on every page load in an iframe with JS. So yes, I want what I posted, just that the URL of that example would be a dynamic http://apple.com and not a static http://urlofmyiframehandler.com – Maxim Zubarev Dec 20 '13 at 14:16
  • @ShafiqJetha Unfortunately there is no attempt. If there would, I wouldn't ask. – Maxim Zubarev Dec 20 '13 at 14:17
  • I have added a more precise description and a real world example to my post after my edit. – Maxim Zubarev Dec 20 '13 at 14:23
  • This might be relevant for you: http://stackoverflow.com/questions/2429045/iframe-src-change-event-detection – Cedric Reichenbach Dec 20 '13 at 14:48
  • You propose to track make an iframe solution and read the iframe url and thereby changing the current address to that url with JS without actually loading that, am I right? – Maxim Zubarev Dec 20 '13 at 14:55

0 Answers0