[jQuery] Re: know if a css stylesheet is load

2008-01-31 Thread Jeffrey Kretz
You can access it with document.styleSheets in most browsers.  See

 

http://www.quirksmode.org/dom/w3c_css.html

 

For more details.

 

JK

 

  _  

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of sebastianw wurtz
Sent: Thursday, January 31, 2008 7:38 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: know if a css stylesheet is load

 

yap im loading the css dynamically, and my problem is that i have the same
css loaded more than one time.

- Mensaje original 
De: Hamish Campbell <[EMAIL PROTECTED]>
Para: jQuery (English) 
Enviado: viernes 1 de febrero de 2008, 0:10:13
Asunto: [jQuery] Re: know if a css stylesheet is load


You can check for the current css property value of an element - so,
for example, you could set the background color of a hidden object and
see check that value at run time.

Are you loading css sheets dynamically?

On Feb 1, 1:21 pm, Yahoo <[EMAIL PROTECTED]> wrote:
> Theres any way with jquery to know if a stylesheet is loaded?
>
> ex.
> style_exist("min_size")

 

 

  _  


Los referentes más importantes en compra/venta de autos se juntaron:
Demotores y Yahoo!. Ahora comprar o vender tu auto es más fácil. 
Visitá http://ar.autos.yahoo.com/



[jQuery] malsup cycle plugin

2008-01-31 Thread kylebuttress

Hello,

i'm using http://www.malsup.com/jquery/cycle/ plugin and trying to get
the fit: 1 option to work.

I assume that this complete functional and work with jquery 1.2.2

thanks


[jQuery] dimensions height/width bug

2008-01-31 Thread Eridius


http://brandonaaron.net/docs/dimensions/#sample-2

if you click on the run for height() or width() you will see the screen
flicker(tested on FF) and I am getting that same error on my page and it
only t=seems to happen for those 2 function(like offset which I am also
using works fine.  anyone know about this issue.  I am use dimensions REV
4257.
-- 
View this message in context: 
http://www.nabble.com/dimensions-height-width-bug-tp15220351s27240p15220351.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Datepicker showon link click

2008-01-31 Thread pedalpete

Hi Roman,

I thought clicking a link with datepicker was the default.

I've got it working with this
[ code]
$('.date-pick').datePicker({clickInput:true});
[/code]

class="date-pick is assigned to an input field that I have hidden with
the css, so only the default text is shown.

The default text is defined in the datepicker.js with the
"TEXT_CHOOSE_DATE" option.

I hope that helps
Pete


[jQuery] Re: know if a css stylesheet is load

2008-01-31 Thread sebastianw wurtz
yap im loading the css dynamically, and my problem is that i have the same css 
loaded more than one time.

- Mensaje original 
De: Hamish Campbell <[EMAIL PROTECTED]>
Para: jQuery (English) 
Enviado: viernes 1 de febrero de 2008, 0:10:13
Asunto: [jQuery] Re: know if a css stylesheet is load


You 
can 
check 
for 
the 
current 
css 
property 
value 
of 
an 
element 
- 
so,
for 
example, 
you 
could 
set 
the 
background 
color 
of 
a 
hidden 
object 
and
see 
check 
that 
value 
at 
run 
time.

Are 
you 
loading 
css 
sheets 
dynamically?

On 
Feb 
1, 
1:21 pm, 
Yahoo 
<[EMAIL PROTECTED]> 
wrote:
> 
Theres 
any 
way 
with 
jquery 
to 
know 
if 
a 
stylesheet 
is 
loaded?
>
> 
ex.
> 
style_exist("min_size")






  Yahoo! Encuentros.

Ahora encontrar pareja es mucho más fácil, probá el nuevo Yahoo! Encuentros 
http://yahoo.cupidovirtual.com/servlet/NewRegistration

[jQuery] Re: absolute beginner! How to set page width to window width?

2008-01-31 Thread [EMAIL PROTECTED]

Thank you, Sam :) Unfortunately I can't work out how to use it 
I did find a plugin called autoscale that worked great, but threw an
error in ie7.

So I suppose my question is: How do I get the window width into the
element style, using the dimensions plugin??

Sorry about this. I promise I'll learn quickly :/

On Feb 1, 12:11 am, "Sam Sherlock" <[EMAIL PROTECTED]> wrote:
> have a look athttp://brandonaaron.net/docs/dimensions/
>
> On 31/01/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>  setting the width of my #pagewrap div to the
> > inner width of the user's window.


[jQuery] [validate] does maxLength(20) supported in textarea?

2008-01-31 Thread Jacky
I tried to do this



But it doesn't work.
So I guess it's not supported in textarea and I will need to add method?
-- 
Best Regards,
Jacky
網絡暴民 http://jacky.seezone.net


[jQuery] script tags not evaluated in $.ajax

2008-01-31 Thread Evan McLain

The documentation for $.ajax states that script tags are evaluated
when doing an $.ajax call:
http://docs.jquery.com/Ajax/jQuery.ajax#options

dataType:
   "html": Returns HTML as plain text; included script tags are
evaluated.

However, that doesn't seem to be the case.  My test case is below.  If
the scripts were being executed, I would expect two alerts: the first
"ajax" and the second "done".  Instead I just see "done", both in FF2
and IE7.

I've also tried setting variables in the ajax page and reading them in
the main page (in case there was some anomaly with alert()), but that
didn't work either.

Thanks!
Evan



Hello world.




$(document).ready(function () {
$.ajax({
url: '/test_ajax.html',
cache: false,
dataType: 'html',
success: function (data) {
alert('done');
},
});
});





alert('ajax');





[jQuery] Re: know if a css stylesheet is load

2008-01-31 Thread Hamish Campbell

You can check for the current css property value of an element - so,
for example, you could set the background color of a hidden object and
see check that value at run time.

Are you loading css sheets dynamically?

On Feb 1, 1:21 pm, Yahoo <[EMAIL PROTECTED]> wrote:
> Theres any way with jquery to know if a stylesheet is loaded?
>
> ex.
> style_exist("min_size")


[jQuery] Re: Is it possible to auto increment an appended value?

2008-01-31 Thread Gorkfu

How would I create a cap to put on the counter, so it doesn't go
higher than 250? Thanks

