Hi Walt
I really appreciate your work on this action. It’s great (in FW5 beta,
too).
Is it possible to link into a particular pane of a carousel (other
than the top one, which shows by default) from another page?
Thanks
It should just work if you use an anchor, named for the ID of the
pane you wish to see first. Note that the page will scroll to the top
of the carousel if the page is taller than the window.
I have hacked this in the past to make it possible to use a
querystring for this purpose (which gets around the page scrolling
business), but it’s a tricky thing, and not possible directly in the
Action version of the script.
Walter
On Feb 25, 2008, at 9:42 AM, Jeff wrote:
Hi Walt
I really appreciate your work on this action. It’s great (in FW5 beta,
too).
Is it possible to link into a particular pane of a carousel (other
than the top one, which shows by default) from another page?
Thanks
Am I doing this right? I can’t add an anchor to the pane itself (Freeway doesn’t seem to like it having other divs on top), but I can add one if I select the first few letters of the text. Then I set the link to point to this anchor on the page. This does cause the page to scroll to the carousel, but the pane I want remains hidden.
Sorry, I should have been more clear. In XHTML, an anchor may refer
to either an explicit a name=“blah” anchor, or to the ID of any
element on the page. So all you need to do is find the ID of the pane
you want to link to. (Look in the Site pane when in Page view or the
Name field of the Inspector while the pane is selected.) Then
manually create a link to yourpage.html#yourpane
Walter
On Feb 26, 2008, at 11:48 AM, jeffstewart wrote:
Am I doing this right? I can’t add an anchor to the pane itself
(Freeway doesn’t seem to like it having other divs on top), but I
can add one if I select the first few letters of the text. Then I
set the link to point to this anchor on the page. This does cause
the page to scroll to the carousel, but the pane I want remains
hidden.
Thanks Walt, but I tried that, too. I've gone back and tried again, linking to the pane, its container and the tab, with no success. Then again, maybe my code is wrong.
The page I'm linking from is here:
Well that’s no good is it. Thought I could use html in here.
Never mind: what I was trying to say:
Thanks Walt, but I tried that, too. I’ve gone back and tried again, linking to the pane, its container and the tab, with no success. Then again, maybe my code is wrong.
The page I’m linking from is here: http://www.message-design.co.uk/oralot/index.html The link to the pane of the carousel is at the bottom right: stress management. Jeff
I see the correct pane content being shown, but the tab at the top
is not being selected. That’s going to take some manual fiddling, I
think.
What you need to do is (conditionally) set the initialSection
variable to the value of the anchor (if any).
Try hacking your page in a text editor to change the line that begins
“var my_glider = …” to read this way:
if(window.location.href.indexOf('#') > -1){
var my_glider = new Glider("carousel",{
duration:0.5,
initialSelection: window.location.href.split('#')[1]
};
}else{
var my_glider = new Glider("carousel",{
duration:0.5};
}
I’ll take a look at this later tonight if I get a chance, and see if
I can automate it. But for now, just see if this actually works.
Thanks,
Walter
On Feb 26, 2008, at 1:57 PM, jeffstewart wrote:
Well that’s no good is it. Thought I could use html in here.
Never mind: what I was trying to say:
Thanks Walt, but I tried that, too. I’ve gone back and tried again,
linking to the pane, its container and the tab, with no success.
Then again, maybe my code is wrong.
The page I’m linking from is here: http://www.message-design.co.uk/
oralot/index.html The link to the pane of the carousel is at the
bottom right: stress management. Jeff
I see the correct pane content being shown, but the tab at the top
is not being selected.
Yes. I tried your code, but it doesn’t seem to work.
I don’t know anything about script, but it does look to me like there should be some closing ) after the = new Glider(
But putting them in what seemed to be the right place didn’t help either.
if(window.location.href.indexOf('#') > -1){
var my_glider = new Glider("carousel",{
duration:0.5,
initialSelection: window.location.href.split('#')[1]
});
}else{
var my_glider = new Glider("carousel",{
duration:0.5});
}
Hope this works for you.
Walter
On Feb 26, 2008, at 3:51 PM, jeffstewart wrote:
On 26 Feb. 2008, 6:39 pm, waltd wrote:
I see the correct pane content being shown, but the tab at the top
is not being selected.
Yes. I tried your code, but it doesn’t seem to work.
I don’t know anything about script, but it does look to me like
there should be some closing ) after the = new Glider(
But putting them in what seemed to be the right place didn’t help
either.
You need to take out the var my_glider = part from the beginning of
the line. If you look inside the if statement, you’ll see that we set
it inside there.
That line should start off with the word ‘if’.
Walter
On Feb 26, 2008, at 4:01 PM, Walter Lee Davis wrote:
Sorry. You are correct about the problem:
if(window.location.href.indexOf(‘#’) > -1){
var my_glider = new Glider(“carousel”,{
duration:0.5,
initialSelection: window.location.href.split(‘#’)[1]
});
}else{
var my_glider = new Glider(“carousel”,{
duration:0.5});
}
Hope this works for you.
Walter
On Feb 26, 2008, at 3:51 PM, jeffstewart wrote:
On 26 Feb. 2008, 6:39 pm, waltd wrote:
I see the correct pane content being shown, but the tab at the top
is not being selected.
Yes. I tried your code, but it doesn’t seem to work.
I don’t know anything about script, but it does look to me like
there should be some closing ) after the = new Glider(
But putting them in what seemed to be the right place didn’t help
either.
Hmmm. It seems as though it’s not firing when the page loads. Try this:
if(window.location.href.indexOf('?') > -1){
var my_glider = new Glider("carousel",{
duration:0.5,
initialSelection: window.location.href.split('?')[1]
});
}else{
var my_glider = new Glider("carousel",{
duration:0.5});
}
And then change the # (hash mark) into a question mark, so your URL
is like this:
Forgot to mention, this functionality has been rolled into the latest
release of Protaculous. You no longer need to hack this by hand. If
you add a querystring reference to the carousel pane you want to be
initially selected, then as soon as the page loads, it will scroll
into view (and without forcing the page to scroll down to the top of
your carousel element either!).
Just create a manual link, there’s no other shortcut that I know of.
Using SCS for this is a bit like hitting a fly with a sledgehammer.
Just enter the link in the Manual side of the dialog, and add the
querystring there.