When using light box links in your publication, there may be situations where you would like to display just a part of an outside website rather than the entire page. The solution is to create an IFrame page which selects just the desired portion, and then point your light box to that IFrame page rather than the original.
See here, two example web pages:
- Commerce Example
Each of these is IFramed in the example publication below:
(Click here to see the example!)
Example Code
<!DOCTYPE html> <html> <head> <style type="text/css"> div { position:fixed; overflow:hidden; left:0px; top:0px; width:X_SIZE_HEREpx; height:Y_SIZE_HEREpx; } iframe { position:absolute; width:1280px; height:1200px; left:-X_POS_HEREpx; top:-Y_POS_HEREpx; } </style> </head> <body> <div><iframe src="TARGET_URL_HERE" scrolling="no"></iframe></div> </body> </html>
To use the above code, simply follow these steps:
1) Copy code in its entirety to your favorite text editor and save as a .html file.
2) Replace X_SIZE_HERE and Y_SIZE_HERE with the desired width and height for your displayed area. This should match the size of your light box.
3) Replace X_POS_HERE and Y_POS_HERE with the position of the top-left corner of your displayed area. This make require a little bit of trial and error. Do not remove the "-" included before each number, they are required.
4) Replace TARGET_URL_HERE with the address of the website you wish to display.
5) Save the file and host it online somewhere. Point to it using your light box link.
Comments
0 comments
Please sign in to leave a comment.