On Jan 28, 2:10 pm, Gorkfu <[EMAIL PROTECTED]> wrote:
> Well the error had nothing to do with the javascript, I checked it in
> the lint. The php was causing the problem... It seems to be an issue
> with using OOP style php for what I wanted to do. I'll either have to
> recode that portion in procedural style or figure something else out.
> Thanks again, Charles.


[jQuery] Re: absolute beginner! How to set page width to window width?

2008-01-31 Thread [EMAIL PROTECTED]

You're right of course, Chris. I wanted to practise jQuery by getting
the layout to do some clever stuff ... once I've mastered the VERY
basics!

Thank you :)

On Jan 31, 10:37 pm, chrismarx <[EMAIL PROTECTED]> wrote:
> just set your div width and height to 100%


[jQuery] Re: absolute beginner! How to set page width to window width?

2008-01-31 Thread [EMAIL PROTECTED]

Thank you, Hamish! That doesn't use any plugin, does it?
Problem, though ... ie7's hiding all my text!!

Can you see what's wrong?
http://client-2.co.uk

On Jan 31, 10:13 pm, Hamish Campbell <[EMAIL PROTECTED]> wrote:
> $(document).ready(function(){
>$(window).resize(function(){
>   $('#pagewrap').width($(window).width());
>});
>
> });
>


[jQuery] Re: Interface Plugin for Jquery

2008-01-31 Thread Charles K. Clarkson

[EMAIL PROTECTED] wrote:

:  I start getting errors in my firefoy error console.
: Can someone please tell how can i solve this problem .

What errors are you getting?



HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
Free Market Advocate
Web Programmer

254 968-8328

http://www.clarksonenergyhomes.com/wordpress/about/



[jQuery] Validation plugin -- need help attaching 'pending' label and one other issue

2008-01-31 Thread Rus Miller

I apologize for the double post.  This subject line is a little more
specific.

I'm trying to do two things that seem as if they should be very simple
(for somebody who has a little more experience than me, that is):

1. Attach a pending label to a currently validating field, like the
error and checked labels
2. Prevent validation on a field with validation rule, but which is
optional and empty.

Can somebody please help me with a concrete answer or a code example?

Thanks,
Rus


[jQuery] Re: Superfish feature request

2008-01-31 Thread Joel Birch

Karl,

I'm honoured that you are getting some use out of Superfish.

I didn't want to give you more work so I just gave the horizontal
stuff a shot and I can't get it right. I just can't get my head around
all these similar sounding measurements! Would you be so kind...?  O:)

Here's where I got to, just for a giggle:

onBeforeShow = function(){
this.each(function(){
var $u = $(this);
$u.css('display','block');
var windowWidth = $w.width(),
offsetLeft = $u.offset().left,
menuWidth = $u.width(),
totalWidth = menuWidth + _offset('x'),
parentWidth = $u.parents('ul').width(); /*I've lost 
where to use this*/
var expandLeft = (offsetLeft + menuWidth > totalWidth);
if (expandLeft) {
$u.css('margin-left','-' + totalWidth - (menuWidth +
offsetLeft)+'px'); /*this ain't right*/
}

var windowHeight = $w.height(),
offsetTop = $u.offset().top,
menuHeight = $u.height(),
baseline = windowHeight + _offset('y');
var expandUp = (offsetTop + menuHeight > baseline);
if (expandUp) {
$u.css('margin-top', baseline - (menuHeight + 
offsetTop));
}
$u.css('display','none');
});
}

Many thanks,
Joel.


[jQuery] tablesorter problem with datetime

2008-01-31 Thread Will Arp


descending sort of a column with
datetime values results in:

31-Jan-2008/9:42:08
31-Jan-2008/13:15:35

should be:

31-Jan-2008/13:15:35
31-Jan-2008/9:42:08

thank you!
-will




[jQuery] Re: Interface Plugin for Jquery

2008-01-31 Thread Joel Birch

Hi Rodolfo,

Interface is no longer supported. I think you need to use the newer UI
library instead nowadays.

Joel BIrch.


[jQuery] Re: Superfish feature request

2008-01-31 Thread Karl Swedberg


On Jan 31, 2008, at 8:50 PM, Joel Birch wrote:



Hi Karl,

Once again you have come through with the goods! I blindly pasted in
your code (all these dimension calculations fry my brain) and it's
working perfectly with regard to positioning. All hail King Karl
[...we're not worthy...]


LOL. You are too funny!

Your Superfish plugin is really fantastic, by the way. I've been using  
it on a couple sites, and the clients are duly impressed. :-)


Anyway, I'm really glad it's working for you. Don't forget to mirror  
those changes for the scrollLeft calculations as well. Unless you want  
me to do that. I'd be happy to.



