[jQuery] Re: Deactivating parent link with JQuery

2009-09-24 Thread Andi23

First of all, let's clarify the actual HTML.  I assume this is what
you have:
ul
lia href=#Link 1/a/li
lia href=#Link 2/a/li
lia href=#Link 3/a
ul
lia href=#Link 3a/a/li
lia href=#Link 3b/a/li
lia href=#Link 3c/a/li
/ul
/li
lia href=#Link 4/a/li
/ul

When you say remove the link, I assume you want to turn this:
lia href=#Link 3/a
into this:
liLink 3

Given that, try this jQuery:
$(li ul).siblings(a).each(function(){
$(this).replaceWith($(this).html());
});


[jQuery] Re: Deactivating parent link with JQuery

2009-09-24 Thread Andi23

In that case, you can just remove the href attribute of the link(s):
$(li ul).siblings(a).removeAttr(href);

or, if you want to leave in the href attribute for future use?, you
can do this:
$(li ul).siblings(a).click(function(){
return false;
});

good luck-


[jQuery] Re: Changing a class name without clicking

2009-09-24 Thread Andi23

Hi there,
You say you want to do this by calling a function, not by clicking.
But let me ask you something: How are you going to call the function?
In other words, when do you want this class change to happen?  Do you
want it to happen as soon as the page loads?  Do you want it to happen
10 seconds after the page loads?  Do you want it to happen when you
mouse over a little red button that says Mouse over me to change the
class now?  I can't help you without this information.
Andi


[jQuery] Re: Execute jQuery from links

2009-09-24 Thread Andi23

That should work in theory, but your structure is wrong.

If you do something like this:
a href=# onclick=$(this).text('yes');Will this work?/a
you will see that it works when you click it.

The javascript: protocol is not necessary, but it won't break anything
if you leave it in.


[jQuery] Re: missing background-image

2009-09-13 Thread Andi23

I think that $(this) may not work in that context.

See if this works:
$('.panel').each(function(){
$(this).css(/*set CSS here*/);
});