[jQuery] Re: Div control

2008-12-15 Thread Shaun Culver

I've been through quite a few of the tutorials/articles, but I still
feel that I do not have the tools to control any div with any link
proper. I feel that Mike Alsup's post was on the right track, but, it
seems, too much was expected to know by a noob like me. How would the
code listed in post #2 be put into action via any a href tag, to
control any specified div? I have searched for a tutorial of this
type, but am still suprised by how little information I've gathered on
this.

At the moment, I am primarily a PHP/SQL developer, and only a
javascript/ajax noob, so I really need to be spoon fed, initially. It
would be most useful if I could be given a demo/example that I could
reverse engineer.

@SLR: Thank you. I'm sure the $(document).ready() method saves many
headaches!


[jQuery] Re: Div control

2008-12-15 Thread Shaun Culver

Thank you for all the help. The documentation is great.


[jQuery] Re: my test passes the first time, but fails the second time

2008-12-15 Thread Michael Geary

It seems extremely unlikely that the code you listed is actually doing what
you think it's doing.

In your updated example (the to this part), you're calling do_something()
*before* the click event happens. Don't you want to call it *when* the click
event happens?

You have this line of code:

$(#my_div).click( do_something() );

Here's what that does:

1. It calls the do_something function immediately when the document ready
callback is called - long before the click event happens.

2. It takes the *return value* of the do_something function and establishes
that as the handler for the click event. In other words, it assumes that the
do_something function returns *another* function, and that function is the
click handler.

3. Later, when #my_div is clicked, it calls that other function.

Is that actually what you want? You haven't shown us what the do_something
function looks like. A function that returns another function can be a very
powerful technique in JavaScript. But I'm just about certain that this isn't
what you're doing here. Or am I wrong about that?

Could you please post a link to a test page instead of the code snippets?
I'm just taking guesses as to what your code really looks like, since so
much of it is missing.

What the heck, here's one more guess. Back to your original code:

 5  $(document).ready(function() {
 6 $(#my_div).click(function () {
 7do_something
 8  });
 9  });

Is it possible that this is actually literally what your code looks like
(minus the line numbers)? I assumed that do_something was just a
placeholder for some other actual code. But is that what the code really
looks like? If do_something is the name of a function, just putting the name
by itself won't do anything. You'd have to use do_something() to actually
call the function. Maybe that's all the problem was, the missing ()?

Well, enough guessing games. Post a link to your actual code. Please! :-)

-Mike

 From: nachocab
 
 Hi everyone,
 I found the mistake, although I'm not quite sure why it 
 works, but it does.
 Change this:
 __app.js___
 5  $(document).ready(function() {
 6 $(#my_div).click(function () {
 7do_something
 8  });
 9  });
 To this:
 5  $(document).ready(function() {
 6 $(#my_div).click( do_something() );
 7 function do_something (){...};
 8  });
 
 Thanks for the inspiration!
 
 Nacho
 On Dec 14, 7:25 pm, Michael Geary m...@mg.to wrote:
  It's pretty hard to tell what might be wrong from the code snippet. 
  Can you post a link to a test page instead?
 
  -Mike
 
   From: nachocab
 
   You're right:
   __test.js__
   1  test(bind div again, function() {
   2         $(#my_div).click();
   3         ok( check_if_it_worked, working) //Here it fails!
   4  });
   __app.js___
   5  $(document).ready(function() {
   6         $(#my_div).click(function () {
   7                do_something
   8          });
   9  });
 
    The test fails because line 2 never calls the function 
 in line 7. 
   Any ideas? I'm clueless... Thanks!
 
   On Dec 14, 2:59 pm, Derrick Jackson 
 derrick.jackso...@gmail.com
   wrote:
Nacho,
 
I am new to jQuery and may not have a lot to offer, but 
 does the 
second function actually fail or does it not run?
 
On 12/14/08, nachocab nacho...@gmail.com wrote:
 
 Hi,
 I have a test that passes if I run it by itself, but if I
   duplicate
 the code and run both of them, the second one fails. What
   am I doing
 wrong?
 
 __test.js___
 test(bind div, function() {
 $(#my_div).click();
 ok( check_if_it_worked, working) });
 
 test(bind div again, function() { $(#my_div).click(); ok( 
 check_if_it_worked, working) //Here it fails!
 });
 
 __app.js___
 $(document).ready(function() {
   $(#my_div).click(function () {
     do_something
   });
 });
 
 Thanks!
 
 Nacho
 
--
Sent from Gmail for mobile | mobile.google.com
 



[jQuery] How to limit draggable div on page.

2008-12-15 Thread m.ugues

Is it possible to limit the draggable feature only on the page and not
out of the visible page?

Kind regards

Max


[jQuery] Re: Good book or site to learn jquery?

2008-12-15 Thread Roberto Rivera

For books, I recommend jQuery in Action
http://tinyurl.com/jq-in-action

On Dec 15, 12:06 am, Steven sappleg...@smoothfusion.com wrote:
 I want to learn how to use jquery.  Does anyone know any good books or
 sites that will teach it?


[jQuery] Re: passing args to a delegate

2008-12-15 Thread Jan Limpens

javascript just keeps amazing me more and more :)
thanks for the insight!

On Sat, Dec 13, 2008 at 8:49 PM, Jeffrey Kretz jeffkr...@hotmail.com wrote:

 Mike's suggestion involves creating a javascript closure.

 There are a number of good articles on closues.

 http://www.google.com/search?hl=enq=javascript+closuresrlz=1W1GGLL_en

 But essentially, when you create a function that has a reference to a value 
 outside of its scope, that function is created as a closure, with its own 
 context that has access to those variables, even when they've been changed on 
 the global scope.

 Try this:

 var x = 25;
 var fn = function(val){
   return function(){
  alert(val);
   };
 }(x);
 x = 30;
 fn();

 The alert will be for 25, rather than 30, as the closure has its own context 
 now for the x variable.

 The downside to closures is that handled incorrectly, they can cause memory 
 leaks.

 But review of the many articles on the subject will help keep that from 
 happening.

 JK


 -Original Message-
 From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On 
 Behalf Of Jan Limpens
 Sent: Saturday, December 13, 2008 2:28 PM
 To: jquery-en@googlegroups.com
 Subject: [jQuery] Re: passing args to a delegate


 while this might keep the browser from crashing, I wonder what values
 these parameters will have, when the event finally occurs. The ones I
 have passed the very first time? I thought they would have been
 destroyed by then, as we left this scope long ago ...
 But I'll try it out :), thanks!

 On Sat, Dec 13, 2008 at 3:22 AM, Mike Nichols nichols.mik...@gmail.com 
 wrote:

 Try this:
 success: function() { registerImageForms(id,key,type); }


 On Dec 12, 5:13 pm, Jan Limpens jan.limp...@gmail.com wrote:
 Hello,

 I have the following code:

 var registerImageForms = function(id, key, type) {
 var sizes = ['small', 'medium', 'large'];
 $('#panel-images fieldset:visible').remove();
 $.each(sizes, function(i, item) {
 var $clonedForm = $('#panel-images fieldset:hidden').clone();
 $(legend, $clonedForm).text(item);
 $([name='id'], $clonedForm).val(id);
 $([name='key'], $clonedForm).val(key);
 $([name='type'], $clonedForm).val(type);
 $([name='size'], $clonedForm).val(item);
 $(img, $clonedForm).attr('src', /imagem/article/ + key +
 / + item + .png);
 $(#panel-images).append($clonedForm);
 $(form, $clonedForm).ajaxForm({
 success: registerImageForms
 });
 $clonedForm.show();
 });

 };

 Success has no args, so everything is rendered empty, after posting
 the form. If I pass arguments as
 success: registerImageForms(id, key, type)

 The browser crashes and it makes sense, because at the time this
 fires, these identifiers mean nothing. But how do I pass them?

 --
 Jan



 --
 Jan





-- 
Jan


[jQuery] Re: Anyone done menu like www.brookechase.com before?

2008-12-15 Thread Roberto Rivera

Use Superfish (http://users.tpg.com.au/j_birch/plugins/superfish/)

On Dec 15, 1:06 am, yonghan yongha...@gmail.com wrote:
 Hi..i want to ask..Does anyone ever before make menu likewww.brookechase
 before??Please teach me ho to do it...Thanks a lot...


[jQuery] Re: [validate] Remote Call Failing

2008-12-15 Thread James Hughes

Ah.  I thought i was.  That explains it! 
 
Thanks for the response
 
James.
 
 


From: jquery-en@googlegroups.com on behalf of Jörn Zaefferer
Sent: Mon 15/12/2008 12:44
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: [validate] Remote Call Failing



Updating to 1.5 should fix the issue.

Jörn

On Mon, Dec 15, 2008 at 11:14 AM, James Hughes j.hug...@kainos.com wrote:

 Hello,

 I am trying to set up a remote validation field using the Validate plugin but 
 for some reason it's not working.  Here is my code,

 $(#myform).validate({
  rules: {
name: {
remote: {
url: /remote-validation/sample/remoteValidate,
data: { field: 'name' }
}
},
age:{
required:true,
number:true
}
  }
 });


 The error I am getting is below.

 s.url.match is not a function
 http://localhost:9090/remote-validation/js/jquery/jquery-1.2.6.js
 Line 2605

 Now if I specify the remote as a string url rathern than an options object it 
 seems to work but that doesn't suit my needs.  It appears I SHOULD be able to 
 use an options object but it's simply not working.  Am I doing something 
 wrong?

 James







This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] Top 5 Movies of the Box Office Watch Online

2008-12-15 Thread 24 Hrs Movies
  Top 5 Movies of the Box Office http://newmegamovies.blogspot.com/


  1. Four Christmases  Reese Witherspoon, Vince Vaughn, Mary Steenburgen  2.
Twilight  Kristen Stewart, Robert Pattinson, Billy Burke  3. Bolt  John
Travolta, Miley Cyrus, Susie Essman  4. Australia  Nicole Kidman, Hugh
Jackman  5. Quantum of Solace  Daniel Craig, Olga Kurylenko, Mathieu Amalric


  Find Here http://newmegamovies.blogspot.com/2008/09/english-movies.html and
Just click The tag...


[jQuery] Bollywood Hot Hot

2008-12-15 Thread 24 Hrs Movies
Maharathi http://newmegamovies.blogspot.com/2008/12/maharathi.html
   And More


  Top 5 Movies of the Box Office Watch It OnLine


   1. Four Christmases  Reese Witherspoon, Vince Vaughn, Mary Steenburgen
 2. Twilight  Kristen Stewart, Robert Pattinson, Billy Burke  3. Bolt  John
 Travolta, Miley Cyrus, Susie Essman  4. Australia  Nicole Kidman, Hugh
 Jackman  5. Quantum of Solace  Daniel Craig, Olga Kurylenko, Mathieu
 Amalric

   Find Herehttp://newmegamovies.blogspot.com/2008/09/english-movies.html
  and Just The tag...

















[jQuery] Re: jQuery.uploader released: Flash based jQuery uploader

2008-12-15 Thread Gilles (Webunity)

I found this on another site:


We use the Flash uploader MultiPowUpload (http://www.element-it.com/
MultiPowUpload.aspx) and Nirvanix HTTP upload. To register new uploads
we use the forwardingurl to forward to a script on our site.

Nirvanix makes a 303 redirect to the forwarding URL with only a header
and no content. The problem is that Flash on Mac needs at least one
char in the response content to accept it as a response and make the
redirect - meaning upload on Mac is not working on our site.

Can we in any way get just a single char in return when using the
forwardingURL to fix this problem?
-

Maybe that helps with your issue 4?
http://developer.nirvanix.com/forums/p/467/1634.aspx


[jQuery] Re: Wildcard selector AND pass the selector to a sub-function?

2008-12-15 Thread Ricardo Tomasi

Just to make that selector look a little friendlier, the '@' has been
deprecated, and you can skip the extra  if you're not using special
characters:

$('input[id^=foo][id$=bar]')

- ricardo

On Dec 14, 5:17 am, Daniel L dan...@cleardocs.com wrote:
 CSS 3 selectors seem to be my solution:

 $('inp...@id^=foo]...@id$=bar]').change(function(){
         alert(this.id);

 }

 This will be attached to all input fields that have an ID starting
 with 'foo' and ending with 'bar' (e.g. 'foo123bar', 'foobar',
 'foo456bar').

 Then within the function I can pass through the actual ID with
 'this.id'.

 Cheers.

 On Dec 14, 1:44 pm, Dan Switzer dswit...@pengoworks.com wrote:

  The easiest way to do this would be to give each div a specific class:

  div id=mydiv1 class=foo /
  div id=mydiv2 class=foo /
  div id=mydiv3 class=foo /
  div id=mydiv4 class=foo /

  Now you could just do:

  $(div.foo).change();

  I like this method, since usually this divs have related visuals, so
  you may already have a constant class defined for the elements.

  An alternative would be to do something like:

  $(div[id^=mydiv]).change();

  This would find all divs with an ID that starts mydiv. The
  performance on the class method may be more efficient though.

  -Dan

  On Sat, Dec 13, 2008 at 8:30 PM, Daniel L dan...@cleardocs.com wrote:

   Hi, I have a situation where the same javascript is repeated about 50
   times - just with a differnt ID. Example:

   $('#mydiv1').change(function() {
     doStuff('#mydiv1');
   });
   $('#mydiv2').change(function() {
     doStuff('#mydiv2');
   });
   ...
   $('#mydiv50').change(function() {
     doStuff('#mydiv50');
   });

   Is there a way to combine all these calls using wildcards?? I imagine
   it would be something like:

   $('#mydiv* as foo').change(function() {
     doStuff('#mydivfoo');
   });

   Any help would be greatly appreciated.


[jQuery] Re: How to limit draggable div on page.

2008-12-15 Thread Richard D. Worth
Just set the containment option to 'window'. See

http://docs.jquery.com/UI/Draggable/draggable#options

for more info. Also note, there is a dedicated list for discussion of jQuery
UI plugins[*]:

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

See you there if you need any more help :)

- Richard

[*] http://rdworth.org/blog/2008/10/jquery-plugins-and-jquery-ui/

On Mon, Dec 15, 2008 at 4:52 AM, m.ugues m.ug...@gmail.com wrote:


 Is it possible to limit the draggable feature only on the page and not
 out of the visible page?

 Kind regards

 Max


[jQuery] Re: DOMWindow

2008-12-15 Thread Liam Potter


|$('#modal').bind('keypress', function(e) {
   if(e.keyCode==27){
   // esc pressed... do anything here...
   }
});
|



[jQuery] [UPDATE] Plugin kiketable.rowsizable (aka Grid Row Sizing)

2008-12-15 Thread Enrique Meléndez Estrada


