iframe

Hi,

Is it possible to create a button outside an iframe that controls items inside the iframe?

For instance, i’ve made a carousel and placed it on the homepage inside an iframe. Now I want to control the carousel from a button on the homepage.

Thanks

David


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

First of all, I have to ask “why?” the whole point of Carousel is to do iframe-like things without an iframe.

Second of all, probably not. The Carousel sets up all of its controls inside of listener functions, which are deliberately not exposed to the global scope.

There is a way to access the contents of a frame and trigger functions declared inside that document, but the functions would have to be declared in that document’s global scope.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

For example:

var doSomething = function(){
    var elm = $$('iframe').first();
    elm.contentWindow.document.someFunction();
};

doSomething()

someFunction is a function defined somewhere within the document loaded into the iframe. doSomething triggers it.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options