[jQuery] Superfish, menu out of screen

2009-12-17 Thread jonas
Hi!

Is is possible to check if a new UL is rendered outside the browser
window?

When using Superfish with default settings, UL's can get rendered
outside the browser window if we have manu child levels, which just
enables the browser scroll. We would for example like the UL to be
rendered to the left, instead of on the right.

Any thoughts?

Regards
Jonas


[jQuery] Re: Validation plugin (bassistance.de) problem

2009-04-22 Thread Jonas

Yeah, I know about the regular behaviour, but the problem is that the
live validation behaves incorrect.

When it validates an input as valid, it sometimes doesn't revalidate
it when you clear the field (so it should state as invalid, but it
still says it's valid).

The behaviours is random. Sometimes it happens on the first field,
sometimes on another.

On Apr 17, 2:17 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
wrote:
 The behaviour is described 
 here:http://docs.jquery.com/Plugins/Validation/Reference#Validation_event

 Jörn

 On Fri, Apr 17, 2009 at 10:46 AM, Jonas jonassa...@gmail.com wrote:

  Example form:http://jquery.bassistance.de/validate/demo/milk/
  (this is the demo for the script onbassistance.de)

  When it does 'live' validation (on blur) it tells the user if the
  field is correct or incorrect. When you fill in the first field, tab
  to the next field, go back to the previous (allready filled in) field
  and clear it, it still counts as valid (notice the icon next to the
  field).

  Since the field is now empty, it should state as invalid, but it
  doesn't.

  This behaviour is random, sometimes it works, sometimes it doesn't.
  Sometimes it happens in the first field, sometimes on one of the
  other.

   It only happens before you try to submit the form, after a page
  submit everything works fine.

  Anybody who has a clue?


[jQuery] Validation plugin (bassistance.de) problem

2009-04-17 Thread Jonas

Example form: http://jquery.bassistance.de/validate/demo/milk/
(this is the demo for the script on bassistance.de)

When it does 'live' validation (on blur) it tells the user if the
field is correct or incorrect. When you fill in the first field, tab
to the next field, go back to the previous (allready filled in) field
and clear it, it still counts as valid (notice the icon next to the
field).

Since the field is now empty, it should state as invalid, but it
doesn't.

This behaviour is random, sometimes it works, sometimes it doesn't.
Sometimes it happens in the first field, sometimes on one of the
other.

 It only happens before you try to submit the form, after a page
submit everything works fine.

Anybody who has a clue?


[jQuery] Working with hash?

2009-03-15 Thread Jonas

I need some advice on working with the hash, are there any good
plugins or alike that I could use? The bestw ould be something like
mysite.com#name=jonasphone=12345

Then I'd do something like
var myHash = getHashObject();

the object would then be soemthing like
{
name: 'jonas',
phone: 12345
}

And something to write to the hash
var myNewHash = {
name: 'donald',
phone: 54321
}
writeHash(myNewHash);

I guess there isn't anything exactly like that but something similiar
would be nice if anyone know something.


[jQuery] [autocomplete] Is it possible to get the array it is working on?

2009-03-14 Thread Jonas

Or maybe this can be done ina  nicer way, let me explain what i want
to do

When you enter something in the field and it matches with one of the
items in the list I want to change the style of the field to bold. I
tried this

$(#name).result(function(event, data, formatted) {
  $('#name').css({fontWeight: 'bold'});
});

But it has 2 drawbacks:
1. It is only executed if I select the item form the autocompletelist,
not if the user simply writes exactly the right thing.
2. If they select the item and the field gets bold as it should and
they THEN remove a letter or write more so it no longer matches I want
to change it back.


Unless there's built in functionality for this the solution I had in
mind was:
$(#name).keydown( function(event) {
  if($(#name).val() in thearray)
  {
make bold
  }
  else
  {
make unbold
  }
}

but then I need a way to fetch the array.


[jQuery] [autocomplete] Force open the search list

2009-03-14 Thread Jonas

I have a text field with autocomplete and now I want to force the list
of matches to show (like when writing a letter).

Say, the user writes hello then unfocus the field. Is it possible to
add an action to a button so when it's pressed it shows the
autocompletematches for the field where the user wrote hello?


Something along the lines of
$('#field').showResults();
If there isn't a function for it already, how can I add it manually to
the jquery.autocomplete.js file?


[jQuery] Re: Is it possible to get the array it is working on?

2009-03-14 Thread Jonas

Hmm it remoevs what I put bwtween [] from the title?
Anyway, the title were supposed to be [autocomplete]Is it possible to
get the array it is working on?

On Mar 14, 10:55 am, Jonas jonas.sjob...@gmail.com wrote:
 Or maybe this can be done ina  nicer way, let me explain what i want
 to do

 When you enter something in the field and it matches with one of the
 items in the list I want to change the style of the field to bold. I
 tried this

 $(#name).result(function(event, data, formatted) {
   $('#name').css({fontWeight: 'bold'});

 });

 But it has 2 drawbacks:
 1. It is only executed if I select the item form the autocompletelist,
 not if the user simply writes exactly the right thing.
 2. If they select the item and the field gets bold as it should and
 they THEN remove a letter or write more so it no longer matches I want
 to change it back.

 Unless there's built in functionality for this the solution I had in
 mind was:
 $(#name).keydown( function(event) {
   if($(#name).val() in thearray)
   {
     make bold
   }
   else
   {
     make unbold
   }

 }

 but then I need a way to fetch the array.


[jQuery] Re: Force open the search list

2009-03-14 Thread Jonas

I found the solution. I simply did

$('#name').click();

On Mar 14, 3:08 pm, Jonas jonas.sjob...@gmail.com wrote:
 I have a text field with autocomplete and now I want to force the list
 of matches to show (like when writing a letter).

 Say, the user writes hello then unfocus the field. Is it possible to
 add an action to a button so when it's pressed it shows the
 autocompletematches for the field where the user wrote hello?

 Something along the lines of
 $('#field').showResults();
 If there isn't a function for it already, how can I add it manually to
 the jquery.autocomplete.js file?


[jQuery] Traversing nested lists and selecting descendants

2008-11-18 Thread Jonas Hallgren

Hi,

I'm a stumbling beginner at jQuery and despite my best efforts at
serching for an answer I just can't seem to find a solution that is
clear to me. So here goes:

I am trying to build a file-explorer using nested UL:s. The folders
are all closed by default and when clicking they are meant to expand.

So I try this:

$(document).ready(function() {
$(.folderroot .folder).click(function(e) {
  var $subs = $(e.target).children();
  $($subs).slidetoggle();
});
});


And this seemed to work at first, but when I started using more levels
in my nesting the subfolders seems to get one event for each level in
my folder structure, opening and instantly closing etc..

So I need to target the first level descendant, and here I cannot find
the correct syntax

What I want to do:

$(document).ready(function() {
$(.folderroot .folder).click(function(e) {
  var $subs = $(e.target);
  $($subs +  ul).slidetoggle();
});
});

but this of course doesn't work.

Can anybody help me out here, any help would be greatly appreciated!