Hi everybody,
I've released an update for another plugin:
http://plugins.jquery.com/project/kiketable_rowsizable
official homepage (and demos):
http://www.ita.es/jquery/jquery.kiketable.rowsizable.htm

, also I remember you the other plugin:
http://www.ita.es/jquery/jquery.kiketable.colsizable.htm

any comment welcome!

--
Enrique Meléndez Estrada (2367)
Servicios Informáticos
Organización y Servicios Internos
Instituto Tecnológico de Aragón



[jQuery] Re: jQuery.uploader released: Flash based jQuery uploader

2008-12-15 Thread Gilles (Webunity)

Although i do appreciate your feedback, do you have any idea how i can
fix the problems?
As far as i see it now, there is only the crashing issue?

Thanx
Gilles

On 15 dec, 08:16, rernens robert.ern...@look2bookonline.com wrote:
 Thanks Gilles for your reply and for the plug in.

 I have continued researching where the problem might be and found the
 following that might help :

 1. plugin works in IE7, Firefox 3.04 Windows and Safari 3 but fails in
 Firefox 3.04 MacOS where Firefox crashes immediately after the log
 displays the message file upload started.

 2. additional parms should be passed as a javascript object which
 works fine in GET mode but seems buggy in POST mode.
 In this case the form data are badly built. While the parms names are
 propertly extracted from the parms object, the parms value are
 improperly extracted and show [object Object] rather than the real
 value.

 3. multiple must be passed as true or false not 1 or 0 or
 false or true. Your documentation was clear and I missed it.

 4. the plugin hangs anyway in all working platforms if the backend
 script issue a redirect.

 Hope it helps

 On 12 déc, 13:03, Gilles (Webunity) gilles0...@gmail.com wrote:



  Hi Guys,

  Sorry for the late update. Although everybody is using it (since i got
  20mb of uploaded files) almost nobody is telling thanx, but that's
  oke, i expected that.

  I got some time to fix some issues and answer some questions:

   1.  multiple: false through settings while building
   theuploaderdoes not work. setMultiple(false) does the job.

  You should pass multiple as a string. 1 turns it on, the rest
  should turn it off, can you recheck?

   2. I can't get the plugin to properly talk to my webserver. The
   backend script gets invoked but the plugin immediately returns upload
   cancelled state without waiting for the backend script to end. I have
   tested with a very simple backend script that does nothing but
   returning some data. (might be related to my kind of server 4DWeb
   server with Active4D ?)

  Can't help you on that one, are you behind a proxy? Flash still
  doesn't like that..

   3. when sending data to the server with the object what format does
   the object use ? Is it a serialization of the data in the form of
   [{field: fieldName, value: fieldData}, ...] or in the form of
   {fieldName: fieldData, ...}. Having not got to that stage yet, I
   have not figured out so I am asking.

  Actualy i can't help you on that one, as far as i know it are all
  basic objects. Also the request is constructed using basic Flash
  methods, so it should not pose any problems. I have put up the php
  source file so you can see how i handle the files.

   Move to Flash Player 10 just to see if it would change something.
   No changes.
   Firefox 3 crashes.
   It seems that the plugin does not handle properly the 404 return code
   from the server.
   Will try on Windows with firefox and IE7 and 8.

  Here on windows with Firefox 2 and 3.04 all works fine. Also IE6 and 7
  work flaweless... Maybe a proxy? Also, make sure you use the logging
  functions, it could help you.- Tekst uit oorspronkelijk bericht niet 
  weergeven -

 - Tekst uit oorspronkelijk bericht weergeven -


[jQuery] Re: nextAll Chaining when nextAll is Empty

2008-12-15 Thread Ricardo Tomasi

The 'click' part of your code seems to work fine. I couldn't test the
rest, but prevAll (you've got a typo there) and nextAll + andSelf are
always returning the correct elements. Use Firebug, set console.log(  $
(this).preAll('a').andSelf().addClass('star_hover') ) inside the
handler and you'll see that the elements are there. My guess is
something is going wrong when you trigger the mouseout.

- ricardo

On Dec 13, 12:32 am, Reepsy mre...@gmail.com wrote:
 Ricardo,

 Sorry, but it is a development stage I am not permitted to share. But
 the markup is this (basically):

 HTML (this was a select menu that gets converted to a hidden field and
 5 a tags in an earlier step)

 input name=rating id=the-rating value= type=hidden
 a href= id=star1 class=star title=1 Star1/a
 a href= id=star2 class=star title=2 Stars2/a
 a href= id=star3 class=star title=3 Stars3/a
 a href= id=star4 class=star title=4 Stars4/a
 a href= id=star5 class=star title=5 Stars5/a

 JS:

 var r = $('#the-rating'); /* THE HIDDEN FIELD STORES RATING */
 $('a.star').click(function(){
   $(r).val($(this).text()); /* RECORD RATING */
   $(this).nextAll('a').andSelf().removeClass
 ('star_selected').triggerHandler('mouseout');
   return false;})

 .hover(
   function() {
      $(this).preAll('a').andSelf().addClass('star_hover')
      $(this).nextAll('a').removeClass('star_selected');
   },
   function() {
     $(this).prevAll('a.star').andSelf().removeClass('star_hover');
     $('#star' + $(r).val()).prevAll('a.star').andSelf().addClass
 ('star_selected');
   }
 );

 This worked exactly as expected on stars 2-4. But on #5 the click
 failed to add the class and fire the mouseout. I presume it is because
 there is no nextAll. Likewise, on star #1 the hover failed remove the
 class. Again, I presume because there is no prevAll.

 Michael

 On Dec 12, 11:50 am, ricardobeat ricardob...@gmail.com wrote:

  Do you have a test page we can look at?

  nextAllreturns an empty object if there is no 'next', but it doesn't
  interrupt thechain, there may be something else going on. I couldn't
  reproduce your situation here,nextAll().andSelf() returns me the
  original element.

  - ricardo

  On Dec 12, 10:39 am, Reepsy mre...@gmail.com wrote:

   This might sound naive, but I expected this to work:

   $(this).nextAll('a').andSelf().removeClass
   ('star_selected').triggerHandler('mouseout');

   It's from a star rating I wrote, where I have 5 a tags in a row. If
   you click on one it removes a class from it and all that follow it,
   and then fires the mouseout event. This works perfectly for stars 1-4,
   but fails on #5, because there is no next. But I did not expect it to
   ignore the rest of thechain. Everything after .nextAllis ignored. If
   I break this into two lines, it works fine:

   $(this).nextAll('a').removeClass('star_selected');
   $(this).removeClass('star_selected').triggerHandler('mouseout');

   But  I am repeating myself with the removeClass. Can anyone see a way
   to combine these back into one statement? The mouseout has to go last.

   Michael


[jQuery] [validate] Remote Call Failing

2008-12-15 Thread James Hughes

Hello,

I am trying to set up a remote validation field using the Validate plugin but 
for some reason it's not working.  Here is my code,

$(#myform).validate({
  rules: {
name: {
remote: {
url: /remote-validation/sample/remoteValidate,
data: { field: 'name' }
}
},
age:{
required:true,
number:true
}
  }
});

 
The error I am getting is below.
 
s.url.match is not a function
http://localhost:9090/remote-validation/js/jquery/jquery-1.2.6.js
Line 2605
 
Now if I specify the remote as a string url rathern than an options object it 
seems to work but that doesn't suit my needs.  It appears I SHOULD be able to 
use an options object but it's simply not working.  Am I doing something wrong?
 
James


This e-mail is intended solely for the addressee and is strictly confidential; 
if you are not the addressee please destroy the message and all copies. Any 
opinion or information contained in this email or its attachments that does not 
relate to the business of Kainos 
is personal to the sender and is not given by or endorsed by Kainos. Kainos is 
the trading name of Kainos Software Limited, registered in Northern Ireland 
under company number: NI19370, having its registered offices at: Kainos House, 
4-6 Upper Crescent, Belfast, BT7 1NT, 
Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
registered in Ireland for VAT under number: 9950340E. This email has been 
scanned for all known viruses by MessageLabs but is not guaranteed to be virus 
free; further terms and conditions may be 
found on our website - www.kainos.com 




[jQuery] Superfish - maintain hover appearance on top level with image replacement?

2008-12-15 Thread Matt

First, thanks to Joel Birch for the great jQuery plugin! I have
implemented Superfish on a site I was working on and customized the
top level using css image replacement with 1 sprite for all the
buttons.

As a finishing touch, I'm wondering if it's possible to maintain the
hover appearance of the top level when the user mouses down into the
sub-menu(s).

The IR method I used involves some extra markup (empty set of em's on
the top level links.) It works for now but I'm open to changing it.

Not too many people seem to implement this kind of modification to
superfish (or they don't write about it) so I thought I'd put mine out
there as an example and maybe we can tweak it to make it better.

my menu css is here:
http://dwdiesel.com/css/superfish.css

any help is appreciated :)

for now I'm just glad the old fireworks mm_menu.js is gone


[jQuery] Superfish - Nav-bar style with bgIframe?

2008-12-15 Thread Alkafy

We've been using Superfish for our menu, but bgIframe doesn't seem to
solve our IE 6 issues.

The test browser:

Internet Explorer 6.0.2600
Windows XP Professional (No Service Packs)

The initiation:

$(document).ready(function(){
$(ul#sf-menu-id).superfish({
autoArrows:  false,
pathClass:  'current'
}).find('ul').bgIframe();
});

Example broken page:

http://www.farmanddairy.com/recipes/submit-recipe

The menu goes behind several of the inputs. This happens across the
site in different places; It even goes behind a couple of image page
headers. I tried using opacity:false but the first child ul gets a
vertical scrollbar and a white background, while the menu still goes
behind other elements. I tried using combinations of the find()
command to dig deeper but I can't get the hang of it. If anyone could
give me a hand, it'd be much appreciated. Thank you.


[jQuery] Re: Trouble setting Select object in browsers != IE 7

2008-12-15 Thread Romain Viovi

hey hey

try to change your select id whith a letter

Ids starting with numbers are not recommended and may cause errors

cheers

