Re: [jQuery] Superfish How-to?

2009-11-30 Thread Charlie




there's a Joomla plugin that will install superfish css, script, a
substitute for supersubs and also i believe hover intent. The biggest
issue that comes up on this board regarding superfish is from Joomla
installs. The install works fine, but the existing menu css can
conflict with superfish css. It doesn't usually cause any dramatic
failure, it just makes tracing css rules difficult for many as one
element may be governed by a superfish css rule, and another by
existing template menu css

If you have any familiarity with Firebug or other DOM inspector's it's
easy to see hierarchy. personally i find commenting out old menu
easiest , however often these rules have the backgrounds you need to
match template

flashwood59 wrote:

  Hi,
I would like to try superfish in a joomla template.
I am new to this list.  I need somebody to guide me through the
procedures to get it working.
a. Where do you create or copy files to in the site structure, root or
template folder?
b. When using hoverIntent, where do those files go?
c. What changes are necessary in the index.php file?
d. Which CSS files affect the styling and operation of superfish
plugin?
e. Is it necessary to install anything via the administrator backend.



I have been using joomla for about a year, I am comfortable working
with CSS and html.

Sincerely,

Jeff

  






Re: [jQuery] get random record?

2009-11-30 Thread Charlie




link to different random functions depending on db
http://www.petefreitag.com/item/466.cfm

$getJSON and volia!

Dave Maharaj :: WidePixels.com wrote:

  Has anyone come across a simple function
that will get a random record from the db?
   
  I just need to send a request every min or
so to get new content from the db and change the content. Pretty much
like a banner rotator but used for random content.
   
  thanks,
   
  Dave






Re: [jQuery] Validate: a question about the Remote option

2009-11-30 Thread Juan Ignacio Borda
hey..!!! you have to actually ECHO the result of your validation the 
remote method expects the response to be true or false.


good luck!
 Original Message 

Hello everyone,

I'm still dealing with that signup form.
Now I'd like to check with an Ajax call if a login is already taken.
That's what I'm doing:

$("#signup").validate( {
rules: {
ulogin: {
required: true,
// It's a custom method checking a regexp, it's working
login: true,
rangelength: [3,20],
remote: "check.php?w=1"
},
   ...

Here's the check.php file:

// Including the connection file, blah blah
...
$valid=true;
// Since I'm planning to use this file as a multipurpose script,
//preventing it from stop working
if (!isset($_REQUEST['w'])) $_REQUEST['w']=1;
if ($_REQUEST['w']==1) {
// If the login is taken, it will return something >0
$number=mysql_num_rows(mysql_query("SELECT `Id` FROM `Users` WHERE 
`Login`='".$_REQUEST['ulogin']."'", $link));
if ($number>0) $valid=false; else $valid=true;
}
After I validate, it stops working: it says incorrect for all fields
after the second submit. After the first submit it says nothing, even
that the login is already taken.
What's wrong?
Thanks!

  



<>

[jQuery] Changing the "Pager" navigation elements?

2009-11-30 Thread Josh
I have a gallery that uses the prev/next function with the pager
navigation elements in between. What I would like to do is have the
pager elements displayed as "4/15" (for example) rather than have
fifteen different elements in a row with the fourth one displayed as
being active. I understand that you can use CSS to style the elements,
but I think this is something that has to be changed in the jquery
script itself. Has anyone tried this?


Re: [jQuery] Best Practices or unobtrusive Javascript

2009-11-30 Thread Shawn
The blocking is an issue, but only if you end up loading more than XXX 
number of elements at a time.  The specific number is browser dependent. 
 I think I read somewhere that IE8 and FF3.5 will only load 4 items 
concurrently (CSS files, JS libraries, images, etc).


So, the knee-jerk solution is to minimize your libraries, compress them 
where possible, enable caching, etc.  OR, load a single JS library that 
will then add the needed elements after the page loads.


Sure putting JS at the end of a file, or even in the middle of the file 
may help with performance, but I would slap my subordinates upside the 
head (in a friendly manner, of course) for doing that.  It makes 
maintaining pages a pain in the rear, seeing as every other page I've 
worked on in recent years puts JS in the header (either library 
includes, or page specific code), AND is contrary to the coding 
standards for our projects.  Writing code that is generally consistent 
with what others tend to do makes that code much easier to understand 
and maintain.


But I recognize the "many ways to do things" rule, and don't mean to 
suggest "my way is right".  If you have the volume where you *really* 
need to worry about performance, then the rules get bent anyways and 
creative solutions are found.  Such as merging all JS libraries into one 
file, then gzipped


My random thoughts.

Shawn

Rafał Pocztarski wrote:

2009/11/30 breadwild :

I have seen several examples on jQuery plugin sites that have the

[jQuery] Re: jquery.form.js and uploading only files

2009-11-30 Thread RobL
I didn't find the solution I was after, however I approached it a
different way. Instead of taking an existing form and removing
elements, I built a new form and cloned the elements I needed and
submitted it. If anyone can demonstrate a cleaner way to do this I'd
be glad to see it.

Cheers

RobL

  $('form input[type="file"]').livequery(function(){

$(this).change(function() {

  input = $(this);
  form  = input.parent().parent('form');
  image = form.find('img');

  // recreate form with the only input we care about
  new_form = cloneForm(form).append(input.clone());

  $('body').append(new_form);

  new_form.ajaxSubmit({
beforeSerialize: function (f,o) {
  o.data = input.serialize();
},
beforeSubmit: function(a,f,o) {
  o.dataType = 'json';
},
complete: function(XMLHttpRequest, textStatus) {
  input.attr('value','');
  image.attr('src', XMLHttpRequest.responseText);
  new_form.hide();
  new_form.remove();
},
  });

});
  });

  function cloneForm(form) {
// reconstruct the important parts of the form
new_form = $('');
new_form.attr('action',form.attr('action') + '/upload');
new_form.attr('method',form.attr('method'));
new_form.attr('enctype',form.attr('enctype'));
new_form.append(form.find('input[name="_method"]').clone());
new_form.append(form.find('input[name="authenticity_token"]').clone
());
new_form.append('');
return new_form;
  }


[jQuery] Re: Best Practices or unobtrusive Javascript

2009-11-30 Thread RobG


On Dec 1, 12:41 am, Scott Sauyet  wrote:
> On Nov 29, 8:21 pm, breadwild  wrote:
>
> > I have seen several examples on jQuery plugin sites that have the
> > 

Re: [jQuery] jQuery expander won't work in Safari?

2009-11-30 Thread Karl Swedberg
It looks like you might be getting a JavaScript error due to a  
conflict between Mootools and jQuery. Not sure why it's happening in  
Safari, but not Firefox. This is the error that appears in Safari's  
error console:


53TypeError: Result of expression '($(filter)|| 
document).getElementsBySelector' [undefined] is not a function.


--Karl


Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Nov 30, 2009, at 2:49 PM, trigramnorth wrote:


Hi, I'm using the code found here for jQuery expander:
http://plugins.learningjquery.com/expander/

It seems to work fine in Firefox but not in Safari. Can anybody help
me figure out why?

Demo link: 
http://www.howtohostamurder.com/index.php?option=com_content&view=article&id=51




[jQuery] Re: Hide chat content

2009-11-30 Thread Scott Sauyet
On Nov 30, 11:00 am, Jerry Johnson  wrote:
> Ya, here is my problem. I know how to make the ajax call, and it all works,
> but, I need to somehow connect the msg id from the mysql database to the
> ajax call, so I need another div, that has the id.

There are many ways to do this.  One simple one is to use an id, or
part of one, now that you know not to repeat the ids or use completely
numeric ones.  Something like this:

  Message 1 here. (delete)
  Message 2 here. (delete)
  Message 3 here. (delete)

$("div.message a").click(function() {
var $msgDiv = $(this).parents("div:first");
var id = $msgDiv[0].id.substring(4);
alert("Pretending to do ajax call involving message " + id);
$msgDiv.fadeOut();
return false;
});

See http://jsbin.com/ebapo (code http://jsbin.com/ebapo/edit)

Good luck,

  -- Scott


Re: [jQuery] slideToggle Functions

2009-11-30 Thread Richard D. Worth
Each of the methods you mention accept (optionally) a single callback
function as a final argument. Neither accept more than one. See:

http://docs.jquery.com/Effects/toggle#speedcallback

http://docs.jquery.com/Effects/slideToggle#speedcallback

If you want to do something different in one case as opposed to another,
check whether the element is visible and then call the appropriate animation
method to show or hide, along with anything else you want to do at the same
time. Or call the toggle or slideToggle, and put your if inside the single
callback, like so:

$('#my-element').click(function() {
  var wasHidden = $('#list-element').is(':hidden');
  $('#list-element').slideToggle(200, function(){
if (wasHidden) {
  $('#status-element').html('show artist index');
  console.log('show');
} else {
  $('#status-element').html('hide artist index');
  console.log('hide');
}
  });
});

- Richard

On Mon, Nov 30, 2009 at 1:39 PM, Gavin  wrote:

> I have a simple bit of jQuery that I just can't get working.
>
> $('#my-element').click(function(){
>$('#list-element').slideToggle(function(){
>$('#status-element').html('show artist
> index');
>console.log('show');
>},function(){
>$('#status-element').html('hide artist
> index');
>console.log('hide');
>}
>);
>});
>
> Right? Simple? I've had it working before, but whenever the element is
> clicked, the element toggles but the console prints 'hide' every time
> and the #status-element never gets changed. I have also tried just
> using toggle() instead of slideToggle and also
>
> slideToggle(200,function(){...
>
> (including the speed before the callback functions).
>
> Any ideas would be appreciated!
>
> Thanks,
> Gavin
>


[jQuery] Using jQuery to total multiple sets of textboxes?

2009-11-30 Thread Equalizer700
I have some code that someone gave me that sums the contents of all
textboxes with the class "additem, and puts the sum in the textbox
with the class "totalitem".  I am not a javascript or jQuery Guru by
any means, but here it is:

$(document).ready(function() {
var total = 0;
var initialText;
//add a focus event to be able to determine if the text has
changed.
$(".additem").focus(function() {
initialText = this.value;
});

//now we evaluate if the text has changed, and if so, update
the total.
$(".additem").blur(function() {
if (this.value != initialText) {
//get the Total currently
total = parseInt($(".totalitem").html());
//subtract the amount we're changing
total -= initialText;
//add in the new amount
total += parseInt(this.value);
//update the total
$(".totalitem").html(total);
}
});

$(".additem").each(function() {
total += parseInt(this.value);
});
$(".totalitem").html(total);
});

How could this be modified to allow summing multiple sets of textboxes
(using each set using a different class name) into multiple total
textboxes (again using different class names)?  Can this somehow be
converted to a function, or can the selectors be dynamically modified
some way?

Any help or advice will be appreciated!


[jQuery] Looking for term in JSON

2009-11-30 Thread Chad
What I have currently is once the page loads the wordStats goes out
and counts the words and then it takes them and we use the most
popular to pull information from a JSON file.

The problem is that if it does not find the most popular word then it
just gives off an error and I am not sure how to provided it with a
default value.

I have pasted my code below along with a sample of my JSON.

Thanks.

$(function() {
var count = 3;

$.extend($.wordStats.stopWords, {'retrieved': true,
'2007': true});

$.wordStats.computeTopWords(count);

for(var i = 0, j = $.wordStats.topWords.length; i < j && i
<= count; i++) {

var $type = 
$.wordStats.topWords[0].substring(1);

}

$.getJSON('test.json',function(data) {

$.each(data[$type], function(key,state) {

alert(state);

});
});

$.wordStats.clear();
});


 JSON

{
'corvair' :
 { 'corvair' : 'Corvairs are fun!'},
'default' :
 {'default' : 'Default Text'}
}




[jQuery] jQuery expander won't work in Safari?

2009-11-30 Thread trigramnorth
Hi, I'm using the code found here for jQuery expander:
http://plugins.learningjquery.com/expander/

It seems to work fine in Firefox but not in Safari. Can anybody help
me figure out why?

Demo link: 
http://www.howtohostamurder.com/index.php?option=com_content&view=article&id=51


[jQuery] Re: Best Practices or unobtrusive Javascript

2009-11-30 Thread Scott Sauyet
On Nov 30, 10:32 am, Andre Polykanine  wrote:
> I prefer to put JS in header, also. But I read somewhere that there is
> a bug dealing with an interference of PHP's $variables and jQuery
> $-notation, so it's suggested to put the jQuery functions into the
> body and not into the head section. Is it true?

I don't do much PHP these days, but when I do, I've never run across
such a bug.  I suppose that if you use double-quoted strings in PHP to
generate JavaScript output, then you would need to escape the "$", but
I don't do that anyway.

  -- Scott


[jQuery] Validate: a question about the Remote option

2009-11-30 Thread Andre Polykanine
Hello everyone,

I'm still dealing with that signup form.
Now I'd like to check with an Ajax call if a login is already taken.
That's what I'm doing:

$("#signup").validate( {
rules: {
ulogin: {
required: true,
// It's a custom method checking a regexp, it's working
login: true,
rangelength: [3,20],
remote: "check.php?w=1"
},
   ...

Here's the check.php file:

// Including the connection file, blah blah
...
$valid=true;
// Since I'm planning to use this file as a multipurpose script,
//preventing it from stop working
if (!isset($_REQUEST['w'])) $_REQUEST['w']=1;
if ($_REQUEST['w']==1) {
// If the login is taken, it will return something >0
$number=mysql_num_rows(mysql_query("SELECT `Id` FROM `Users` WHERE 
`Login`='".$_REQUEST['ulogin']."'", $link));
if ($number>0) $valid=false; else $valid=true;
}
After I validate, it stops working: it says incorrect for all fields
after the second submit. After the first submit it says nothing, even
that the login is already taken.
What's wrong?
Thanks!

-- 
With best regards from Ukraine,
Andre
Skype: Francophile; Wlm&MSN: arthaelon @ yandex.ru; Jabber: arthaelon @ 
jabber.org
Yahoo! messenger: andre.polykanine; ICQ: 191749952
Twitter: m_elensule



[jQuery] get random record?

2009-11-30 Thread Dave Maharaj :: WidePixels.com
Has anyone come across a simple function that will get a random record from
the db?
 
I just need to send a request every min or so to get new content from the db
and change the content. Pretty much like a banner rotator but used for
random content.
 
thanks,
 
Dave


Re: [jQuery] Jquery specialist for hire

2009-11-30 Thread Jerry Johnson
I'll do it for $5. paypal: laces...@gmail.com
email me at: jerryhost@gmail.com


Re: [jQuery] Jquery specialist for hire

2009-11-30 Thread Michael Geary
There was a pretty good example posted here a few days ago that may have all
the code you need:

http://groups.google.com/group/jquery-en/msg/546500f34de23d79

The problem that Darjana was asking about shouldn't apply in your case; just
be sure to use the full absolute URL to your Server 2.

You'll need to fill in the specifics, but you can see where the jQuery code
sends some data up to the server, the PHP code on the server reads that data
and sends back a JSON response (actually JSONP - that's how you work around
the cross-domain issue), and the jQuery code reads that data that the server
sent.

-Mike

On Mon, Nov 30, 2009 at 8:40 AM, Bjorn Symister  wrote:

>  I have posted on craigslist with no luck, so I will post here.  I am
> seeking a specific jQuery solution.  Please name your rate and I can pay
> through paypal.  I needed this solution last week :)
>
> My Scenario, 2 Servers, 2 Scripts, 1 Form.
> Form collects Email addresses.  This form is on Server 1: my client end
> server.  I can only place html,javascript,css on this server.  No server
> side scripts.
>
> On Server 2: I will have a php script that will receive the data or use
> jQuery getJSON to get it..
>
> Problem: I need to handle the submission of the data without refreshing the
> entire page (need Ajax).  Problem is however using Ajax, you cannot send
> data to another domain (So I’ve read).  Options are using an iFrame or JSON.
>  I would prefer JSON, however at this point, I just need a solution.  If you
> know how to do this, please just name your fixed rate to provide the scripts
> and I’ll take it from there.
>
> Thanks,
>
> Bjorn
>


[jQuery] slideToggle Functions

2009-11-30 Thread Gavin
I have a simple bit of jQuery that I just can't get working.

$('#my-element').click(function(){
$('#list-element').slideToggle(function(){
$('#status-element').html('show artist index');
console.log('show');
},function(){
$('#status-element').html('hide artist index');
console.log('hide');
}
);
});

Right? Simple? I've had it working before, but whenever the element is
clicked, the element toggles but the console prints 'hide' every time
and the #status-element never gets changed. I have also tried just
using toggle() instead of slideToggle and also

slideToggle(200,function(){...

(including the speed before the callback functions).

Any ideas would be appreciated!

Thanks,
Gavin


[jQuery] superfish

2009-11-30 Thread jq
does anyone know how to make the text link color of a superfish menu
remain highlighted when navigating to its submenus?

I have a menu where you see the link text only (not the background).

I can only get the list item background to remain onhover, but not the
enclosed link color.

Maybe this is a css question: can I change the color of a link inside
a list item by hovering over the list item but not the link.

any pointers would be helpful

thanks

jq


[jQuery] Re: Having trouble getting Superfish to work...

2009-11-30 Thread flashwood59
Hi,
I would like to try superfish in a joomla template.
I am new to this list.  I need somebody to guide me through the
procedures to get it working.
a. Where do you create or copy files to in the site structure, root or
template folder?
b. When using hoverIntent, where do those files go?
c. What changes are necessary in the index.php file?
d. Which CSS files affect the styling and operation of superfish
plugin?
e. Is it necessary to install anything via the administrator backend.

I have been using joomla for about a year, I am comfortable working
with CSS and html.

Sincerely,

Jeff


[jQuery] Looking for Plugin

2009-11-30 Thread KevinM2k
Hi,

I'm looking for a jQuery plugin that can do the same thing as this
site:

http://www.totalpropertyservices.co.uk/services.php

you'll see near the top there are 4 images which when rollover an
overlay pops up, but the image can (if wanted) also fade to others
similar to the cycle plugin for jQuery.

Does anyone know of a plugin that can already do this behaviour? It
seems like it is the cycle plugin mixed with some kind of overlay one.

Thanks

Kev


[jQuery] Superfish How-to?

2009-11-30 Thread flashwood59
Hi,
I would like to try superfish in a joomla template.
I am new to this list.  I need somebody to guide me through the
procedures to get it working.
a. Where do you create or copy files to in the site structure, root or
template folder?
b. When using hoverIntent, where do those files go?
c. What changes are necessary in the index.php file?
d. Which CSS files affect the styling and operation of superfish
plugin?
e. Is it necessary to install anything via the administrator backend.



I have been using joomla for about a year, I am comfortable working
with CSS and html.

Sincerely,

Jeff


Re: [jQuery] Re: Problem with plugins

2009-11-30 Thread Michael Geary
Could it be that you are also loading prototype.js or some other library
that redefines the $() function?

Does it find plugin methods if you use jQuery(...)... instead of $(...)...?

Do the built-in jQuery methods show up?

What does it display if you enter each of these lines into the Firebug
console:

$().jquery

jQuery().jquery

Sooner or later you may have to post that test page. Sooner would be better,
save us all a lot of work. :-)

-Mike

On Mon, Nov 30, 2009 at 7:48 AM, Paulodemoc  wrote:

> The plugins are being loaded. When I open the source code and click on
> the js url, it opens alright
> But when I call the command:
>
> $(selector).pluginFunction({options});
>
> An error message appears saying that pluginFunction is not a
> function... on ALL plugins...
>
> On Nov 27, 12:45 pm, Brett Ritter  wrote:
> > On Mon, Nov 23, 2009 at 5:55 AM,Paulodemoc wrote:
> > > Its the javasscript on the php page, and the only php there is to
> > > output the urls, and these urls are being printed correctly
> > > The url doesn't affect the understanding of the rest of the code...
> >
> > If your plugins aren't loading, those URLs are quite likely involved.
> > We have no way of knowing if they are indeed working since we don't
> > see the output.
> >
> > Try sending the HTML the browser is getting.
> >
> > --
> > Brett Ritter / SwiftOne
> > swift...@swiftone.org
>


[jQuery] Jquery specialist for hire

2009-11-30 Thread Bjorn Symister
I have posted on craigslist with no luck, so I will post here.  I am seeking
a specific jQuery solution.  Please name your rate and I can pay through
paypal.  I needed this solution last week :)

My Scenario, 2 Servers, 2 Scripts, 1 Form.
Form collects Email addresses.  This form is on Server 1: my client end
server.  I can only place html,javascript,css on this server.  No server
side scripts.

On Server 2: I will have a php script that will receive the data or use
jQuery getJSON to get it..

Problem: I need to handle the submission of the data without refreshing the
entire page (need Ajax).  Problem is however using Ajax, you cannot send
data to another domain (So I¹ve read).  Options are using an iFrame or JSON.
I would prefer JSON, however at this point, I just need a solution.  If you
know how to do this, please just name your fixed rate to provide the scripts
and I¹ll take it from there.

Thanks,

Bjorn


[jQuery] Re: Problem with plugins

2009-11-30 Thread Scott Sauyet
On Nov 30, 10:48 am, Paulodemoc  wrote:
> The plugins are being loaded. When I open the source code and click on
> the js url, it opens alright
> But when I call the command:
>
> $(selector).pluginFunction({options});
>
> An error message appears saying that pluginFunction is not a
> function... on ALL plugins...

As others have said, this seems to mean that the plug-in scripts are
not referenced properly.  Is there a way you can strip down your
output and post it, perhaps on JSBin?

  -- Scott


Re: [jQuery] Re: Hide chat content

2009-11-30 Thread Jerry Johnson
Ya, here is my problem. I know how to make the ajax call, and it all works,
but, I need to somehow connect the msg id from the mysql database to the
ajax call, so I need another div, that has the id.


[jQuery] Re: Problem with plugins

2009-11-30 Thread Paulodemoc
The plugins are being loaded. When I open the source code and click on
the js url, it opens alright
But when I call the command:

$(selector).pluginFunction({options});

An error message appears saying that pluginFunction is not a
function... on ALL plugins...

On Nov 27, 12:45 pm, Brett Ritter  wrote:
> On Mon, Nov 23, 2009 at 5:55 AM,Paulodemoc wrote:
> > Its the javasscript on the php page, and the only php there is to
> > output the urls, and these urls are being printed correctly
> > The url doesn't affect the understanding of the rest of the code...
>
> If your plugins aren't loading, those URLs are quite likely involved.
> We have no way of knowing if they are indeed working since we don't
> see the output.
>
> Try sending the HTML the browser is getting.
>
> --
> Brett Ritter / SwiftOne
> swift...@swiftone.org


Re: [jQuery] Re: Best Practices or unobtrusive Javascript

2009-11-30 Thread Andre Polykanine
Hello Scott and all,

I prefer to put JS in header, also. But I read somewhere that there is
a bug dealing with an interference of PHP's $variables and jQuery
$-notation, so it's suggested to put the jQuery functions into the
body and not into the head section. Is it true?
-- 
With best regards from Ukraine,
Andre
Skype: Francophile; Wlm&MSN: arthaelon @ yandex.ru; Jabber: arthaelon @ 
jabber.org
Yahoo! messenger: andre.polykanine; ICQ: 191749952
Twitter: m_elensule

- Original message -
From: Scott Sauyet 
To: jQuery (English) 
Date: Monday, November 30, 2009, 4:41:04 PM
Subject: [jQuery] Re: Best Practices or unobtrusive Javascript

On Nov 29, 8:21 pm, breadwild  wrote:
> I have seen several examples on jQuery plugin sites that have the
> 

RE: [jQuery] Selector Help

2009-11-30 Thread Rick Faircloth
Good, practical formatting for understand “the chain”…

 

 

From: Michael Geary [mailto:m...@mg.to] 
Sent: Monday, November 30, 2009 3:28 AM
To: jquery-en@googlegroups.com
Subject: Re: [jQuery] Selector Help

 

That's a nice solution.

Let's make it easier to follow with some indentation:

$('a.filter').click(function() {
$(this)
.closest('ul')
.children()
.removeClass('active')
.end()
.end()
.closest('li')
.addClass('active');
});

The basic indentation rules we're following here are:

* Put each method call on a line by itself, with the "." at the beginning of
the line. (You can put more than one call on the same line, but only when
they don't change the selection.)

* Where a method creates the jQuery object or changes its element selection,
indent the next line.

* Where .end() is called, un-indent that line.

You could even go overboard on readability and add the missing .end() calls
at the very end:

$('a.filter').click(function() {
$(this)
.closest('ul')
.children()
.removeClass('active')
.end()
.end()
.closest('li')
.addClass('active')
.end()
.end();
});

Now this looks a lot like the way we indent blocks in JavaScript and other
languages. Each .closest() or .children() call is matched up with its own
.end() call - as is the initial $(this) - and the indentation indicates the
code affected by each of those calls.

It's more customary to omit those trailing.end() calls, but with or without
them, the indentation is a great help in visualizing the structure of a
complex chain.

-Mike

On Sun, Nov 29, 2009 at 11:39 PM, Michel Belleville
 wrote:

Even better :
$('a.filter').click(function() {

$(this).closest('ul').children().removeClass('active').end().end().closest('
li').addClass('active');

});


Michel Belleville



2009/11/29 Mauricio (Maujor) Samy Silva 

 

Try this:

 

$('a.filter').click(function(){
  $(this).parent().siblings('li').removeClass('active');
  $(this).parent('li').addClass('active');
});

 

Maurício

-Mensagem Original- 

De: Charlie   

Para: jquery-en@googlegroups.com 

Enviada em: domingo, 29 de novembro de 2009 03:56

Assunto: Re: [jQuery] Selector Help

...


Dave Maharaj :: WidePixels.com wrote:
How would I go about adding  class to the li in this set up?
 all
some
none

...

  

 

 

 



[jQuery] Re: jquery problems - please help - not a CODER - just an USER

2009-11-30 Thread Scott Sauyet
On Nov 30, 6:48 am, Escu  wrote:
> i got an wordpress theme (paid one) and it uses jquery. I got a plugin
> (WP Ajax Edit Comments 3.1) that uses jquery too. The problem is that
> both jquerys doesn't work together. When i disable one, the other one
> is working. Any ideeas?

Although it's possible that someone in this forum could help you, I'd
suggest that the one with the most knowledge here are the ones who
built the theme or the plug-in.  Is there any support with the paid
theme?  Perhaps there's an upgrade to a later version of jQuery
available for the theme or the plug-in.

jQuery has not remained entirely backwards-compatible as it has
developed, and there's a reasonable chance that the theme used
features of jQuery that have changed with the newer release of jQuery
used by the plug-in, or vice versa.  jQuery has techniques that allow
you to use multiple versions on one page, but if you are not a coder,
then someone who knows the plug-in or the theme would probably have to
help you incorporate these techniques.

Good luck,

  -- Scott


[jQuery] Re: How to text inside Tag of a Table?

2009-11-30 Thread Scott Sauyet
On Nov 30, 6:43 am, "SharepointMag [yb]"
 wrote:
> var $elements = $('table');
> $elements.each(function(){
> // here i want to get the text inside the caption tag inside THIS element ...
>  }

var captionText = $("caption", this).text();

The second parameter to the "$" function is a context to search in.
In this case, "this" is the current table element, exactly what you
want for a context.  The following would also work, and I don't know
if there is any real internal difference between them:

var captionText = $(this).find("caption").text()

Cheers,

  -- Scott


[jQuery] Re: Best Practices or unobtrusive Javascript

2009-11-30 Thread Scott Sauyet
On Nov 29, 8:21 pm, breadwild  wrote:
> I have seen several examples on jQuery plugin sites that have the
> 

[jQuery] Re: Superfish - Multiple Columns

2009-11-30 Thread Chris
On Nov 22, 11:25 am, Charlie  wrote:
> : simplest case -- you can put just about any element into an LI,  , floating 
> your internal elements with 1/2 the width of the LI/UL they are in will make 
> 2columns
> Chris wrote:How would you useSuperfishto make a dropdown menu that 
> containsmultiplecolumnsof menu items?

Thanks, you're right. Turned out to be entirely a CSS/HTML issue.


[jQuery] How to text inside Tag of a Table?

2009-11-30 Thread SharepointMag [yb]
Hi,

how can i the text inside a  Tag of a table?

I am iteration though elements with this code:

var $elements = $('table');
$elements.each(function(){

// here i want to get the text inside the caption tag inside THIS
element ...

 }


[jQuery] jquery problems - please help - not a CODER - just an USER

2009-11-30 Thread Escu
i got an wordpress theme (paid one) and it uses jquery. I got a plugin
(WP Ajax Edit Comments 3.1) that uses jquery too. The problem is that
both jquerys doesn't work together. When i disable one, the other one
is working. Any ideeas?


[jQuery] jqgrid - pager in add inline form

2009-11-30 Thread CRL
Hi

I'm trying to add next/prev buttons in the default add in form of a
jqgrid. Do you have any idea or example to help me? I could add my own
buttons, but I'd like to call the same function as framework to
navigate...

Thanks in advance.

Cyril


[jQuery] JCarusel - contents of page have moved to the left

2009-11-30 Thread elena-bred...@yandex.ru
Forgive for my bad English
I have established JCarusel on the site www.persona-city.ru.
After that all contents of page have moved to the left.

How it to correct?

Elena


[jQuery] Validate plugin: insertAfter problem/question

2009-11-30 Thread Gian
I am using the jQuery Validation plugin in conjuction with the
jqTransform plugin to style the form.

I need to insert the error message after the "rowElem" div. I can do
that, but the problem is that for each input field I get all the error
messages form the other fields.
Example: if I got 3 required fields, when I hit "submit" I got 3 times
"this field is required" after each "rowElem" which include the submit
button.

Thi is the HTML output before the submission (with the output from the
jqTransform plugin):










This is the JS:


// VALIDATION + AJAX FORM
$(document).ready(function(){
$('#contactform').validate({

errorPlacement: function(error, element) {
error.insertAfter('.rowElem');
},

 submitHandler: function(form) {

   $(form).ajaxSubmit({
success: function() {
$('#contactform').hide();
$('.contact-col h4').hide();
$('#contact-col-form').append("

Thanks! Your request has been sent.

") } }); } }); }); Any help to solve this "multipling" effect is appreciated. Thanks.

[jQuery] Centering simple-modal in an iFrame

2009-11-30 Thread Christian
hi,

we have a page A with an embedded iframe B (which is quite long, but
most of the time the content only fills the part at the very top).
Displaying a simple-modal centered in the iframe B results (obviously)
in the modal being located in the non visible area. So we're wondering
whether there is an alternative to that, e.g. centering the modal in
the visible part of the iframe.

Thanks for your help, any thoughts are appreciated!


[jQuery] Superfish vertical/arrow question

2009-11-30 Thread MozreplGuy
Hi all,

I successfully included superfish into a joomla site (still on
localhost). I use it in vertical mode. It works fine. But there is one
thing that doesn't look very nice.

Every menu with a sub menu has a sub-indicator '>>' (character 187,
enabled by autoarrow flag). The indicator itself is fine. However the
indicator doesn't appear on the same line as the menu text.

For example it looks like:

Menu1
>>

But I would like it to like:

Menu1 >>



Does anybody have an idea how I could achieve that. I looked at the
code (e.g. superfish), but my skill level doesn't allow me to find a
solution :-)

I would appreciate any help.


Thanks, Mozrepl


[jQuery] Re: Hide chat content

2009-11-30 Thread Scott Sauyet
On Nov 29, 3:26 pm, Jerry Johnson  wrote:
> ok, that worked, but now I need to make an ajax call...

So go ahead and make one.  :-)

Or were you looking for more specific help?

  -- Scott


[jQuery] Re: Best Practices or unobtrusive Javascript

2009-11-30 Thread breadwild
Thanks, I did not know that.

On Nov 30, 1:09 am, Rafał Pocztarski  wrote:
> 2009/11/30 breadwild :
>
> > I have seen several examples on jQuery plugin sites that have the
> > 

[jQuery] Re: Best Practices or unobtrusive Javascript

2009-11-30 Thread breadwild
Thank you.

I'm not exactly doing Ajax, but I should have mentioned that when the
page is loaded, user-admin time preferences for innerfade.js, for
example, are selected from the database and populate template
placeholder in the Javascript.

So, it sounds like I will not be kicked out of the pool if I run my JS
in the body. Phew!

On Nov 29, 7:29 pm, Shawn  wrote:
> When doing dynamic sites, you sometimes have no choice but to put the JS
> in the body area.  My rule of thumb is to use libraries wherever
> possible and include those libraries in the  section.  But with
> the understanding that *sometimes* (though rarely these days) I will
> need to put JS into the body.
>
> Take a look at what you are doing with the code that is in the body
> area.  Can that code be wrapped up in a function and called in the
> $(document).ready() function?  If so, then that is probably what you
> should be doing to make your code more self contained.
>
> Building Ajax driven sites sometimes needs the code in the body area
> though.  If you dynamically add a block of elements and need to do
> something to them the moment they are loaded, then this *might* be a
> reasonable time to embed JS code directly.  Though I tend to use
> $.ajax() and so can just call a function after adding the elements.
> Which means I can pre-write that function in a library, with no JS
> needed in the body area.
>
> Clear as mud?  :)
>
> Shawn
>
> breadwild wrote:
> > I have seen several examples on jQuery plugin sites that have the
> >  tag and Javascript within the  and not the  where
> > I thought it was supposed to go.
>
> > It would be better for my content manager and the templating system if
> > the Javascript *were* in the  but I don't want to be guilty of
> > not having unobtrusive code.
>
> > What's the standard/acceptable/best practices method?
>
> > 
> >