All we (Jesse and I, that is - I'm not hinting for Karl to do it!)

need to do now is rewrite the z-index code so that revealed submenus
always appear above the rest of the menu. Then I think we can put this
little exercise to bed.

Zip archive (linked above) and test page has been updated.


Great news. Congrats!


--Karl


[jQuery] Re: Return False Failing In IE6

2008-01-31 Thread Joel Birch

It's probably because console.log is a Firebug-only thing so IE spits
the dummy and doesn't read the rest of the function which contains the
return false. Remove the console.log and it should work.

Joel Birch.


[jQuery] Re: Superfish Help Required

2008-01-31 Thread Joel Birch

Doh, just as I clicked send I realised you wanted the solution for
when JS was *not* available. I guess you could use
display:none/display:block in your CSS along side the necessary 'top'
values, and then use the callbacks as shown above, but with opposite
effects. This way, when JS is available, the callbacks will negate the
display:none stuff and just use 'top', but the display:none will still
be there when JS is unavailable.

Did that make sense? I rushed it out to cover my previous post's error ;)

Joel Birch.


[jQuery] Re: Superfish Help Required

2008-01-31 Thread Joel Birch

Hmmm, a fix? I think of it as a feature actually, as the links have
more chance of remaining accessible to screen-readers and the like if
you don't use display:none. Untested by me, but it's a common theory.

You could try  attaching your display:none/display:block to the onHide
and onBeforeShow callbacks, respectively.

$('.nav').superfish({
/* your other options here, and then add... */
onBeforeShow : function() {
$(this).show(); /*easier than display:none*/
},
onHide : function() {
$(this).hide(); /*easier than display:none*/
}
});

This is untested, but it *should* work. Good luck.

Joel Birch.


[jQuery] Re: Superfish feature request

2008-01-31 Thread Joel Birch

Hi Karl,

Once again you have come through with the goods! I blindly pasted in
your code (all these dimension calculations fry my brain) and it's
working perfectly with regard to positioning. All hail King Karl
[...we're not worthy...]

All we (Jesse and I, that is - I'm not hinting for Karl to do it!)
need to do now is rewrite the z-index code so that revealed submenus
always appear above the rest of the menu. Then I think we can put this
little exercise to bed.

Zip archive (linked above) and test page has been updated.

Cheers
Joel Birch.


[jQuery] Re: Superfish Help Required

2008-01-31 Thread Dave Buchholz - I-CRE8




On 31/1/08 12:26, "Joel Birch" <[EMAIL PROTECTED]> wrote:

> 
> Hi Dave,
> 
> Instead of display:none and display:block to hide and reveal your
> submenus you need to use top:-999em and top:1.5em (or whatever the
> vertical offset you need for your menu) respectively. The only other
> thing you need to once you have swaped 'display' for 'top' is that you
> will need position:relative on your li elements so that the top offset
> you add to the ul elements is relative to their parent list items.
> 
> Tested in Firebug and works perfect. Good luck.
> 
> Joel Birch.

Joel,

Another question if I may, if I want to use display none to prevent the
dropdowns being tabbed through when they are not visible when js is not
present then the animations do not work when js is available is there a fix
for this ?


Regards,


Dave Buchholz
I-CRE8
http://www.i-cre8.co.uk
Skype: I-CRE8




[jQuery] Re: newbiish.. must be a better way than what I'm doing to find the next div after the following inputs?

2008-01-31 Thread rickcr



On Jan 31, 4:57 pm, "Richard D. Worth" <[EMAIL PROTECTED]> wrote:
> Hmm. It worked for me. I actually tested it. :) $(this).parent() selects the
>  tag. .nextAll() gets all the next elements (forward siblings), then the
> 'div:first' filter finds the first one that's a div. Oh well, Glen's
> solution is fine.
>
> - Richard

Richard, thanks for much for replying back, since you made me realize
I had screwed up (shocker there:), but more importantly I now really
need your solution, because I changed the div structure a bit to the
following, and your solution now works perfectly. (The other one by
Glen was perfect as well for the initial scenario I proposed, but now
since I changed the structure, yours really helps out.)




//might have other divs inside



//might have other divs inside



//might have other divs inside

 


 $(".hasHidden").click( function () {
  $.clearHideStuff( jQuery(this).parent().nextAll("div:first"),
jQuery(this)  );
 });

(I know I could do the select on the checkbox but this stuff in real
life is dynamic and it applies the class to different types of inputs)

Thanks again.


[jQuery] Re: absolute beginner! How to set page width to window width?

2008-01-31 Thread [EMAIL PROTECTED]

Ignore me, I found this:
http://plugins.jquery.com/project/autoscale :D

Next, how to limit the maximum size? I know I've seen a post on that
in here 
I'm going to like jQuery :)

On Jan 31, 8:48 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> setting the width of my #pagewrap div to the
> inner width of the user's window.


[jQuery] [validate] Merging min/max to range reduces usability

2008-01-31 Thread Blair McBride

>From the Validation Plugin v1.2 changelog:

* Added feature to merge min + max into and range and minlength +
maxlength into rangelength


While a great idea, this unfortunately means its impossible to have
separate error messages if needed. Personally, I prefer to use
separate error messages when using a wide range - I think this makes
it more usable to the end-user.

For example, showing "Please enter at least 2 characters" is far more
usable than showing "Please enter between 2 and 1000 characters".

I'm not suggesting the complete removal of this behavior, just to give
an option to either enable or disable it.

Until then, its a simple enough hack to just remove/comment-out the
relevant part of the normalizeRules function.


[jQuery] Re: absolute beginner! How to set page width to window width?

2008-01-31 Thread chrismarx

im not sure you really need jquery for this, or at least not much.
just set your div width and height to 100%

$("yourDiv").css({width:"100%",height:"100%"});

On Jan 31, 3:48 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Hello :)
>
> Thanks for the multitude of helpful threads you people post!
>
> Before trying something gorgeous with jQuery, I thought I should try
> something basic - like setting the width of my #pagewrap div to the
> inner width of the user's window. I can't do it right!
>
> Please will you show me how to do it? And, if you're feeling generous,
> how to make it resize if the user resizes their viewport?
>
> Cheers -
> Cherry.


[jQuery] Interface Plugin for Jquery

2008-01-31 Thread [EMAIL PROTECTED]

Hello everyone, my name is Rodolfo  and i am a student at the dresden
university of technology (Germany)
could someone please tell me how do i make this plugin to work
correctly i have downloaded the hole source and I linked it to my html
archive:




but when i execute an animation or just do something for example:

$("#caller").click(function(){
   $('#container').Shake(2);

});

 I start getting errors in my firefoy error console.
Can someone please tell how can i solve this problem . thank very much

Rodolfo


[jQuery] Return false on a link in IE

2008-01-31 Thread HappyCamper

Return false seems to work on buttons but not links in IE. Is this a
known bug? Am I just noobin out here?

What can I do to work around it?


[jQuery] Re: getScript making multiple calls

2008-01-31 Thread pedalpete

This is awesome Feed,
I was having the exact same problem.

The reason why it loads multiple times (it seems to me) is that jquery
is appending the new objects to the previous list it holds when the
function is run.
Not sure if this is a jquery error, or just the way things are
supposed to be.

However, I am having a problem unbinding the events tied to the
jqueryForm plugin.

my jqueryForm is called with the function addAJAX(), but using $
(this).unbind('addAJAX()') or $(this).unbind('addAJAX') does not seem
to work, nor does (this).unbind('submit').

Any ideas?
Here's my code
[code]
function addType(){$(".create").click(function(event) {
id = this.id;
var posTop = event.pageY;
var posLeft = event.pageX;
var formID = "#createForm";
$.ajax({
type: "GET",
url: "processes/addType.php",
data: "gid="+id,
success: function(response){
$(formID).css({ position: 'absolute', 
top: posTop, left:
posLeft });
$(formID).fadeIn("slow").html(response);
addAJAX();
cancelForm(formID);
refreshClicking();
}
});
$(this).unbind('click');
});
};
// prepare the form when the DOM is ready
function addAJAX(){
var options = {
target:'#createForm',   // target element(s) to be
updated with server response
success:  showResponse
};

// bind to the form's submit event
$('#createForm').submit(function() {
// inside event callbacks 'this' is the DOM element so we
first
// wrap it in a jQuery object and then invoke ajaxSubmit
$(this).ajaxSubmit(options);

// !!! Important !!!
// always return false to prevent standard browser submit and
page navigation
return false;
});


// pre-submit callback
function showRequest(formData, jqForm, options) {
// formData is an array; here we use $.param to convert it to a
string to display it
// but the form plugin does this for you automatically when it
submits the data
var queryString = $.param(formData);

// jqForm is a jQuery object encapsulating the form element.  To
access the
// DOM element for the form do this:
// var formElement = jqForm[0];

  alert('About to submit: \n\n' + queryString);


// here we could return false to prevent the form from being
submitted;
// returning anything other than false will allow the form submit
to continue

}

// post-submit callback
function showResponse(options)  {
// for normal html responses, the first argument to the success
callback
// is the XMLHttpRequest object's responseText property

// if the ajaxSubmit method was passed an Options Object with the
dataType
// property set to 'xml' then the first argument to the success
callback
// is the XMLHttpRequest object's responseXML property

// if the ajaxSubmit method was passed an Options Object with the
dataType
// property set to 'json' then the first argument to the success
callback
// is the json data object returned by the server


$.ajax({

type: "GET",
url: "processes/getgroups.php",
data: "cid="+cid,
success: function(response2){
$(".groups").html(response2);
$("#createForm").fadeOut("slow");
refreshClicking();

}

});
$(this).unbind('addAJAX');

};
};
[/code]


[jQuery] Return False Failing In IE6

2008-01-31 Thread HappyCamper

$("#addedRules").append('remove');
$('.removeRule').click(function(){
$(this).parent().remove();
console.log('removed rule');
return false;
});


In IE6 the rule is removed, but the link isn't disabled. Any ideas?


[jQuery] Re: absolute beginner! How to set page width to window width?

2008-01-31 Thread Hamish Campbell

$(document).ready(function(){
   $(window).resize(function(){
  $('#pagewrap').width($(window).width());
   });
});

The margin and padding of the body needs to be set to 0 for this to
work properly. Note that as soon as you start adding borders to
#pagewrap you're going to get problems. Also not sure how this looks
in anything other than IE7.

Also note that different browsers handle the resize functionality
different - IE7 will fire it as you resize, FF2 only on finished the
resize (I think), so be carefull.

On Feb 1, 9:48 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hello :)
>
> Thanks for the multitude of helpful threads you people post!
>
> Before trying something gorgeous with jQuery, I thought I should try
> something basic - like setting the width of my #pagewrap div to the
> inner width of the user's window. I can't do it right!
>
> Please will you show me how to do it? And, if you're feeling generous,
> how to make it resize if the user resizes their viewport?
>
> Cheers -
> Cherry.