Beres Botond a écrit :
 The code you posted should work normally. But make sure
 existingCase.records.Spin_Off__c is a string (and also make sure it
 doesnt have trailing whitespace!).
 But if it just doesn't work, yeah you can set an option selected
 explicitly
 
 $(#00N8002fnHx  option).each(function() {
if($(this).val() == existingCase.records.Spin_Off__c) {
$(this).attr('selected','selected')
}
// the following part might not be necessary... depends one exactly
 what conditions you use it
elseif($(this).attr('selected') != undefined) {
$(this).removeAttr('selected')
}
 });
 
 
 On Dec 15, 5:17 am, raskren rask...@gmail.com wrote:
 Yes, I think the markup is valid.  Copy  Pasted below:

 select id=00N8002fnHx tabindex=7 name=00N8002fnHx
 option value=--None--/option
 option value=YesYes/option
 option value=NoNo/option
 /select

 I do not have control over the markup.  Is there any other way to make
 an option selected that will work cross-browser?

 On Dec 14, 9:22 pm, Jeffrey Kretz jeffkr...@hotmail.com wrote:



 There shouldn't be an issue, so long as existingCase.records.Spin_Off__c
 has a correct value.
 Do your option elements have explicitly defined values?  Like this:
 option value=YesYes/option
 option value=NoNo/option
 option value= /option
 If not, try changing your markup and see if that helps.
 JK
 trouble in Firefox 3.0.4 and Safari 3 - both in Windows.  My code does
 seem to run properly in IE7.
 Some code:
 $(#00N8002fnHx).val(existingCase.records.Spin_Off__c);
 Is this a known issue in these browsers?  Am I doing anything
 obviously wrong?

-- 
Romain Viovi
42 rue Pigalle
75009 Paris

+33 6 63 16 90 15
+33 9 54 40 84 40

romain.vi...@gmail.com


[jQuery] Accordion initial state after page changes

2008-12-15 Thread alex.zeta

Hello,

I'm stuck with a simple jquery accordion script that is
http://www.stevekrueger.com/jquery-accordion-tutorial/.

The problem is that there are links inside my divs that brings to
another page where the same accordion menu should be included and left
opened at the same state like the previous page (hope to be enough
clear... ).

The script I'm using will always close all the accordion divs upon the
second page load. I'm a total newbie of jquery and couldn't understand
exactly how jquery works (among other things I've to do i promise that
I will learn jQuery as soon as possible ); in the meantime could
someone explain me if there is a way to do this?

that's the jquery accordion script:

$(document).ready(function(){
   $(.content).hide();
   $('img src=arrow-down.png class=arrow /').insertAfter('a
h1');
   $(a h1).click(function(){
  if($(this).is(.active)) {
 $(this).toggleClass(active);
   $('.arrow.active').attr('src','arrow-down.png'); // change the
image src of the current ACTIVE image to have an INACTIVE state.
 $(this).parent().next(.content).slideToggle();
 return false;
  } else {
 $(.content:visible).slideUp(slow); // close all visible
divs with the class of .content
 $(h1.active).removeClass(active);  // remove the class
active from all h1's with the class of .active
 $(this).toggleClass(active);
 $('.arrow.active').attr('src','arrow-down.png'); // change
the image src of the current ACTIVE image to have an INACTIVE state.
 $(.arrow).addClass('active');
 $(this).siblings('.arrow.active').attr('src','arrow-
up.png'); // change the image src of the new active image to have an
active state.
 $(this).parent().next(.content).slideToggle();
 return false;
  }
   });
});

Thank you in advice.

Alex - italy


[jQuery] incompatible while creating image element with IE

2008-12-15 Thread joe

$(image/).attr({src:imagesrc,alt:joe})
.mouseover(function(){this.src=imagel+imageid;})
.mouseout(function(){this.src=images+imageid;})
.appendTo($(#bc+bookrecno));

$(image src=\+imagesrc+\/)
.mouseover(function(){this.src=imagel+imageid;})
.mouseout(function(){this.src=images+imageid;})
.appendTo($(#bc+bookrecno));

$(input type='image'/).attr({src:imagesrc,alt:joe})
.mouseover(function(){this.src=imagel+imageid;})
.mouseout(function(){this.src=images+imageid;})
.appendTo($(#bc+bookrecno));

IE is the only bugger.


[jQuery] Re: Good book or site to learn jquery?

2008-12-15 Thread olduvai

I also recommend the two above.

On Dec 15, 7:22 am, Sean O seanodot...@yahoo.com wrote:
 Steven-99 wrote:

  I want to learn how to use jquery.  Does anyone know any good books or
  sites that will teach it?

 The book, Learning jQuery (Swedberg, Chaffer), is quite good.
 --
 View this message in 
 context:http://www.nabble.com/Good-book-or-site-to-learn-jquery--tp21007959s2...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: table sorter issue, how do i sort these as a currency

2008-12-15 Thread MorningZ


Showing the init code doesn't really help others help you...

Got an example of the HTML you are trying to sort?



On Dec 15, 7:01 am, livewire9174 markmch...@gmail.com wrote:
 Hi,
 I am using this to initialise the page

 SCRIPT type=text/javascript
         $(document).ready(function() {
             $(#tableOne)
                         .tablesorter({ debug: false, sortList: [[0, 0]], 
 widgets:
 ['zebra'] })
             .tablesorterPager({ container: $(#pagerOne),
 positionFixed: false })
           });

 /SCRIPT

 I have a row in the table which is a european currency, how do I sort
 by this?


[jQuery] jCarousel - A bug appears after resizing browser's window

2008-12-15 Thread Shoaib

I am using jCarousel 0.2.3 in my project for a continuous circular
logo scroller. Implementation is at the bottom.

jCarosouel is working smoothly. But the problem occures when
browsers's window is resized.

Under this problem, number of visible items are reduced from 6 to 3
and appear in such a fashion that these items scrolls left and next
item does not appear on right and similar situation for next scroll.
And when only one logo is there, it disappears and next 3 items
appears to continue this strange behaviour.

Here is the link to view the implementation. http://isa95.zeropoint.it/
NOTE: Please resize your browser in any way to see the problem.

Kindly guide me in this regard to control it.

Shoaibi

== Implementation ==

$(document).ready(function(){

function mycarousel_itemVisibleInCallback(carousel, item, i,
state, evt){
var idx = carousel.index(i, mycarousel_itemList.length);
carousel.add(i, mycarousel_getItemHTML(mycarousel_itemList[idx
- 1]));
};

function mycarousel_itemVisibleOutCallback(carousel, item, i,
state, evt){
carousel.remove(i);
};

function mycarousel_getItemHTML(item){
return item.html;
};

function mycarousel_initCallback(carousel){
carousel.buttonNext.bind('click', function() {
carousel.startAuto(0);
});

carousel.buttonPrev.bind('click', function() {
carousel.startAuto(0);
});

carousel.clip.hover(function() {
carousel.stopAuto();
}, function() {
carousel.startAuto();
});
};

$('#foundation_partners').jcarousel({
auto: 2,
visible: 6,
wrap: 'circular',
scroll: 1,
easing: 'swing',
initCallback: mycarousel_initCallback,
itemVisibleInCallback: {onBeforeAnimation:
mycarousel_itemVisibleInCallback},
itemVisibleOutCallback: {onAfterAnimation:
mycarousel_itemVisibleOutCallback},
animation: 'slow'
});

});


[jQuery] table sorter issue, how do i sort these as a currency

2008-12-15 Thread livewire9174

Hi,
I am using this to initialise the page

SCRIPT type=text/javascript
$(document).ready(function() {
$(#tableOne)
.tablesorter({ debug: false, sortList: [[0, 0]], 
widgets:
['zebra'] })
.tablesorterPager({ container: $(#pagerOne),
positionFixed: false })
  });

/SCRIPT


I have a row in the table which is a european currency, how do I sort
by this?



[jQuery] Confirmed the bug and have a fix

2008-12-15 Thread jch

The bug is that yuicompressor is not happy with the 'float' property
being standalone.  The fix is to quote the property 'float' on that
line:

Instead of:
li.css({overflow: hidden, float: o.vertical ? none :
left});

use:

li.css({overflow: hidden, 'float': o.vertical ? none :
left});

Hope that helps,
Jerry

http://www.whatcodecraves.com/


[jQuery] Re: Cycle plug in Next/Prev image Alt issue

2008-12-15 Thread Mor Vimmer
Yep, that did the trick.
Thank you so much!

Mor

On Sun, Dec 14, 2008 at 2:38 PM, Mike Alsup mal...@gmail.com wrote:


  I tried using the onBefore, and I looked at the samples at your
  website (http://malsup.com/jquery/cycle/int2.html), but for some
  reason, the function doesn't recognize the image title or alt text. I
  get the this.src or this.alt as undefined.  And that's the reason
  I turned to the prevNextClick. With this function, I could send the
  html object to the function.
  At first I thought it's because I am loading the images in a wordpress
  loop, but with firebug I could see that the page has all the
  information.
  So I am unsure what I am doing wrong?

 The arguments sent to the 'before' function are different to those
 sent to the prevNextClick function.

 function onBefore(incomingSlide, outgoingSlide, options, isForwardNav)
 {
// inside the funciton 'this' is equal to the incomingSlide
 element
 }

 Mike





 



[jQuery] click function

2008-12-15 Thread Alfredo Alessandrini

I've a simple question..

I'm writing a function that call an event on first mouse click and
call another event on second mouse click.

But I've some problem, because work only the first mouse click:

jQuery(document).ready(function() {
$(.menu a).click(function() {
$(this).next(em).animate({opacity: show, top: -205}, slow);

$(this).next(em).animate({opacity: hide, top: -205}, fast);

});

});

Any help.. :-)

Thanks in advance,

Alfredo


[jQuery] Font size in sifr plugin

2008-12-15 Thread flycast

I am trying to get the sifr plugin working. It seems to be working
except that I cannot get the size of the font to change except by
using zoom. I have the Gunmetal swf file specified and the font is
changing to the Gunmetal font.

I have tried setting the height using style in the tag and using a
class in a seperate css file. Both times I disables the sifr plugin to
make sure that the styles were taking.

If I use zoom then the text gets cut off.

What is the proper way to control font size?


[jQuery] Re: my test passes the first time, but fails the second time

2008-12-15 Thread Michael Geary

That's certainly a possibility, although there was no indication in the code
snippet in the original post that there was any Ajax downloading or dynamic
creation of elements.

That's why it's so important to post a link to an actual test page, instead
of little code snippets taken out of context. Otherwise we're just all
taking wild guesses as to what might be wrong.

-Mike 

 From: QuadCom
 
 It seems to me that you are having a binding problem. I came 
 across this in the past and found the simplest solution to 
 the problem.
 
 Your original code is kinda correct but there's too much of 
 it. Your defining a click event in doc.ready is correct as 
 written but only gets fired once at document loading. If 
 dynamic content gets loaded afterwards, those new objects 
 will not be added to the click event handler. You will have 
 to rebind the new objects in order for them to register the event.
 
 $(document).ready(function() {
 
   //The original click event binding will work only once!!
   $(#my_div).click(function () {
  do_something
   });
 
 
 });
 
 ***The new code 
 
 
 $(document).ready(function() {
 
 // Convert the bind event handler to a custom function so 
 that you can call it whenever you need.
 function mybind(){
$(#my_div).click(function () {
alert('you clicked');
});
 }
 
 //Call the function initially to create the bind mybind();
 
 });
 
 Everytime you load new content that you wish to have the 
 click events bound to, you will have to unbind() then call 
 your new mybind() function like so;
 
 $('#my_div').unbind();
 mybind();
 
 The reason for the unbind is so that if there are multiple 
 matching items on the page, they will trigger the click event 
 code each time the binding is run until and unbind is called. 
 You can simulate this by calling mybind(); twice in the 
 doc.ready. When you click on #my_div, it will show the alert twice!
 
 Hope this clears up the confusion.
 
 
 
 On Dec 15, 2:31 am, nachocab nacho...@gmail.com wrote:
  Hi everyone,
  I found the mistake, although I'm not quite sure why it 
 works, but it 
  does.
  Change this:
  __app.js___
  5  $(document).ready(function() {
  6         $(#my_div).click(function () {
  7                do_something
  8          });
  9  });
  To this:
  5  $(document).ready(function() {
  6         $(#my_div).click( do_something() );
  7         function do_something (){...};
  8  });
 
  Thanks for the inspiration!
 
  Nacho
  On Dec 14, 7:25 pm, Michael Geary m...@mg.to wrote:
 
   It's pretty hard to tell what might be wrong from the 
 code snippet. 
   Can you post a link to a test page instead?
 
   -Mike
 
From: nachocab
 
You're right:
__test.js__
1  test(bind div again, function() {
2         $(#my_div).click();
3         ok( check_if_it_worked, working) //Here it fails!
4  });
__app.js___
5  $(document).ready(function() {
6         $(#my_div).click(function () {
7                do_something
8          });
9  });
 
 The test fails because line 2 never calls the function 
 in line 7. 
Any ideas? I'm clueless... Thanks!
 
On Dec 14, 2:59 pm, Derrick Jackson 
derrick.jackso...@gmail.com
wrote:
 Nacho,
 
 I am new to jQuery and may not have a lot to offer, 
 but does the 
 second function actually fail or does it not run?
 
 On 12/14/08, nachocab nacho...@gmail.com wrote:
 
  Hi,
  I have a test that passes if I run it by itself, but if I
duplicate
  the code and run both of them, the second one fails. What
am I doing
  wrong?
 
  __test.js___
  test(bind div, function() {
  $(#my_div).click();
  ok( check_if_it_worked, working) });
 
  test(bind div again, function() { 
 $(#my_div).click(); ok( 
  check_if_it_worked, working) //Here it fails!
  });
 
  __app.js___
  $(document).ready(function() {
    $(#my_div).click(function () {
      do_something
    });
  });
 
  Thanks!
 
  Nacho
 
 --
 Sent from Gmail for mobile | mobile.google.com
 



[jQuery] Re: [validate] Remote Call Failing

2008-12-15 Thread Jörn Zaefferer
Updating to 1.5 should fix the issue.

Jörn

On Mon, Dec 15, 2008 at 11:14 AM, James Hughes j.hug...@kainos.com wrote:

 Hello,

 I am trying to set up a remote validation field using the Validate plugin but 
 for some reason it's not working.  Here is my code,

 $(#myform).validate({
  rules: {
name: {
remote: {
url: /remote-validation/sample/remoteValidate,
data: { field: 'name' }
}
},
age:{
required:true,
number:true
}
  }
 });


 The error I am getting is below.

 s.url.match is not a function
 http://localhost:9090/remote-validation/js/jquery/jquery-1.2.6.js
 Line 2605

 Now if I specify the remote as a string url rathern than an options object it 
 seems to work but that doesn't suit my needs.  It appears I SHOULD be able to 
 use an options object but it's simply not working.  Am I doing something 
 wrong?

 James

 
 This e-mail is intended solely for the addressee and is strictly 
 confidential; if you are not the addressee please destroy the message and all 
 copies. Any opinion or information contained in this email or its attachments 
 that does not relate to the business of Kainos
 is personal to the sender and is not given by or endorsed by Kainos. Kainos 
 is the trading name of Kainos Software Limited, registered in Northern 
 Ireland under company number: NI19370, having its registered offices at: 
 Kainos House, 4-6 Upper Crescent, Belfast, BT7 1NT,
 Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
 registered in Ireland for VAT under number: 9950340E. This email has been 
 scanned for all known viruses by MessageLabs but is not guaranteed to be 
 virus free; further terms and conditions may be
 found on our website - www.kainos.com





[jQuery] Re: Trouble setting Select object in browsers != IE 7

2008-12-15 Thread Beres Botond

The code you posted should work normally. But make sure
existingCase.records.Spin_Off__c is a string (and also make sure it
doesnt have trailing whitespace!).
But if it just doesn't work, yeah you can set an option selected
explicitly

$(#00N8002fnHx  option).each(function() {
   if($(this).val() == existingCase.records.Spin_Off__c) {
   $(this).attr('selected','selected')
   }
   // the following part might not be necessary... depends one exactly
what conditions you use it
   elseif($(this).attr('selected') != undefined) {
   $(this).removeAttr('selected')
   }
});


On Dec 15, 5:17 am, raskren rask...@gmail.com wrote:
 Yes, I think the markup is valid.  Copy  Pasted below:

 select id=00N8002fnHx tabindex=7 name=00N8002fnHx
 option value=--None--/option
 option value=YesYes/option
 option value=NoNo/option
 /select

 I do not have control over the markup.  Is there any other way to make
 an option selected that will work cross-browser?

 On Dec 14, 9:22 pm, Jeffrey Kretz jeffkr...@hotmail.com wrote:



  There shouldn't be an issue, so long as existingCase.records.Spin_Off__c
  has a correct value.

  Do your option elements have explicitly defined values?  Like this:

  option value=YesYes/option
  option value=NoNo/option
  option value= /option

  If not, try changing your markup and see if that helps.

  JK

  trouble in Firefox 3.0.4 and Safari 3 - both in Windows.  My code does
  seem to run properly in IE7.

  Some code:
  $(#00N8002fnHx).val(existingCase.records.Spin_Off__c);

  Is this a known issue in these browsers?  Am I doing anything
  obviously wrong?


[jQuery] Re: jquery validation

2008-12-15 Thread Caleb Morse
The validator plugin needs a unique name attribute for every field.
Otherwise it will only validate the first occurrence of the name.

So you would need something like:


form name='myform' id='myform'
input type='text' name='name1' id='name1' class='required name' /
input type='text' name='name2' id='name2' class='required name' /

And so on.

-- Caleb


On Sun, Dec 14, 2008 at 21:02, Adwin Wijaya adwin.wij...@gmail.com wrote:


 I am using jquery validation from bassistance.de

 I have problem with dynamic forms which have same input name.
 (i know the demo has one dynamic form,  but they have unique name)

 this is the example

 form name='myform' id='myform'
 input type='text' name='name[]' id='name1' class='required name' /
 input type='text' name='name[]' id='name2' class='required name' /
 input type='text' name='name[]' id='name3' class='required name' /
 input type='text' name='name[]' id='name4' class='required name' /
 input type='text' name='name[]' id='name5' class='required name' /
 input type='text' name='name[]' id='name6' class='required name' /
 input type='text' name='name[]' id='name7' class='required name' /
 /form

 how to validate each fields ? it seems it only validate the first one
 and ignore the rest.
 can i create custom validation for each input which has name class ($
 (.name)) ?

 thanks ... i really need this to be done ...
 and i cannot rename the name of each fields so it has unique name.



[jQuery] getting hover and active css styles?

2008-12-15 Thread aviProgammer

hi i need to detect an elements hover and active css styles without
actually mousing over or clicking on it. how can i do that using
jquery?


[jQuery] Re: click function

2008-12-15 Thread theCrandallSter

I am not exactly sure what you are doing with the positioning, but
try .toggle() instead perhaps?

Cheers

On Dec 15, 11:13 am, Alfredo Alessandrini alfreal...@gmail.com
wrote:
 I've a simple question..

 I'm writing a function that call an event on first mouse click and
 call another event on second mouse click.

 But I've some problem, because work only the first mouse click:

 jQuery(document).ready(function() {
 $(.menu a).click(function() {
     $(this).next(em).animate({opacity: show, top: -205}, slow);

     $(this).next(em).animate({opacity: hide, top: -205}, fast);

         });

 });

 Any help.. :-)

 Thanks in advance,

 Alfredo


[jQuery] passing this reference to setTimeout()

2008-12-15 Thread ekallevig

I'm using jQuery.hover for a dropdown menu and I want to add a slight
delay to mouseOut functions but I can't figure out how to pass the
jQuery(this) reference into the setTimeout() function... can this be
done?

ex.

jQuery('li.drop').hover(
function(){
jQuery(this).addClass('show');
},
function(){
var t = setTimeout( function(){ 
jQuery(this).removeClass('show'); },
1000);
}
);


[jQuery] Re: Font size in sifr plugin

2008-12-15 Thread banalitis

Have you given line-height alongside font-size a go?

On 15 Dec, 16:25, flycast e...@janasnyder.com wrote:
 I am trying to get the sifr plugin working. It seems to be working
 except that I cannot get the size of the font to change except by
 using zoom. I have the Gunmetal swf file specified and the font is
 changing to the Gunmetal font.

 I have tried setting the height using style in the tag and using a
 class in a seperate css file. Both times I disables the sifr plugin to
 make sure that the styles were taking.

 If I use zoom then the text gets cut off.

 What is the proper way to control font size?


[jQuery] Re: validation remote

2008-12-15 Thread Jet

Hi,

Sounds like we are having the same problem.

I have posted about the problem in this thread.

http://groups.google.com/group/jquery-en/browse_thread/thread/5d29f6e751ce5f3a?hl=en#

The thread above though refers to a field not using remote, but I'm
also having the same problem on another page when using remote.

URL: http://www.thaidatelink.com/account/register/

(checkout the Username field which I'm using remote.)

Well...sorry I'm not of much help.

Just to bring to your attention about this similar thread and hope
that Jörn (the author of this wonderful script) could help.

Good luck!

;)

On Dec 15, 4:48 am, kemalemin kemale...@gmail.com wrote:
 Hi, my validation summary worked quite fine before I made a remote
 username check available to it. The problem is when for the first time
 an already existing username is entered into the username box, the
 error div pops alright saying that the username already exists in the
 db. however when I go back and correct it, the error message
 disappears but the containing div still exists on the page. below is
 the code, I hope somebody can help

  var container = $('#error_container');
         // validate the form when it is submitted
         var validator = $(#frmUserRegister).validate({
             onkeyup: false,
                 errorContainer: container,
                 errorLabelContainer: $(ol, container),
                 wrapper: 'li',
                 meta: validate,
                 rules: {
             txtFullName: {
                 required: true,
                 rangelength:[3, 100]},
             txtUsername: {
                 required: true,
                 rangelength:[5, 30],
                 remote:ajaxCheckUsername.aspx}, // returns 'true' or
 'false' as string
             txtEmail: {
                 required: true,
                 email: true},
             txtPassword: {
                 required: true,
                 rangelength:[5, 20]},
             txtConfirmPassword: {
                 equalTo: #txtPassword}
         },

         messages: {
             txtFullName: {
                 required: Please enter your strongfull name/
 strong.,
                 rangelength: Fullname must be strongbetween 3 and
 100 characters/strong},
             txtUsername: {
                 required: Please enter a strongvalid username/
 strong.,
                 rangelength: Username must be strongbetween 5 and
 30 characters/strong.,
                 remote: jQuery.format(strongu{0}/u is already
 taken/strong, please choose a different username.)},
             txtEmail: {
                 required: please provide an strongemail/strong
 address.,
                 email: please provide a strongvalid email/strong
 address},
             txtPassword: {
                 required: please provide a strongpassword/
 strong,
                 rangelength: Password must be strong between 6 and
 20 characters/strong},
             txtConfirmPassword: {
                 equalTo: passwords strongmust match/strong.}
         },
         });

 });

     /script

     style type=text/css
 #error_container
 {
     background-image:url(img/error.gif);
     background-repeat:no-repeat;
         background-color: #FFE8E8;
         border: 1px solid #CC;
         color: #CC;
     font-family:Tahoma;
     font-size:11px;
     padding:4px 0 0 40px;
     display: none;

 }

 #error_container ol li {
         list-style-type:circle;

 }

 form.frmUserRegister label.frmUserRegister, label.error {
         /* remove the next line when you have trouble in IE6 with labels in
 list */
         color: #CC;

 }

 /style
 /head
 body
     form id=frmUserRegister runat=server
     div id=error_container
         strongplease review and correct the following errors:/strong
         ol
             li style=display:none;/li
         /ol
         /div

  the rest of the page are the form fields...

 here, the div with the id of error_container is still being
 displayed...


[jQuery] Re: passing this reference to setTimeout()

2008-12-15 Thread Mike Alsup

 I'm using jQuery.hover for a dropdown menu and I want to add a slight
 delay to mouseOut functions but I can't figure out how to pass the
 jQuery(this) reference into the setTimeout() function... can this be
 done?

 jQuery('li.drop').hover(
         function(){
                 jQuery(this).addClass('show');
         },
         function(){
                 var t = setTimeout( function(){ 
 jQuery(this).removeClass('show'); },
 1000);
         }
 );


jQuery('li.drop').hover(
function(){
jQuery(this).addClass('show');
},
function(){
var $this = jQuery(this);
setTimeout( function(){ $this.removeClass('show'); }, 1000);
}
)



[jQuery] DOMWindow

2008-12-15 Thread m.ugues

Is it possible to close a modal/nonmodal domWindow with the ESC key?

Kind regards

Max


[jQuery] Re: Confirmed the bug and have a fix

2008-12-15 Thread Jerry Cheung
Oops, I meant to post to this about yuicompressor and jcarousellite:

http://groups.google.com/group/jquery-en/browse_thread/thread/c17dd87e38844f2/4e7d8db08f49369a?lnk=gstq=yuicompressor+jcarousellite#4e7d8db08f49369a

On Sun, Dec 14, 2008 at 8:55 PM, jch jollyje...@gmail.com wrote:

 The bug is that yuicompressor is not happy with the 'float' property
 being standalone.  The fix is to quote the property 'float' on that
 line:

 Instead of:
li.css({overflow: hidden, float: o.vertical ? none :
 left});

 use:

li.css({overflow: hidden, 'float': o.vertical ? none :
 left});

 Hope that helps,
 Jerry

 http://www.whatcodecraves.com/



[jQuery] Re: my test passes the first time, but fails the second time

2008-12-15 Thread QuadCom

It seems to me that you are having a binding problem. I came across
this in the past and found the simplest solution to the problem.

Your original code is kinda correct but there's too much of it. Your
defining a click event in doc.ready is correct as written but only
gets fired once at document loading. If dynamic content gets loaded
afterwards, those new objects will not be added to the click event
handler. You will have to rebind the new objects in order for them to
register the event.

$(document).ready(function() {

  //The original click event binding will work only once!!
  $(#my_div).click(function () {
 do_something
  });


});

***The new code 


$(document).ready(function() {

// Convert the bind event handler to a custom function so that you can
call it whenever you need.
function mybind(){
   $(#my_div).click(function () {
   alert('you clicked');
   });
}

//Call the function initially to create the bind
mybind();

});

Everytime you load new content that you wish to have the click events
bound to, you will have to unbind() then call your new mybind()
function like so;

$('#my_div').unbind();
mybind();

The reason for the unbind is so that if there are multiple matching
items on the page, they will trigger the click event code each time
the binding is run until and unbind is called. You can simulate this
by calling mybind(); twice in the doc.ready. When you click on
#my_div, it will show the alert twice!

Hope this clears up the confusion.



On Dec 15, 2:31 am, nachocab nacho...@gmail.com wrote:
 Hi everyone,
 I found the mistake, although I'm not quite sure why it works, but it
 does.
 Change this:
 __app.js___
 5  $(document).ready(function() {
 6         $(#my_div).click(function () {
 7                do_something
 8          });
 9  });
 To this:
 5  $(document).ready(function() {
 6         $(#my_div).click( do_something() );
 7         function do_something (){...};
 8  });

 Thanks for the inspiration!

 Nacho
 On Dec 14, 7:25 pm, Michael Geary m...@mg.to wrote:

  It's pretty hard to tell what might be wrong from the code snippet. Can you
  post a link to a test page instead?

  -Mike

   From: nachocab

   You're right:
   __test.js__
   1  test(bind div again, function() {
   2         $(#my_div).click();
   3         ok( check_if_it_worked, working) //Here it fails!
   4  });
   __app.js___
   5  $(document).ready(function() {
   6         $(#my_div).click(function () {
   7                do_something
   8          });
   9  });

    The test fails because line 2 never calls the function in
   line 7. Any ideas? I'm clueless... Thanks!

   On Dec 14, 2:59 pm, Derrick Jackson derrick.jackso...@gmail.com
   wrote:
Nacho,

I am new to jQuery and may not have a lot to offer, but does the
second function actually fail or does it not run?

On 12/14/08, nachocab nacho...@gmail.com wrote:

 Hi,
 I have a test that passes if I run it by itself, but if I
   duplicate
 the code and run both of them, the second one fails. What
   am I doing
 wrong?

 __test.js___
 test(bind div, function() {
 $(#my_div).click();
 ok( check_if_it_worked, working)
 });

 test(bind div again, function() {
 $(#my_div).click();
 ok( check_if_it_worked, working) //Here it fails!
 });

 __app.js___
 $(document).ready(function() {
   $(#my_div).click(function () {
     do_something
   });
 });

 Thanks!

 Nacho

--
Sent from Gmail for mobile | mobile.google.com


[jQuery] Re: passing this reference to setTimeout()

2008-12-15 Thread ekallevig

Thanks!

On Dec 15, 11:59 am, Mike Alsup mal...@gmail.com wrote:
  I'm using jQuery.hover for a dropdown menu and I want to add a slight
  delay to mouseOut functions but I can't figure out how to pass the
  jQuery(this) reference into the setTimeout() function... can this be
  done?

  jQuery('li.drop').hover(
          function(){
                  jQuery(this).addClass('show');
          },
          function(){
                  var t = setTimeout( function(){ 
  jQuery(this).removeClass('show'); },
  1000);
          }
  );

 jQuery('li.drop').hover(
     function(){
         jQuery(this).addClass('show');
     },
     function(){
         var $this = jQuery(this);
         setTimeout( function(){ $this.removeClass('show'); }, 1000);
     }
 )


[jQuery] Re: Superfish module for Joomla

2008-12-15 Thread Soylent

I don't have a live site up with the menu's yet, but will post it when
I get it ready to go.

On Dec 8, 9:52 am, Lawk Salih lsa...@gmail.com wrote:
 Can you also share the link where we can see a live link of this
 project.

 Thanks, Lawk.

 On Dec 8, 9:21 am, Soylent cymor...@gmail.com wrote:

  I don't know if any of you use Joomla, but I'm doing a website for
  someone that wants it.  Anyway, I wanted to addSuperfishto the main
  menu of the site but wanted the client to be able to configure it from
  the admin panel.  I couldn't find amodulefor this, so I made one.  I
  hope Joel doesn't mind.  I tried to give plenty of credit to him.
  Below is the link to themoduleif anyone else would like to use it.
  It is my first Joomlamoduleand is just mod_mainmenu edited to
  include theSuperfishfeatures.

 http://joomlacode.org/gf/project/superfishmodule


[jQuery] Re: Superfish module for Joomla

2008-12-15 Thread Soylent

One problem I've been having is that if any other module/plugin loads
the prototype js library, it kills superfish.  To fix this, I replaced
all references in the script from $. or $( to jQuery. and jQuery( -- I
didn't like having to do this, but unfortunately I'm stuck using both
jQuery and prototype on the same site.



On Dec 8, 9:05 pm, Joel Birch joeldbi...@gmail.com wrote:
 Hey, not only do I not mind, but I am overjoyed that you are 
 usingSuperfishfor this! Everyone should feel free to useSuperfishhowever
 they want. Nice work.

 Joel BIrch.

 On Dec 9, 1:21 am, Soylent cymor...@gmail.com wrote:

  I don't know if any of you use Joomla, but I'm doing a website for
  someone that wants it.  Anyway, I wanted to addSuperfishto the main
  menu of the site but wanted the client to be able to configure it from
  the admin panel.  I couldn't find amodulefor this, so I made one.  I
  hope Joel doesn't mind.  I tried to give plenty of credit to him.
  Below is the link to themoduleif anyone else would like to use it.
  It is my first Joomlamoduleand is just mod_mainmenu edited to
  include theSuperfishfeatures.

 http://joomlacode.org/gf/project/superfishmodule


[jQuery] Re: table sorter issue, how do i sort these as a currency

2008-12-15 Thread livewire9174

here is the code, I need to stop the execution somewhere I guess ? I
am using ajax calls to put data into to table, so I guess I cant
attach the tablesorter script until the ajax calls have fully
finished ?


[code]
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN http://
www.w3.org/TR/html4/loose.dtd
?php
header(Expires: Mon, 26 Jul 1997 05:00:00 GMT);

// always modified
header(Last-Modified:  . gmdate(D, d M Y H:i:s) .  GMT);

// HTTP/1.1
header(Cache-Control: no-store, no-cache, must-revalidate);
header(Cache-Control: post-check=0, pre-check=0, false);
header(Cache-Control: public);
// HTTP/1.0
header(Pragma: no-cache);

session_start();
?
head
title/title
script type=text/javascript src=jquery-latest.js/script

script type=text/javascript
function ajaxFunction()

{

  var xmlHttp=null;
try
  {

  // Firefox, Opera 8.0+, Safari
  xmlHttp=new XMLHttpRequest();
  xmlHttp1=new XMLHttpRequest();
  xmlHttp2=new XMLHttpRequest();
  xmlHttp3=new XMLHttpRequest();
  xmlHttp4=new XMLHttpRequest();
  xmlHttp5=new XMLHttpRequest();
  xmlHttp6=new XMLHttpRequest();
  xmlHttp7=new XMLHttpRequest();
   xmlHttp8=new XMLHttpRequest();
  }
catch (e)
  {
  // Internet Explorer
  try
{
xmlHttp=new ActiveXObject(Msxml2.XMLHTTP);
xmlHttp1=new ActiveXObject(Msxml2.XMLHTTP);
xmlHttp2=new ActiveXObject(Msxml2.XMLHTTP);
xmlHttp3=new ActiveXObject(Msxml2.XMLHTTP);
xmlHttp4=new ActiveXObject(Msxml2.XMLHTTP);
xmlHttp5=new ActiveXObject(Msxml2.XMLHTTP);
xmlHttp6=new ActiveXObject(Msxml2.XMLHTTP);
xmlHttp7=new ActiveXObject(Msxml2.XMLHTTP);
xmlHttp8=new ActiveXObject(Msxml2.XMLHTTP);
}
  catch (e)
{
try
  {
  xmlHttp=new ActiveXObject(Microsoft.XMLHTTP);
  xmlHttp1=new ActiveXObject(Microsoft.XMLHTTP);
  xmlHttp2=new ActiveXObject(Microsoft.XMLHTTP);
  xmlHttp3=new ActiveXObject(Microsoft.XMLHTTP);
  xmlHttp4=new ActiveXObject(Microsoft.XMLHTTP);
  xmlHttp5=new ActiveXObject(Microsoft.XMLHTTP);
  xmlHttp6=new ActiveXObject(Microsoft.XMLHTTP);
  xmlHttp7=new ActiveXObject(Microsoft.XMLHTTP);
  xmlHttp8=new ActiveXObject(Microsoft.XMLHTTP);

  }
catch (e)
  {
  alert(Your browser does not support AJAX!);
  return false;
  }
}
  }

xmlHttp.onreadystatechange=function()
{
if(xmlHttp.readyState==4)
  {

   document.getElementById('resulta').innerHTML =
xmlHttp.responseText;
  document.getElementById('showMessagea').style.display='none';
  }
}

  xmlHttp1.onreadystatechange=function()
{
if(xmlHttp1.readyState==4)
  {
   document.getElementById('resultb').innerHTML =
xmlHttp1.responseText;

  document.getElementById('showMessageb').style.display='none';
  }
}


xmlHttp2.onreadystatechange=function()
{
if(xmlHttp2.readyState==4)
  {
   document.getElementById('resultc').innerHTML =
xmlHttp2.responseText;
  document.getElementById('showMessagec').style.display='none';
  }
}

xmlHttp3.onreadystatechange=function()
{
if(xmlHttp3.readyState==4)
  {
   document.getElementById('resultd').innerHTML =
xmlHttp3.responseText;
  document.getElementById('showMessaged').style.display='none';
  }
}


xmlHttp4.onreadystatechange=function()
{
if(xmlHttp4.readyState==4)
  {
   document.getElementById('resulte').innerHTML =
xmlHttp4.responseText;
  document.getElementById('showMessagee').style.display='none';
  }
}

xmlHttp5.onreadystatechange=function()
{
if(xmlHttp5.readyState==4)
  {
   document.getElementById('resultf').innerHTML =
xmlHttp5.responseText;
  document.getElementById('showMessagef').style.display='none';
  }
}

xmlHttp6.onreadystatechange=function()
{
if(xmlHttp6.readyState==4)
  {
   document.getElementById('resultg').innerHTML =
xmlHttp6.responseText;
  document.getElementById('showMessageg').style.display='none';
  }
}

xmlHttp7.onreadystatechange=function()
{
if(xmlHttp7.readyState==4)
  {
   document.getElementById('resulth').innerHTML =
xmlHttp7.responseText;
  document.getElementById('showMessageh').style.display='none';
  }
}

xmlHttp8.onreadystatechange=function()
{
if(xmlHttp8.readyState==4)
  {
   document.getElementById('resulti').innerHTML =
xmlHttp8.responseText;
  document.getElementById('showMessagei').style.display='none';
  }
}


  xmlHttp.open(GET,http://www..com/1.php,true);
  xmlHttp.send(null);
  document.getElementById('showMessagea').style.display='';


  xmlHttp1.open(GET,http://www..com/12.php,true);
  xmlHttp1.send(null);
  document.getElementById('showMessageb').style.display='';


  xmlHttp2.open(GET,http://www..com/122.php,true);
  

[jQuery] Re: layout of a project / good practices

2008-12-15 Thread brian

On Mon, Dec 15, 2008 at 10:13 AM, Jan Limpens jan.limp...@gmail.com wrote:

 Hi guys,

 I wonder if anybody knows a good page/tutorial/etc... that explains
 good practices in structuring a project that uses jquery.
 Currently I have a mess of files that all populate the global name
 space with things currently in need.
 If my server side programming looked like that, I'd through me out of
 the window :)

 I need to fix this up, probably putting things in classes (well, these
 funny top level functions that work like classes, in a way) etc..

 But how does this work with things like $(document).load(...)? And
 many questions (most of which have not come into my mind) more.


If you want a more class-like setup, have a look at the WymEditor [1]
code, which extends the JQuery objects associated with textareas, and
the Tidy plugin, which extends WymEditor's functionality.

As far as files go (if that's what you're also asking about), I
generally keep jQuery and its plugins in js/lib, with 'jquery-' in the
filename.  The rest of my code i put in js/, though sometimes in
subdirs relating to the application.

[1] www.wymeditor.org


[jQuery] Re: incompatible while creating image element with IE

2008-12-15 Thread brian

On Mon, Dec 15, 2008 at 10:41 AM, joe zhoulongh...@gmail.com wrote:

 $(image/).attr({src:imagesrc,alt:joe})
 .mouseover(function(){this.src=imagel+imageid;})
 .mouseout(function(){this.src=images+imageid;})
 .appendTo($(#bc+bookrecno));

 $(image src=\+imagesrc+\/)
 .mouseover(function(){this.src=imagel+imageid;})
 .mouseout(function(){this.src=images+imageid;})
 .appendTo($(#bc+bookrecno));

 $(input type='image'/).attr({src:imagesrc,alt:joe})
 .mouseover(function(){this.src=imagel+imageid;})
 .mouseout(function(){this.src=images+imageid;})
 .appendTo($(#bc+bookrecno));

 IE is the only bugger.


You might be more likely to get a response if you were to mention what
the problem is.


[jQuery] Re: [treeview] Brief flash of expanded tree

2008-12-15 Thread neokio

On Dec 15, 3:48 pm, Michael Geary m...@mg.to wrote:
   I'm not sure if it's the best solution, but a friend of
   mine helped me overcome the issue i was experiencing.
   We added a line of CSS to hidetreeviewon load, and then set
   it to display in the demo.js file once everything was loaded
   $(#browser).treeview({
           animated: fast,
           persist: cookie,
           collapsed: true
           }).css('display','block');
  Hey Andrew, nice patch. I've been bothered by that flash for
  a while now. I wonder how that will effect SEO .. I'm using
  treeview for my main content navigation. Do you think the
  bots and crawlers will trigger the display:block call, or
  will the hidden treeview remain hidden? And what about
  visitors with js disabled? The nav will be hidden completely.
  Anyone know of another way to stop the expanded flash glitch?

 Instead of putting the CSS directly in the head, use document.write to
 insert it. That way it won't have any effect if JS is disabled or if a
 crawler reads the page.

 IOW, where you might have this in the head:

     style type=text/css
         #browser { display:none; }
     /style

 Replace it with:

     script type=text/javascript
         document.write(
             'style type=text/css',
                 '#browser { display:none; }',
             '/style'
         );
     /script

 -Mike

Nice one Mike, that's a smart workaround. Thanks :)


[jQuery] Calculate form sections into form total

2008-12-15 Thread Nic Hubbard

I am wondering what the best practice is for calulating form sections
into a form total.  E.g., the top of the form has some radio buttons
with price values, when a value is selected the total field at the
bottom of the form is updated.  There is also a set of checkboxes with
values, with a click event, clicking any of these will update the
value of the total input field.

The problem I run into is calculating vars when they are inside
different functions.  How does one go about doing this?

Here is what I have:

//Find if user is attending
$('#attendingOptions input').change(function() {
if ($('#q38480_q1_0:checked').length === 1) {
 var attendVal = 175;
 $('#q38487_q1').val('175');
} else {
 var attendVal = 0;
 $('#q38487_q1').val('0');
}
});

//Calculate awards lunch value
var lunchVal = parseInt($('#q38481_q3').val()) * 50;

$('#sponsorOptions :checkbox').click(
function() {
  var valueStart = 0;
  $('#sponsorOptions input:checkbox:checked').each(function() {
valueStart += parseInt($(this).val());
  });
  $('#q38487_q1').val(valueStart + attendVal);
})

Right now the calculation does not work because attendVal is inside
another function.


[jQuery] Re: superfish z-index problem

2008-12-15 Thread Caveman

Here is the whole page.  I tried to edit out some of the code to make
it easier to read, but I guess that didn't work.  The google maps api
key used on this page will only run on localhost:

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd

html xmlns=http://www.w3.org/1999/xhtml;
headtitle

/title
script src=js/MainScripts.js type=text/javascript/script
link rel=stylesheet type=text/css media=screen href=css/
superfish.css /link rel=stylesheet type=text/css media=screen
href=css/superfish-vertical.css /
script src=js/jquery-1.2.6.min.js type=text/javascript/
script
script type=text/javascript src=js/superfish.js/script

script type=text/javascript

$(document).ready(function() {
$(ul.sf-menu).superfish({
animation: { height: 'show' },   // slide-down effect
without fade-in
delay: 1200   // 1.2 second delay on
mouseout
});
 });
/script

script src=http://maps.google.com/maps?
file=apiamp;v=2amp;key=ABQI59UKubRwwNbom4chV2XX5BT2yXp_ZAY8_ufC3CFXhHIE1NvwkxT-
CT66mJHBl663tMCNavyeNN3W9Q
  type=text/javascript/script
script type=text/javascript
String.prototype.trim = function() { return this.replace(/^\s*
(\S*(\s+\S+)*)\s*$/, $1); };
var map;
var directionsPanel;
var directions;
function load() {
  if (GBrowserIsCompatible()) {
  map = new GMap2(document.getElementById(map));
var point = new GLatLng(38.880733, -94.810861);
map.setCenter(point, 14);
var marker = new GMarker(point);
map.addOverlay(marker);
map.addControl(new GSmallMapControl());

  }
}


window.onload = function() {
load();
}
window.unload = function() {
GUnload();
}
function getMyDirections() {
var sa = document.getElementById('streetAddress').value.trim();
var c = document.getElementById('city').value.trim();
var z = document.getElementById('zip').value.trim();
var s = document.getElementById(state).options
[document.getElementById(state).selectedIndex].value;
if (sa == '') {
alert('Please enter a street address');
return false;
}
if (c == '') {
alert('Please enter a city');
return false;
}
if (z == '') {
alert('Please enter a zipcode');
return false;
}

map.clearOverlays();
if (directions !=null)
directions.clear();

directionsPanel = document.getElementById(directionsPanel);
directions = new GDirections(map, directionsPanel);
directions.load(from:  + sa + ,  + c + ,  + s +   + z + 
to: 500 E. Loula, Olathe, KS 66061 (Olathe Community Theatre));

document.getElementById(directionsPanel).style.display =
'inline';

}

function opendiv() {
var dddiv = document.getElementById('dd');
if (dddiv.style.display == 'none')
dddiv.style.display = 'inline';
else
dddiv.style.display = 'none';
return false;
}

/script
/head
body
form name=aspnetForm method=post action=Location.aspx
id=aspnetForm
div
input type=hidden name=__VIEWSTATE id=__VIEWSTATE value=/
wEPDwUKMTY1NDU2MTA1Mg9kFgJmD2QWAgIDD2QWAgIBD2QWCgIBDxYCHgtfIUl0ZW1Db3VudAICFgQCAQ9kFgJmDxUCATEOTGVhZGluZyBMYWRpZXNkAgIPZBYCZg8VAgEzC1JhYmJpdCBIb2xlZAIFDxYCHgdWaXNpYmxlaGQCBw8WAh4EVGV4dAUzPGEgaHJlZj0iQ3VycmVudFNlYXNvbkF1ZGl0aW9ucy5hc3B4Ij5BdWRpdGlvbnM8L2E
+ZAIJDxYCHwACARYCAgEPZBYCZg8VAgIxNQ5SeWFu4oCZcyBFdmVudGQCDQ8WAh8AAgIWBAIBD2QWBGYPFQEJMjAwNC0yMDA1ZAIBDxYCHwACBhYMAgEPZBYCZg8VAwkyMDA0LTIwMDUHQnVkZGllcwdCdWRkaWVzZAICD2QWAmYPFQMJMjAwNC0yMDA1BENsdWUEQ2x1ZWQCAw9kFgJmDxUDCTIwMDQtMjAwNQ5HbGVuIEdhcnkgUm9zcw5HbGVuIEdhcnkgUm9zc2QCBA9kFgJmDxUDCTIwMDQtMjAwNQhMb25lc3RhcghMb25lc3RhcmQCBQ9kFgJmDxUDCTIwMDQtMjAwNQ9QZXJmZWN0IFdlZGRpbmcPUGVyZmVjdCBXZWRkaW5nZAIGD2QWAmYPFQMJMjAwNC0yMDA1BlBpY25pYwZQaWNuaWNkAgIPZBYEZg8VAQkyMDA3LTIwMDhkAgEPFgIfAAICFgQCAQ9kFgJmDxUDCTIwMDctMjAwOA1OdW5zZW5zYXRpb25zDU51bnNlbnNhdGlvbnNkAgIPZBYCZg8VAwkyMDA3LTIwMDgWVGhlIERpYXJ5IG9mIEFubiBGcmFuaxZUaGUgRGlhcnkgb2YgQW5uIEZyYW5rZGRw1ICat9cM/
2O7S2iBqR32aeyscQ== /
/div

divTiffany's Content will surround this page/div
div style=float:left; z-index:1;



ul class=sf-menu sf-vertical style=z-index:100;
lia href=Default.aspxHome/a/li
lia href=Reservation.aspxTickets/a/li
li

a href=#2008/2009 Season/a
ul

lia href=Performance.aspx?EventID=1Leading 
Ladies/a/li

lia href=Performance.aspx?EventID=3Rabbit 
Hole/a/li

/ul


/li
li

a href=CurrentSeasonAuditions.aspxAuditions/a
/li
li

a href=#Special Events/a
ul

lia href=SpecialEvent.aspx?EventID=15Ryan’s 
Event/a/li

/ul


/li
lia href=Calendar.aspxCalendar/a/li
lia href=#ScrapBook/a

ul

lia 

[jQuery] Using the not() filter

2008-12-15 Thread WhoButSB

Hello All!
I'm trying to figure out the correct way to use the not() method.  I
know there is also a :not() filter in selectors class but I couldn't
get that one to work either.

My goal is to add a click function to all the input fields on a page.
But not select the input buttons that are nested in certain divs.

Here is what I have tried so far:

$(input).not($('#addNewAddress:input',
'#addNewContactDetail:input')).click(function(){
console.log($(this).attr('id'));
});

AND

$(input).not('#addNewAddress input', '#addNewContactDetail
input').click(function(){
console.log($(this).attr('id'));
});

Neither have worked so far.  Should I be using the :not() command in
the selector?

Thanks for the help!


[jQuery] [autocomplete] Options

2008-12-15 Thread Samuel Santos

Where can I find a complete list of all the available options of the
jQuery Autocomplete plugin?


[jQuery] [validate] Naming rules by class

2008-12-15 Thread ycuentocorto

Can I name the validations by classname, in order to verfify all
fiuelds that match with specified classname?

For example set that all input that have a class  date  (input
class=other_class date ... ...) will be checked in required, min and
max lenght an others.

Thanks in advance.



[jQuery] Re: Trouble using rules( add, rules ) as well as setting attribute for range validations

2008-12-15 Thread BillSaysThis

I am not able to make equalTo work despite trying many variations of
inserting the validation. For instance:

tr class=
td class=labelEmail/td
tdinput type=text class=required 
email
id=memEmail type=text //td
/tr
tr class=even
td class=labelSilly Human Test/td
tdinput type=text 
class={required:true,email:true,
equalTo:'#memEmail'} id=isHuman type=text value=Enter your email
again //td
/tr

or

$('#teamAptSurvey').validate({
rules: {
isHuman: {
equalTo: '#memEmail'
},
messages: {
isHuman: {
equalTo: 'Must match your email'
}
}
}
});

$('#isHuman').blur(function() {
$('#teamAptSurvey').valid();
});

I'm including jquery and validator:

script type=text/javascript src=include/
jquery-1.2.6.min.js/script
script type=text/javascript src=http://dev.jquery.com/view/
trunk/plugins/validate/jquery.validate.js/script

Thanks!
On Oct 21, 10:49 am, Jörn Zaefferer joern.zaeffe...@googlemail.com
wrote:
 Further testing is welcome, I plan to release 1.5 on Friday.

 Jörn

 On Tue, Oct 21, 2008 at 8:16 PM, Jörn Zaefferer

 joern.zaeffe...@googlemail.com wrote:
  Done!

  You can find the latest revision here:
 http://jqueryjs.googlecode.com/svn/trunk/plugins/validate/

  Jörn

  On Tue, Oct 21, 2008 at 7:08 PM, BobS bob.silverb...@gmail.com wrote:

  I would love to have this feature.  It would save me a bunch of extra
  lines of code.  Any idea if and when this might be implemented into
  the plugin?

  On Oct 21, 5:55 am, lightglitch mario.ffra...@gmail.com wrote:
  Done.

 http://dev.jquery.com/ticket/3503

  On Oct 21, 9:53 am, Jörn Zaefferer joern.zaeffe...@googlemail.com
  wrote:

   Could you file a ticket for this?http://dev.jquery.com/newticket
   (requires registration)

   Thanks!

   Jörn

   On Mon, Oct 20, 2008 at 8:49 PM, lightglitch mario.ffra...@gmail.com 
   wrote:

I have made a patch for my app to therulesfunction to supportcustom
messages:

This is the new function, would be nice to have something similar to
this.

       rules: function(command, argument) {
               var element = this[0];

               if (command) {
                       var staticRules = $.data(element.form, 
'validator').settings.rules;
                       var existingRules = 
$.validator.staticRules(element);
                       switch(command) {
                       case add:
                               $.extend(existingRules, 
$.validator.normalizeRule(argument));
                               staticRules[element.name] = 
existingRules;

                               / PATCH ***/
                               if (argument.messages) {
                                   if ($.data(element.form,
'validator').settings.messages[element.name])
                                        $.extend($.data(element.form,
'validator').settings.messages[element.name],argument.messages);
                                  else
                                       $.data(element.form,
'validator').settings.messages[element.name] = argument.messages;
                               }
                               / END PATCH ***/
                               break;
                       case remove:
                               if (!argument) {
                                       delete 
staticRules[element.name];
                                       return existingRules;
                               }
                               var filtered = {};
                               $.each(argument.split(/\s/), 
function(index, method) {
                                       filtered[method] = 
existingRules[method];
                                       delete existingRules[method];
                               });
                               return filtered;
                       }
               }

               var data = $.validator.normalizeRules(
               $.extend(
                       {},
                       $.validator.metadataRules(element),
                       $.validator.classRules(element),
                       $.validator.attributeRules(element),
                       $.validator.staticRules(element)
               ), 

[jQuery] Re: [autocomplete] Options

2008-12-15 Thread Charlie Griefer
On Mon, Dec 15, 2008 at 9:55 AM, Samuel Santos sama...@gmail.com wrote:


 Where can I find a complete list of all the available options of the
 jQuery Autocomplete plugin?



assuming you're using the following plugin -
http://www.dyve.net/jquery/?autocomplete :

http://www.dyve.net/jquery/autocomplete.txt

-- 
I have failed as much as I have succeeded. But I love my life. I love my
wife. And I wish you my kind of success.


[jQuery] Re: Options

2008-12-15 Thread MorningZ

For Jorn's plugin

http://docs.jquery.com/UI/Autocomplete/autocomplete#options





On Dec 15, 12:55 pm, Samuel Santos sama...@gmail.com wrote:
 Where can I find a complete list of all the available options of the
 jQuery Autocomplete plugin?


[jQuery] Re: Good book or site to learn jquery?

2008-12-15 Thread none

jQuery in Action
Learning JQuery
jQuery Reference Guide


[jQuery] Re: Calculate form sections into form total

2008-12-15 Thread Nic Hubbard

Ok, I moved the main js into a function and it worked:

function calculate() {
  var valueStart = 0;
  if ($('#q38481_q3').val() === '') {
$('#q38481_q3').val('0')
  }
  var lunchVal = parseInt($('#q38481_q3').val()) * 50;
  $('#sponsorOptions :checked, #attendingOptions :checked').each
(function() {
valueStart += parseInt($(this).val());
  });
  $('#q38487_q1').val(valueStart + lunchVal);
};

//Calculate fields to add up total
$('#sponsorOptions :checkbox, #attendingOptions input').click(
function() {
  calculate();
});

$('#q38481_q3').blur(
function() {
  calculate();
});


On Dec 15, 10:56 am, Nic Hubbard nnhubb...@gmail.com wrote:
 I am wondering what the best practice is for calulating form sections
 into a form total.  E.g., the top of the form has some radio buttons
 with price values, when a value is selected the total field at the
 bottom of the form is updated.  There is also a set of checkboxes with
 values, with a click event, clicking any of these will update the
 value of the total input field.

 The problem I run into is calculating vars when they are inside
 different functions.  How does one go about doing this?

 Here is what I have:

 //Find if user is attending
         $('#attendingOptions input').change(function() {
         if ($('#q38480_q1_0:checked').length === 1) {
          var attendVal = 175;
          $('#q38487_q1').val('175');
         } else {
          var attendVal = 0;
          $('#q38487_q1').val('0');
         }
         });

         //Calculate awards lunch value
         var lunchVal = parseInt($('#q38481_q3').val()) * 50;

     $('#sponsorOptions :checkbox').click(
     function() {
       var valueStart = 0;
       $('#sponsorOptions input:checkbox:checked').each(function() {
         valueStart += parseInt($(this).val());
       });
       $('#q38487_q1').val(valueStart + attendVal);
     })

 Right now the calculation does not work because attendVal is inside
 another function.


[jQuery] Re: Change Cycle plugin fx dynamically?

2008-12-15 Thread JohnnyCee

An update...

I got a page to work where I change the Cycle fx parameter
dynamically. Basically, I reconstruct the HTML for the slides
dynamically and then call Cycle() on it. The page is not online yet;
when it is, I'll post a URL to it.


[jQuery] Re: Brief flash of expanded tree

2008-12-15 Thread besh

http://www.learningjquery.com/2008/10/1-awesome-way-to-avoid-the-not-so-excellent-flash-of-amazing-unstyled-content

On Nov 29, 2:42 pm, Andrew andrewblun...@gmail.com wrote:
 Hi

 I've got the treeview plugin set to be collapsed on load. This works
 generally, but every now and then, the page loads and the tree appears
 fully expanded, before shrinking back to it's collapsed (or whatever
 cookie state).

 The page i'm working at iswww.australian-postcodes.com.
 Try clicking Animated  Leader  Ultramagnus ... and then Unofficial 
 Fansproject  City Commander, and if it doesn't do it, go back and
 forth between the 2 pages a few times.

 I managed to grab a screenshot of the expanded list before it
 collapses -http://www.australian-postcodes.com/treeview.png... you
 can see the styles are only partially applied as well?

 Please help! Otherwise, i've found this plugin to be just what i
 needed :)

 Thanks, Andrew


[jQuery] Re: Font size in sifr plugin

2008-12-15 Thread flycast

Yes. I have also copied the examples at the bottom of this page:
http://jquery.thewikies.com/sifr/#description

And they work except that the resulting swf ends up being very small.
The text in the Sample text example starts out being 5em but the swf
that replaces it ends up being about 12px.

I can get it working but the size is messed up.

On Dec 15, 10:36 am, banalitis banali...@googlemail.com wrote:
 Have you given line-height alongside font-size a go?

 On 15 Dec, 16:25, flycast e...@janasnyder.com wrote:

  I am trying to get the sifr plugin working. It seems to be working
  except that I cannot get the size of the font to change except by
  using zoom. I have the Gunmetal swf file specified and the font is
  changing to the Gunmetal font.

  I have tried setting the height using style in the tag and using a
  class in a seperate css file. Both times I disables the sifr plugin to
  make sure that the styles were taking.

  If I use zoom then the text gets cut off.

  What is the proper way to control font size?


[jQuery] serialScroll and jCarousel lite

2008-12-15 Thread IsRaz88

Hey, I was wondering if anyone knows how I could implement
serialScroll with jCarousel lite to get a constant scrolling function
instead of scroll then pause.

Any help is appreciated. Thanks.

-IsRaz88


[jQuery] How to access javascript variable of another frame?

2008-12-15 Thread andriscs

Hi,

If I have a page that has the following JS in header:
script
x=someValue
/script

and it has a child frame, how can I acces the value of the top page?

top.$(?).

I already tried top.$(#x) but it couldn't be read.

Is it even possible to access variables through frames?


[jQuery] Re: Using the not() filter

2008-12-15 Thread Rik Lomas

Try:

$(input).not('#addNewAddress, #addNewContactDetail').click();

Rik

2008/12/15 WhoButSB whobu...@gmail.com:

 Hello All!
 I'm trying to figure out the correct way to use the not() method.  I
 know there is also a :not() filter in selectors class but I couldn't
 get that one to work either.

 My goal is to add a click function to all the input fields on a page.
 But not select the input buttons that are nested in certain divs.

 Here is what I have tried so far:

 $(input).not($('#addNewAddress:input',
 '#addNewContactDetail:input')).click(function(){
console.log($(this).attr('id'));
 });

 AND

 $(input).not('#addNewAddress input', '#addNewContactDetail
 input').click(function(){
console.log($(this).attr('id'));
 });

 Neither have worked so far.  Should I be using the :not() command in
 the selector?

 Thanks for the help!



-- 
Rik Lomas
http://rikrikrik.com


[jQuery] eq() driving me nuts...

2008-12-15 Thread asrij...@googlemail.com

Hi Guys,

gotta problem here and i don't know why it occurs:

Example:
Simple Html Page
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
html
  head
  meta http-equiv=content-type content=text/html;
charset=windows-1250
  meta name=generator content=PSPad editor, www.pspad.com
  title/title
  script type=text/javascript src=js/jquery.js/script
  /head
  body

script type=text/javascript
jQuery.noConflict();
  jQuery(document).ready(function() {
alert( jQuery('#test:eq(1)  a:eq(0)').attr('href') );
  });
/script

div id=test
test
/div
div id=test
test
/div
  /body
/html

if '#test:eq(0)  a:eq(0)' is set, it returns the right href value.
But when I change it to '#test:eq(1)  a:eq(0)' I only get
undefinied from my alert box.

Can anyone explain me why? I dont get it, maybe I'm doing a big
mistake in my little code.

thx a lot


[jQuery] eq() driving me nuts...

2008-12-15 Thread Guengoeren


Hi Guys,

gotta problem here and i don't know why it occurs:

Example:
Simple Html Page
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
html
  head
  meta http-equiv=content-type content=text/html; charset=windows-1250
  meta name=generator content=PSPad editor, www.pspad.com
  title/title
  script type=text/javascript src=js/jquery.js/script
  /head
  body

script type=text/javascript
jQuery.noConflict();  
  jQuery(document).ready(function() {
alert( jQuery('#test:eq(1)  a:eq(0)').attr('href') );
  });
/script

div id=test
 http://www.test.de test 
/div
div id=test
 http://www.test2.de test 
/div
  /body
/html

if '#test:eq(0)  a:eq(0)' is set, it returns the right href value. But when
I change it to '#test:eq(1)  a:eq(0)' I only get undefinied from my alert
box.

Can anyone explain me why? I dont get it, maybe I'm doing a big mistake in
my little code.

thx a lot 
-- 
View this message in context: 
http://www.nabble.com/-jQuery--eq%28%29-driving-me-nuts...-tp21022666s27240p21022666.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] How to link myFunction(this) to a div

2008-12-15 Thread WebGrunt

Hi

I'm new to jQuery and here's one thing that doesn't make sense.  How
do I link an existing function with this as argument to a div?

The function to be called is really simple:

function test(e)
{
  alert(e.id);
  //Also tried e.getAttribute(id) or e.attr(id)
}

Here is what I tried so far inside the $(document).ready(function()
{}); part:

$(div.someClass).each(function(){
  $(this).test();
});

$(div.someClass).each(function(){
  $(this).test;
});

$(div.someClass).each(function(){
  $(this).click(test);
});

$(div.someClass).each(function(){
  $(this).click(test());
});

Alternatively, I tried:

function test(strId)
{
  alert(strId);
}

$(div.someClass).each(function(){
  var strId = $(this).attr(id);
  $(this).test(strId);
});

$(div.someClass).each(function(){
  var strId = $(this).attr(id);
  $(this).click(test(strId));
});

Can someone point me in the right direction?  Maybe it's just one of
the many different combo's I haven't tried, but I'm rather amazed that
something this basic is so difficult to get right (and find
documentation on).

Thanks!


[jQuery] Optimized Code

2008-12-15 Thread issya

I recently made this small script and was thinking it is a bit long.
It works just fine, I was wondering if there is any way to make it
shorter or is this right? Thanks in advance for the help.

$(document).ready(
function()
{
if ($('input:checked').val() == 'city') {
$('.city').show();
$('.zip').hide();
$('.county').hide(); }
else if ($('input:checked').val() == 'zip') {
$('.zip').show();
$('.city').hide();
$('.county').hide(); }
else if ($('input:checked').val() == 'county') {
$('.county').show();
$('.zip').hide();
$('.city').hide(); }
else {
$('.city').show();
$('.zip').hide();
$('.county').hide(); }

$('input').click(function() {
if ($(this).val() == 'city') {
$('.city').show();
$('.zip').hide();
$('.county').hide();

$('#id_zip_code').find('option:first').attr('selected',
'selected').parent('select');

$('#id_county').find('option:first').attr('selected',
'selected').parent('select');
}
else if ($(this).val() == 'zip') {
$('.zip').show();
$('.city').hide();
$('.county').hide();

$('#id_city').find('option:first').attr('selected',
'selected').parent('select');

$('#id_county').find('option:first').attr('selected',
'selected').parent('select');
}
else if ($(this).val() == 'county') {
$('.county').show();
$('.city').hide();
$('.zip').hide();

$('#id_zip_code').find('option:first').attr('selected',
'selected').parent('select');

$('#id_city').find('option:first').attr('selected',
'selected').parent('select');
}
});
}
);


[jQuery] [validate] ignore: using '.multiple, .selectors'

2008-12-15 Thread Andy Blackwell

For others wanting to utilize multiple selectors in their ignore
parameter ala:

$validator = $('form.validate').validate({
ignore: '.ignore, .ignore :input, :hidden :input'
});

Just one item must be changed in v1.5 to allow this, which will only
add to the functionality and not detract anything.

Line#421 Before: .not( this.settings.ignore )
Line#421 ---After: .not( $(this.settings.ignore) )

This:
// select all valid inputs inside the form (no submit or reset
buttons)
// workaround $Query([]).add until http://dev.jquery.com/ticket/2114
is solved
return $([]).add(this.currentForm.elements)
.filter(:input)
.not(:submit, :reset, :image, [disabled])
.not( this.settings.ignore )
.filter(function() {
!this.name  validator.settings.debug  window.console 
console.error( %o has no name assigned, this);
// select only the first element for each name, and only those 
with
rules specified
if ( this.name in rulesCache || 
!validator.objectLength($(this).rules
()) )
return false;
rulesCache[this.name] = true;
return true;
});


Becomes This:
// select all valid inputs inside the form (no submit or reset
buttons)
// workaround $Query([]).add until http://dev.jquery.com/ticket/2114
is solved
return $([]).add(this.currentForm.elements)
.filter(:input)
.not(:submit, :reset, :image, [disabled])
.not( $(this.settings.ignore) )
.filter(function() {
!this.name  validator.settings.debug  window.console 
console.error( %o has no name assigned, this);
// select only the first element for each name, and only those 
with
rules specified
if ( this.name in rulesCache || 
!validator.objectLength($(this).rules
()) )
return false;
rulesCache[this.name] = true;
return true;
});


[jQuery] Looking for an automated image replace loop

2008-12-15 Thread BarisArt

I have this list of images:

ul
  liimg src=image1.jpg alt=Image 1 //li
  li style=display: noneimg src=image2.jpg alt=Image 2 //
li
  li style=display: noneimg src=image3.jpg alt=Image 3 //
li
/ul

What I would like to have is an jQuery method which fades Image1 after
a few seconds and then appears Image2. And so on. After the last
image, Image 1 should be displayed again.

Is this possible in jQuery?



[jQuery] Re: eq() driving me nuts...

2008-12-15 Thread Rik Lomas

It's probably due to the fact that you're only allowed one id on the
page at a time, $('#example') should only ever return one element,
which is probably why $('#example:eq(1)') isn't working

There's more on this here:
http://www.tizag.com/cssT/cssid.php

Rik

2008/12/15 Guengoeren guengoe...@acocon.de:


 Hi Guys,

 gotta problem here and i don't know why it occurs:

 Example:
 Simple Html Page
 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
 html
  head
  meta http-equiv=content-type content=text/html; charset=windows-1250
  meta name=generator content=PSPad editor, www.pspad.com
  title/title
  script type=text/javascript src=js/jquery.js/script
  /head
  body

script type=text/javascript
jQuery.noConflict();
  jQuery(document).ready(function() {
alert( jQuery('#test:eq(1)  a:eq(0)').attr('href') );
  });
/script

div id=test
 http://www.test.de test
/div
div id=test
 http://www.test2.de test
/div
  /body
 /html

 if '#test:eq(0)  a:eq(0)' is set, it returns the right href value. But when
 I change it to '#test:eq(1)  a:eq(0)' I only get undefinied from my alert
 box.

 Can anyone explain me why? I dont get it, maybe I'm doing a big mistake in
 my little code.

 thx a lot
 --
 View this message in context: 
 http://www.nabble.com/-jQuery--eq%28%29-driving-me-nuts...-tp21022666s27240p21022666.html
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.





-- 
Rik Lomas
http://rikrikrik.com


[jQuery] Re: How to link myFunction(this) to a div

2008-12-15 Thread Rik Lomas

The simplest way would be to do something like test($(this)); as test
is a function, not a method of the jQuery object.

The more complex way would be to extend jQuery to allow method so you
could use $(this).test();
http://docs.jquery.com/Core/jQuery.fn.extend

Rik

2008/12/15 WebGrunt bievie...@gmail.com:

 Hi

 I'm new to jQuery and here's one thing that doesn't make sense.  How
 do I link an existing function with this as argument to a div?

 The function to be called is really simple:

 function test(e)
 {
  alert(e.id);
  //Also tried e.getAttribute(id) or e.attr(id)
 }

 Here is what I tried so far inside the $(document).ready(function()
 {}); part:

 $(div.someClass).each(function(){
  $(this).test();
 });

 $(div.someClass).each(function(){
  $(this).test;
 });

 $(div.someClass).each(function(){
  $(this).click(test);
 });

 $(div.someClass).each(function(){
  $(this).click(test());
 });

 Alternatively, I tried:

 function test(strId)
 {
  alert(strId);
 }

 $(div.someClass).each(function(){
  var strId = $(this).attr(id);
  $(this).test(strId);
 });

 $(div.someClass).each(function(){
  var strId = $(this).attr(id);
  $(this).click(test(strId));
 });

 Can someone point me in the right direction?  Maybe it's just one of
 the many different combo's I haven't tried, but I'm rather amazed that
 something this basic is so difficult to get right (and find
 documentation on).

 Thanks!




-- 
Rik Lomas
http://rikrikrik.com


[jQuery] Re: How to access javascript variable of another frame?

2008-12-15 Thread RobG



On Dec 16, 9:00 am, andriscs izochr...@gmail.com wrote:
 Hi,

 If I have a page that has the following JS in header:
 script
 x=someValue
 /script

 and it has a child frame, how can I acces the value of the top page?

If you are using frames, then from a child frame either:

  parent.x

for the parent frame or

  top.x

for the very top frame (which might also be the parent) will do.


--
Rob


[jQuery] Re: Looking for an automated image replace loop

2008-12-15 Thread Kean

This might work

I will give the ul an id=gallery

var loop = function(){
//current slide
var cur = $(#gallery li:visible);
   // fade out current li, on finish fade in next li
   cur.fadeOut(500, function(){
  // run the loop function again when time is up, in this case 5
seconds
  cur.next().fadeIn(500, setTimeout(loop, 5000));
});
}
// on the first time wait for 5 seconds before transitioning
setTimeout(loop, 5000);

On Dec 15, 1:39 pm, BarisArt baris...@gmail.com wrote:
 I have this list of images:

 ul
   liimg src=image1.jpg alt=Image 1 //li
   li style=display: noneimg src=image2.jpg alt=Image 2 //
 li
   li style=display: noneimg src=image3.jpg alt=Image 3 //
 li
 /ul

 What I would like to have is an jQuery method which fades Image1 after
 a few seconds and then appears Image2. And so on. After the last
 image, Image 1 should be displayed again.

 Is this possible in jQuery?


[jQuery] Re: Looking for an automated image replace loop

2008-12-15 Thread Kean

I forgot to include the detection script to see if it's the last child

var cur = $(#gallery li:visible);
  if (cur.is(:last-child) ) {
  cur.fadeOut(500, function(){
  // run the loop function again when time is up, in this case 5
seconds
  $(#gallery li:first-child).fadeIn(500, setTimeout(loop,
5000));
});

  }

else {
cur.fadeOut(500, function(){
  // run the loop function again when time is up, in this case 5
seconds
  cur.next().fadeIn(500, setTimeout(loop, 5000));
});

}


On Dec 15, 3:32 pm, Kean shenan...@gmail.com wrote:
 This might work

 I will give the ul an id=gallery

 var loop = function(){
     //current slide
     var cur = $(#gallery li:visible);
    // fade out current li, on finish fade in next li
    cur.fadeOut(500, function(){
       // run the loop function again when time is up, in this case 5
 seconds
       cur.next().fadeIn(500, setTimeout(loop, 5000));
     });}

 // on the first time wait for 5 seconds before transitioning
 setTimeout(loop, 5000);

 On Dec 15, 1:39 pm, BarisArt baris...@gmail.com wrote:

  I have this list of images:

  ul
    liimg src=image1.jpg alt=Image 1 //li
    li style=display: noneimg src=image2.jpg alt=Image 2 //
  li
    li style=display: noneimg src=image3.jpg alt=Image 3 //
  li
  /ul

  What I would like to have is an jQuery method which fades Image1 after
  a few seconds and then appears Image2. And so on. After the last
  image, Image 1 should be displayed again.

  Is this possible in jQuery?


[jQuery] Re: eq() driving me nuts...

2008-12-15 Thread Karl Rudd

There shouldn't be 2 elements with the same id. Try using a class.

There are no a elements inside the divs. I presume this is just a
cut and paste error?

Karl Rudd

On Tue, Dec 16, 2008 at 9:24 AM, asrij...@googlemail.com
asrij...@googlemail.com wrote:

 Hi Guys,

 gotta problem here and i don't know why it occurs:

 Example:
 Simple Html Page
 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN
 html
  head
  meta http-equiv=content-type content=text/html;
 charset=windows-1250
  meta name=generator content=PSPad editor, www.pspad.com
  title/title
  script type=text/javascript src=js/jquery.js/script
  /head
  body

script type=text/javascript
jQuery.noConflict();
  jQuery(document).ready(function() {
alert( jQuery('#test:eq(1)  a:eq(0)').attr('href') );
  });
/script

div id=test
test
/div
div id=test
test
/div
  /body
 /html

 if '#test:eq(0)  a:eq(0)' is set, it returns the right href value.
 But when I change it to '#test:eq(1)  a:eq(0)' I only get
 undefinied from my alert box.

 Can anyone explain me why? I dont get it, maybe I'm doing a big
 mistake in my little code.

 thx a lot



[jQuery] Re: How to link myFunction(this) to a div

2008-12-15 Thread Kean

I didn't quite get what you meant but by judging on Rik's solution you
can integrate custom functions into jQuery

(function($) {
  $.fn.test = function() {
alert(this.id);
  }
})(jQuery);

body id=wellwellwell/body

// this alerts wellwellwell
$(body).test();

On Dec 15, 3:23 pm, Rik Lomas lomas@gmail.com wrote:
 The simplest way would be to do something like test($(this)); as test
 is a function, not a method of the jQuery object.

 The more complex way would be to extend jQuery to allow method so you
 could use $(this).test();http://docs.jquery.com/Core/jQuery.fn.extend

 Rik

 2008/12/15 WebGrunt bievie...@gmail.com:





  Hi

  I'm new to jQuery and here's one thing that doesn't make sense.  How
  do I link an existing function with this as argument to a div?

  The function to be called is really simple:

  function test(e)
  {
   alert(e.id);
   //Also tried e.getAttribute(id) or e.attr(id)
  }

  Here is what I tried so far inside the $(document).ready(function()
  {}); part:

  $(div.someClass).each(function(){
   $(this).test();
  });

  $(div.someClass).each(function(){
   $(this).test;
  });

  $(div.someClass).each(function(){
   $(this).click(test);
  });

  $(div.someClass).each(function(){
   $(this).click(test());
  });

  Alternatively, I tried:

  function test(strId)
  {
   alert(strId);
  }

  $(div.someClass).each(function(){
   var strId = $(this).attr(id);
   $(this).test(strId);
  });

  $(div.someClass).each(function(){
   var strId = $(this).attr(id);
   $(this).click(test(strId));
  });

  Can someone point me in the right direction?  Maybe it's just one of
  the many different combo's I haven't tried, but I'm rather amazed that
  something this basic is so difficult to get right (and find
  documentation on).

  Thanks!

 --
 Rik Lomashttp://rikrikrik.com


[jQuery] Re: How to access javascript variable of another frame?

2008-12-15 Thread andriscs

Thanks, it worked, I thought I tried it already, apparently didn't.

On dec. 16, 00:32, RobG rg...@iinet.net.au wrote:
 On Dec 16, 9:00 am, andriscs izochr...@gmail.com wrote:

  Hi,

  If I have a page that has the following JS in header:
  script
  x=someValue
  /script

  and it has a child frame, how can I acces the value of the top page?

 If you are using frames, then from a child frame either:

   parent.x

 for the parent frame or

   top.x

 for the very top frame (which might also be the parent) will do.

 --
 Rob


[jQuery] Re: Optimized Code

2008-12-15 Thread Kean

Here's how I will code it.

jQuery(function($)
{ // this means document.ready

  var optionDisplay = function() {
var val = $(input:checked).val();
$(.city, .zip, .country).hide();

if (val.length  0)
  $(.+val).show();
else
  $(.city).show();

$(#id_zip_code, #id_country, #id_city).find('option:first').attr
('selected', 'selected');

  }

  optionDisplay(); // run optionDisplay on document ready

  $('input').click(optionDisplay);

});

On Dec 15, 1:55 pm, issya floridali...@gmail.com wrote:
 I recently made this small script and was thinking it is a bit long.
 It works just fine, I was wondering if there is any way to make it
 shorter or is this right? Thanks in advance for the help.

 $(document).ready(
         function()
         {
                 if ($('input:checked').val() == 'city') {
                         $('.city').show();
                         $('.zip').hide();
                         $('.county').hide(); }
                 else if ($('input:checked').val() == 'zip') {
                         $('.zip').show();
                         $('.city').hide();
                         $('.county').hide(); }
                 else if ($('input:checked').val() == 'county') {
                         $('.county').show();
                         $('.zip').hide();
                         $('.city').hide(); }
                 else {
                         $('.city').show();
                         $('.zip').hide();
                         $('.county').hide(); }

                 $('input').click(function() {
                 if ($(this).val() == 'city') {
                                 $('.city').show();
                                 $('.zip').hide();
                                 $('.county').hide();
                                 
 $('#id_zip_code').find('option:first').attr('selected',
 'selected').parent('select');
                                 
 $('#id_county').find('option:first').attr('selected',
 'selected').parent('select');
                 }
                 else if ($(this).val() == 'zip') {
                                 $('.zip').show();
                                 $('.city').hide();
                                 $('.county').hide();
                                 
 $('#id_city').find('option:first').attr('selected',
 'selected').parent('select');
                                 
 $('#id_county').find('option:first').attr('selected',
 'selected').parent('select');
                 }
                 else if ($(this).val() == 'county') {
                                 $('.county').show();
                                 $('.city').hide();
                                 $('.zip').hide();
                                 
 $('#id_zip_code').find('option:first').attr('selected',
 'selected').parent('select');
                                 
 $('#id_city').find('option:first').attr('selected',
 'selected').parent('select');
                 }
                 });
         }
 );


[jQuery] Re: Naming rules by class

2008-12-15 Thread Kean

The answer is yes. I have no idea if there's a validation widget out
there that fulfill your needs.

Just a quick example of how you can probably build the widget on your
own.


input class=required /


jQuery(function($){
  $(input.required).blur(function(){
if (this.val.length == 0)
  alert(field is required);
  });
});

On Dec 15, 12:26 pm, ycuentocorto olivares.rodr...@gmail.com wrote:
 Can I name the validations by classname, in order to verfify all
 fiuelds that match with specified classname?

 For example set that all input that have a class  date  (input
 class=other_class date ... ...) will be checked in required, min and
 max lenght an others.

 Thanks in advance.


[jQuery] Re: Odd issues passing JSON to server [resolved]

2008-12-15 Thread Shawn Grover


Just to put an answer to this, in case someone else runs into it...

The problem was a PHP issue.  The problem line was

$data = json_decode($_GET[p]);

That line is perfectly fine, and the p var does have data.  However 
the quotes in the string were automatically escaped.  So the line needed 
to be changed to read


$data = json_decoe(stripslashes($_GET[p));

At which point it worked as expected.

Shawn

Shawn Grover wrote:


I'm not sure if I have a server side issue or a client side issue.  The 
problem is that I am generating a JSON string in my plugin, and passing 
it to a php page (though the back end shouldn't matter in the long run). 
 I can see that a parameter is infact passed, but trying to decode that 
string is giving me nothing - not even errors.  Sooo, I'm stuck not 
knowing if the json string is invalid, or I'm doing something wrong on PHP.


I have a pastie with the code in question at http://pastie.org/338246.

Any tips are appreciated.  Thanks.

Shawn


[jQuery] fisheye: Position fixed: how?

2008-12-15 Thread Boz

Hallo everyone, i'm using a script found on:
http://www.ndesign-studio.com/blog/design/css-dock-menu
I noticed that it use jquery and interface.js . I've changed css
style, using position fixed for dock2. so images reamains on the
botton of the screen while i scroll the page, but the sensible area
which is used to animate images, reamains on the top.. why? somebody
can help me?
i've tested here: 
http://www.stephenking.it/frm/viewtopic.php?f=12t=37160start=0

Sorry for my bad english, but i'm really tired.
Thank you all.


[jQuery] Superfish anyway for the menu to go right rather than left?

2008-12-15 Thread mrha...@gmail.com

I am getting ready to launch supperfish on my site and have been asked
that if the subs hit the right side of the page that it reverse
direction. I have never seen anyone do this but admit I have not fully
researched this. I cant post the site for the public bit will share it
if someone needs to see it to help. I have 5 or 6 sub menus and
sometimes I fall off the page a bit less usable for some of the deep
items.

Thanks for your help!


[jQuery] jQuery and PHP form problem

2008-12-15 Thread Magnificent

Hi all, I've been messing around with jQuery (which is pretty cool),
but I'm having an issue with jQuery form binding and PHP $POST
variable processing.

Basically, what I'm running into is my php branch is not executed
while the form has an id (jQuery is taking precendence). If I remove
the id, the php branch works, but then obviously the jQuery code
doesn't run.

Anyone have any ideas how I can get both to run? Can I put php code in
jQuery code? I've tried to but so far have not had success! Below is a
snippet of my code:

form id=form_search method=post
 label for=search_fieldSearch:/label
 input id=search name=search_field type=text
 input id=btnSearch name=search_button type=submit
value=Go
/form

//this php executes when there is no form id
?php
if($_POST['search_button']){
 //do whatever when form is submitted
?

//this jQuery binding trumps the php code
$('#form_search').bind('submit', function() {
//do stuff here on submit
});


[jQuery] Hovering the mouse through multiple div's that intersect?

2008-12-15 Thread Janmansilver

I have 4 div boxes that intersect with each other. They are all
supposed to fade in if the mouse is hovering over any of them and not
fade out when the mouse hovers from from one div box to another
directly, only when the mouse leaves the area that all the divs cover,
are they supposed to fade out.

How do I solve this?

(to make it a bit more complicated I would also like to make 2 of the
divs fade slower than the rest.)

$('.wPictures,#wInfo').hover(
  function () {
$('.wPictures,#wInfo').animate({opacity: 1.0,}, 1);
$('#wLeft,#wRight').show();
  },
  function () {
$('.wPictures,#wInfo').animate({opacity: 0.0,}, 250);
$('#wLeft,#wRight').hide();
  }
);

});


[jQuery] Re: submenu position: left or right

2008-12-15 Thread mrha...@gmail.com

I am also looking for the same thing, any solution?


[jQuery] Re: Using the not() filter

2008-12-15 Thread Kean

This probably will work too.

$(input:not(#addNewAddress, #addNewContactDetail)).click();

On Dec 15, 3:01 pm, Rik Lomas lomas@gmail.com wrote:
 Try:

 $(input).not('#addNewAddress, #addNewContactDetail').click();

 Rik

 2008/12/15 WhoButSB whobu...@gmail.com:





  Hello All!
  I'm trying to figure out the correct way to use the not() method.  I
  know there is also a :not() filter in selectors class but I couldn't
  get that one to work either.

  My goal is to add a click function to all the input fields on a page.
  But not select the input buttons that are nested in certain divs.

  Here is what I have tried so far:

  $(input).not($('#addNewAddress:input',
  '#addNewContactDetail:input')).click(function(){
                         console.log($(this).attr('id'));
  });

  AND

  $(input).not('#addNewAddress input', '#addNewContactDetail
  input').click(function(){
                         console.log($(this).attr('id'));
  });

  Neither have worked so far.  Should I be using the :not() command in
  the selector?

  Thanks for the help!

 --
 Rik Lomashttp://rikrikrik.com


[jQuery] Re: click function

2008-12-15 Thread Kean

Here's exactly the function that you need.

http://docs.jquery.com/Events/toggle#fnfn2fn3.2Cfn4.2C...

On Dec 15, 8:56 am, theCrandallSter thecrandalls...@gmail.com wrote:
 I am not exactly sure what you are doing with the positioning, but
 try .toggle() instead perhaps?

 Cheers

 On Dec 15, 11:13 am, Alfredo Alessandrini alfreal...@gmail.com
 wrote:

  I've a simple question..

  I'm writing a function that call an event on first mouse click and
  call another event on second mouse click.

  But I've some problem, because work only the first mouse click:

  jQuery(document).ready(function() {
  $(.menu a).click(function() {
      $(this).next(em).animate({opacity: show, top: -205}, slow);

      $(this).next(em).animate({opacity: hide, top: -205}, fast);

          });

  });

  Any help.. :-)

  Thanks in advance,

  Alfredo


[jQuery] Re: jQuery and PHP form problem

2008-12-15 Thread Mike Alsup

 Basically, what I'm running into is my php branch is not executed
 while the form has an id (jQuery is taking precendence). If I remove
 the id, the php branch works, but then obviously the jQuery code
 doesn't run.

 Anyone have any ideas how I can get both to run? Can I put php code in
 jQuery code? I've tried to but so far have not had success! Below is a
 snippet of my code:

 form id=form_search method=post
      label for=search_fieldSearch:/label
      input id=search name=search_field type=text
      input id=btnSearch name=search_button type=submit
 value=Go
 /form

You should never have an element with an id value that does not match
its name value.  Get that straightened out and you'll be fine.


[jQuery] Re: incompatible while creating image element with IE

2008-12-15 Thread joe

i use the three way to create a image element,it works on all browsers
except IE,
IE just not show the image element.
thank you.

On 12月16日, 上午2时25分, brian bally.z...@gmail.com wrote:
 On Mon, Dec 15, 2008 at 10:41 AM, joe zhoulongh...@gmail.com wrote:

  $(image/).attr({src:imagesrc,alt:joe})
  .mouseover(function(){this.src=imagel+imageid;})
  .mouseout(function(){this.src=images+imageid;})
  .appendTo($(#bc+bookrecno));

  $(image src=\+imagesrc+\/)
  .mouseover(function(){this.src=imagel+imageid;})
  .mouseout(function(){this.src=images+imageid;})
  .appendTo($(#bc+bookrecno));

  $(input type='image'/).attr({src:imagesrc,alt:joe})
  .mouseover(function(){this.src=imagel+imageid;})
  .mouseout(function(){this.src=images+imageid;})
  .appendTo($(#bc+bookrecno));

  IE is the only bugger.

 You might be more likely to get a response if you were to mention what
 the problem is.


[jQuery] Re: Hovering the mouse through multiple div's that intersect?

2008-12-15 Thread Jeffrey Kretz

You could put all 4 boxes inside a containing div, and apply the hover event
to that parent div.

When you move from one child div to another, it will not fire the mouseleave
event.

JK

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Janmansilver
Sent: Monday, December 15, 2008 4:09 PM
To: jQuery (English)
Subject: [jQuery] Hovering the mouse through multiple div's that intersect?


I have 4 div boxes that intersect with each other. They are all
supposed to fade in if the mouse is hovering over any of them and not
fade out when the mouse hovers from from one div box to another
directly, only when the mouse leaves the area that all the divs cover,
are they supposed to fade out.

How do I solve this?

(to make it a bit more complicated I would also like to make 2 of the
divs fade slower than the rest.)

$('.wPictures,#wInfo').hover(
  function () {
$('.wPictures,#wInfo').animate({opacity: 1.0,}, 1);
$('#wLeft,#wRight').show();
  },
  function () {
$('.wPictures,#wInfo').animate({opacity: 0.0,}, 250);
$('#wLeft,#wRight').hide();
  }
);

});



[jQuery] Animation speed dilemma...

2008-12-15 Thread Dan G. Switzer, II

I'm working on an ESPN style ticker and one of the problems I'm running in
to is that I need to base animation on a specific speed, not a duration.

Right now the animations all are based on duration (aka complete this
animation in 2 seconds.) However, I need my animations to all run at the
same visual speed (like 12/frames a seconds.)

Any easy way to do this with the built-in animation methods? I can roll the
animation up manually, but thought there might be a tip for converting the
animation speed to frames per second instead of overall duration.

-Dan




[jQuery] Re: jQuery and PHP form problem

2008-12-15 Thread Magnificent

I'm not sure I understand.  If you're saying change my inputs to:

input id=search name=search type=text
input id=btnSearch name=btnSearch type=submit value=Go

That has no effect, the jQuery form binding still trumps the php $POST
branch.

On Dec 15, 4:43 pm, Mike Alsup mal...@gmail.com wrote:
  Basically, what I'm running into is my php branch is not executed
  while the form has an id (jQuery is taking precendence). If I remove
  the id, the php branch works, but then obviously the jQuery code
  doesn't run.

  Anyone have any ideas how I can get both to run? Can I put php code in
  jQuery code? I've tried to but so far have not had success! Below is a
  snippet of my code:

  form id=form_search method=post
       label for=search_fieldSearch:/label
       input id=search name=search_field type=text
       input id=btnSearch name=search_button type=submit
  value=Go
  /form

 You should never have an element with an id value that does not match
 its name value.  Get that straightened out and you'll be fine.


[jQuery] Re: Animation speed dilemma...

2008-12-15 Thread Dave Methvin

Do you have a link to a ticker similar to the one you want to create?
I didn't see one on the ESPN site.

Also, what if the client can't keep up with 12 frames/sec? Should it
drop frames?


[jQuery] Re: Hovering the mouse through multiple div's that intersect?

2008-12-15 Thread Janmansilver

Thanks that worked perfectly! :-)

On Dec 16, 1:55 am, Jeffrey Kretz jeffkr...@hotmail.com wrote:
 You could put all 4 boxes inside a containing div, and apply the hover event
 to that parent div.

 When you move from one child div to another, it will not fire the mouseleave
 event.

 JK

 -Original Message-
 From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On

 Behalf Of Janmansilver
 Sent: Monday, December 15, 2008 4:09 PM
 To: jQuery (English)
 Subject: [jQuery] Hovering the mouse through multiple div's that intersect?

 I have 4 div boxes that intersect with each other. They are all
 supposed to fade in if the mouse is hovering over any of them and not
 fade out when the mouse hovers from from one div box to another
 directly, only when the mouse leaves the area that all the divs cover,
 are they supposed to fade out.

 How do I solve this?

 (to make it a bit more complicated I would also like to make 2 of the
 divs fade slower than the rest.)

 $('.wPictures,#wInfo').hover(
       function () {
         $('.wPictures,#wInfo').animate({opacity: 1.0,}, 1);
         $('#wLeft,#wRight').show();
       },
       function () {
         $('.wPictures,#wInfo').animate({opacity: 0.0,}, 250);
         $('#wLeft,#wRight').hide();
       }
     );

 });


[jQuery] Re: Animation speed dilemma...

2008-12-15 Thread Dan Switzer

Dae,

I'm talking about the ticker that ESPN uses on TV. As far as how many
FPS per second, I have decided what I'm using. I'm just needing to
make the visual speed of scrolling consistent (which is done by moving
an element to the left until it's no longer visible) to be the same no
matter how wide the element is.

Using duration based speed, an element 400px wide will appear to
scroll slower than an element 800px wide. I want the speed of the
animation to look the same.

Part of the reason I want to use the native animation methods is
because so much work has gone into make the animations smooth--I don't
want to re-invent the wheel.

-Dan

On Mon, Dec 15, 2008 at 8:07 PM, Dave Methvin dave.meth...@gmail.com wrote:

 Do you have a link to a ticker similar to the one you want to create?
 I didn't see one on the ESPN site.

 Also, what if the client can't keep up with 12 frames/sec? Should it
 drop frames?



[jQuery] Re: jQuery and PHP form problem

2008-12-15 Thread Magnificent

I'm wondering if echo'ing the jQuery script inside my PHP code will
work. If I do:

if($_POST['search_button']){
   echo 
  script type='text/javascript'
  alert('inside post branch');
  /script
   ;
}

That works fine, but if I copy/paste in my jQuery code I want
executed:

if($_POST['search_button']){
   echo 
  script type='text/javascript'
  jQuery(function(){
  $('#form_search').bind('submit', function() {
 //code here
 });
  });
  /script
 ;
}

I think the error was jQuery is not defined.  It's just a copy/paste
of existing jQuery code that works fine elsewhere on the page.


  1   2   >