[Pro] Scripty Accordion

Here’s something interesting I noticed… I made a scripty accordion menu as a stand-alone html page, and it worked fine in preview and in browsers. When I had it load into a page in a mark-up item, it loaded fine, but would not expand/contract. I replaced the mark-up item with an iframe, and it worked fine. Is there a reason for this?

Thanks, David


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

There are two JavaScript libraries needed by the effect, and they get added to the page by the Action. Without them, the effect will not do anything.

Walter

On Mar 6, 2012, at 12:11 AM, David wrote:

Here’s something interesting I noticed… I made a scripty accordion menu as a stand-alone html page, and it worked fine in preview and in browsers. When I had it load into a page in a mark-up item, it loaded fine, but would not expand/contract. I replaced the mark-up item with an iframe, and it worked fine. Is there a reason for this?

Thanks, David


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


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

Walt,

Are you saying that the page inserted into an iframe carries the code with it, but that the same page inserted into a markup item via php does not? Is that because of where the JavaScript resides in the code?

Thanks, David


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

An iframe is allowed to hold an entire page worth of content, because it is a separate “sandbox” --essentially another browser window – away from the outer page. But a markup item categorically cannot, because it just creates a DIV within the current document. If you put a complete (html head body) page anywhere inside the body of a second page, you have created a bicephalous monster.

Modern browsers deal with this sort of abomination surprisingly well, but JavaScript DOM manipulation like that which goes on in the Accordion effect requires as a baseline a completely valid (X)HTML page to work predictably. What you have made is not valid, so it doesn’t work.

Walter

On Mar 6, 2012, at 9:55 AM, David wrote:

Walt,

Are you saying that the page inserted into an iframe carries the code with it, but that the same page inserted into a markup item via php does not? Is that because of where the JavaScript resides in the code?

Thanks, David


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


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