[jQuery] Re: contents().height() in FF

2008-01-31 Thread Sebioff

Uh, allright, I'm sorry...I guess I found a solution.
The trick is to wrap the content in a span, and then retrieve the
spans height.
But still, I guess if contents().height() (which sounds so logical to
retrieve the contents height, don't you think) works in Internet
Explorer it should work in Firefox as well (or it shouldn't give any
nasty exceptions, at least)...

If someone got an even easier way than the span-wrapping I'd be glad
to hear about!

On 31 Jan., 22:14, Sebioff <[EMAIL PROTECTED]> wrote:
> Hi,
> i've got a div with overflow:auto.
> I want to check whether the content of the div is higher than the div
> itself (in order to know whether I need to show a "scroll down" link
> or not).
>
> In Internet Explorer with jQuery 1.2.2. I can get the contents height
> without any problem with:
> $("#div").contents().height()
>
> (I don't know if this is the best way to do it, but it's the only one
> I found...)
> The problem is, in Firefox it doesn't work and all I get is the
> following error message:
>
> Fehler: [Exception... "Could not convert JavaScript argument"
> nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"  location: "JS
> frame ::http://www.rakuun.de/Stuff/Schasler/jquery-1.2.2.js::
> anonymous :: line 853"  data: no]
> Quelldatei:http://www.rakuun.de/Stuff/Schasler/jquery-1.2.2.js
> Zeile: 853
>
> You can try it out yourself 
> here:http://www.rakuun.de/Stuff/Schasler/content_height_test.html
>
> Any idea how to fix this or how to get the contents height in a way
> that works in both browsers?


[jQuery] Re: Fighting a closure

2008-01-31 Thread Charles K. Clarkson

timothytoe wrote:

: This next one is obviously a work of JavaScript art (as opposed to the
: former, which is a more jQuery solution).

Actually, it's very jQuery-ish. We can use a similar form to add
custom methods to the jQuery object.



: Does anyone want to explain it?
: 
:  for ( i=0;i<5;i++ ) {
: (function(num) {
: $("#port"+num).click(function() { bigchart(num) });
: })(i);
:  }

In javascript, you can force a block of code to run by wrapping it in
two sets of parentheses ( ... code ... )(). For example, this function will
not run
until it is called and being anonymous (it has not been assigned to a
variable) there is no way to call it:

function(num) {
   $("#port"+num).click(function() { bigchart(num) });
};

But, if I wrap it in parenthesis like this, it will run as it is
encountered.

(function(num) {
   $("#port"+num).click(function() { bigchart(num) });
})();

The problem is that num remains undefined. To define it we can pass
a value in the second parenthesis. This set of five routines will run
for each value 0 through 4.

(function(num) {
   $("#port"+num).click(function() { bigchart(num) });
})(0);

(function(num) {
   $("#port"+num).click(function() { bigchart(num) });
})(1);

(function(num) {
   $("#port"+num).click(function() { bigchart(num) });
})(2);

(function(num) {
   $("#port"+num).click(function() { bigchart(num) });
})(3);

(function(num) {
   $("#port"+num).click(function() { bigchart(num) });
})(4);

That's an awful lot to type. To bad we aren't programmers, then we
could write a loop to step through the values passed to ... Hey, we are
programmers! Carpenters of the future and all that.

for ( i = 0; i < 5 ;i++ ) {
   (function(num) {
   $("#port"+num).click(function() { bigchart(num) });
   })(i);
}


HTH,

Charles K. Clarkson
-- 
Mobile Homes Specialist
Free Market Advocate
Web Programmer

254 968-8328

http://www.clarksonenergyhomes.com/wordpress/about/



[jQuery] Re: Validate 1.2 Questions

2008-01-31 Thread Jörn Zaefferer


Priest, James (NIH/NIEHS) [C] schrieb:

[...]

(2) How do you indicate dependencies within the markup, as opposed to
within the plugin call? In other words, if I have a group of radio
buttons, and a text input that is only required if a certain radio
button is checked, can I add something to the markup of the text input
to indicate that?




I haven't done that but I think you could use the visible example like
I've shown above to do something similar:

elementwhichischecked: {required: "#parentelement:checked"}

Or something along those lines...
  
I recommend using custom methods to encapsulate the logic for such 
dependency checks, that way you'll just have to use that method in the 
markup and no code at all.


Jörn


[jQuery] Re: Email validation broken in plugin v1.2?!

2008-01-31 Thread Jörn Zaefferer


Scott González schrieb:

Please, don't do that.  The modified regex you provided is way over
simplified.  I'll try to produce the regex you want, it should be as
easy as making the domain label required in the host name.
  
1.2.1 will include email validation that requires the tld, providing the 
current implementation via additional methods. Same goes for the url 
validation.


Jörn


[jQuery] [Validation] One request and one issue...please help?

2008-01-31 Thread Rus Miller

I'm trying to do two things that seem as if they should be very simple
(for somebody who has a little more experience than me, that is):

1. Attach a pending label to a currently validating field, like the
error and checked labels
2. Prevent validation on a field with validation rule, but which is
optional and empty.

Can somebody help me with a concrete answer or a code example?

Thanks,
Rus


[jQuery] Re: absolute beginner! How to set page width to window width?

2008-01-31 Thread Sam Sherlock
have a look at http://brandonaaron.net/docs/dimensions/

On 31/01/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> Hello :)
>
> Thanks for the multitude of helpful threads you people post!
>
> Before trying something gorgeous with jQuery, I thought I should try
> something basic - like setting the width of my #pagewrap div to the
> inner width of the user's window. I can't do it right!
>
> Please will you show me how to do it? And, if you're feeling generous,
> how to make it resize if the user resizes their viewport?
>
> Cheers -
> Cherry.
>


[jQuery] know if a css stylesheet is load

2008-01-31 Thread Yahoo


Theres any way with jquery to know if a stylesheet is loaded?

ex.
style_exist("min_size")




[jQuery] Re: Fighting a closure

2008-01-31 Thread timothytoe

Ah, that makes sense. Thanks.

On Jan 31, 4:04 pm, Danny <[EMAIL PROTECTED]> wrote:
> Depends on what you're trying to do. In your case, the index and the
> value are identical, but next time they may not be:
> $.each( ['a','b','c'], function (index, val){
>   // index is 0...1...2, val is 'a'...'b'...'c'
>
> });
>
> On Jan 31, 3:40 pm, timothytoe <[EMAIL PROTECTED]> wrote:
>
> > $.each( [0,1,2,3,4], function(index, num) {
> > $("#port"+num).click(function() { bigchart(num); });
>
> > });
>
> > Wait. What's the "index" in there for. I don't need that, do I? Seems
> > to work fine without it. I'll assume that was a leftover from a
> > previous idea.


[jQuery] Re: Fighting a closure

2008-01-31 Thread Danny

Depends on what you're trying to do. In your case, the index and the
value are identical, but next time they may not be:
$.each( ['a','b','c'], function (index, val){
  // index is 0...1...2, val is 'a'...'b'...'c'
});

On Jan 31, 3:40 pm, timothytoe <[EMAIL PROTECTED]> wrote:
> $.each( [0,1,2,3,4], function(index, num) {
> $("#port"+num).click(function() { bigchart(num); });
>
> });
>
> Wait. What's the "index" in there for. I don't need that, do I? Seems
> to work fine without it. I'll assume that was a leftover from a
> previous idea.


[jQuery] Re: [validate] Validation Plugin - how to remove a control form validation

2008-01-31 Thread Jörn Zaefferer


Dave Stewart schrieb:

[...]

I hope you have enough information now to help me out!
  
Yep, great! I put in on my list for 1.2.1, most likely adding it as an 
example as it is an interesting issue. Ping me again if you don't hear 
anything in the next days.


Jörn


[jQuery] Re: Not Submit [validate]

2008-01-31 Thread Jörn Zaefferer


Marcos Aurélio schrieb:

Thanks for the answer!

I think you should put your validate / delegate / ajaxQueue in the
same file. In my case, and the majority, only use these two plugins to
run validate, and for this reason we have to include 3 files.

Make a package, all built.
  
Agreed. I've already added the part of the ajaxQueue plugin that is 
required, and I'll either add delegate, too, or provide a bundle that 
includes both.


Jörn


[jQuery] Re: Validation plugin - spinner while validating field?

2008-01-31 Thread Jörn Zaefferer


Rus Miller schrieb:

Also, I noticed that even though the 'Check URL' field on my form
(http://monovisiondesign.com/client/jquery/validate-url/form.php) is
not required, it still performs a remote call and a label.checked is
applied to the field when it's left empty.  Am I doing something wrong
or is there a way to prevent that?
  
Good point. Whats happening: The field is checked if it has any rules. 
If it hasn't, nothing happens. If it has, they are executed. Now the 
remote validation returns that the field is valid, because not required 
and nothing was entered, and the field is marked as valid.


Currently I see no reason to change that to not apply any "message" to 
the field at all in this case, which should be what you are looking for, 
right?


Let me know, otherwise I'll just fix that for 1.2.1.

Jörn


[jQuery] Re: Problem in creating Dynamic tables

2008-01-31 Thread Wizzud

So what is the problem exactly?
What have you tried that didn't work, and in what way did it not work?

On Jan 31, 4:11 am, Anand <[EMAIL PROTECTED]> wrote:
> John please help
>
> On Jan 30, 1:21 pm, Anand <[EMAIL PROTECTED]> wrote:
>
> > Hi All,
> > I am trying to create a dynamic table. It is to be created on onchange
> > event of a text box which will tell how many templates to be added.
> > The structure which I want to add to my page dynamically is
> > 
> > 
> > 
> > 
> > 
> > 
> > label1
> > label2
> > 
> > 
> > 
> > lots of inputs and checkboxes
> > 
> > 
>
> > This is one unit which I want to add on tabbing out of the text box.
> > It can be added any no of times.
> > thanks,
> > Anand


[jQuery] Re: newbiish.. must be a better way than what I'm doing to find the next div after the following inputs?

2008-01-31 Thread Richard D. Worth
Hmm. It worked for me. I actually tested it. :) $(this).parent() selects the
 tag. .nextAll() gets all the next elements (forward siblings), then the
'div:first' filter finds the first one that's a div. Oh well, Glen's
solution is fine.

- Richard

On Jan 31, 2008 2:16 PM, rickcr <[EMAIL PROTECTED]> wrote:

>
> Thanks guys!, parents("div:first")  did the trick.
>
>  ( $(this).parent().nextAll('div:first')  didn't seem work, which I'm
> assuming is because the immediate parent is the  tag for the
> input.)
>
>
> On Jan 31, 1:52 pm, "Richard D. Worth" <[EMAIL PROTECTED]> wrote:
> > Another option is:
> >
> > $(this).parent().nextAll('div:first')
> >
> > - Richard
> >
> > On Jan 31, 2008 1:27 PM, Glen Lipka <[EMAIL PROTECTED]> wrote:
> >
> > > How about parents("div:first")
> >
> > > Glen
> >
> > > On Thu, Jan 31, 2008 at 8:54 AM, rickcr <[EMAIL PROTECTED]>
> wrote:
> >
> > > > This should be easy, but I'm stumped on this. I can't find examples
> > > > showing cases where the find 'skips ahead' .. what I want to is find
> > > > the next  after any of the radio inputs is clicked so that if I
> > > > have...
> >
> > > > 
> > > > Blue
> > > > Green
> > > > Red
> >
> > > >
> > > >Stuff
> > > >
> > > > 
> >
> > > > $(":[EMAIL PROTECTED]'color']").click( function () {
> > > >$(this).parent().parent().find('div.childSec')  //must be
> > > > something better than parent, parent?
> > > > });
> >
> > > > I've been trying different selectors for 'div' inside of parent and
> > > > prev but not having much luck. I'm sure I'm missing something
> stupid.
> > > > Any help appreciated.
>


[jQuery] Re: contents().height() in FF

2008-01-31 Thread Olaf Bosch


Sebioff schrieb:


You can try it out yourself here:
http://www.rakuun.de/Stuff/Schasler/content_height_test.html

Any idea how to fix this or how to get the contents height in a way
that works in both browsers?


In your Demo this works for me in FF-Console:

alert("Content height: " + $("#pane1 div").height());



--
Viele Grüße, Olaf

---
[EMAIL PROTECTED]
http://olaf-bosch.de/
http://ohorn.info/
http://www.akitafreund.de/
---


[jQuery] Re: Fighting a closure

2008-01-31 Thread timothytoe

$.each( [0,1,2,3,4], function(index, num) {
$("#port"+num).click(function() { bigchart(num); });
});

Wait. What's the "index" in there for. I don't need that, do I? Seems
to work fine without it. I'll assume that was a leftover from a
previous idea.


[jQuery] absolute beginner! How to set page width to window width?

2008-01-31 Thread [EMAIL PROTECTED]

Hello :)

