I learned a few things after I posted this on my blog about putting a close button on top of centered fluid images.
I used jquery and translate in CSS transforms there to do the job. But I found that it can also be done with the help of a combination of window.innerWidth/Height and element.clientWidth/Height. As window.innerWidth/Height and element.clientWidth/Height are also supported by older browser, a technique using these methods must be preferred. Demos and explanations here.
Updated 04-10-2015 at 11:52 PM by molendijk
EDIT: see this for an alternative (better?) method..
CLICK HERE IF YOU WANT TO GO STRAIGHT AWAY TO THE DEMO PAGE.
The translate() method used inside the HTML-code below moves both a (super) div-containing-a-close-buttom (id: 'the_div') and an image (id: 'the_img') to the center of the window. The jquery-onload in the image ensures that the width of the div equals the width of the image. This is a requirement if we want to get the button (in the div) at the right position in front of
Updated 04-10-2015 at 11:47 PM by molendijk
If we want to use the browser's scrollbar to scroll the content of an iframe, we must do the following:
calculate iframe's offsetHeight + pixel distance of top of iframe with respect to top of main window + pixel distance of bottom of iframe with respect to bottom of main window ;give the main window a pixel height that is identical to the result of that calculation;make sure that the value for the number of pixels that the content of the iframe is scrolled upward (in the case of
We can embed and programmatically control multiple YouTube videos by putting onloads like the following in (existing) iframes:
Updated 12-07-2014 at 04:15 PM by molendijk
It's not easy to find a good rich text editor on the internet that:
1. explains in comprehensive terms how to save the edits online, that is, how to send them to the server (or that at least uses clear instructions on how to do it);
2. does not require that software be installed on your hard disc.
So I created my own personal file explaining (to myself) how to achieve 1 and 2 above. Some of you may be interested in it, so here's the result. You can find all the explanations
Updated 10-20-2014 at 10:19 PM by molendijk