[jQuery] Re: preventDefault

2009-08-23 Thread Hans

Thanks, James!

the :has() selector did not work on the 'if' statement, but you put me
on the right track.

the code now looks like this:

$('ul#hoofdNavigatieLijst > li > ul > li:has("ul") > a ').click
(function(event) {
event.preventDefault();
});

and it works like a charm.

thanks again!

On 21 aug, 22:09, James  wrote:
> I think you want to use :has() selector instead of 
> contains().http://docs.jquery.com/Selectors/has
>
> I think contains() works only for text nodes and not elements. I
> haven't tested it to be sure.
>
> On Aug 20, 9:06 pm, Hans  wrote:
>
>
>
> > hello everybody,
>
> > the site I'm building has a dropdown menu based on an unordered list
> > with 3 levels. I've got it working nicely using jQuery, but there is
> > one thing I can't get working..
>
> > this is the problem:
>
> > the 'a href' on the first tow levels serves to open up the level below
> > without leaving the page. there is a real link for the non-script
> > users, so I have switched off the first two levels using
> > "event.preventDefault();"
>
> > however, on the second level some items do not contain any 3rd level
> > links, so in that case the user should navigate away using the 2nd
> > level link. therefore the link on level 2 should one be disabled if
> > the list-item contains a list (ul).
>
> > I tried doing this:
>
> >         $('ul#hoofdNavigatieLijst > li > ul > li > a 
> > ').click(function(event)
> > {
> >                 if ($(this).parent('li').contains('ul')) {
> >                 event.preventDefault();
> >                 }
> >                 });
>
> > it doesn't do the trick, however.
>
> > can anyone help me? thanks!- Tekst uit oorspronkelijk bericht niet 
> > weergeven -
>
> - Tekst uit oorspronkelijk bericht weergeven -


[jQuery] preventDefault

2009-08-21 Thread Hans

hello everybody,

the site I'm building has a dropdown menu based on an unordered list
with 3 levels. I've got it working nicely using jQuery, but there is
one thing I can't get working..

this is the problem:

the 'a href' on the first tow levels serves to open up the level below
without leaving the page. there is a real link for the non-script
users, so I have switched off the first two levels using
"event.preventDefault();"

however, on the second level some items do not contain any 3rd level
links, so in that case the user should navigate away using the 2nd
level link. therefore the link on level 2 should one be disabled if
the list-item contains a list (ul).

I tried doing this:

$('ul#hoofdNavigatieLijst > li > ul > li > a ').click(function(event)
{
if ($(this).parent('li').contains('ul')) {
event.preventDefault();
}
});

it doesn't do the trick, however.

can anyone help me? thanks!


[jQuery] Re: attr difference in Firefox and IE7

2008-05-20 Thread hans



On May 20, 1:35 pm, Sid <[EMAIL PROTECTED]> wrote:
> Karl,
>
> Thanks a lot :-)
>
> Works perfectly well. But IE still shows an error notification in the
> status bar. I'm just afraid it might come in between as I add more
> features. Any ideas?
>
> Regards

The "original blue" anchor has a mouseover event defined where you
call a function that doesn't exist.
-> onmouseover="prev('style1')"



[jQuery] Re: How to speed up performance of html() and load()

2008-04-21 Thread hans

I would like to second this, besides the problems mentioned above this
also causes the bug in IE that triggers the security warning (http://
support.microsoft.com/kb/925014). The only way to prevent this seems
to be replacing the code in the empty function with
this.innerHTML="";

Any news or thoughts about this from the guru's would be apreciated!
hans


[jQuery] Drupal jQuery plugin wrapper

2008-04-20 Thread Hans Riemenschneider
Hi Group!

I've been struggling with implementing jQuery plugins into Drupal 6. I've
spent a day and a half attempting various means of creating the wrapper
Drupal will understand.

Also, which is the preferred method (and when?)
drupal_add_js http://api.drupal.org/api/function/drupal_add_js/6
jQuery plugins module http://drupal.org/project/jquery_plugin

If anyone who has installed a jQuery plugin into a Drupal 6 site could
please dumb down the process for me, I'd be very grateful.

Thank you!


[jQuery] Re: each loop selects to much

2007-10-31 Thread hans

Ahh that explains clearly why my expectations were so different from
the results.

Thank you both Glen and Dave!



[jQuery] jQuery article on dev.opera.com

2007-10-30 Thread Hans S . Tømmerholt

Hello.

Been lurking this list for quite some time. I'm impressed with the  
activity and friendliness here. I'd just like to give you a heads up that  
I've posted an article about jQuery on http://dev.opera.com, the developer  
website made by Opera Software. It's meant as an article in a series  
covering different JavaScript toolkits and comparing them. I was writing  
just while you guys finished up 1.2, so unfortunately it deals primarily  
with 1.1.4.

See:
http://dev.opera.com
http://dev.opera.com/articles/view/introduction-to-javascript-toolkits/
http://dev.opera.com/articles/view/jquery-write-less-do-more/

-- 
Hans S. Tømmerholt
Developer, Web Applications, Opera Software


[jQuery] $(document) bug?

2007-09-13 Thread hans

Hi,

I just downloaded the latest version(1.2) and the $(document) object
doesn't seem to be functioning. I tried the new $(document).height()
which always returns 0 (zero) for me and binding the resize event
isn't working for me either. The code:

$(document).height();

$(document).resize(function(){
  alert("Stop it!");
});


Is this a bug or am i missing something? :)

thanks,
Hans