Thanks for the multitude of helpful threads you people post!

Before trying something gorgeous with jQuery, I thought I should try
something basic - like setting the width of my #pagewrap div to the
inner width of the user's window. I can't do it right!

Please will you show me how to do it? And, if you're feeling generous,
how to make it resize if the user resizes their viewport?

Cheers -
Cherry.


[jQuery] Re: jCarousel infinite loop problem w/ multiple carousels on display: none

2008-01-31 Thread Todd

I actually was able to figure out what the issue was.

Since this error was happening on resize, I commented out

$(window).bind('resize', function() { self.reload(); });

and for good measure, also commented out

alert('jCarousel: No width/height set for items. This will cause an
infinite loop. Aborting...');

That seemed to do the trick.  Now I can swap out carousels using show/
hide with an onclick and when I resize the browser window, no alert.

Once the page is up, I will post a link so others may benefit from how
it was built and use it for their own platforms.

- Todd


[jQuery] Re: newbiish.. must be a better way than what I'm doing to find the next div after the following inputs?

2008-01-31 Thread rickcr

Thanks guys!, parents("div:first")  did the trick.

 ( $(this).parent().nextAll('div:first')  didn't seem work, which I'm
assuming is because the immediate parent is the  tag for the
input.)


On Jan 31, 1:52 pm, "Richard D. Worth" <[EMAIL PROTECTED]> wrote:
> Another option is:
>
> $(this).parent().nextAll('div:first')
>
> - Richard
>
> On Jan 31, 2008 1:27 PM, Glen Lipka <[EMAIL PROTECTED]> wrote:
>
> > How about parents("div:first")
>
> > Glen
>
> > On Thu, Jan 31, 2008 at 8:54 AM, rickcr <[EMAIL PROTECTED]> wrote:
>
> > > This should be easy, but I'm stumped on this. I can't find examples
> > > showing cases where the find 'skips ahead' .. what I want to is find
> > > the next  after any of the radio inputs is clicked so that if I
> > > have...
>
> > > 
> > > Blue
> > > Green
> > > Red
>
> > >
> > >Stuff
> > >
> > > 
>
> > > $(":[EMAIL PROTECTED]'color']").click( function () {
> > >$(this).parent().parent().find('div.childSec')  //must be
> > > something better than parent, parent?
> > > });
>
> > > I've been trying different selectors for 'div' inside of parent and
> > > prev but not having much luck. I'm sure I'm missing something stupid.
> > > Any help appreciated.


[jQuery] Re: Issue with next()/prev() traversal

2008-01-31 Thread besh

Oops!

Mea culpa! next() and prev() gets only the very next/prev siblings.
Next iteration (now tested ;)):

$('#eventlist a.boldFont').nextAll('a:first').trigger('click');
$('#eventlist a.boldFont').prevAll('a:first').trigger('click');

--
Bohdan Ganicky

On Jan 31, 7:42 pm, besh <[EMAIL PROTECTED]> wrote:
> Hi,
>
> try this:
>  $('#eventlist a.boldFont').next('a').trigger('click');
>  $('#eventlist a.boldFont').prev('a').trigger('click');
>
> --
> Bohdan Ganicky
>
> On Jan 31, 4:26 pm, "[EMAIL PROTECTED]"
>
> <[EMAIL PROTECTED]> wrote:
> > Hallo,
>
> > I am quite new to Jquery and so please forgive me if my problem sounds
> > dumb ;)
>
> > HTML:
>
> > 
> >One
> >Two
> >Three
> > <--
>
> >Four
> >Five
> > <--
>
> >Six
> > 
>
> > Problem:
> >I have to access the anchor above the anchor wih class "boldFont"
> > and the anchor below the anchor with class ".boldFont".I tried using
> > the following statements, it worked partially, but i definitely would
> > like to find a clear n neat solution.
>
> > My code:
> >$
> > ("#eventlist").find("a.boldFont").next().next().next().trigger('click');
> >$
> > ("#eventlist").find("a.boldFont").prev().prev().prev().trigger('click');
>
> > For now, it may work since there are only three to four elements
> > between the anchor. But, if there are N-elements, icannot just go on
> > writing "next()" !!???!


[jQuery] contents().height() in FF

2008-01-31 Thread Sebioff

Hi,
i've got a div with overflow:auto.
I want to check whether the content of the div is higher than the div
itself (in order to know whether I need to show a "scroll down" link
or not).

In Internet Explorer with jQuery 1.2.2. I can get the contents height
without any problem with:
$("#div").contents().height()

(I don't know if this is the best way to do it, but it's the only one
I found...)
The problem is, in Firefox it doesn't work and all I get is the
following error message:

Fehler: [Exception... "Could not convert JavaScript argument"
nsresult: "0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS)"  location: "JS
frame :: http://www.rakuun.de/Stuff/Schasler/jquery-1.2.2.js ::
anonymous :: line 853"  data: no]
Quelldatei: http://www.rakuun.de/Stuff/Schasler/jquery-1.2.2.js
Zeile: 853

You can try it out yourself here:
http://www.rakuun.de/Stuff/Schasler/content_height_test.html

Any idea how to fix this or how to get the contents height in a way
that works in both browsers?


[jQuery] Re: Fighting a closure

2008-01-31 Thread timothytoe

I ended up using this. I liked it much better than my previous
solution (passing in "this" and then stripping the digit out in the
handler).

$.each( [0,1,2,3,4], function(index, num) {
$("#port"+num).click(function() { bigchart(num); });
});

This one is easy for me to read, comprehend, and maintain. And having
it around in my code will be a good way for me to keep the
jQuery .each in mind.

This next one is obviously a work of JavaScript art (as opposed to the
former, which is a more jQuery solution). Does anyone want to explain
it?

 for ( i=0;i<5;i++ ) {
(function(num) {
$("#port"+num).click(function() { bigchart(num) });
})(i);
 }


[jQuery] Re: How to prevent user from clicking links or buttons while submitting

2008-01-31 Thread Klaus Hartl

First of all you should keep in mind that a user can always submit a
form by hitting enter. Thus disabling the buttons only is more or less
useless. You should just alter the forms submit event, this is where
it all happens. That even works if you manually submit forms via
links.

Here's what I'd try - disable the form submit after the first submit
took place:

$('form').one('submit', function( ) {
$(this).bind('submit', function() { return false; });
});


--Klaus


On Jan 31, 4:33 pm, brooke <[EMAIL PROTECTED]> wrote:
> Here is the situation.  We have a form that has links and when the
> user clicks on them it will submit the form.  The problem is that
> sometimes the users were doubleclicking or clicking on different links
> while the form was submitting.  I am completely new to jQuery but one
> of the programmers implemented the solution below.  What it is doing
> is binding a function that clears the onClick event when the link is
> clicked.  It works great in firefox but it is causing IE to lock up.
> I was thinking that somehow the timing is off and it is clearing the
> current anchors onClick before it can process the whole thing..
> (maybe??)  Below is the code.. any suggestions??
>
> sak10625_disabler = function(){
>
>    $("a, [EMAIL PROTECTED], [EMAIL PROTECTED]").attr("onClick",
> "");
>
> }
>
> $(document).ready(function(){
>         $("a").filter(function(){regexp=/submit\(\)/; return regexp.test($
> (this).attr("onclick"));}).bind("click", sak10625_disabler);
>    $("[EMAIL PROTECTED], [EMAIL PROTECTED]").bind("click",
> sak10625_disabler);
>
> });


[jQuery] Re: Loading GIF Slideshow w/o Modal

2008-01-31 Thread Ange

Here's a link to the page working as I want it to, with the exception
of the initial page load being over 4MB:
http://www.circleatseven.com/test/portfolio.php



On Jan 31, 12:05 pm, Pickledegg <[EMAIL PROTECTED]> wrote:
> SEAN-O
>
> The above link is what I found too, but you're missing the original
> post slightly. He needs something that you can plug into a database,
> as preloading the images is impractical with large files.
>
> Does anyone know of a database ready version?
>
> On Jan 31, 4:17 pm, Sean O <[EMAIL PROTECTED]> wrote:
>
> > Ange,
>
> > It sounds like the SlideViewer plugin might help 
> > you:http://www.gcmingati.net/wordpress/wp-content/lab/jquery/imagestrip/i...
>
> > SEAN O
> > _www.sean-o.com
>
> > Ange-6 wrote:
>
> > > I'm looking for a jQuery slideshow plugin, and I can't seem to fond
> > > one that does all I need. Cycle and jCarousel come close. But my
> > > problem is I have multiple galleries on one page, and they all have
> > > large images. So, since they load all the images in every gallery and
> > > then hide them, the page totals over 4000KB.
>
> > > I need something like Litebox or Thickbox that calls the next/prev
> > > image and loads it as needed, with a loading gif. But I don't want a
> > > pop-up modal. It would be nice if I could just put one image from each
> > > gallery in the HTML and have the prev/next buttons load and fade to
> > > the prev/next image.
>
> > > Any suggestions?
>
> > --
> > View this message in 
> > context:http://www.nabble.com/Loading-GIF-Slideshow-w-o-Modal-tp15194790s2724...
> > Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: Issue with next()/prev() traversal

2008-01-31 Thread besh

Hi,

try this:
 $('#eventlist a.boldFont').next('a').trigger('click');
 $('#eventlist a.boldFont').prev('a').trigger('click');

--
Bohdan Ganicky

On Jan 31, 4:26 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Hallo,
>
> I am quite new to Jquery and so please forgive me if my problem sounds
> dumb ;)
>
> HTML:
>
> 
>One
>Two
>Three
> <--
>
>Four
>Five
> <--
>
>Six
> 
>
> Problem:
>I have to access the anchor above the anchor wih class "boldFont"
> and the anchor below the anchor with class ".boldFont".I tried using
> the following statements, it worked partially, but i definitely would
> like to find a clear n neat solution.
>
> My code:
>$
> ("#eventlist").find("a.boldFont").next().next().next().trigger('click');
>$
> ("#eventlist").find("a.boldFont").prev().prev().prev().trigger('click');
>
> For now, it may work since there are only three to four elements
> between the anchor. But, if there are N-elements, icannot just go on
> writing "next()" !!???!


