Skip to content
Advertisement

How to hook into html with my own html overlay?

I am trying to overlay some HTML code over a website’s image using <iframe> and CSS.

The website is a weather-monitoring website (which we’ve purchase btw), that I want to overlay with my own HTML code and image.

Is it possible to “hook” into one portion of the image with my own image? I want it hooked (so-to-speak, pardon my jargon), so the browser’s resizing won’t change it’s layout and for it to also work on mobile device browsers.

This is the website I am referring to (sorry it’s not a public accessible site).

3rd party weather monitoring website

I’ve managed to somewhat achieve what I want using this code…

JavaScript

But as you’ve guessed, the top and right positioning is hardcoded to overlay that box in the right spot.

However, as soon as I re-size the browser or view it on a mobile device, the <canvas> element shifts to the right (or left or down) and the underlying compass dial shows from behind (somewhat partially obscured).

i.e.

enter image description here

There must be a better way to do this. Any ideas and suggestions?

Thanks

Advertisement

Answer

The answer was to use CSS margin-left and rights.

JavaScript

and referring to the html with this class…

JavaScript
User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement