
Originally Posted by
DaveX
Got this to work! I assume by playing with the CSS I can change the color of the box and such? Also, as my test, I pointed it to open a video on a page from another site I built. The video was way low in the box. After I opened the box up I could view it fine. Does the script assume the video is playing center/middle of the page? Also, is it possible to add 'next' and 'previous' arrows? this is a great script!
Great! I've been upgrading the script and the demo page, make sure you have the latest files. Once the script appears in the submissions section, it will no longer be updated so often as it currently is being.
Yes, you can change the css to change the box's appearance. The latest css (which you may or may not already have, and which is meant for use with the latest script, which I just uploaded) is better commented (but can and will be even better commented in the future) and is simplified from the version when we first started talking about this. Make sure to grab both latest mybox.css and mybox_ie.css files at the same time as the latest mybox.js script file.
There are two basic approaches to videos that seem to work well so far:
- Put the video in the upper left corner of a page with its body element's style set:
Code:
body {
margin:0;
padding:0;
}
Then in your rel="iframe" link to it, set the size of the iframe to the size of the video. This is the method currently used by the demo.
- Center the video on a page with whatever other content you like. Set your rel="iframe" link's size to an adequate size to show all this content, including the video. This is the method that I was using at first with the demo.
You can add next and previous arrows by using the syntax eplained on the demo page:
Once you have set up your page, the various 'boxes' are numbered 0 to whatever and can be recalled using (in a link or button):
onclick="return mybox.show(#);"
where # is the number 0 through whatever in the order you originally made them on that page. Except for Ajax content. That may be recalled:
onclick="return mybox.show('url_to_page', 'optional_caption');"
However, since these would go best on the page featuring the videos, which would be in an iframe, they would need to be:
Code:
onclick="return parent.mybox.show(#);"
And, though I am not certain, the page(s) in the iframe would probably need to be on the same domain as the page using the script for these to work.
Bookmarks