[jQuery] Re: Issue with next()/prev() traversal

2008-01-31 Thread Wizzud

One way (assuming there is only one a.boldFont, and its position is
unknown and may change):

// store a list of all anchors in the target div...
var anchors = $('#eventlist a');

// then when(ever) you need to...
// ...find the position of the boldFont anchor within the stored list
var bf = anchors.index($('a.boldFont', anchors)[0])
// ...put the anchor following the boldfont anchor (if there is one)
into a list
   , clk = anchors.slice(bf+1,bf+2);
// ...add the preceding anchor (if there is one) to the new list
if(bf > 0) clk.add(anchors[bf-1]);
// ...trigger click on the list contents (1 or 2 anchors)
clk.trigger('click');

On Jan 31, 3:26 pm, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> Hallo,
>
> I am quite new to Jquery and so please forgive me if my problem sounds
> dumb ;)
>
> HTML:
>
> 
>One
>Two
>Three
> <--
>
>Four
>Five
> <--
>
>Six
> 
>
> Problem:
>I have to access the anchor above the anchor wih class "boldFont"
> and the anchor below the anchor with class ".boldFont".I tried using
> the following statements, it worked partially, but i definitely would
> like to find a clear n neat solution.
>
> My code:
>$
> ("#eventlist").find("a.boldFont").next().next().next().trigger('click');
>$
> ("#eventlist").find("a.boldFont").prev().prev().prev().trigger('click');
>
> For now, it may work since there are only three to four elements
> between the anchor. But, if there are N-elements, icannot just go on
> writing "next()" !!???!


[jQuery] Re: How to prevent user from clicking links or buttons while submitting

2008-01-31 Thread Glen Lipka
I whipped up a demo.  Not exactly what you had requested, but close.
http://commadot.com/jquery/PleaseWaitButton.php

I am concerned why the click is appending twice.

Does this help?

Glen

On Thu, Jan 31, 2008 at 7:33 AM, brooke <[EMAIL PROTECTED]> wrote:

>
> Here is the situation.  We have a form that has links and when the
> user clicks on them it will submit the form.  The problem is that
> sometimes the users were doubleclicking or clicking on different links
> while the form was submitting.  I am completely new to jQuery but one
> of the programmers implemented the solution below.  What it is doing
> is binding a function that clears the onClick event when the link is
> clicked.  It works great in firefox but it is causing IE to lock up.
> I was thinking that somehow the timing is off and it is clearing the
> current anchors onClick before it can process the whole thing..
> (maybe??)  Below is the code.. any suggestions??
>
> sak10625_disabler = function(){
>
>   $("a, [EMAIL PROTECTED], [EMAIL PROTECTED]").attr("onClick",
> "");
>
> }
> $(document).ready(function(){
>$("a").filter(function(){regexp=/submit\(\)/; return regexp.test($
> (this).attr("onclick"));}).bind("click", sak10625_disabler);
>   $("[EMAIL PROTECTED], [EMAIL PROTECTED]").bind("click",
> sak10625_disabler);
> });
>


[jQuery] Re: Not a plugin but code for anyone trying to have collapse-able menu with cookies

2008-01-31 Thread Karl Swedberg


Very cool, Charles! Wow, I wish I had the time to study all the stuff  
that comes through this discussion list. Hard to keep up.



--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Jan 31, 2008, at 8:22 AM, Charles K. Clarkson wrote:



Karl Swedberg wrote:

: On my test page (http://test.learningjquery.com/cookie-menu.html), I
: put a link to another page with the same script and menu so you can
: see the persistence of the expand/collapse state.

   Never being able to leave well enough alone and having a little  
time

on my hands, I squeezed the cookie information into a separate object.
By calling an instance of it (using new) we can easily have multiple
menus on a page.

Here is the beginning of the cookieMenu code:

   $.fn.cookieMenu = function(cookieName){

   var $topLevel = this.find('li ul');
   $topLevel.hide();

   var menuCookie = new $.cookie.menu(cookieName);
   menuCookie.showCookie();


   Using a cookie object reduced the size of each click function. The
bigIndex() function is a private method of the $.cookie.menu object.

   var $this = $(this), $checkElement = $this.next('ul');

   if ( menuCookie.isOpen(index) ) {
   $checkElement.show();
   }
   $this.click(function() {
   if ($checkElement.is(':hidden')) {
   $checkElement.slideDown();
   menuCookie.open(index);

   } else {
   $checkElement.slideUp();
   menuCookie.close(index);
   }
   menuCookie.showCookie();
   return false;
   });


   I also made calling the menus little simpler. It assumes the
structure of the menu is a simple unordered list of lists like we have
been using.

script>