HighDots Forums  

Jquery UI Accordion Navigation

jQuery jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. jQuery is designed to change the way that you write JavaScript.


Discuss Jquery UI Accordion Navigation in the jQuery forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Richard D. Worth
 
Posts: n/a

Default Re: [jQuery] Re: Jquery UI Accordion Navigation - 11-07-2009 , 07:21 AM






It looks like you'll have to supply your own navigationFilter function:

http://docs.jquery.com/UI/Accordion#option-navigationFilter

The default is

navigationFilter: function() {
return this.href.toLowerCase() == location.href.toLowerCase();
}

which is trying to match the whole url, not the end, and not just the hash

- Richard

On Sat, Nov 7, 2009 at 3:49 AM, mehstg1319 <mehstg (AT) gmail (DOT) com> wrote:

Quote:
Right, All out of ideas now. :-(

Have changed the 1,2,3 etc to valid tokens and changed the NAME to ID.
But still no luck.

I sense I must be very close, but cannot work out why it does not
work.

Paul

On Nov 6, 5:15 pm, "Richard D. Worth" <rdwo... (AT) gmail (DOT) com> wrote:
h3><a name="1" class="menuLink" href="#1" tabindex="-1">Home</a></h3
...
h3><a name="2" class="menuLink" href="#2" tabindex="-1">About</a></h3
...
h3><a name="3" class="menuLink" href="#3"
tabindex="-1">Portfolio</a></h3

- Richard

On Fri, Nov 6, 2009 at 11:55 AM, mehstg1319 <meh... (AT) gmail (DOT) com> wrote:
I don't see any ID's or Names that don't start with a letter in my
code. :-s

P

On Nov 6, 4:50 pm, "Richard D. Worth" <rdwo... (AT) gmail (DOT) com> wrote:
ID and NAME tokens must begin with a letter ([A-Za-z])

On Fri, Nov 6, 2009 at 11:39 AM, mehstg1319 <meh... (AT) gmail (DOT) com
wrote:
Richard,

I have tried using ID's. Seems to make no difference, the
navigation
will still not work :-( I believe I may have the anchors slightly
wrong, but cannot work out what is wrong with them.

With regards to your second point about using a valid ID? I do not
understand, I don't see anything wrong with the names i have used?

P

On Nov 6, 1:43 pm, "Richard D. Worth" <rdwo... (AT) gmail (DOT) com> wrote:
Two suggestions:

1. use id instead of name

2. use a valid id. See

http://www.w3.org/TR/html4/types.html#h-6.2
"
ID and NAME tokens must begin with a letter ([A-Za-z]) and may be
followed
by any number of letters, digits ([0-9]), hyphens ("-"),
underscores
("_"),
colons (":"), and periods (".").
"

- Richard

On Fri, Nov 6, 2009 at 3:00 AM, mehstg1319 <meh... (AT) gmail (DOT) com
wrote:
Thanks very much

That has fixed that bug, silly mistake to make!!

The navigation still does not work however :-( i.e. if I go to
http://www.paulbraham.com/test_site/index.html#2itshouldopen on
the
second panel and if I go to
http://www.paulbraham.com/test_site/index.html#3
it should open on the third.

Any ideas what I have done wrong here?

Paul

On Nov 6, 1:42 am, "jquery.redsqu... (AT) googlemail (DOT) com"
jquery.redsqu... (AT) googlemail (DOT) com> wrote:
Your click function fail is due to the fact you hook the
event up
outside of a doc ready block. You can either change it to use
.live
or
move it after the accordion initialise call.

On Nov 5, 2:48 pm, mehstg1319 <meh... (AT) gmail (DOT) com> wrote:

Hi guys

I am working on the following sitehttp://
www.paulbraham.com/test_site/
and am having a few troubles with my JQuery Accordion.

Basically, I have turned on Navigation, and inserted three
anchors,
#1, #2 and #3 for the three sections that exist. Now in
theory,
i
could go to index.html#2 and it would load with section 2
open.
This
is not happening, and I cannot work out what is wrong with
my
code.

Also, I have used the following code to update the hash on
the
address
bar when a section is selected. This is so it is possible
to
bookmark
the website with a certain section open. This is also not
working.

$(".menuLink").click(function(event){
window.location.hash=this.hash;
});

If it helps, I found this tutorial, that shows it working
perfectly, I
just can't work out what is so different about mine!!


http://www.michaeljacobdavis.com/tutorials/statesavingaccordion/state.
..

Thanks in advance

Paul

Reply With Quote
  #12  
Old   
Richard D. Worth
 
Posts: n/a

Default Re: [jQuery] Re: Jquery UI Accordion Navigation - 11-07-2009 , 07:22 AM






And sorry I didn't realize we're on the wrong list. If you need any more
help, please start a new thread on the jQuery UI list:

http://groups.google.com/group/jquery-ui

Thanks.

- Richard

On Sat, Nov 7, 2009 at 7:21 AM, Richard D. Worth <rdworth (AT) gmail (DOT) com> wrote:

Quote:
It looks like you'll have to supply your own navigationFilter function:

http://docs.jquery.com/UI/Accordion#option-navigationFilter

The default is

navigationFilter: function() {
return this.href.toLowerCase() == location.href.toLowerCase();
}

which is trying to match the whole url, not the end, and not just the hash

- Richard

On Sat, Nov 7, 2009 at 3:49 AM, mehstg1319 <mehstg (AT) gmail (DOT) com> wrote:

Right, All out of ideas now. :-(

Have changed the 1,2,3 etc to valid tokens and changed the NAME to ID.
But still no luck.

I sense I must be very close, but cannot work out why it does not
work.

Paul

On Nov 6, 5:15 pm, "Richard D. Worth" <rdwo... (AT) gmail (DOT) com> wrote:
h3><a name="1" class="menuLink" href="#1" tabindex="-1">Home</a></h3
...
h3><a name="2" class="menuLink" href="#2" tabindex="-1">About</a></h3
...
h3><a name="3" class="menuLink" href="#3"
tabindex="-1">Portfolio</a></h3

- Richard

On Fri, Nov 6, 2009 at 11:55 AM, mehstg1319 <meh... (AT) gmail (DOT) com> wrote:
I don't see any ID's or Names that don't start with a letter in my
code. :-s

P

On Nov 6, 4:50 pm, "Richard D. Worth" <rdwo... (AT) gmail (DOT) com> wrote:
ID and NAME tokens must begin with a letter ([A-Za-z])

On Fri, Nov 6, 2009 at 11:39 AM, mehstg1319 <meh... (AT) gmail (DOT) com
wrote:
Richard,

I have tried using ID's. Seems to make no difference, the
navigation
will still not work :-( I believe I may have the anchors slightly
wrong, but cannot work out what is wrong with them.

With regards to your second point about using a valid ID? I do not
understand, I don't see anything wrong with the names i have used?

P

On Nov 6, 1:43 pm, "Richard D. Worth" <rdwo... (AT) gmail (DOT) com> wrote:
Two suggestions:

1. use id instead of name

2. use a valid id. See

http://www.w3.org/TR/html4/types.html#h-6.2
"
ID and NAME tokens must begin with a letter ([A-Za-z]) and may
be
followed
by any number of letters, digits ([0-9]), hyphens ("-"),
underscores
("_"),
colons (":"), and periods (".").
"

- Richard

On Fri, Nov 6, 2009 at 3:00 AM, mehstg1319 <meh... (AT) gmail (DOT) com
wrote:
Thanks very much

That has fixed that bug, silly mistake to make!!

The navigation still does not work however :-( i.e. if I go
to
http://www.paulbraham.com/test_site/index.html#2itshouldopenon
the
second panel and if I go to
http://www.paulbraham.com/test_site/index.html#3
it should open on the third.

Any ideas what I have done wrong here?

Paul

On Nov 6, 1:42 am, "jquery.redsqu... (AT) googlemail (DOT) com"
jquery.redsqu... (AT) googlemail (DOT) com> wrote:
Your click function fail is due to the fact you hook the
event up
outside of a doc ready block. You can either change it to
use
.live
or
move it after the accordion initialise call.

On Nov 5, 2:48 pm, mehstg1319 <meh... (AT) gmail (DOT) com> wrote:

Hi guys

I am working on the following sitehttp://
www.paulbraham.com/test_site/
and am having a few troubles with my JQuery Accordion.

Basically, I have turned on Navigation, and inserted three
anchors,
#1, #2 and #3 for the three sections that exist. Now in
theory,
i
could go to index.html#2 and it would load with section 2
open.
This
is not happening, and I cannot work out what is wrong with
my
code.

Also, I have used the following code to update the hash on
the
address
bar when a section is selected. This is so it is possible
to
bookmark
the website with a certain section open. This is also not
working.

$(".menuLink").click(function(event){
window.location.hash=this.hash;
});

If it helps, I found this tutorial, that shows it working
perfectly, I
just can't work out what is so different about mine!!


http://www.michaeljacobdavis.com/tutorials/statesavingaccordion/state.
..

Thanks in advance

Paul



Reply With Quote
  #13  
Old   
mehstg1319
 
Posts: n/a

Default Re: Jquery UI Accordion Navigation - 11-08-2009 , 11:48 AM



Cheers Richard. Have moved my post over to the Jquery-UI group. Have
made a little progress, but still no cigar. Cheers for the help.

P

On Nov 7, 12:22*pm, "Richard D. Worth" <rdwo... (AT) gmail (DOT) com> wrote:
Quote:
And sorry I didn't realize we're on the wrong list. If you need any more
help, please start a new thread on the jQuery UI list:

http://groups.google.com/group/jquery-ui

Thanks.

- Richard

On Sat, Nov 7, 2009 at 7:21 AM, Richard D. Worth <rdwo... (AT) gmail (DOT) com> wrote:

It looks like you'll have to supply your own navigationFilter function:

http://docs.jquery.com/UI/Accordion#option-navigationFilter

The default is

navigationFilter: function() {
* return this.href.toLowerCase() == location.href.toLowerCase();
}

which is trying to match the whole url, not the end, and not just the hash

- Richard

On Sat, Nov 7, 2009 at 3:49 AM, mehstg1319 <meh... (AT) gmail (DOT) com> wrote:

Right, All out of ideas now. :-(

Have changed the 1,2,3 etc to valid tokens and changed the NAME to ID.
But still no luck.

I sense I must be very close, but cannot work out why it does not
work.

Paul

On Nov 6, 5:15 pm, "Richard D. Worth" <rdwo... (AT) gmail (DOT) com> wrote:
h3><a name="1" class="menuLink" href="#1" tabindex="-1">Home</a></h3
...
h3><a name="2" class="menuLink" href="#2" tabindex="-1">About</a></h3
...
h3><a name="3" class="menuLink" href="#3"
tabindex="-1">Portfolio</a></h3

- Richard

On Fri, Nov 6, 2009 at 11:55 AM, mehstg1319 <meh... (AT) gmail (DOT) com> wrote:
I don't see any ID's or Names that don't start with a letter in my
code. :-s

P

On Nov 6, 4:50 pm, "Richard D. Worth" <rdwo... (AT) gmail (DOT) com> wrote:
ID and NAME tokens must begin with a letter ([A-Za-z])

On Fri, Nov 6, 2009 at 11:39 AM, mehstg1319 <meh... (AT) gmail (DOT) com
wrote:
Richard,

I have tried using ID's. Seems to make no difference, the
navigation
will still not work :-( I believe I may have the anchors slightly
wrong, but cannot work out what is wrong with them.

With regards to your second point about using a valid ID? I do not
understand, I don't see anything wrong with the names i have used?

P

On Nov 6, 1:43 pm, "Richard D. Worth" <rdwo... (AT) gmail (DOT) com> wrote:
Two suggestions:

1. use id instead of name

2. use a valid id. See

http://www.w3.org/TR/html4/types.html#h-6.2
"
ID and NAME tokens must begin with a letter ([A-Za-z]) and may
be
followed
by any number of letters, digits ([0-9]), hyphens ("-"),
underscores
("_"),
colons (":"), and periods (".").
"

- Richard

On Fri, Nov 6, 2009 at 3:00 AM, mehstg1319 <meh... (AT) gmail (DOT) com
wrote:
Thanks very much

That has fixed that bug, silly mistake to make!!

The navigation still does not work however :-( *i.e. if I go
to
http://www.paulbraham.com/test_site/index.html#2itshouldopenon
the
second panel and if I go to
http://www.paulbraham.com/test_site/index.html#3
it should open on the third.

Any ideas what I have done wrong here?

Paul

On Nov 6, 1:42 am, "jquery.redsqu... (AT) googlemail (DOT) com"
jquery.redsqu... (AT) googlemail (DOT) com> wrote:
Your click function fail is due to the fact you hook the
event up
outside of a doc ready block. You can either change it to
use
.live
or
move it after the accordion initialise call.

On Nov 5, 2:48 pm, mehstg1319 <meh... (AT) gmail (DOT) com> wrote:

Hi guys

I am working on the following sitehttp://
www.paulbraham.com/test_site/
and am having a few troubles with my JQuery Accordion.

Basically, I have turned on Navigation, and inserted three
anchors,
#1, #2 and #3 for the three sections that exist. Now in
theory,
i
could go to index.html#2 and it would load with section 2
open.
This
is not happening, and I cannot work out what is wrong with
my
code.

Also, I have used the following code to update the hash on
the
address
bar when a section is selected. This is so it is possible
to
bookmark
the website with a certain section open. This is also not
working.

$(".menuLink").click(function(event){
* * * * * * * * * window.location.hash=this.hash;
* * * * *});

If it helps, I found this tutorial, that shows it working
perfectly, I
just can't work out what is so different about mine!!

http://www.michaeljacobdavis.com/tutorials/statesavingaccordion/state.
..

Thanks in advance

Paul

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.