Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Keep header from refreshing


Reply


4 Posts   1585 Views

Avatar
sonicparke

74 Posts

19 June 2008 at 4:26am

Edited: 19/06/2008 4:28am

I'd like to use an swf file for the header but I'd really like it to keep looping constantly and not refresh as user navigate through the site. I'm not sure how to achieve this with SS templates.

Another idea I'd like to get working is what Panic has done with their Coda site. I really like the sliding pages as you navigate through the sections.
http://www.panic.com/coda/

I'm not much of a coder so I'm not exactly sure how to make this happen using SS. Anybody got any smart & easy ideas?

Avatar
dio5

Community Member, 501 Posts

19 June 2008 at 4:50am

Not wanting the header (thus page) to 'refresh' means not going to another page, and that can only be achieved through ajax afaik.


In that way you'll stay on the same page and your flash animation can loop/do whatever you want, but you'll load in the new content on a certain part of the page. So you'll update only part of the page instead of going to a whole new page.


There's a few ways to achieve this, but you'll need javascript to catch the events of the links, and adapt yr SS coding to it possibly (Director::is_ajax()). You might want to use the built-in prototype framework or look at other js libs such as mootools, jquery, yui...


However, having a site that works only with ajax definitely has a lot of drawbacks as well, so make sure it works without it first.


This would be a drastic thing to do though just to keep a looping header :), so maybe there is a way to pass some variables from one page to another in flash, so that the animation starts at the correct position everytime - thus creating a loop. Google?


Re the coda thing: well, it's basically just javascript as well, so look at some frameworks and their demo's. Almost all of them have some animation stuff in them.


Hope this somehow helps. :)

Avatar
sonicparke

74 Posts

19 June 2008 at 5:02am

Thanks. That does help. It could be that the header thing isn't worth it.

As far as the Coda effect. I know you can use javascript to do that but what I'm trying to wrap my head around is how to have SS output every page to one specific page that can be "slid" via the javascript. It's just one page that javascript moves around to different anchors.

Avatar
adiwidjaja

Community Member, 14 Posts

19 June 2008 at 6:19am

> but what I'm trying to wrap my head around is how to have SS output every page to one
> specific page that can be "slid" via the javascript.

Oh, that part is really easy: Just make something like an ArticleHolder (Tutorial 2) that lists all subpages. Then use something like this: http://stilbuero.de/jquery/tabs_3/ for the effect.

For this specific library, you need an unordered list and a div for each content. Something like this should work (beware, untested code):

<ul>
<% control AllChildren %>
<li><a href="#$URLPart">$Title</a></li>
<% end_control %s>
</ul>
<% control AllChildren %>
<div id="$URLPart">
$Content
</div>
<% end_control %>

I'm using "AllChildren" above, so you can uncheck the "show in menus" to suppress the display of the subpages in the tree. The sliding effect is implemented by the JS.

Cheers,

Andy