[jQuery] Jquery UI Tabs FX only working in one direction

2009-11-23 Thread mehstg1319
Hi Guys

Just a quick one. I have a site that features a Jquery UI Tab widget
within one section of an Accordion. I am having a problem with the
effects on this Tab only working when navigating backwards in the list
(i.e. going tab 3, tab 2, tab 1).

When I run forwards through the list of tabs, the effect does not work
and it just jumps between the tabs like no effect is specified.

The tabs can be found here: http://www.paulbraham.com/new_test/#content=2

Also, my site uses the Jquery BBQ plugin to keep a history of where
the user has been (for the back button and bookmarking). I am not sure
if this is causing the effects issue.

Thanks in advance

Paul


[jQuery] Re: Jquery UI Accordion Navigation

2009-11-08 Thread mehstg1319
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"  wrote:
> 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  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  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"  wrote:
> >> > Home
> >> > ...
> >> > About
> >> > ...
> >> >  >> tabindex="-1">Portfolio
>
> >> > - Richard
>
> >> > On Fri, Nov 6, 2009 at 11:55 AM, mehstg1319  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"  wrote:
> >> > > > ID and NAME tokens must begin with a letter ([A-Za-z])
>
> >> > > > On Fri, Nov 6, 2009 at 11:39 AM, mehstg1319 
> >> 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"  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 
> >> 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...@googlemail.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
> >> u

[jQuery] Re: Jquery UI Accordion Navigation

2009-11-07 Thread mehstg1319
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"  wrote:
> Home
> ...
> About
> ...
> Portfolio
>
> - Richard
>
> On Fri, Nov 6, 2009 at 11:55 AM, mehstg1319  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"  wrote:
> > > ID and NAME tokens must begin with a letter ([A-Za-z])
>
> > > On Fri, Nov 6, 2009 at 11:39 AM, mehstg1319  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"  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  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...@googlemail.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  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


[jQuery] Re: Jquery UI Accordion Navigation

2009-11-06 Thread mehstg1319
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#2 it should open 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...@googlemail.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  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


[jQuery] Jquery Accordion and History

2009-11-04 Thread mehstg1319
Hey

Trying to implement JQuery on a website I am working on, basically,
the whole front page is one big accordion and clicking on the various
bars opens and closes the sections. Like this example.

This all works perfectly, but like all javascript, if the user clicks
the back button, it does not keep a history of the changes.

I understand there are plugins like Jquery History and Jquery-BBQ that
I can use, but I cannot work out how to implement them!

The code I wrote for my accordion is as follows:
Code:

  $(document).ready(function(){
$(".bodyText").hide();
$("a h3").click(function(){
if($(this).is('.active')) {
$(this).toggleClass("active");
$(this).parent().parent().next(".bodyText").slideToggle();
return false;
} else {
$(".bodyText:visible").slideUp("slow");
$("h3.active").removeClass("active");
$(this).toggleClass("active");
$(this).parent().parent().next(".bodyText").slideToggle();
return false;
}
});
});

Pretty simple code really, and does what I want. Just want to get some
kind of history, so if the user uses the back button, they nav back
through the site.

Any ideas?


[jQuery] Jquery tree menu Ul Li Ul

2009-01-22 Thread mehstg1319

Hi everybody

Just looking for a couple of words of advice really as I haven't seen
anything on the web that seems to fit what I am looking for.

Basically...I have built a two tier menu system using Jquery to show
and hide the second level when certain parts are clicked.

I was wondering if it was possible to have it's state stay the same
between pages on the site. I.e. have a second level stay open after a
link is clicked and the page changes.

At the moment, as soon as the page changes, the menu closes back up to
default state, which is what would be expected.

My code is as follows.

$(document).ready(function() {
//Hides Level 2 Menu Tree Elements
$("div#leftnav > ul > li > ul").hide();

// TREE MENU EVENT
$("div#leftnav > ul > li > a").click(function(event) {
if ($(this).attr("href") == "#" ) {
event.preventDefault();
if ($(this).next().is("ul") == true ) {
var classCheck = $(this).attr("class");

$("ul").filter(".active").hide("slow");
$("ul").filter(".active").removeClass();
$("a").removeClass("active");

if (classCheck != "active") {
$(this).addClass("active");
$(this).next("ul").addClass("active");
$("ul").filter(".active").show("slow");
}
}
else
{
$("ul").filter(".active").hide("slow");
$("ul").filter(".active").removeClass();
$("a").removeClass("active");
}
}
})
})


Paul