[jQuery] Re: table striping performance with livequery

2008-11-26 Thread Lance White

unsubscribe


On 25/11/08 9:39 PM, Carpii [EMAIL PROTECTED] wrote:

 
 Thanks Brandon, that looks very interesting.
 Ive read a lot about event handling in jQuery and there seems to be a
 lot of different plugins, so it was hard to decide which one is best
 suited.
 
 Is there a time when livequery is more suitable than listen?
 Or even a time when I might want to use both plugins simultaneously?
 
 Thanks




[jQuery] Re: Selector Help

2008-11-26 Thread Liam Potter


almost

$('.link').click(function () {
$(this).parent().BLAHBLAHBLAH();
});



Jason wrote:

Code:

fieldset
a href= class=link/a
/fieldset

fieldset
a href= class=link/a
/fieldset

fieldset
a href= class=link/a
/fieldset

When a link is clicked, I would like to be able to reference the
particular parent fieldset element, and not all of them.

Something like this doesn't work:

$('.link').click(function () {
$(this+':parent').BLAHBLAHBLAH();
});

Thanks in advance, the help here is top notch!
  




[jQuery] [BrainStorm] $.fn.is can't support complex Event Delegation

2008-11-26 Thread sliu

Event Delegation are showing its advantage,especially in large
webapp.
what's event delegation:
http://icant.co.uk/sandbox/eventdelegation/

jquery has several plugin to support it, check the one:
http://dev.jquery.com/browser/trunk/plugins/delegate/jquery.delegate.js?rev=5519

it use $.fn.is to check whether the event.target match the selector.

but $.fn.is is too weak to support:
http://docs.jquery.com/Traversing/is

quote: If no element fits, or the expression is not valid, then the
response will be 'false'. Note: Only simple expressions are supported.
Complex expressions, such as those containing hierarchy selectors
(such as +, ~, and ) will always return 'true'. filter is used
internally, therefore all rules that apply there apply here, as well.

for example:
body
ul
  lia id=it/a/li
/ul
/body

$('#it').is('.non_exsisting_class a')

will return true, unexpectly.

I heard: jQuery is about to add event delegation feature in the next
release.
question 1: is that true?

I personally think event delegation is a big thing, to break
limitations, and lead UI programming more component-based style and
declaritive-style.

reglib is a very good javascript library to support event delegation.
its author call jQuery(prototype...) as load-traverse-modify style.  I
suffered with that style, so I admit. reglib event give some solution
to treat load-traverse-modify style.

I looked into reglib's source code, some duplicates with jQuery.

question 2: Is it possible to merge two projects together?

reglib:
http://code.google.com/p/reglib/
http://code.google.com/p/reglib/w/list


actually, I'd like step further, how about write code like this:

// define a component type named 'sidebar', which contains h2 and ul
var sidebar = reg.defineComponent('sidebar', function(sidebar){
  sidebar.init(function(){
//load tranversal and modify??
  });

  var h2 = sidebar.with(' h2');
  var ul = sidebar.with('ul');
  var li = ul.with('li');

  sidebar.data(function(topData){
h2.data(topData.title);
ul.data(topData.items);
li.data(function(topData){ this.parent.data()[this.index] });
  });

  h2.click(function(){
 alert(this.data()); //topData.title
  });

  li.hover(
function(){ this.addClass('hover');},
function(){ this.removeClass('hover'); }
  );
}

// DOM(id=sidebar) will become a sidebar component, and framework will
bind the data to it and sub-components.
reg.match('#sidebar').to('sidebar', {:title = '...', :items =
[...]});

UI-data binding is another anoying problem.


[jQuery] detect visibility of nested elements

2008-11-26 Thread schellmax

hello,
is there a selector or something to detect the visibility of a nested
element?
for example, i got the following:

div style=display:nonepInvisible text/p/div

'p:visible' will return the preceding p-tag, although it's not visible
at all, as it's parent isn't.

do i have to loop through all parents and check their 'display'
property or maybe there's a more elegant solution to this?

max


[jQuery] is anyone use linkselect on IE brower?

2008-11-26 Thread anonymous

if the select has many option(only more than 200),the page will very
delay on page loading,the cpu use will be full.any help?


[jQuery] Re: Selector Help

2008-11-26 Thread 徐显峰
yes it is

2008/11/26 Liam Potter [EMAIL PROTECTED]


 almost

 $('.link').click(function () {
$(this).parent().BLAHBLAHBLAH();
 });



 Jason wrote:

 Code:

 fieldset
 a href= class=link/a
 /fieldset

 fieldset
 a href= class=link/a
 /fieldset

 fieldset
 a href= class=link/a
 /fieldset

 When a link is clicked, I would like to be able to reference the
 particular parent fieldset element, and not all of them.

 Something like this doesn't work:

 $('.link').click(function () {
$(this+':parent').BLAHBLAHBLAH();
 });

 Thanks in advance, the help here is top notch!






[jQuery] remove objects from set

2008-11-26 Thread takeshin

Hi!

Using hints from this group, I create set of invalid fields this way:

jQuery.fn.push = function( selector_or_nodes ) {
  //  Given a selector or a jQuery 
object, append all of the
nodes to
  // the current jQuery object.
  var nodes = (typeof a == 'string') ?
  $( selector_or_nodes ) : 
selector_or_nodes;
  var node_count = nodes.length;
  for( var i = 0; i  node_count; i++ ) 
{
  this[ this.length++ ] = 
nodes[ i ]
  };

  };

$.extend({
   validation: {
   invalidFields: $([]),


   addInvalidField: 
function(field) {
   
this.invalidFields.pushIf($(field));
   }
}
});

// code here...
$.addInvalidField($('#myid1'));
// more code here...
$.addInvalidField($('#myid2'));

How to remove object from $.validation.invalidFields?

I'm trying to do it like this:

jQuery.fn.removeIf = function(selector_or_nodes) {
  //  Given a selector or a jQuery 
object, removes all of the
nodes from
  // the current jQuery object.
  var nodes = (typeof a == 'string') ?
  $(selector_or_nodes) : 
selector_or_nodes;
  for (var i = 0; ithis.length; i++) {
  for (var j=0; 
jnodes.length;j++) {
  if 
(this[i]==nodes[j]) {
  // REMOVE 
THIS ELEMENT HERE
  }
  }
  }
  };

I managed to determine if object exist in that set,
but how to remove it?

--
regards,
takeshin


[jQuery] getBoxObjectFor() is deprecated

2008-11-26 Thread edzah

Well I am getting the same error and I'm not using the flash plugin.
Anyone else get this?

Ed

**Since I can't reopen this old topic**

Pete wrote:
 I keep seeing this error message from time to time on a site that I'm
 working on.
 *Use of getBoxObjectFor() is deprecated. Try to use
 element.getBoundingClientRect() if possible.*

 The site still seems to work fine, it's just an annoying error.

 I have a feeling it has something to do with the jquery flash plugin I'm
 using, but I can't find an answer for it.  Anyone have any ideas?

 Thanks,
 -pete


[jQuery] Re: ANN: Books-a-million.com using jQuery

2008-11-26 Thread Rey Bango


Yes, you're missing the fact that this is a big company that's adopted 
jQuery. Whether they've incorporated another lib is irrelevant 
especially because we go to great lengths to ensure that jQuery 
developers aren't locked into one lib. We make sure that you can use 
jQuery with other tools.


Rey
jQuery Team

[EMAIL PROTECTED] wrote:

top site?
1Mb homepage downloadjq and proto...hmmm
Am I missing something?

On Nov 25, 4:37 am, Andy Matthews [EMAIL PROTECTED] wrote:

I used to work for the web company who developed the original BAM
site, and now a friend of mine is project manager for them. They just
released a new version of their website and it uses jQuery:

http://www.booksamillion.com/

From the source, it looks like they're really only making use of an
accordion plugin, but hey...another notch in the belt of jQuery.




[jQuery] Re: detect visibility of nested elements

2008-11-26 Thread Karl Swedberg

You can create your own pseudo-class selector:

$.extend($.expr[ : ], {
  trulyVisible : $(a).is(':visible')  !$ 
(a).parents(':hidden').length

});

Remy Sharp wrote about this a while back, and constructed the filter a  
little bit differently, but it should have the same effect:


http://remysharp.com/2008/10/17/jquery-really-visible/


--Karl


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




On Nov 26, 2008, at 3:37 AM, schellmax wrote:



hello,
is there a selector or something to detect the visibility of a nested
element?
for example, i got the following:

div style=display:nonepInvisible text/p/div

'p:visible' will return the preceding p-tag, although it's not visible
at all, as it's parent isn't.

do i have to loop through all parents and check their 'display'
property or maybe there's a more elegant solution to this?

max




[jQuery] [TUTORIAL] Create AJAX websites based on anchors navigation likes Gmail

2008-11-26 Thread AdrianMG

In this tutorial we will see how to create an AJAX website without
lose the reference to the URL. What is that not lose the reference? If
you have created some full AJAX website you have realized when you
change the web content, the URL is not updated, so, the URL reference
is lost. Services like Gmail uses it to increase the navigation's user
experience.

Check it out at: 
http://yensdesign.com/2008/11/creating-ajax-websites-based-on-anchor-navigation/

Cheers!


[jQuery] Re: IE7: loading XML per ajax

2008-11-26 Thread w-o-m

I just tried a most simple XML-file. Same result:

?xml version=1.0 encoding=UTF-8?
test
animal id=dog/animal
animal id=cat/animal
animal id=mouse/animal
/test

1. Simply opening the xml with IE works without error.
2. errorThrown points to undefined
3. It won't work without the standalone=no, either.

On 25 Nov., 23:59, George [EMAIL PROTECTED] wrote:
 The error message does indicate that it does not like something about
 XML.

 Try folowing.
 1. Save xml on your drive and simply open it with IE. See if it gives
 you an error.
 2. What does errorThrown points to?
 3. The standalone=no not sure it's valid...

 George.

 On Nov 25, 3:56 pm, w-o-m [EMAIL PROTECTED] wrote:

  That's true. But a SVG is still just an XML file. I don't need IE to
  draw the grapic, I just need the data. My script, btw, doesn't work
  with other XML's either.

  ricardobeat wrote:
   IE7 doesn't support SVG afaik.

   On Nov 25, 6:08 am, w-o-m [EMAIL PROTECTED] wrote:
Hello,

I tried to load a .svg vector graphic with $.ajax, which works
perfectly well in FF and Opera, but not in Internet Explorer.

My script looks like this:

$(document).ready(function(){
$.ajax({
type: GET,
url: test.svg,
dataType: xml,
success: function(data){ parseSVG(data); },
error: function(xhr, textStatus, errorThrown){ alert
(textStatus); }
});

});

function parseSVG(svg){
/* function that parses the DOM of the file */

}

If I run this in IE7, the error function is called. The alert box then
reads parsererror.

The svg-file looks like this (renaming it into .xml makes no
difference):

?xml version=1.0 encoding=UTF-8 standalone=no?
svg
path
d=M 167.4375,684.375 L 165.96875,685.71875 z
id=blablabla
style=fill:#79b63f;fill-opacity:1; ... /
path ... /
path ... /
/svg

I assume, that IE doesn't like something about the xml, but I don't
know what...- Hide quoted text -

  - Show quoted text -


[jQuery] Re: getBoxObjectFor() is deprecated

2008-11-26 Thread Shawn Grover


I see this occasionally, but on pages that I didn't write, or even use 
jQuery.  This is a FF issue, I believe  I could be wrong though...


Shawn

edzah wrote:

Well I am getting the same error and I'm not using the flash plugin.
Anyone else get this?

Ed

**Since I can't reopen this old topic**

Pete wrote:

I keep seeing this error message from time to time on a site that I'm
working on.
*Use of getBoxObjectFor() is deprecated. Try to use
element.getBoundingClientRect() if possible.*

The site still seems to work fine, it's just an annoying error.

I have a feeling it has something to do with the jquery flash plugin I'm
using, but I can't find an answer for it.  Anyone have any ideas?

Thanks,
-pete


[jQuery] Re: table striping performance with livequery

2008-11-26 Thread Karl Swedberg

http://www.letmegooglethatforyou.com/?q=How+do+I+unsubscribe+from+a+group%3F

--Karl


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




On Nov 26, 2008, at 3:45 AM, Lance White wrote:



unsubscribe


On 25/11/08 9:39 PM, Carpii [EMAIL PROTECTED] wrote:



Thanks Brandon, that looks very interesting.
Ive read a lot about event handling in jQuery and there seems to be a
lot of different plugins, so it was hard to decide which one is best
suited.

Is there a time when livequery is more suitable than listen?
Or even a time when I might want to use both plugins simultaneously?

Thanks







[jQuery] Re: table striping performance with livequery

2008-11-26 Thread Ariel Flesler

Hahaha! that site is great. How come I've never seen that before :D

On Wed, Nov 26, 2008 at 10:22 AM, Karl Swedberg [EMAIL PROTECTED] wrote:
 http://www.letmegooglethatforyou.com/?q=How+do+I+unsubscribe+from+a+group%3F

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



 On Nov 26, 2008, at 3:45 AM, Lance White wrote:

 unsubscribe


 On 25/11/08 9:39 PM, Carpii [EMAIL PROTECTED] wrote:


 Thanks Brandon, that looks very interesting.

 Ive read a lot about event handling in jQuery and there seems to be a

 lot of different plugins, so it was hard to decide which one is best

 suited.

 Is there a time when livequery is more suitable than listen?

 Or even a time when I might want to use both plugins simultaneously?

 Thanks




 




-- 
Ariel Flesler
http://flesler.blogspot.com


[jQuery] Re: treeview pluging issues - .find(.hitarea)

2008-11-26 Thread Dirceu Barquette
You are welcome!! :D

2008/11/26 alextait [EMAIL PROTECTED]


 thanks very much!

 :)

 On Nov 24, 4:12 am, Dirceu Barquette [EMAIL PROTECTED]
 wrote:
  Hi alextait,
 
  there is a new release for jqtreeview plugin at:
 http://downloads.sourceforge.net/jqtreevial/jqtreevial-pack-0.3.zip
 
  I've added insert and delete methods.
 
  Dirceu Barquette
 
  2008/11/21 alextait [EMAIL PROTECTED]
 
 
 
   I have taken a look at your plugin... that fantastic!
 
   Unfortunately it does not seem to do what i need.
 
   Since our category/product data is so huge... I am trying to create a
   tree that will populate the child nodes only when the parent node is
   clicked.
 
   Once loaded into the dom the user can collapse or expand nodes using
   jquery.
 
   Will continue trying to get the treeview code to work for now.
 
   thanks very much for your help!
 
   :)
 
   On 20 Nov, 16:32, Dirceu Barquette [EMAIL PROTECTED]
   wrote:
Hi,
seehttp://sourceforge.net/projects/jqtreevial/
 
I've been developing this plugin. Not complete yet, but is
 functional.
Dirceu
 
2008/11/20 alextait [EMAIL PROTECTED]
 
 I am fairly new to jquery and I am trying to create a
 product/category
 browser/tree using the treeview plugin and ajax.
 
 My first simple issue is this peice of code i am trying to
 understand.
 
 .find(.hitarea)
 
 what is happening here ? I understand the find functino but not
 sure
 about the chevron usage ?
 
 the overall problem is this.
 
 On viewing my list. if i click on one of the initial categories the
 second sub categories show up fine. I can then contract this sub
 list
 if i wish. If i leave this open and click on one of the sub
 categories
 for some reason i cannot then contract it again.
 
 I have looked into the treeview plugin code and found that the
 toggler method which would normaly just contract the list branch
 fires twice causing it to hide again.
 
 If anyone has any idea on thie general problem that would be great.
 
 thanks for any help in advance



[jQuery] Re: Replacing DIV with XML

2008-11-26 Thread Dipi Evil Danger
Didn´t worked. And returned no errors. :(
Now it don´t anything load at all.

2008/11/26 Dipi Evil Danger [EMAIL PROTECTED]

 Awesome!
 Thanks a lot.

 I´ll try it now.

 2008/11/25 ricardobeat [EMAIL PROTECTED]


 Hi,

 1. appendTo() appends content: adds content after everything that
 already exists. You can use empty() to remove the contents before
 appending, that's the exact same result as replace().
 2. replaceAll only works the first time because you are replacing the
 ol element with a div, so on the second run there is no
 '#fichaFilme ol' for the function to find.

 That kilometric string concatenation will be a pain to debug, there
 are cleaner ways to do it. I took the liberty to recode your example:
 http://pastebin.com/m76fa

 Basically you have a model mark-up for a movie and you clone it for
 each one you are displaying, so you don't need to recreate all the
 html in a string.

 abraço,
 - ricardo

 On Nov 25, 9:24 am, Dipi Evil Danger [EMAIL PROTECTED] wrote:
  I´m trying to make an dynamic page with XML values. When the visitor
 click
  on an item it replaces the content. But it is not doing his job. This is
 the
  code:
  $('a').click(function() {
  var key = $(this).attr('id').charAt(4);
  $('a').click(function() {
  var key = $(this).attr('id').charAt(4);
   $.ajax({
   type: GET,
   url: ../cms/xmlCinema.php?id=000+key,
   dataType: xml,
   success: function(xml) {
 
   $(xml).find(filme).each(function(){
  var texto =  ;
  var album =  ;
   var texto = 'div class=moviesTitle' +
  $(this).find('nome').text() + ' (i' + $(this).find('ano').text() +
  '/i)/divbr';
   texto = texto + 'div class=moviesPosterimg
  id=poster'+key+' name=poster'+key+'
  src=../cinema/poster/000'+key+'.jpg width=95/div';
   texto = texto + 'div class=moviesLabelNome
  original:/div div class=moviesDatanbsp;' +
  $(this).find('nome_original').text() + '/div';
   texto = texto + 'div
 class=moviesLabelEstréia:/div
  div class=moviesDatanbsp;' + $(this).find('data').text() +
 '/div';
   texto = texto + 'div class=moviesLabelTrilha:/div
  div class=moviesDatanbsp;' + $(this).find('trilha').text() +
 '/div';
   texto = texto + 'div class=moviesLabelGênero:/div
  div class=moviesDatanbsp;' + $(this).find('genero').text() +
 '/div';
   texto = texto + 'div class=moviesLabelPaís de
  Origem:/div div class=moviesDatanbsp;' +
  $(this).find('pais_de_origem').text() + '/div';
   texto = texto + 'div class=moviesLabelSite:/div
 div
  class=moviesDatanbsp;a href=' + $(this).find('site').text() + '
  target=_blank' + $(this).find('site').text() + '/a/div';
   texto = texto + 'div
 class=moviesLabelDuração:/div
  div class=moviesDatanbsp;' + $(this).find('duracao').text() + '
  min./div';
   texto = texto + 'div
 class=moviesLabelDireção:/div
  div class=moviesDatanbsp;' + $(this).find('duracao').text() + '
  min./div';
   //Sinopse
   texto = texto + 'div
 class=moviesLabelSinopse:/div
  div class=moviesReleasenbsp;' + $(this).find('sinopse').text() +
  '/div';
  $('div/div')
   .html(texto)
   .replaceAll('#fichaFilme ol');
   }); //close each(
   } //close sucess
   }); //close $.ajax(
  $(#fichaFilme).fadeIn(3000);}); //close click(
 
  If I use appendTo it adds content. If I use replaceAll it only works
 in
  the first time.
 
  Here is the page (working on it):
 http://www.ncweb.com.br/PHP/index.php?mod=Cinema
 
  Thanks!
 
  --
  dipi evil danger
  Gott weiß ich will kein Engel seinhttp://meadiciona.com/dipi




 --
 dipi evil danger
 Gott weiß ich will kein Engel sein
 http://meadiciona.com/dipi





-- 
dipi evil danger
Gott weiß ich will kein Engel sein
http://meadiciona.com/dipi


[jQuery] Why does :not([id=blah]) not work?

2008-11-26 Thread Jeremy Carlson

Hi there,

I'm just starting to explore using jQuery. Like it so far, but I'm
totally thrown by this.

On a page, I'm trying to hide all images in a set except the first
one. Then, when you click on a menu link, another should fade in, and
all others fade out.

The second part works - when you click on a link tag, the image w/ the
ID listed as the href of the link fades in, and any others that are
visible fade out. I'm using this:

$(#central img:not([id=href])).fadeOut(slow);

So I copied that syntax to the initial .ready function, like this:

$(#central img:not([id=thefirst])).hide();

This variable ('thefirst') is created using jQuery.url.attr(anchor),
whereas 'href' is created using $(this).attr(href), where (this)
refers to the associated link. I think the key has to be there
somehow, but I don't see it.

I've posted this page at http://jeremycarlson.com/test/jq/portfolio.htm
(there are several alerts thrown in so I can see what the variables
are at any given time, which makes the load a little odd) I just can't
see what's going wrong.

Thanks in advance for any help anyone might offer.

Here is the full js code:

script type=text/javascript src=jquery-1.2.6.js/script
script type=text/javascript 
src=jquery.url.packed.js/script
script type=text/javascript

 $(document).ready(function(){

if(undefined != jQuery.url.attr(anchor)) {
var anchor = jQuery.url.attr(anchor);
var thefirst = #+anchor;
alert (thefirst);
} else {
var thefirst = #view1;
alert(thefirst);
}

$(#central img:not([id=thefirst])).hide();

$(#central img).css({position:absolute});

$(#view-menu a).click(function(event){
$(this).focus();
var href = $(this).attr(href);
alert(href);
$(#central 
img:not([id=href])).fadeOut(slow);
$(href).fadeIn(slow);
event.PreventDefault;
});
});
/script

Thank you,
Jeremy Carlson


[jQuery] Hi all, jquery issue (major) with IE - all versions

2008-11-26 Thread tukutela

HI all,

This only happens with IE (all versions), on line 1120 in
jquery-1.2.6.js I get the following error.

Line 1120:
Invalid Property Value

The line in the js file is the following:

elem[ name ] = value;

It inside attr: function( elem, name, value )

Does anybody have a problem similar to this?


[jQuery] Re: Back Button

2008-11-26 Thread OhNoMrBill

I am bounding this follow-on question up...thread kind of went off
course.

The bit about links makes sense; but then how do I bind the javacsript
onclick functions to the links?


On Nov 24, 5:29 am, OhNoMrBill [EMAIL PROTECTED] wrote:
 That makes sense; but then how do I bind the functions to the links?

 The functions represent a large block of black-boxed code that is an
 AJAX handler that pushes content into destination divs.

 On Nov 24, 2:52 am, Brian Cherne [EMAIL PROTECTED] wrote:



  Take a look at the history plug-in page code again:
  http://www.mikage.to/jquery/jquery_history.html

  A really important concept to understand is that the history plug-in (any
  history plug-in) is listening / watching for the URL to change. Any change
  you want it to make going Back you will need to let it make going
  Forward (and on click) as well. You basically relinquish control to the
  history plug-in (actually to the pageload function if you're following the
  example URL to the letter). It works like this:

  - user clicks link with an #home href
  - url changes to page.html#home
  - history plug-in notices url change, calls pageload function
  - pageload function does something based on home

  - user clicks link with an #products href
  - url changes to page.html#products
  - history plug-in notices url change, calls pageload function
  - pageload function does something based on products

  - user clicks browser's Back button
  - url changes to page.html#home
  - history plug-in notices url change, calls pageload function
  - pageload function does something based on home

  - user clicks browser's Forward button
  - url changes to page.html#products
  - history plug-in notices url change, calls pageload function
  - pageload function does something based on products

  I hope this makes sense. You will need to:

  1) remove the inline onclick for each of your links. That overrides the
  history plug-in and you won't be able to work around it (cleanly).

  2) make the href hash values different for each of your links.

  So, instead of:
  a href=# onclick=showHome()Home/a

  You'll need something more like:
  a href=#homeHome/a
  a href=#productsProducts/a

  I hope this helps.

  Brian.

  On Sun, Nov 23, 2008 at 10:51 PM, OhNoMrBill [EMAIL PROTECTED] wrote:

   Anyone have an ideal on this?

   On Nov 22, 8:15 pm, OhNoMrBill [EMAIL PROTECTED] wrote:
I am in a real bind on this issue. Is anyone able to answer? Help
would be greatly appreciated if you can!!

On Nov 22, 10:50 am, OhNoMrBill [EMAIL PROTECTED] wrote:

 Here is the scenario I am trying to deal with currently:

 I have a link that looks like:

 a href=# onClick=$.Content_Home();Some Link/a

 All the url links in this site look like this...onclick overrides.

 What I need to do is ensure that when a user clicks back, the actual
 prior jQuery function is called, and not the entire page.

 I tried the history plugin, and can not seem to get it to pick this
 kind of thing up. Anyone with direct experience on this kind of thing,
 please chime in with some suggestions.- Hide quoted text -

- Show quoted text -- Hide quoted text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -


[jQuery] Re: $.fn.is can't support complex Event Delegation

2008-11-26 Thread Ariel Flesler

jQuery.Intercept does support complex selectors.

http://plugins.jquery.com/project/Intercept

--
Ariel Flesler
http://flesler.blogspot.com

On Nov 26, 5:03 am, sliu [EMAIL PROTECTED] wrote:
 Event Delegation are showing its advantage,especially in large
 webapp.
 what's event delegation:http://icant.co.uk/sandbox/eventdelegation/

 jquery has several plugin to support it, check the 
 one:http://dev.jquery.com/browser/trunk/plugins/delegate/jquery.delegate

 it use $.fn.is to check whether the event.target match the selector.

 but $.fn.is is too weak to support:http://docs.jquery.com/Traversing/is

 quote: If no element fits, or the expression is not valid, then the
 response will be 'false'. Note: Only simple expressions are supported.
 Complex expressions, such as those containing hierarchy selectors
 (such as +, ~, and ) will always return 'true'. filter is used
 internally, therefore all rules that apply there apply here, as well.

 for example:
 body
 ul
   lia id=it/a/li
 /ul
 /body

 $('#it').is('.non_exsisting_class a')

 will return true, unexpectly.

 I heard: jQuery is about to add event delegation feature in the next
 release.
 question 1: is that true?

 I personally think event delegation is a big thing, to break
 limitations, and lead UI programming more component-based style and
 declaritive-style.

 reglib is a very good javascript library to support event delegation.
 its author call jQuery(prototype...) as load-traverse-modify style.  I
 suffered with that style, so I admit. reglib event give some solution
 to treat load-traverse-modify style.

 I looked into reglib's source code, some duplicates with jQuery.

 question 2: Is it possible to merge two projects together?

 reglib:http://code.google.com/p/reglib/http://code.google.com/p/reglib/w/list

 actually, I'd like step further, how about write code like this:

 // define a component type named 'sidebar', which contains h2 and ul
 var sidebar = reg.defineComponent('sidebar', function(sidebar){
   sidebar.init(function(){
     //load tranversal and modify??
   });

   var h2 = sidebar.with(' h2');
   var ul = sidebar.with('ul');
   var li = ul.with('li');

   sidebar.data(function(topData){
     h2.data(topData.title);
     ul.data(topData.items);
     li.data(function(topData){ this.parent.data()[this.index] });
   });

   h2.click(function(){
      alert(this.data()); //topData.title
   });

   li.hover(
     function(){ this.addClass('hover');},
     function(){ this.removeClass('hover'); }
   );

 }

 // DOM(id=sidebar) will become a sidebar component, and framework will
 bind the data to it and sub-components.
 reg.match('#sidebar').to('sidebar', {:title = '...', :items =
 [...]});

 UI-data binding is another anoying problem.


[jQuery] Re: jquery.cycle centering image

2008-11-26 Thread web_dev12


Its working perfectly on my page right now:
http://john1.netfirms.com/VAM/template.html

but. I know I hate the damn but too.. :confused:

on a MAC in both firefox and safari it seems that the cycle using div #s1
seems to change the color of other text on the page and make it bold as the
image fades out. (text under the our mandate image as well as text in the
other jquery.cycle function in the whats new section.

NOTE: those divs are not in the same containers as any of the elements that
use the jquery.cycle function.

It works perfectly now in Opera, firefox, IE 7 and Safari for Windows.  

When I take out the image cycle functions, then it seems to work fine.  Is
there any known issues like this on MAC browsers?




malsup wrote:
 
 
  I'm aware
 that Cycle does not always work well in IE8 standards mode and I've
 submitted a error report to the IE team.  We'll see what happens when
 the next beta comes out.
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/jquery.cycle-centering-image-tp20604074s27240p20702160.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Has jQuery development halted?

2008-11-26 Thread Bob den Otter


Hi all,

There hasn't been a jQuery update in what seems like ages, and jQuery UI 
1.6 will be released 'in the next few days' since somewhere in 
september.  I know John has been really busy with a lot of great things, 
but it seems to me like the development of jquery has seriously lagged 
the last few months.


As a small example: there isn't even a way to detect chrome in the 
official jquery builds yet, and chrome has been out for several months now.


I'm afraid that the lack of updates will eventually have a negative 
impact on the great Query community, causing people to leave for other 
js frameworks. I sincerely hope not, but i _am_ worried about it.


Best, Bob.



[jQuery] jCarousel skips images after css edit

2008-11-26 Thread Willem

I've had the same problem as bobh had some months ago. I have a total
of 4 images which I want to appear one at a time.

I changed the scroll:3 in scroll:1 in the jquery.jcarousel.js file

and added my css to 212x130 in stead of 75x75.

still it skips from the 1st image to the 4th, back to the 1st, and so
on.

I can imagine it has something to do with the jquery.jcarousel.js
file, because I can't seem to find if and if so, where it links to
this js file


[jQuery] which event i should use for changing 'input type text'?

2008-11-26 Thread mangajin

I am working on JQuery event that populate another function when the
user click the check box, radio buttion and the drop down list. They
are all work fine with 'change(fn)'. However the problem I found is
when i use 'input type text' that get the value from calendar picker.
The function populateSearchInfo(); was not triggered when the value in
the inbox was changed. Any Idea? Can anyone suggest other event? the
following is the code example.

Html:
div class=searchCalendar
input type=text  value=26-11-2008 class=inp date-pick dp-
applied name=dateTimeS id=dateTimeS/
/div

Jquery:

$('form .searchCalendar input').change(function(){
   populateSearchInfo();
});


[jQuery] the event in JQuery

2008-11-26 Thread mangajin

I am working on JQuery event that populate another function when the
user clicks the check box, radio buttion and the drop down list. They
are all work fine with 'change(fn)'. However  the problem i found when
i use 'input type text' that get the value from calendar picker. It
seems as if 'change' function doesn't work when the value in input
type text is changed. The following is code example.  (the value in
input type is from calendar picker).

Html:
div class=searchCalendar
input type=text  value=26-11-2008 class=inp date-pick dp-
applied name=dateTimeS id=dateTimeS/
/div

Jquery:
$('form .searchCalendar input').change(function(){
   populateSearchInfo();
});


[jQuery] Re: Replacing DIV with XML

2008-11-26 Thread Dipi Evil Danger
Awesome!
Thanks a lot.

I´ll try it now.

2008/11/25 ricardobeat [EMAIL PROTECTED]


 Hi,

 1. appendTo() appends content: adds content after everything that
 already exists. You can use empty() to remove the contents before
 appending, that's the exact same result as replace().
 2. replaceAll only works the first time because you are replacing the
 ol element with a div, so on the second run there is no
 '#fichaFilme ol' for the function to find.

 That kilometric string concatenation will be a pain to debug, there
 are cleaner ways to do it. I took the liberty to recode your example:
 http://pastebin.com/m76fa

 Basically you have a model mark-up for a movie and you clone it for
 each one you are displaying, so you don't need to recreate all the
 html in a string.

 abraço,
 - ricardo

 On Nov 25, 9:24 am, Dipi Evil Danger [EMAIL PROTECTED] wrote:
  I´m trying to make an dynamic page with XML values. When the visitor
 click
  on an item it replaces the content. But it is not doing his job. This is
 the
  code:
  $('a').click(function() {
  var key = $(this).attr('id').charAt(4);
  $('a').click(function() {
  var key = $(this).attr('id').charAt(4);
   $.ajax({
   type: GET,
   url: ../cms/xmlCinema.php?id=000+key,
   dataType: xml,
   success: function(xml) {
 
   $(xml).find(filme).each(function(){
  var texto =  ;
  var album =  ;
   var texto = 'div class=moviesTitle' +
  $(this).find('nome').text() + ' (i' + $(this).find('ano').text() +
  '/i)/divbr';
   texto = texto + 'div class=moviesPosterimg
  id=poster'+key+' name=poster'+key+'
  src=../cinema/poster/000'+key+'.jpg width=95/div';
   texto = texto + 'div class=moviesLabelNome
  original:/div div class=moviesDatanbsp;' +
  $(this).find('nome_original').text() + '/div';
   texto = texto + 'div class=moviesLabelEstréia:/div
  div class=moviesDatanbsp;' + $(this).find('data').text() + '/div';
   texto = texto + 'div class=moviesLabelTrilha:/div
  div class=moviesDatanbsp;' + $(this).find('trilha').text() +
 '/div';
   texto = texto + 'div class=moviesLabelGênero:/div
  div class=moviesDatanbsp;' + $(this).find('genero').text() +
 '/div';
   texto = texto + 'div class=moviesLabelPaís de
  Origem:/div div class=moviesDatanbsp;' +
  $(this).find('pais_de_origem').text() + '/div';
   texto = texto + 'div class=moviesLabelSite:/div
 div
  class=moviesDatanbsp;a href=' + $(this).find('site').text() + '
  target=_blank' + $(this).find('site').text() + '/a/div';
   texto = texto + 'div class=moviesLabelDuração:/div
  div class=moviesDatanbsp;' + $(this).find('duracao').text() + '
  min./div';
   texto = texto + 'div class=moviesLabelDireção:/div
  div class=moviesDatanbsp;' + $(this).find('duracao').text() + '
  min./div';
   //Sinopse
   texto = texto + 'div class=moviesLabelSinopse:/div
  div class=moviesReleasenbsp;' + $(this).find('sinopse').text() +
  '/div';
  $('div/div')
   .html(texto)
   .replaceAll('#fichaFilme ol');
   }); //close each(
   } //close sucess
   }); //close $.ajax(
  $(#fichaFilme).fadeIn(3000);}); //close click(
 
  If I use appendTo it adds content. If I use replaceAll it only works in
  the first time.
 
  Here is the page (working on it):
 http://www.ncweb.com.br/PHP/index.php?mod=Cinema
 
  Thanks!
 
  --
  dipi evil danger
  Gott weiß ich will kein Engel seinhttp://meadiciona.com/dipi




-- 
dipi evil danger
Gott weiß ich will kein Engel sein
http://meadiciona.com/dipi


[jQuery] Re: Has jQuery development halted?

2008-11-26 Thread Andy Matthews

Have you reviewed the roadmaps for 1.2 and 1.3?

http://docs.jquery.com/JQuery_1.2_Roadmap

http://docs.jquery.com/JQuery_1.3_Roadmap


andy

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Bob den Otter
Sent: Wednesday, November 26, 2008 8:54 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Has jQuery development halted?


Hi all,

There hasn't been a jQuery update in what seems like ages, and jQuery UI 
1.6 will be released 'in the next few days' since somewhere in 
september.  I know John has been really busy with a lot of great things, 
but it seems to me like the development of jquery has seriously lagged 
the last few months.

As a small example: there isn't even a way to detect chrome in the 
official jquery builds yet, and chrome has been out for several months now.

I'm afraid that the lack of updates will eventually have a negative 
impact on the great Query community, causing people to leave for other 
js frameworks. I sincerely hope not, but i _am_ worried about it.

Best, Bob.




[jQuery] Re: Has jQuery development halted?

2008-11-26 Thread Bob den Otter


Hi Andy,

I found that 1.3 roadmap earlier today, when i was googling for news on 
jQuery 1.3.. Those pages list no dates, so I have no idea if they're 
current or not.


Best, Bob.


Have you reviewed the roadmaps for 1.2 and 1.3?

http://docs.jquery.com/JQuery_1.2_Roadmap

http://docs.jquery.com/JQuery_1.3_Roadmap


andy

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Bob den Otter
Sent: Wednesday, November 26, 2008 8:54 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Has jQuery development halted?


Hi all,

There hasn't been a jQuery update in what seems like ages, and jQuery UI 
1.6 will be released 'in the next few days' since somewhere in 
september.  I know John has been really busy with a lot of great things, 
but it seems to me like the development of jquery has seriously lagged 
the last few months.


As a small example: there isn't even a way to detect chrome in the 
official jquery builds yet, and chrome has been out for several months now.


I'm afraid that the lack of updates will eventually have a negative 
impact on the great Query community, causing people to leave for other 
js frameworks. I sincerely hope not, but i _am_ worried about it.


Best, Bob.



  




[jQuery] Re: treeview pluging issues - .find(.hitarea)

2008-11-26 Thread alextait

thanks very much!

:)

On Nov 24, 4:12 am, Dirceu Barquette [EMAIL PROTECTED]
wrote:
 Hi alextait,

 there is a new release for jqtreeview plugin 
 at:http://downloads.sourceforge.net/jqtreevial/jqtreevial-pack-0.3.zip

 I've added insert and delete methods.

 Dirceu Barquette

 2008/11/21 alextait [EMAIL PROTECTED]



  I have taken a look at your plugin... that fantastic!

  Unfortunately it does not seem to do what i need.

  Since our category/product data is so huge... I am trying to create a
  tree that will populate the child nodes only when the parent node is
  clicked.

  Once loaded into the dom the user can collapse or expand nodes using
  jquery.

  Will continue trying to get the treeview code to work for now.

  thanks very much for your help!

  :)

  On 20 Nov, 16:32, Dirceu Barquette [EMAIL PROTECTED]
  wrote:
   Hi,
   seehttp://sourceforge.net/projects/jqtreevial/

   I've been developing this plugin. Not complete yet, but is functional.
   Dirceu

   2008/11/20 alextait [EMAIL PROTECTED]

I am fairly new to jquery and I am trying to create a product/category
browser/tree using the treeview plugin and ajax.

My first simple issue is this peice of code i am trying to understand.

.find(.hitarea)

what is happening here ? I understand the find functino but not sure
about the chevron usage ?

the overall problem is this.

On viewing my list. if i click on one of the initial categories the
second sub categories show up fine. I can then contract this sub list
if i wish. If i leave this open and click on one of the sub categories
for some reason i cannot then contract it again.

I have looked into the treeview plugin code and found that the
toggler method which would normaly just contract the list branch
fires twice causing it to hide again.

If anyone has any idea on thie general problem that would be great.

thanks for any help in advance


[jQuery] Superfish help

2008-11-26 Thread Steve

Hi there,

I'm a bit of jQuery and Javascript newbie so please bare with me.

I've just implement the Superfish menu plugin, using the package
available at http://users.tpg.com.au/j_birch/plugins/superfish/#download
.

All working fine until I introduced some totally unconnected
Javascript to the mix, I can only assume there is a conflict but I'm
afraid I'm uncertain how to resolve it.

My implementation is:

style type=text/css
!--
@import url(css/menu3/superfish.css);
--
/style
script type=text/javascript src=js/jquery-1.2.6.min.js/script
script type=text/javascript src=js/hoverIntent.js/script
script type=text/javascript src=js/superfish.js/script
script type=text/javascript src=js/supersubs.js/script
script type=text/javascript
$(document).ready(function(){
$(ul.sf-menu).supersubs({
minWidth:12,   // minimum width of sub-menus in em
units
maxWidth:27,   // maximum width of sub-menus in em
units
extraWidth:  1 // extra width can ensure lines don't
sometimes turn over
   // due to slight rounding differences
and font-family
}).superfish();  // call supersubs first, then superfish, so
that subs are
 // not display:none when measuring. Call
before initialising
 // containing tabs for same reason.
});
/script

Pretty standard stuff I'm sure you'll agree, and as I mentioned this
works as expected.

When I introduce this to the mix:

script language=javascript type=text/javascript src=http://
usr.echoclick2call.com/ini/2717.js/scriptscript
language=javascript type=text/javascript src=http://
static.echoclick2call.com/scripts/click2call.js/script

External scripts that provide additional functionality for the site
the menu fails to render correctly (I lose the default fade effects,
the arrows and a portion of the styling).

Any suggestions?

I was under the impressiong that jQuery was namespaced to avoid
problems like this? Or am I getting confused with another library?

Cheers,

Steve


[jQuery] remove objects from set

2008-11-26 Thread takeshin

Hi,

I add elements to set this way:

jQuery.fn.pushIf = function(selector_or_nodes) {
  var nodes = (typeof a == 'string') ?
  $(selector_or_nodes) : 
selector_or_nodes;
  var node_count = nodes.length;
  for(var i = 0; i  node_count; i++) {
  var exists = false;
  for (var j = 0; j  
this.length; j++) {
  if (this[j] == nodes[ 
i ]) {
  exists = true;
  break;
  }
  }
  if (!exists) {
  this[ this.length++ ] 
= nodes[ i ]
  };
  }

 $.extend({
   validation: {
   invalidFields: $([]),


   addInvalidField: 
function(field) {
//Add fields here
   
this.invalidFields.pushIf($(field));
   }
});

  };



I want to have function removing from invalidFields, like that:

jQuery.fn.remove = function( selector_or_nodes ) {

  var nodes = (typeof a == 'string') ?
  $( selector_or_nodes ) : 
selector_or_nodes;
  var node_count = nodes.length;
  for( var i = 0; i  node_count; i++ ) 
{
  for (var j = 0; j  
this.length; j++) {
  if (this[j] == nodes[ 
i ]) {
 
alert('fffound!');
  // delete 
this item here
// I would use splice if this was an array, but this is jQuery object
 break;
 }
  }
  }
  };

How to delete item if fffound?

--
regards,
takeshin


[jQuery] Superfish Problem

2008-11-26 Thread Steven Morgan

Hi there,

Firstly apologies if I've just spammed this list, the message didn't seem to 
appear after 24 hours within the Google Group when I used the Web interface.

I'm a bit of jQuery and Javascript newbie so please bare with me.

I've just implement the Superfish menu plugin, using the package available at 
http://users.tpg.com.au/j_birch/plugins/superfish/#download .

All working fine until I introduced some totally unconnected Javascript to the 
mix, I can only assume there is a conflict but I'm afraid I'm uncertain how to 
resolve it.

My implementation is:

style type=text/css
!--
@import url(css/menu3/superfish.css);
--
/style
script type=text/javascript src=js/jquery-1.2.6.min.js/script
script type=text/javascript src=js/hoverIntent.js/script
script type=text/javascript src=js/superfish.js/script
script type=text/javascript src=js/supersubs.js/script
script type=text/javascript
$(document).ready(function(){ 
$(ul.sf-menu).supersubs({ 
minWidth:12,   // minimum width of sub-menus in em units 
maxWidth:27,   // maximum width of sub-menus in em units 
extraWidth:  1 // extra width can ensure lines don't sometimes 
turn over 
   // due to slight rounding differences and 
font-family 
}).superfish();  // call supersubs first, then superfish, so that subs 
are 
 // not display:none when measuring. Call before 
initialising 
 // containing tabs for same reason. 
}); 
/script

Pretty standard stuff I'm sure you'll agree, and as I mentioned this works as 
expected.
When I introduce this to the mix:

script language=javascript type=text/javascript 
src=http://usr.echoclick2call.com/ini/2717.js;/scriptscript 
language=javascript type=text/javascript 
src=http://static.echoclick2call.com/scripts/click2call.js;/script

External scripts that provide additional functionality for the site the menu 
fails to render correctly (I lose the default fade effects, the arrows and a 
portion of the styling).

Any suggestions?

I was under the impressiong that jQuery was namespaced to avoid problems like 
this? Or am I getting confused with another library?

Cheers,

Steve


[jQuery] jquery swfobject Flash detection

2008-11-26 Thread [EMAIL PROTECTED]

Hello.

There is a Flash movie in my page - if the user doesn't have Flash, I
want a jQuery Cycle slideshow to play instead. It all looks great, but
I don't know how to tell whether the slideshow is running even if it's
not needed!

Will my jQuery function run, even after SWFObject has removed the div
it's targeted to?

If it does, I'm wasting memory so my next question would be: How
should I write a conditional, to execute the function only if Flash is
not present?

Hope I've explained it clearly enough :/

Cherry.


[jQuery] Best way to grab an item from an object?

2008-11-26 Thread Shazzaam


Hi, I was wondering what the fastest way to get an item from an object is,
for example I have this object:

var TESTS = [
{
id: 1,
name: 'Test 1',
},
{
id: 2,
name: 'Test 2',
} 
];

If I know the id is 1, do I have to iterate through the whole list to
retrieve the name, or can I use jquery's filter function or something else.

Thanks!
-- 
View this message in context: 
http://www.nabble.com/Best-way-to-grab-an-item-from-an-object--tp20703347s27240p20703347.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: tabindex for beginners

2008-11-26 Thread Mark Gibson

If you are using IE, then it won't currently work in jQuery 1.2.6.
Add the following fix at the top of your script:

if ($.browser.msie  !$.props.tabindex) $.props.tabindex =
'tabIndex';

and you don't need to use the each() call, just do this:

$(':input').attr('tabindex', -1);

a better idea, is to exclude any inputs that already have a tabindex
attr:

$(':input:not([tabindex])').attr('tabindex', -1);

Hope this helps
- Mark

On Nov 25, 1:04 pm, gil_yoktan [EMAIL PROTECTED] wrote:
 Hello I finally managed to make jquery work for me. I want to set all
 input tabindex to -1 (not selectable by tab key). This is what I
 wrote (taken from the source of an example)

 script type=text/javascript

     $(document).ready(function() {
         // set tabs
         $(':input').each(function(i, e) {
             alert( + this.id + +   TABINDEX=  + $(this).attr
 ('tabindex') +   );
             $(this).attr('tabindex', -1);
             alert(TABINDEX AFTER   =  + $(this).attr('tabindex') +
 );
         })
     });
 /script

 The 1st alert shows me the name of the element and the tabindex
 current value
 The 2nd alert - shows me TABINDEX AFTER = -1 as I expected and I
 as need. But the source of the HTML page is NOT changed - none of the
 input tags has a tabindex of -1 !!
 I guess I miss something basic... Please give me a hint to redirect me
 to the right direction.
 Thank you in advance   Gil Yoktan


[jQuery] Re: Has jQuery development halted?

2008-11-26 Thread Rey Bango


Hi Ben,

I think one of the things that we've done is spoiled jQuery developers 
by releasing often. Obviously, we try hard to do that (spoil jQuery 
developers) because we want you guys to have the very best features and 
be able to build kick-ass apps.


Every so often though, we do need to slow down to:

1) make sure we're addressing the needs of the community in the right way
2) build solid features that won't adversely affect the API
3) have ample time to do proper testing
4) take a well-deserved break from pushing out code :)

We definitely haven't halted development and we're trying to nail down 
our next release. So just be patient a little longer and we should get a 
release out in the near future.


Rey
jQuery Team


Bob den Otter wrote:


Hi all,

There hasn't been a jQuery update in what seems like ages, and jQuery UI 
1.6 will be released 'in the next few days' since somewhere in 
september.  I know John has been really busy with a lot of great things, 
but it seems to me like the development of jquery has seriously lagged 
the last few months.


As a small example: there isn't even a way to detect chrome in the 
official jquery builds yet, and chrome has been out for several months now.


I'm afraid that the lack of updates will eventually have a negative 
impact on the great Query community, causing people to leave for other 
js frameworks. I sincerely hope not, but i _am_ worried about it.


Best, Bob.




[jQuery] Re: Hi all, jquery issue (major) with IE - all versions

2008-11-26 Thread tukutela

Hi all, I have some additional information which I hope might be of
use.

the function is passed the following variables:
name = color
value = inherit

unfortunately I'm not able to get the elem to help out more, anyone
have any suggestions on how to debug?


On Nov 26, 9:42 am, tukutela [EMAIL PROTECTED] wrote:
 HI all,

 This only happens with IE (all versions), on line 1120 in
 jquery-1.2.6.js I get the following error.

 Line 1120:
 Invalid Property Value

 The line in the js file is the following:

 elem[ name ] = value;

 It inside attr: function( elem, name, value )

 Does anybody have a problem similar to this?


[jQuery] Re: $.fn.is can't support complex Event Delegation

2008-11-26 Thread sliu

Thanks for your quick reply.

Intercept do work, its source code:

$intercept.absolute = /[\s+~]/;
if( selector == 'self'  target == this  || $intercept.absolute.test
(selector)
 ? $(selector).index(target) != -1 : 
$target.is(selector) )
ret = handlers[selector].apply(target, 
arguments) !== false 
ret;

It checks whether the selector is simple or complex, use $target.is
(selector) or $(selector).index.

talent~





$intercept.absolute.test(selector)
64 ? $(selector).index(target) != -1 : $target.is(selector) )

On Nov 26, 10:33 pm, Ariel Flesler [EMAIL PROTECTED] wrote:
 jQuery.Intercept does support complex selectors.

 http://plugins.jquery.com/project/Intercept

 --
 Ariel Fleslerhttp://flesler.blogspot.com

 On Nov 26, 5:03 am, sliu [EMAIL PROTECTED] wrote:

  Event Delegation are showing its advantage,especially in large
  webapp.
  what's event delegation:http://icant.co.uk/sandbox/eventdelegation/

  jquery has several plugin to support it, check the 
  one:http://dev.jquery.com/browser/trunk/plugins/delegate/jquery.delegate

  it use $.fn.is to check whether the event.target match the selector.

  but $.fn.is is too weak to support:http://docs.jquery.com/Traversing/is

  quote: If no element fits, or the expression is not valid, then the
  response will be 'false'. Note: Only simple expressions are supported.
  Complex expressions, such as those containing hierarchy selectors
  (such as +, ~, and ) will always return 'true'. filter is used
  internally, therefore all rules that apply there apply here, as well.

  for example:
  body
  ul
    lia id=it/a/li
  /ul
  /body

  $('#it').is('.non_exsisting_class a')

  will return true, unexpectly.

  I heard: jQuery is about to add event delegation feature in the next
  release.
  question 1: is that true?

  I personally think event delegation is a big thing, to break
  limitations, and lead UI programming more component-based style and
  declaritive-style.

  reglib is a very good javascript library to support event delegation.
  its author call jQuery(prototype...) as load-traverse-modify style.  I
  suffered with that style, so I admit. reglib event give some solution
  to treat load-traverse-modify style.

  I looked into reglib's source code, some duplicates with jQuery.

  question 2: Is it possible to merge two projects together?

  reglib:http://code.google.com/p/reglib/http://code.google.com/p/reglib/w/list

  actually, I'd like step further, how about write code like this:

  // define a component type named 'sidebar', which contains h2 and ul
  var sidebar = reg.defineComponent('sidebar', function(sidebar){
    sidebar.init(function(){
      //load tranversal and modify??
    });

    var h2 = sidebar.with(' h2');
    var ul = sidebar.with('ul');
    var li = ul.with('li');

    sidebar.data(function(topData){
      h2.data(topData.title);
      ul.data(topData.items);
      li.data(function(topData){ this.parent.data()[this.index] });
    });

    h2.click(function(){
       alert(this.data()); //topData.title
    });

    li.hover(
      function(){ this.addClass('hover');},
      function(){ this.removeClass('hover'); }
    );

  }

  // DOM(id=sidebar) will become a sidebar component, and framework will
  bind the data to it and sub-components.
  reg.match('#sidebar').to('sidebar', {:title = '...', :items =
  [...]});

  UI-data binding is another anoying problem.


[jQuery] Re: jquery swfobject Flash detection

2008-11-26 Thread [EMAIL PROTECTED]

Answered my own question:

* Yes, the Ajax function was still running, even though its results
were not being published,
* I stopped that with a conditional ...

if( $( '#xmlContent' ).find( 'object' ) )
{
cycle_content ();
};

Actually the Cycle loads quicker than the Flash, so I'm using it
instead!

I'd still like to know what vars can be returned from SWFObject for
this purpose, though, if anybody has that info ...

C.

On Nov 26, 3:32 pm, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 Hello.

 There is a Flash movie in my page - if the user doesn't have Flash, I
 want a jQuery Cycle slideshow to play instead. It all looks great, but
 I don't know how to tell whether the slideshow is running even if it's
 not needed!

 Will my jQuery function run, even after SWFObject has removed the div
 it's targeted to?

 If it does, I'm wasting memory so my next question would be: How
 should I write a conditional, to execute the function only if Flash is
 not present?

 Hope I've explained it clearly enough :/

 Cherry.


[jQuery] Re: $.fn.is can't support complex Event Delegation

2008-11-26 Thread sliu

$(selector).index(target) != -1

may cause performance issue?

reglib recursively check event.target and its ancestor to know whether
it matches selector.

another question, selector with nested context may help -- as I
mentioned in the first post.
but reglib and intercept don't provide.



On Nov 27, 12:32 am, sliu [EMAIL PROTECTED] wrote:
 Thanks for your quick reply.

 Intercept do work, its source code:

 $intercept.absolute = /[\s+~]/;
 if( selector == 'self'  target == this  || $intercept.absolute.test
 (selector)
                          ? $(selector).index(target) != -1 : 
 $target.is(selector) )
                                 ret = handlers[selector].apply(target, 
 arguments) !== false 
 ret;

 It checks whether the selector is simple or complex, use $target.is
 (selector) or $(selector).index.

 talent~

 $intercept.absolute.test(selector)
 64 ? $(selector).index(target) != -1 : $target.is(selector) )

 On Nov 26, 10:33 pm, Ariel Flesler [EMAIL PROTECTED] wrote:

  jQuery.Intercept does support complex selectors.

 http://plugins.jquery.com/project/Intercept

  --
  Ariel Fleslerhttp://flesler.blogspot.com

  On Nov 26, 5:03 am, sliu [EMAIL PROTECTED] wrote:

   Event Delegation are showing its advantage,especially in large
   webapp.
   what's event delegation:http://icant.co.uk/sandbox/eventdelegation/

   jquery has several plugin to support it, check the 
   one:http://dev.jquery.com/browser/trunk/plugins/delegate/jquery.delegate

   it use $.fn.is to check whether the event.target match the selector.

   but $.fn.is is too weak to support:http://docs.jquery.com/Traversing/is

   quote: If no element fits, or the expression is not valid, then the
   response will be 'false'. Note: Only simple expressions are supported.
   Complex expressions, such as those containing hierarchy selectors
   (such as +, ~, and ) will always return 'true'. filter is used
   internally, therefore all rules that apply there apply here, as well.

   for example:
   body
   ul
     lia id=it/a/li
   /ul
   /body

   $('#it').is('.non_exsisting_class a')

   will return true, unexpectly.

   I heard: jQuery is about to add event delegation feature in the next
   release.
   question 1: is that true?

   I personally think event delegation is a big thing, to break
   limitations, and lead UI programming more component-based style and
   declaritive-style.

   reglib is a very good javascript library to support event delegation.
   its author call jQuery(prototype...) as load-traverse-modify style.  I
   suffered with that style, so I admit. reglib event give some solution
   to treat load-traverse-modify style.

   I looked into reglib's source code, some duplicates with jQuery.

   question 2: Is it possible to merge two projects together?

   reglib:http://code.google.com/p/reglib/http://code.google.com/p/reglib/w/list

   actually, I'd like step further, how about write code like this:

   // define a component type named 'sidebar', which contains h2 and ul
   var sidebar = reg.defineComponent('sidebar', function(sidebar){
     sidebar.init(function(){
       //load tranversal and modify??
     });

     var h2 = sidebar.with(' h2');
     var ul = sidebar.with('ul');
     var li = ul.with('li');

     sidebar.data(function(topData){
       h2.data(topData.title);
       ul.data(topData.items);
       li.data(function(topData){ this.parent.data()[this.index] });
     });

     h2.click(function(){
        alert(this.data()); //topData.title
     });

     li.hover(
       function(){ this.addClass('hover');},
       function(){ this.removeClass('hover'); }
     );

   }

   // DOM(id=sidebar) will become a sidebar component, and framework will
   bind the data to it and sub-components.
   reg.match('#sidebar').to('sidebar', {:title = '...', :items =
   [...]});

   UI-data binding is another anoying problem.


[jQuery] Re: remove objects from set

2008-11-26 Thread ricardobeat
You can add elements to a jQuery object simply using

$('originalobject').add('#someid').add('.someclass').add($
('anotherobject')).add(node);

and remove with the filter() function:

var unwanted = $('unwanted');

$('wanted').filter(function(i){
for (var n=0,nl=unwanted.length; nnl; n++){
if (this == unwanted[n]) return false;
} return true;
});

On Nov 26, 9:26 am, takeshin [EMAIL PROTECTED] wrote:
 Hi!

 Using hints from this group, I create set of invalid fields this way:

 jQuery.fn.push = function( selector_or_nodes ) {
                                           //  Given a selector or a jQuery 
 object, append all of the
 nodes to
                                           // the current jQuery object.
                                           var nodes = (typeof a == 'string') ?
                                           $( selector_or_nodes ) : 
 selector_or_nodes;
                                           var node_count = nodes.length;
                                           for( var i = 0; i  node_count; i++ 
 ) {
                                                   this[ this.length++ ] = 
 nodes[ i ]
                                           };

                                   };

 $.extend({
                                                    validation: {
                                                            invalidFields: 
 $([]),

                                                            addInvalidField: 
 function(field) {
                                                                    
 this.invalidFields.pushIf($(field));
                                                            }

 }
 });

 // code here...
 $.addInvalidField($('#myid1'));
 // more code here...
 $.addInvalidField($('#myid2'));

 How to remove object from $.validation.invalidFields?

 I'm trying to do it like this:

 jQuery.fn.removeIf = function(selector_or_nodes) {
                                           //  Given a selector or a jQuery 
 object, removes all of the
 nodes from
                                           // the current jQuery object.
                                           var nodes = (typeof a == 'string') ?
                                           $(selector_or_nodes) : 
 selector_or_nodes;
                                           for (var i = 0; ithis.length; i++) 
 {
                                                   for (var j=0; 
 jnodes.length;j++) {
                                                           if 
 (this[i]==nodes[j]) {
                                                                   // REMOVE 
 THIS ELEMENT HERE
                                                           }
                                                   }
                                           }
                                   };

 I managed to determine if object exist in that set,
 but how to remove it?

 --
 regards,
 takeshin

[jQuery] Re: Why does :not([id=blah]) not work?

2008-11-26 Thread ricardobeat

The selector passed to $ function is a string, so you need to
concatenate whatever variables you want into the string:

$(#central img:not([id=+thefirst+])).hide();

this actually could be much clearer:

$('#central img').not(#+thefirst).hide();

the same applies to your 'href' var.

sds,
- ricardo

On Nov 25, 8:26 pm, Jeremy Carlson [EMAIL PROTECTED] wrote:
 Hi there,

 I'm just starting to explore using jQuery. Like it so far, but I'm
 totally thrown by this.

 On a page, I'm trying to hide all images in a set except the first
 one. Then, when you click on a menu link, another should fade in, and
 all others fade out.

 The second part works - when you click on a link tag, the image w/ the
 ID listed as the href of the link fades in, and any others that are
 visible fade out. I'm using this:

 $(#central img:not([id=href])).fadeOut(slow);

 So I copied that syntax to the initial .ready function, like this:

 $(#central img:not([id=thefirst])).hide();

 This variable ('thefirst') is created using jQuery.url.attr(anchor),
 whereas 'href' is created using $(this).attr(href), where (this)
 refers to the associated link. I think the key has to be there
 somehow, but I don't see it.

 I've posted this page athttp://jeremycarlson.com/test/jq/portfolio.htm
 (there are several alerts thrown in so I can see what the variables
 are at any given time, which makes the load a little odd) I just can't
 see what's going wrong.

 Thanks in advance for any help anyone might offer.

 Here is the full js code:

                 script type=text/javascript src=jquery-1.2.6.js/script
                 script type=text/javascript 
 src=jquery.url.packed.js/script
                 script type=text/javascript

                  $(document).ready(function(){

                         if(undefined != jQuery.url.attr(anchor)) {
                                 var anchor = jQuery.url.attr(anchor);
                                 var thefirst = #+anchor;
                                 alert (thefirst);
                         } else {
                                 var thefirst = #view1;
                                 alert(thefirst);
                         }

                         $(#central img:not([id=thefirst])).hide();

                         $(#central img).css({position:absolute});

                         $(#view-menu a).click(function(event){
                                 $(this).focus();
                                 var href = $(this).attr(href);
                                 alert(href);
                                 $(#central 
 img:not([id=href])).fadeOut(slow);
                                 $(href).fadeIn(slow);
                                 event.PreventDefault;
                         });
                 });
                 /script

 Thank you,
 Jeremy Carlson


[jQuery] Re: Hi all, jquery issue (major) with IE - all versions

2008-11-26 Thread ricardobeat

Some detail about what function is being called and what it's trying
to do could help.

On Nov 26, 2:23 pm, tukutela [EMAIL PROTECTED] wrote:
 Hi all, I have some additional information which I hope might be of
 use.

 the function is passed the following variables:
 name = color
 value = inherit

 unfortunately I'm not able to get the elem to help out more, anyone
 have any suggestions on how to debug?

 On Nov 26, 9:42 am, tukutela [EMAIL PROTECTED] wrote:

  HI all,

  This only happens with IE (all versions), on line 1120 in
  jquery-1.2.6.js I get the following error.

  Line 1120:
  Invalid Property Value

  The line in the js file is the following:

  elem[ name ] = value;

  It inside attr: function( elem, name, value )

  Does anybody have a problem similar to this?


[jQuery] Re: Anyone know how to find the topmost elements of a specific type?

2008-11-26 Thread Mark Gibson

I don't think I stated my problem fully.

What I'm trying to do it process the elements recursively, so using
the ul's as an example:

1. Find the shallowest ul's (Karl's solutions would work here).
2. For each ul found:
3. Add content to the ul.
4. Find the next shallowest ul within each ul.
5. Recurse from step 2 (until there are no more deeper ul's).

var dostuff = function(elem) {
  $(elem).findShallowest('ul').each(function() {
// do stuff, add content
dostuff(this);
  });
}

It's important that the elements are processed in this manner,
as content is added which may include more ul's which in turn
need processing.
Also the exact structure is not known, so I can't rely on child ''
ops.

I think it could be done by stopping find() from going any deeper
once it finds match, but from looking at the jQuery src, find() is a
little baffling.

Thanks for help so far
- Mark.

On Nov 17, 7:28 pm, Karl Swedberg [EMAIL PROTECTED] wrote:
 Hi Mark,

 I took a look at your original post again, and from your description  
 there it looks like this would work:

 $('ul').filter(function() {
    return !$(this).parents('ul').length;

 })

 --Karl

 
 Karl Swedbergwww.englishrules.comwww.learningjquery.com

 On Nov 17, 2008, at 10:58 AM, Mark Gibson wrote:



  The trouble is that the elements i'm looking for are not necessarily
  direct children of the container,
  so  isn't going to work. What I really need is to stop jQuery from
  searching any deeper once it
  finds the first ul, but continue the search at the same and
  shallower levels.
  Is  there a way to do this with a $.expr[':'] plugin?

  On Nov 11, 11:24 am, Klaus Hartl [EMAIL PROTECTED] wrote:
  That won't work. :first-child will give you *all* uls that are the
  first child of any element:

  div id=container
      ul!-- is first child --
          li
              ul ... /ul!-- is first child --
          /li
      /ul
  /div

  If you need the topmost ul use the  combinator:

  $('#container  u')

  Oh, jQuery has some documentation about 
  selectors:http://docs.jquery.com/Selectors

  En plus knowing the spec doesn't hurt 
  either:http://www.w3.org/TR/CSS21/selector.htmlhttp://www.w3.org/TR/css3-sel...

  --Klaus

  On 11 Nov., 02:07, Hector Virgen [EMAIL PROTECTED] wrote:

  Oops, it's actually $('#container ul:first-child')
  Here's a nifty page of CSS3 
  selectors:http://www.w3.org/TR/2001/CR-css3-selectors-2003/#selectors

  -Hector

  On Mon, Nov 10, 2008 at 5:06 PM, Hector Virgen  
  [EMAIL PROTECTED] wrote:
  $('#container ul:first') should give you the first UL in the  
  container
  -Hector

  On Mon, Nov 10, 2008 at 4:50 PM, Mark Gibson  
  [EMAIL PROTECTED] wrote:

  Anyone know how I can find the topmost elements of a certain  
  type, eg.

  Say I have several ul lists on a page, which in turn contain  
  sub-
  lists, and so on.
  Is there a selector I can use to find all the topmost ul  
  elements.

  I've been raking my brains over this, and can't see a way with css
  style selectors,
  have i overlooked something?

  Ideally I'd like to do:
  $('ul:topmost')

  or:
  $('#container ul:topmost')

  Cheers
  - Mark


[jQuery] Re: $.fn.is can't support complex Event Delegation

2008-11-26 Thread Ariel Flesler

 $(selector).index(target) != -1

 may cause performance issue?

 reglib recursively check event.target and its ancestor to know whether
 it matches selector.

It depends on the selector. I'm pretty sure it depends on many
factors.

If you (f.e) click an element that is deeply nested in the dom, then
recursing its ancestors will surely take a long time (proportionally
of course).

A simple selector is something relatively fast to process and just
ONCE, not once for EACH ancestor.

If you add to that, that Sizzle will have a cache when available...
well.. even faster.

I'm not saying this way is surely faster, just that the other approach
is not straightly better, always.

--
Ariel Flesler
http://flesler.blogspot.com


[jQuery] Re: Object-oriented plugins?

2008-11-26 Thread Hector Virgen
I've been thinking about this over the weekend and came up with a way to
write class-based plugins while still following the jQuery convention. Maybe
someone else has done this before but I couldn't find any documentation on
this subject.
The idea is to extend the base jQuery object with the javascript class, and
then extend jQuery.fn with a simple method that does nothing but instantiate
the class and return this.

The nice thing about this approach is that you can still make chainable
plugins without polluting the jQuery.fn namespace with a ton of methods.

$('#mydiv').myplugin().show();

But if you need access to the object, you can use the new construct.

var myplugin = new $.MyPlugin($('#mydiv'));
myplugin.doSomething();

Here is an example plugin that just alerts some text when the selected
elements are clicked. But, if you create the plugin object manually with the
new construct, you can change the message or invoke the alert without the
click:

(function($){
var Alerter = function(selector, options)
{
var obj = this;
 this.settings = {
message: 'no message'
};
 $.extend(this.settings, options);
 selector.click(function()
{
obj.alert.call(obj);
});
}
 Alerter.prototype.alert = function()
{
alert('Alerter said: ' + this.settings.message);
}
 Alerter.prototype.message = function(message)
{
this.settings.message = message;
return this;
}
 $.extend({
Alerter: Alerter
});
 $.fn.extend({
alerter: function(options)
{
var alerter = new $.Alerter(this, options);
return this;
}
});
})(jQuery);


// Usage as jQuery plugin
$('#mydiv').alerter({
message: 'foo'
});

// Usage as object
var alerter = new $.Alerter($('#anotherdiv'), {
message: 'bar'
});

// As an object, you can call methods on it easily
alerter.message('new message');
alerter.alert(); // alerts Alerter said: new message

Any thoughts on this approach?

-Hector


On Sun, Nov 23, 2008 at 5:15 AM, Scott González [EMAIL PROTECTED]wrote:


 Providing the method name as the first parameter is a bit awkward,
 perhaps looking at the alternatives would help:

 Add namespaces to jQuery.  This isn't very jQuery-like.  Example: $
 (el).tabs.add(url, label).show();

 Add a new jQuery method for every plugin instance method.  This
 pollutes the jQuery namespace, so this should only be done when it
 really makes sense.  Example: $(el).addTab(url, label);

 Use events.  You can bind custom events in a namespace and then have
 users interact with your plugin by triggering those events.  Example: $
 (el).trigger('add.tabs', url, label);

 There may be other approaches as well.

 The jQuery UI approach allows plugins to expose as many methods as
 they want while only using one method in the jQuery namespace.



[jQuery] Re: window close

2008-11-26 Thread brian
I think your close link is in the wrong scope for what you want to do. You
probably want to have something along these lines:

div id=the_pop_up_div
[close link]
div
[external content here]
/div
/div


On Wed, Nov 26, 2008 at 12:30 AM, Namrata Vagyani
[EMAIL PROTECTED]wrote:

 yes the content of pop-up is in external file.
 I tried with ID also but not able to hide it.

 On Tue, Nov 25, 2008 at 10:41 AM, brian [EMAIL PROTECTED] wrote:

 Is the content of the pop-up (including the close link) an external
 file?

 In any case, why not just give the pop-up div an ID?


 On Tue, Nov 25, 2008 at 12:05 AM, Namrata Vagyani 
 [EMAIL PROTECTED] wrote:

 This is also not working :(

 On Mon, Nov 24, 2008 at 7:51 PM, Isaak Malik [EMAIL PROTECTED] wrote:

 Try:

 $(this).parents('.popup_window_wrapper').hide();


 On Mon, Nov 24, 2008 at 6:08 AM, Debby [EMAIL PROTECTED]wrote:


 Hi all,

 On click of hyperlink, i am cerating one popup which is under one div
 having class but no id.
 On click of  close window hyperlink in the popup i want to hide this
 popup.
 But not able to hide this.
 I tried this, but not working
 $(this).parent('.popup_window_wrapper').css({'display':'none'});

 popup_window_wrapper: Is the class of popup div.

 Please help me.




 --
 Isaak Malik
 Web Developer







[jQuery] Re: Function Optimization w/ jQuery

2008-11-26 Thread Paul Mills

Hi,
It's very hard to tell what you are trying to do from looking at just
the JavaScript. Can you post some HTML and a short explanation of what
you want to achieve.

jQuery has a built in toggle function that shows hidden elements and
hides visible ones. So your second function would be coded something
like this to toggle visibility of all p elements:
$(p).toggle();

Paul

On Nov 26, 12:41 am, halcyonandon [EMAIL PROTECTED] wrote:
 I've been reading the jQuery documentation and trying to improve this
 function(well functions) and its siblings, however I'm running into
 all sorts of syntactical errors when I make changes past this point.
 For example, I know there is a better way to write  this.elements
 ['activities[ActivitiesTab]'].value = ckd; or  var radios =
 document.forms['ActivitiesTab'].elements['activities[ActivitiesTab]'];

 But the biggest issue is I know there are alternatives to statements I
 make that can be much shorter and faster with jQuery, but any attempts
 I make just seem to break it. Any insight into this issue would be
 appreciated, thanks!

       initActivityForms: function() {
             var radios = document.forms['ActivitiesTab'].elements
 ['activities[ActivitiesTab]'];
             $(actids).each(function(i) {
                 var fmName = 'ticketSearchForm' + actids[i].ucFirst();
                 var fm = document.forms[fmName];
                 $(radios[i]).click(function() {
                     $.bots.toggleASF(actids[i]);
                     });
                 $(fm).submit(function() {
                     $(radios).each(function(i) {
                         if (radios[i].checked) {
                             ckd = radios[i].value;
                         }
                     });
                     this.elements['activities[ActivitiesTab]'].value =
 ckd;
                 });
                 });
             radios[0].checked = true;
         },
         toggleASF: function(actid) {
             $(actids).each(function(i) {
                 var obb = $('#' + actids[i]);
                 if (actid == actids[i]) {
                     $(obb).show();
                 } else {
                     $(obb).hide();
                 }
             });
             },


[jQuery] Re: scope issues in safari

2008-11-26 Thread thesubtledoctor

Thanks alot for the suggestion.  It didn't work though.  I'm at a
loss.  Is this a jQuery bug, or am I doing something wrong?



On Nov 25, 3:53 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote:

 You could try this:

     jQuery('div.clause').each(function(){
       var width = 0;
       var words = jQuery(this).children('div.word');
       for (var i=0;iwords.length;i++)
       {
          var word = words.eq(i);
          var thiswidth = word.width();
          var padding = word.css('padding-left');
          width = width + parseInt(thiswidth) + parseInt(padding);
       }
       jQuery(this).width(width+30);
     });

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

 Behalf Of thesubtledoctor
 Sent: Tuesday, November 25, 2008 10:44 AM
 To: jQuery (English)
 Subject: [jQuery] scope issues in safari

 I need to calculate the widths of the divs of class 'clause'
 dynamically based on the widths of their contents, divs of class
 'word'.  The following code works correctly in Firefox:

     jQuery('div.clause').each(function(){
       var width = 0;
        jQuery(this).children('div.word').each(function(){
          var thiswidth = jQuery(this).width();
          var padding = jQuery(this).css('padding-left');
          width = width + parseInt(thiswidth) + parseInt(padding);
         });
       jQuery(this).width(width+30);
     });

 but in Safari it seems that a) the variable 'width' is calculated by
 adding the widths of every div.word, not just those within a given
 div.clause, b) 'width' is not local within the outer .each brackets,
 so that what would be the total width of the second div.clause but for
 issue (a) is added on top of the already calculated width for the
 first div.clause.

 So in Firefox the calculated widths are 187px, 268px, and 353px,
 whereas in safari they are 2838px, 8544px, and 34206px.

 Can anyone suggest a solution?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
jQuery (English) group.
To post to this group, send email to jquery-en@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-en?hl=en
-~--~~~~--~~--~--~---



[jQuery] Re: Hi all, jquery issue (major) with IE - all versions

2008-11-26 Thread Brandon Aaron
It sounds like you might be trying to set css properties via the .attr
method instead of the .css method.
--
Brandon Aaron

On Wed, Nov 26, 2008 at 10:23 AM, tukutela
[EMAIL PROTECTED]wrote:


 Hi all, I have some additional information which I hope might be of
 use.

 the function is passed the following variables:
 name = color
 value = inherit

 unfortunately I'm not able to get the elem to help out more, anyone
 have any suggestions on how to debug?


 On Nov 26, 9:42 am, tukutela [EMAIL PROTECTED] wrote:
  HI all,
 
  This only happens with IE (all versions), on line 1120 in
  jquery-1.2.6.js I get the following error.
 
  Line 1120:
  Invalid Property Value
 
  The line in the js file is the following:
 
  elem[ name ] = value;
 
  It inside attr: function( elem, name, value )
 
  Does anybody have a problem similar to this?



[jQuery] [tooltip] plugin

2008-11-26 Thread donb

I have used this successfully for elments that were defined in the
initial page (hardcoded into the html).  But now that I have a couple
I .append() dynamically, I cannot get the text to popup.  It seems as
if the .tooltip() doesn't work if the element is added after the page
loads.

Note that I perform $(#tooltipID).tooltip() after the $
(#container).append() is done.  I would expect that as long as the
element I want to bind the tooltip to exists, it should attach itself
to that element.

I even tried a setTimeout to defer the .toolip() execution slightly,
just in case.  No better.  I am careful to ensure there are no
duplicate IDs.

I found that I could (with Firebug) perform a .toggle() on the
selector, and it would hide/show properly.  So clearly the element is
there and 'known' to scripts because other actions work.  Only
the .tooltip() seems to not 'see' the dynamically-added elements.

Briefly, my effort is thus:

if ($(label.selection-status~a).length==0) {  
// No 'a'
siblings yet, add them

$(label.selection-status).after( a 
id='unselectall'
class='status' href='#' caption='caption' info='info'text1/a a
id='showall'class='status' href='#' caption='showall'
info='info'text2/a);
$(a#unselectall).tooltip();
$(a#showall).tooltip();
$(a#unselectall).click(
function() {

SetCookie(cookieFavorites,'');
evalFavorites();
clearAll();
return false;
}
);
$(a#showall).click(
function() {

$(this).attr('href',$(this).attr('href').toString().split
('#')[0].split('')[0].split('?')[0] + '?' + getIdlist()+ns=1);
}
);
}


[jQuery] jQuery Tooltip plugin 1.3

2008-11-26 Thread donb

I have used this successfully for elements that were defined in the
initial page (hardcoded into the html).  But now that I have a couple
I .append() dynamically, I cannot get the text to popup.  It seems as
if the .tooltip() doesn't work if the element is added after the page
loads.

Note that I perform $(#tooltipID).tooltip() after the $
(#container).append() is done.  I would expect that as long as the
element I want to bind the tooltip to exists, it should attach itself
to that element.

I even tried a setTimeout to defer the .toolip() execution slightly,
just in case.  No better.  I am careful to ensure there are no
duplicate IDs.

I found that I could (with Firebug) perform a .toggle() on the
selector, and it would hide/show properly.  So clearly the element is
there and 'known' to scripts because other actions work.  Only
the .tooltip() seems to not 'see' the dynamically-added elements.

Briefly, my effort is thus:

if ($(label.selection-
status~a).length==0) {  // No 'a'
siblings yet, add them

$(label.selection-
status).after( a id='unselectall'
class='status' href='#' caption='caption' info='info'text1/a a
id='showall'class='status' href='#' caption='showall'
info='info'text2/a);
$(a#unselectall).tooltip();
$(a#showall).tooltip();
$(a#unselectall).click(
function() {
 
SetCookie(cookieFavorites,'');
 
evalFavorites();
 
clearAll();
return
false;
}
);
$(a#showall).click(
function() {
$
(this).attr('href',$(this).attr('href').toString().split
('#')[0].split('')[0].split('?')[0] + '?' + getIdlist()+ns=1);
}
);
}


[jQuery] Show and Hide methods on div tag stuttering animation

2008-11-26 Thread Todd Stuart
Hello,

I am using .show() and on a div object. In both IE and FF the display starts
out nice and smooth and then seems to stutter at the end of the show. I have
tried using .show(fast), .show(slow) also, but with the same results.
Does anyone know a fix to this?

Thanks,
TS


[jQuery] Re: Object-oriented plugins?

2008-11-26 Thread Balazs Endresz

I personally use the same approach in the Translate plugin (maybe I
should have told you that before :), but with that you don't need the
'new' keyword: $.translate() returns a new object (it's a bit similar
to $.ajax or jQuery itself, you don't need 'new' there either).
http://code.google.com/p/jquery-translate/

With Translate you can only control the behaviour through the options
when using the jQuery method (though the object is available in
callback functions), but  in your case I think you can still consider
letting the first variable call a method:

$.fn.alerter = function(a){
 if(typeof a!=string) {
  var alerter = new $.Alerter(this, a);
  $(this).data(alerter, alerter); //store the instance
 } else {
  var instance = $(this).data(alerter); //get the instance
  instance[a].apply(instance, $.makeArray(arguments).slice(1) ); //
call method
 }
 return this;
}

I don't want to push this but it's really not a lot of code for a
shorthand, as you don't need to deal with the instances in your code
beacause they're handled by the plugin and you can call methods
without breaking a chain, but it really depends on what you want the
plugin to do.

Some other discussions related to this topic if you're interested:
http://groups.google.com/group/jquery-en/browse_thread/thread/9dc9be1cc298cbdd
http://groups.google.com/group/jquery-dev/browse_thread/thread/48400f696b85a7cb
http://groups.google.com/group/jquery-dev/browse_thread/thread/b2f784b7575456dc/0cd276379f8a2f7d?show_docid=0cd276379f8a2f7d
http://groups.google.com/group/jquery-dev/browse_thread/thread/6c02b9b939c96bdb/5f244e161b9c1346?show_docid=5f244e161b9c1346

On Nov 26, 7:16 pm, Hector Virgen [EMAIL PROTECTED] wrote:
 I've been thinking about this over the weekend and came up with a way to
 write class-based plugins while still following the jQuery convention. Maybe
 someone else has done this before but I couldn't find any documentation on
 this subject.
 The idea is to extend the base jQuery object with the javascript class, and
 then extend jQuery.fn with a simple method that does nothing but instantiate
 the class and return this.

 The nice thing about this approach is that you can still make chainable
 plugins without polluting the jQuery.fn namespace with a ton of methods.

 $('#mydiv').myplugin().show();

 But if you need access to the object, you can use the new construct.

 var myplugin = new $.MyPlugin($('#mydiv'));
 myplugin.doSomething();

 Here is an example plugin that just alerts some text when the selected
 elements are clicked. But, if you create the plugin object manually with the
 new construct, you can change the message or invoke the alert without the
 click:

 (function($){
 var Alerter = function(selector, options)
 {
 var obj = this;
  this.settings = {
 message: 'no message'};

  $.extend(this.settings, options);
  selector.click(function()
 {
 obj.alert.call(obj);});
 }

  Alerter.prototype.alert = function()
 {
 alert('Alerter said: ' + this.settings.message);}

  Alerter.prototype.message = function(message)
 {
 this.settings.message = message;
 return this;}

  $.extend({
 Alerter: Alerter});

  $.fn.extend({
 alerter: function(options)
 {
 var alerter = new $.Alerter(this, options);
 return this;

 }
 });
 })(jQuery);

 // Usage as jQuery plugin
 $('#mydiv').alerter({
 message: 'foo'

 });

 // Usage as object
 var alerter = new $.Alerter($('#anotherdiv'), {
 message: 'bar'

 });

 // As an object, you can call methods on it easily
 alerter.message('new message');
 alerter.alert(); // alerts Alerter said: new message

 Any thoughts on this approach?

 -Hector

 On Sun, Nov 23, 2008 at 5:15 AM, Scott González [EMAIL PROTECTED]wrote:



  Providing the method name as the first parameter is a bit awkward,
  perhaps looking at the alternatives would help:

  Add namespaces to jQuery.  This isn't very jQuery-like.  Example: $
  (el).tabs.add(url, label).show();

  Add a new jQuery method for every plugin instance method.  This
  pollutes the jQuery namespace, so this should only be done when it
  really makes sense.  Example: $(el).addTab(url, label);

  Use events.  You can bind custom events in a namespace and then have
  users interact with your plugin by triggering those events.  Example: $
  (el).trigger('add.tabs', url, label);

  There may be other approaches as well.

  The jQuery UI approach allows plugins to expose as many methods as
  they want while only using one method in the jQuery namespace.


[jQuery] Problems with sortable()

2008-11-26 Thread René

Can someone tell me why serialize returns nothing?


ul id=sort
li id=1123/li
li id=2abc /li
li id=3456/li
li id=4xyz/li
/ul

script type=text/javascript src=http://ajax.googleapis.com/ajax/
libs/jquery/1.2.6/jquery.min.js/script
script type=text/javascript src=http://ajax.googleapis.com/ajax/
libs/jqueryui/1.5.2/jquery-ui.js/script

script type=text/javascript

$('#sort').sortable({
cursor: 'move',
axis:   'y',
update: function() {
sorted = $(this).sortable(serialize, 'id');
alert (sorted);
}
});

/script


[jQuery] Re: Show and Hide methods on div tag stuttering animation

2008-11-26 Thread Nathan


You should post an example. Then could let you know what's going on.


On Nov 26, 12:27 pm, Todd Stuart [EMAIL PROTECTED] wrote:
 Hello,

 I am using .show() and on a div object. In both IE and FF the display starts
 out nice and smooth and then seems to stutter at the end of the show. I have
 tried using .show(fast), .show(slow) also, but with the same results.
 Does anyone know a fix to this?

 Thanks,
 TS


[jQuery] Re: Show and Hide methods on div tag stuttering animation

2008-11-26 Thread Balazs Endresz

Most likely it's because the padding and margin properties are not
animated:
http://groups.google.com/group/jquery-dev/browse_thread/thread/5c990ab32a8ef733/f92692bb578495b6?show_docid=f92692bb578495b6

On Nov 26, 9:27 pm, Todd Stuart [EMAIL PROTECTED] wrote:
 Hello,

 I am using .show() and on a div object. In both IE and FF the display starts
 out nice and smooth and then seems to stutter at the end of the show. I have
 tried using .show(fast), .show(slow) also, but with the same results.
 Does anyone know a fix to this?

 Thanks,
 TS


[jQuery] Re: Anyone know how to find the topmost elements of a specific type?

2008-11-26 Thread ricardobeat

I sketched up a plugin for this.

It's at http://ff6600.org/j/jquery.dig.js

Live example at http://jsbin.com/ugena/

It just steps throught the children with the tag given and executes a
function for each one, passing it it's 'hierarchy level' in relation
to the container where the plug-in was called. Any new children added
in the process will be taken into account on the next step.

hope it helps!

- ricardo

On Nov 26, 3:52 pm, Mark Gibson [EMAIL PROTECTED] wrote:
 I don't think I stated my problem fully.

 What I'm trying to do it process the elements recursively, so using
 the ul's as an example:

 1. Find the shallowest ul's (Karl's solutions would work here).
 2. For each ul found:
 3. Add content to the ul.
 4. Find the next shallowest ul within each ul.
 5. Recurse from step 2 (until there are no more deeper ul's).

 var dostuff = function(elem) {
   $(elem).findShallowest('ul').each(function() {
     // do stuff, add content
     dostuff(this);
   });

 }

 It's important that the elements are processed in this manner,
 as content is added which may include more ul's which in turn
 need processing.
 Also the exact structure is not known, so I can't rely on child ''
 ops.

 I think it could be done by stopping find() from going any deeper
 once it finds match, but from looking at the jQuery src, find() is a
 little baffling.

 Thanks for help so far
 - Mark.

 On Nov 17, 7:28 pm, Karl Swedberg [EMAIL PROTECTED] wrote:

  Hi Mark,

  I took a look at your original post again, and from your description  
  there it looks like this would work:

  $('ul').filter(function() {
     return !$(this).parents('ul').length;

  })

  --Karl

  
  Karl Swedbergwww.englishrules.comwww.learningjquery.com

  On Nov 17, 2008, at 10:58 AM, Mark Gibson wrote:

   The trouble is that the elements i'm looking for are not necessarily
   direct children of the container,
   so  isn't going to work. What I really need is to stop jQuery from
   searching any deeper once it
   finds the first ul, but continue the search at the same and
   shallower levels.
   Is  there a way to do this with a $.expr[':'] plugin?

   On Nov 11, 11:24 am, Klaus Hartl [EMAIL PROTECTED] wrote:
   That won't work. :first-child will give you *all* uls that are the
   first child of any element:

   div id=container
       ul!-- is first child --
           li
               ul ... /ul!-- is first child --
           /li
       /ul
   /div

   If you need the topmost ul use the  combinator:

   $('#container  u')

   Oh, jQuery has some documentation about 
   selectors:http://docs.jquery.com/Selectors

   En plus knowing the spec doesn't hurt 
   either:http://www.w3.org/TR/CSS21/selector.htmlhttp://www.w3.org/TR/css3-sel...

   --Klaus

   On 11 Nov., 02:07, Hector Virgen [EMAIL PROTECTED] wrote:

   Oops, it's actually $('#container ul:first-child')
   Here's a nifty page of CSS3 
   selectors:http://www.w3.org/TR/2001/CR-css3-selectors-2003/#selectors

   -Hector

   On Mon, Nov 10, 2008 at 5:06 PM, Hector Virgen  
   [EMAIL PROTECTED] wrote:
   $('#container ul:first') should give you the first UL in the  
   container
   -Hector

   On Mon, Nov 10, 2008 at 4:50 PM, Mark Gibson  
   [EMAIL PROTECTED] wrote:

   Anyone know how I can find the topmost elements of a certain  
   type, eg.

   Say I have several ul lists on a page, which in turn contain  
   sub-
   lists, and so on.
   Is there a selector I can use to find all the topmost ul  
   elements.

   I've been raking my brains over this, and can't see a way with css
   style selectors,
   have i overlooked something?

   Ideally I'd like to do:
   $('ul:topmost')

   or:
   $('#container ul:topmost')

   Cheers
   - Mark


[jQuery] Re: Best way to grab an item from an object?

2008-11-26 Thread ricardobeat

That's an array of objects, and yes, you'll have to iterate through
all of them. jQuery can make it a bit easier but it's not actually
'faster'. I think you meant 'shortest' :)

var idOne = $.grep(TESTS, function(obj){
   return (obj.id == 1);
});

- ricardo

On Nov 26, 1:38 pm, Shazzaam [EMAIL PROTECTED] wrote:
 Hi, I was wondering what the fastest way to get an item from an object is,
 for example I have this object:

                 var TESTS = [
                         {
                                 id: 1,
                                 name: 'Test 1',
                         },
                         {
                                 id: 2,
                                 name: 'Test 2',
                         }                                
                 ];

 If I know the id is 1, do I have to iterate through the whole list to
 retrieve the name, or can I use jquery's filter function or something else.

 Thanks!
 --
 View this message in 
 context:http://www.nabble.com/Best-way-to-grab-an-item-from-an-object--tp2070...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: which event i should use for changing 'input type text'?

2008-11-26 Thread ricardobeat

the onchange event will only fire after you 'blur' the input. You
might want to use the keydown event for real-time checks.

- ricardo

On Nov 26, 11:55 am, mangajin [EMAIL PROTECTED] wrote:
 I am working on JQuery event that populate another function when the
 user click the check box, radio buttion and the drop down list. They
 are all work fine with 'change(fn)'. However the problem I found is
 when i use 'input type text' that get the value from calendar picker.
 The function populateSearchInfo(); was not triggered when the value in
 the inbox was changed. Any Idea? Can anyone suggest other event? the
 following is the code example.

 Html:
 div class=searchCalendar
 input type=text  value=26-11-2008 class=inp date-pick dp-
 applied name=dateTimeS id=dateTimeS/
 /div

 Jquery:

 $('form .searchCalendar input').change(function(){
    populateSearchInfo();
         });


[jQuery] Re: Problems with sortable()

2008-11-26 Thread René

OK, I figured out my problem.

The li items need to have an ID in the form of item_1.

On Nov 26, 2:07 pm, René [EMAIL PROTECTED] wrote:
 Can someone tell me why serialize returns nothing?

 ul id=sort
 li id=1123/li
 li id=2abc /li
 li id=3456/li
 li id=4xyz/li
 /ul

 script type=text/javascript src=http://ajax.googleapis.com/ajax/
 libs/jquery/1.2.6/jquery.min.js/script
 script type=text/javascript src=http://ajax.googleapis.com/ajax/
 libs/jqueryui/1.5.2/jquery-ui.js/script

 script type=text/javascript

 $('#sort').sortable({
     cursor:     'move',
     axis:       'y',
     update: function() {
         sorted = $(this).sortable(serialize, 'id');
         alert (sorted);
     }

 });

 /script


[jQuery] Re: Problems with sortable()

2008-11-26 Thread ajpiano

the ID attribute is not allowed to start with a number.

--adam

On Nov 26, 5:09 pm, René [EMAIL PROTECTED] wrote:
 OK, I figured out my problem.

 The li items need to have an ID in the form of item_1.

 On Nov 26, 2:07 pm, René [EMAIL PROTECTED] wrote:

  Can someone tell me why serialize returns nothing?

  ul id=sort
  li id=1123/li
  li id=2abc /li
  li id=3456/li
  li id=4xyz/li
  /ul

  script type=text/javascript src=http://ajax.googleapis.com/ajax/
  libs/jquery/1.2.6/jquery.min.js/script
  script type=text/javascript src=http://ajax.googleapis.com/ajax/
  libs/jqueryui/1.5.2/jquery-ui.js/script

  script type=text/javascript

  $('#sort').sortable({
      cursor:     'move',
      axis:       'y',
      update: function() {
          sorted = $(this).sortable(serialize, 'id');
          alert (sorted);
      }

  });

  /script


[jQuery] Re: Best way to grab an item from an object?

2008-11-26 Thread Dave Methvin

You'd need to iterate through them, but if you're exclusively using
the id to retrieve them you could use this:

 var TESTS = {
 1: {
 id: 1,
 name: 'Test 1',
 },
 2: {
 id: 2,
  name: 'Test 2',
 }
 };

var theone = TESTS[someid];

That is, use an object and retrieve the elements using the ID property.


[jQuery] Re: Object-oriented plugins?

2008-11-26 Thread ajpiano

I've been writing a lot of jQuery plugins for internal use that use an
OO and prototypal approach.  I have a basic class that i use for all
plugins that provides some basic methods (like storing the instance in
the .data() of the element and fires the internal methods of the
subclass, and then i attach a basic jQuery plugin functionality to
start it all up.  I've found it rather enjoyable to work with for
creating and working with objects with a lot of methods...and it keeps
the jQuery namespace clean

app.Toolbox = function(tool)  {
function Toolbox() {}
Toolbox.prototype = $.extend({
flag:function() {
app.flags[tool.name] = true;
},
unflag:function() {
delete app.flags[tool.name];
},
initTool:function() {
if (tool.flags) {
if (app.flags[tool.name]) {
alert(You can only launch one 
+tool.description+ at a
time.);
return false;
} else {
this.flag();
}
}
tool.$el.data(tool.name,this);
return this.init();
},
takeDown:function() {
tool.destroy.call(this);
tool.$el.removeData(tool.name);
tool.flags  this.unflag();
}
},tool);
return new Toolbox().initTool();
};

jQuery.fn.columnMasterEditor = function() {
return this.each(function() {
var $a = $(a href='#' class='masterEditLink' 
title='Update entire
column...'/);
$a
.tooltip(app.defaults.tooltip)
.prependTo(this)
.bind(click.columnMasterEditor,function(e) {
new app.Toolbox.ColumnMasterEditor($a,e);
return false;
});
});
};

this is just a pattern i have developed for myself but if anyone has
feedback on it please do share...


--adam



On Nov 26, 3:41 pm, Balazs Endresz [EMAIL PROTECTED] wrote:
 I personally use the same approach in the Translate plugin (maybe I
 should have told you that before :), but with that you don't need the
 'new' keyword: $.translate() returns a new object (it's a bit similar
 to $.ajax or jQuery itself, you don't need 'new' there 
 either).http://code.google.com/p/jquery-translate/

 With Translate you can only control the behaviour through the options
 when using the jQuery method (though the object is available in
 callback functions), but  in your case I think you can still consider
 letting the first variable call a method:

 $.fn.alerter = function(a){
  if(typeof a!=string) {
   var alerter = new $.Alerter(this, a);
   $(this).data(alerter, alerter); //store the instance
  } else {
   var instance = $(this).data(alerter); //get the instance
   instance[a].apply(instance, $.makeArray(arguments).slice(1) ); //
 call method
  }
  return this;

 }

 I don't want to push this but it's really not a lot of code for a
 shorthand, as you don't need to deal with the instances in your code
 beacause they're handled by the plugin and you can call methods
 without breaking a chain, but it really depends on what you want the
 plugin to do.

 Some other discussions related to this topic if you're 
 interested:http://groups.google.com/group/jquery-en/browse_thread/thread/9dc9be1...http://groups.google.com/group/jquery-dev/browse_thread/thread/48400f...http://groups.google.com/group/jquery-dev/browse_thread/thread/b2f784...http://groups.google.com/group/jquery-dev/browse_thread/thread/6c02b9...

 On Nov 26, 7:16 pm, Hector Virgen [EMAIL PROTECTED] wrote:

  I've been thinking about this over the weekend and came up with a way to
  write class-based plugins while still following the jQuery convention. Maybe
  someone else has done this before but I couldn't find any documentation on
  this subject.
  The idea is to extend the base jQuery object with the javascript class, and
  then extend jQuery.fn with a simple method that does nothing but instantiate
  the class and return this.

  The nice thing about this approach is that you can still make chainable
  plugins without polluting the jQuery.fn namespace with a ton of methods.

  $('#mydiv').myplugin().show();

  But if you need access to the object, you can use the new construct.

  var myplugin = new $.MyPlugin($('#mydiv'));
  

[jQuery] Is there a menu button plugin for Jquery

2008-11-26 Thread Ashish

Is there a menu button plugin for Jquery?

I need Something similar to 
http://developer.yahoo.com/yui/examples/button/btn_example08.html
or http://developer.yahoo.com/yui/examples/button/btn_example0.html in
Jquery.

I have a grid structure and need need to put menu button on each row.
Each row has data retrieved from database. Action chosed from menu
button will perform on the row. (I  do not know number of rows
beforehand.)



[jQuery] Re: Object-oriented plugins?

2008-11-26 Thread Carpii

On Nov 26, 10:27 pm, ajpiano [EMAIL PROTECTED] wrote:

 this is just a pattern i have developed for myself but if anyone has
 feedback on it please do share...


Can you show an example of how such a class would be used?

Im struggling to understand the benefit of it, although Im sure there
is one

Thanks


[jQuery] Re: scope issues in safari

2008-11-26 Thread Jeffrey Kretz

Can you post a test case url showing this issue?
JK

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of thesubtledoctor
Sent: Wednesday, November 26, 2008 11:37 AM
To: jQuery (English)
Subject: [jQuery] Re: scope issues in safari


Thanks alot for the suggestion.  It didn't work though.  I'm at a
loss.  Is this a jQuery bug, or am I doing something wrong?



On Nov 25, 3:53 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote:

 You could try this:

     jQuery('div.clause').each(function(){
       var width = 0;
       var words = jQuery(this).children('div.word');
       for (var i=0;iwords.length;i++)
       {
          var word = words.eq(i);
          var thiswidth = word.width();
          var padding = word.css('padding-left');
          width = width + parseInt(thiswidth) + parseInt(padding);
       }
       jQuery(this).width(width+30);
     });

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

 Behalf Of thesubtledoctor
 Sent: Tuesday, November 25, 2008 10:44 AM
 To: jQuery (English)
 Subject: [jQuery] scope issues in safari

 I need to calculate the widths of the divs of class 'clause'
 dynamically based on the widths of their contents, divs of class
 'word'.  The following code works correctly in Firefox:

     jQuery('div.clause').each(function(){
       var width = 0;
        jQuery(this).children('div.word').each(function(){
          var thiswidth = jQuery(this).width();
          var padding = jQuery(this).css('padding-left');
          width = width + parseInt(thiswidth) + parseInt(padding);
         });
       jQuery(this).width(width+30);
     });

 but in Safari it seems that a) the variable 'width' is calculated by
 adding the widths of every div.word, not just those within a given
 div.clause, b) 'width' is not local within the outer .each brackets,
 so that what would be the total width of the second div.clause but for
 issue (a) is added on top of the already calculated width for the
 first div.clause.

 So in Firefox the calculated widths are 187px, 268px, and 353px,
 whereas in safari they are 2838px, 8544px, and 34206px.

 Can anyone suggest a solution?




[jQuery] Re: Problems with sortable()

2008-11-26 Thread René

Yes, but additionally, the IDs need to have an underscore separator,
for some reason.

item_1
a_1
car_2

etc.

There needs to be an underscore between the first alpha character and
the number.

On Nov 26, 3:12 pm, ajpiano [EMAIL PROTECTED] wrote:
 the ID attribute is not allowed to start with a number.

 --adam

 On Nov 26, 5:09 pm, René [EMAIL PROTECTED] wrote:

  OK, I figured out my problem.

  The li items need to have an ID in the form of item_1.

  On Nov 26, 2:07 pm, René [EMAIL PROTECTED] wrote:

   Can someone tell me why serialize returns nothing?

   ul id=sort
   li id=1123/li
   li id=2abc /li
   li id=3456/li
   li id=4xyz/li
   /ul

   script type=text/javascript src=http://ajax.googleapis.com/ajax/
   libs/jquery/1.2.6/jquery.min.js/script
   script type=text/javascript src=http://ajax.googleapis.com/ajax/
   libs/jqueryui/1.5.2/jquery-ui.js/script

   script type=text/javascript

   $('#sort').sortable({
       cursor:     'move',
       axis:       'y',
       update: function() {
           sorted = $(this).sortable(serialize, 'id');
           alert (sorted);
       }

   });

   /script


[jQuery] Sortable / draggable problem -- items shift on drag

2008-11-26 Thread René

I've noticed that when using sortable(), when I click-and-drag an
item, it shifts left and up. Not sure what is causing this. Has anyone
found a way to keep draggable items from changing width and x-position
when dragging?

...Rene


[jQuery] Re: Problems with sortable()

2008-11-26 Thread 徐显峰
Who is the use of Gtalk?

2008/11/27 René [EMAIL PROTECTED]


 Yes, but additionally, the IDs need to have an underscore separator,
 for some reason.

 item_1
 a_1
 car_2

 etc.

 There needs to be an underscore between the first alpha character and
 the number.

 On Nov 26, 3:12 pm, ajpiano [EMAIL PROTECTED] wrote:
  the ID attribute is not allowed to start with a number.
 
  --adam
 
  On Nov 26, 5:09 pm, René [EMAIL PROTECTED] wrote:
 
   OK, I figured out my problem.
 
   The li items need to have an ID in the form of item_1.
 
   On Nov 26, 2:07 pm, René [EMAIL PROTECTED] wrote:
 
Can someone tell me why serialize returns nothing?
 
ul id=sort
li id=1123/li
li id=2abc /li
li id=3456/li
li id=4xyz/li
/ul
 
script type=text/javascript src=http://ajax.googleapis.com/ajax/
libs/jquery/1.2.6/jquery.min.js/script
script type=text/javascript src=http://ajax.googleapis.com/ajax/
libs/jqueryui/1.5.2/jquery-ui.js/script
 
script type=text/javascript
 
$('#sort').sortable({
cursor: 'move',
axis:   'y',
update: function() {
sorted = $(this).sortable(serialize, 'id');
alert (sorted);
}
 
});
 
/script



[jQuery] style selector (noob question)

2008-11-26 Thread Craig

Hi, does anyone know if it's possible to extract a style attribute
from a style (and not an element)?
For instance:
style
.myclass { background-color:white; }
/style

I have some legacy javascript that takes colors as parameters to
functions and i'd like to be able to define those in a style sheet and
then 'extract' the colors from that.

I can only get it to work if I do something like this:
div class=myclass /
...
var color = $(.myclass).css(background-color);


any ideas?
Craig.


[jQuery] Jquery Lightbox issue in IE7

2008-11-26 Thread Prasad

I have used Lightbox for portfolio, it works well in all browsers on
my locale machine. When I upload it on server for first time I can see
 click Next but for second image Next button goes down.

Please let me know if there is any solution.

URL: http://creativevisa.net/ver3/index.htm


[jQuery] png and black backgrounds in IE7

2008-11-26 Thread Tijmen Smit

I read quite a bit about this problem, and there doesn't seem to be a
good fix. But it have the impression that the only reason why Ie7
shows the black background is because of the change in the opacity
during the animation.

This is the code that I have right now. I try'd to change the
opacity:show into opacity0.9, so that the opacity wouldn't be
changed during the animation. But that didn't really work, actually
the whole animation stopped working.

What would I need to change in the code to make the opacity remain the
same? Just writing 0.9 instead of show doesnt seem to work?

$(.active-date a).hover(function() {
$(this).next(div).animate({opacity: show, top: -75}, 
slow);
}, function() {
$(this).next(div).animate({opacity: hide, top: -85}, 
fast);
});

Thanks :)


[jQuery] jquery not working in IE...period

2008-11-26 Thread whoompswhoomps

Hello all,

I just uploaded jquery on my website, http://www.bloompocket.com.

If you're looking at the homepage with FF or Safari, you'll see that
there is 10px padding above the green ShareThis icon. However, in
IE, that icon kisses right up against the text above it.

I am using the following code to add a class to the p containing the
ShareThis icon:

 $(document).ready(function(){
   $(.more-link+p).addClass(share_this);
 });

And FYI, here is the code I'm using to call jquery:
script src=http://www.bloompocket.com/js/jquery/jquery-1.2.6.js;
type=application/javascript/script

Can anyone see what I'm doing wrong here?

Thanks!

Doron



[jQuery] can't get an attribute from an appended img

2008-11-26 Thread Radu

hi, this is my first post on the group

so,

i have a form through wich i'm sending an ajax reques to a php script
and get the result back.
to be more clear i write a text into an input box then i submit it to
a php file where I make an image from the text using gd2. Then I send
back the path to the image.

I use this path so i can add images to a div. add the images to the
div i'm using append(). The ids of the images are dynamicly made.

all ok until this point

what I want to do is, when I clikc an image to optain it's id (in an
alert for example)

For some reason I get the ids only for the elements that were
originaly in the page, but not for the appended imgs

Thanks,
Radu


[jQuery] ajaxSubmit

2008-11-26 Thread [EMAIL PROTECTED]

Hi,

I am using ajax form plugin. After I defined the new value (different
with the attribute value of the form)  of url and type properties
within Option Object,  and pass options to ajaxSubmit. It didn't
override the form attribute value. Anyone knows why?

Thanks


[jQuery] Events with the slider

2008-11-26 Thread oconnell

I have a page where I need to trigger a function call when a user
changes the value of either end of the slider.  I create the slider
when the DOM is ready using this:

$('#productmatrix-slider').slider({ min: sliderMin, max:sliderMax,
range: true, change: function(e,ui) { submitProductMatrix() } });

The function 'submitProductMatrix() is defined elsewhere in my .js
file.

So, this works whenever I grab one of the slider handles and move it.
However, I also have a button the user can click that will 'reset' the
slider back to the original sliderMin and sliderMax values.  This is
the code that does that:

function setCurrentSliderPositions(currentPositionLow,
currentPositionHight){
$('#productmatrix-slider').slider(moveTo, currentPositionLow,
0 );
$('#productmatrix-slider').slider(moveTo, currentPositionHight,
1 );
}

The problem is that for each moveTo, it triggers that callback
function, and so I end up executing the 'submitProductMatrix' function
twice when I reset the the slider.

So, my thought was that I could unbind the 'change' event on the
slider before I do the 'moveTo' and then rebind the 'change' event
after I am done.  But, I can't get that to work.  Does anyone have any
ideas on what I am doing wrong?

Thanks in advance, Chris


[jQuery] Preloading content pager with nav... please suggest?

2008-11-26 Thread jqnoob


Hi All, I've looked through all the plugins on the main jquery site and as my
name suggests, I'm not a veteran jquery user. I'm not really sure which to
choose for what I am trying to do and thought I'd ask the forum...

I am looking for a plugin to page through picture/audio pairs with their
paths stored in the database. It should preload one for either 'previous' or
'next' and generate a simple navigation scheme like:
previous 5 6 7 8 9 next

If it is pretty then that is a bonus too  :p

Many THANKS in advance and please know I've done my best in trying to find a
lightweight replacement for my bulky php paging...

jqnoob
-- 
View this message in context: 
http://www.nabble.com/Preloading-content-pager-with-nav...-please-suggest--tp20701897s27240p20701897.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Fade effects when using replacement technique?

2008-11-26 Thread BigFisch

For an idea, here is a snippet:

n_video.clone().insertAfter(u_video);

Is there a way to make it so the content that is inserted, is inserted
with an effect?

If anyone can provide an example that would be awesome. Thanks!


[jQuery] Help in modification of Easiest Tooltip and image preview Plugin

2008-11-26 Thread Mahmoud M. Abdel-Fattah

While I was searching for a simple plugin that can make a tooltip
image preview, I found this one :
http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery

it has 3 types  am using this type :
http://cssglobe.com/lab/tooltip/03/

but the problem that, the tooltip is overlaping the window size, so
how can I fix this ?

the .js file is not packed  here it's :
http://cssglobe.com/lab/tooltip/03/main.js

Thanks for your time,
Mahmoud M. Abdel-Fattah


[jQuery] set class to active list item

2008-11-26 Thread ruijters (justdesign)

I have the following code to fade menu items and highlight the active
one. I can't get the active one thing to work.
I've searched a lot but could only find ways to add a class to the
anchor, and I would like to add the class to the li (cause the anchor
already has a class)

Here is my code

script src=_js/jquery-1.2.6.min.js type=text/javascript
charset=utf-8/script
script type=text/javascript charset=utf-8
$(function () {
if ($.browser.msie  $.browser.version  7) return;

$('#navigation li')
.removeClass('highlight')
.find('a')
.append('span class=hover /').each(function () {
var $span = $(' span.hover', this).css('opacity',
0);
$(this).hover(function () {
// on hover
$span.stop().fadeTo(100, 1);
}, function () {
// off hover
$span.stop().fadeTo(100, 0);
});
});

});

/script
script type=text/javascript
$(document).ready( function(){
var path = location.pathname.substring(1);
$('[EMAIL PROTECTED]' + path + ']').parents(li).addClass('active');
});
/script

  div id=navigatie
ul id=navigation
  li class=highlighta href=beeldbank.html
class=beeldbankspanbeeldbank/span/a/li
  li class=highlighta href=huisstijl.html
class=huisstijlspanhuisstijl/span/a/li
  li class=highlighta href=index.html
class=voorbeeldenspanvoorbeelden/span/a/li
/ul
 /div



Any ideas how to set (or change) the class to the li?


[jQuery] Change overflow of div when element clicked

2008-11-26 Thread Jason Turcotte

Hello,

I'm fairly new to jQuery and am trying to do the following.

I am using a coda slider effect for a website, which is working fine.

What I need to do is change the overflow CSS property for a div when
another element is clicked.

Here's what I have:

script type=text/javascript
$(document).ready(function(){

$(#test).click(function() $(#faq).css(overflow,auto);

});
/script

...snip...

  div id=navTab
ul class=navigation
  lia href=#homeHome/a/li
  lia href=#aboutAbout/a/li
  lia href=#practicePractice Areas/a/li
  lia href=#faq id=testCommon Questions/a/li
  li class=stripa href=#contactContact and Directions/
a/li
/ul
  /div

...snip...

div class=panel id=faq
  h1Common Questions/h1
  pIntro Paragraph/p
  div class=accordion
h3Do I need a lawyer?/h3
pParagraph 2 content/p
/div

CSS for #faq has overflow set to hidden.  What I want to happen is
when people click on the Common Questions link that is changes the
overflow property of #faq to auto (overflow:auto).

Right now, nothing happens when I click the link.

Help is appreciated!


[jQuery] listnav plugin

2008-11-26 Thread idgcorp

I have implemented this awesome plugin with great success and would
like to know if its possible to refresh the plugin after appending/
removing data from the list.

Can I break the connection and then rebind the data?


[jQuery] Ajax Call on form submit

2008-11-26 Thread [EMAIL PROTECTED]

Hi,

I am sending user to different sites based on their attribute once
they log in. I added a ajax call to check the users attribute before
submitting login form. I am implementing this using ajax form plugin.
The ajax call  reside in beforeSubmit call back function, it seems
that the ajax call is never invoked within the call back function.

Anyone can help me?

Thanks


[jQuery] trying to act on certain DIV's and not others

2008-11-26 Thread [EMAIL PROTECTED]

Hi folks,
apologies if this is a completely noob question. I wish to close
(hide) and number of div's whilst leaving others open. I considered
the possibility that it might be feasible in Jquery to act on div's
with a certain pattern in the id name. Not sure if this is true tho;
for example

div id-=contact_blah
div id=contact_yak
div id=nothanks

so that the first two div's would be subject to being hidden, and the
third left alone.

I wish essentially to have a series of links toggle the visibility of
some div's, but when a link is clicked and a div is unhidden, - all
other divs to hide.

Any ideas?

best wishes and thanks

Steve / Nibb


[jQuery] How to disable both weekends and national days

2008-11-26 Thread spike

To disable weekends i use:
beforeShowDay: $.datepicker.noWeekends

But i can't use funktion for national days at the same time!

beforeShowDay: $.datepicker.nationalDays

Is it possible to give  beforeShowDay two values?




[jQuery] can't get an attribute from an appended img

2008-11-26 Thread Radu

hi, this is my first post on the group

so,

i have a form through wich i'm sending an ajax reques to a php script
and get the result back.
to be more clear i write a text into an input box then i submit it to
a php file where I make an image from the text using gd2. Then I send
back the path to the image.

I use this path so i can add images to a div. add the images to the
div i'm using append(). The ids of the images are dynamicly made.

all ok until this point

what I want to do is, when I clikc an image to optain it's id (in an
alert for example)

For some reason I get the ids only for the elements that were
originaly in the page, but not for the appended imgs

Thanks,
Radu


[jQuery] ajaxSubmit plugin

2008-11-26 Thread [EMAIL PROTECTED]

Hi,

I am trying the ajax form plugin.  After I defined new value of url
and type properties within Option Object, those values of the
properties didn't override the corresponding attributes value in the
form.  Does anyone know why?

Thanks


[jQuery] Re: listnav plugin

2008-11-26 Thread Jack Killpatrick


Glad you like the plugin. Can you give me a little more about your use 
case so I'm sure I know what you're asking for? IE, are you just 
adding/removing LI's?


- Jack

idgcorp wrote:

I have implemented this awesome plugin with great success and would
like to know if its possible to refresh the plugin after appending/
removing data from the list.

Can I break the connection and then rebind the data?

  





[jQuery] Re: trying to act on certain DIV's and not others

2008-11-26 Thread David Andrews

Hey Steve,

I think regex is possible in the selector so using \\S* as your wildcard.. 

$('#contact_\\S*').each();

Sorry haven't tested the above - but hope it helps you out.

Dave
-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: 26 November 2008 16:18
To: jQuery (English)
Subject: [jQuery] trying to act on certain DIV's and not others


Hi folks,
apologies if this is a completely noob question. I wish to close
(hide) and number of div's whilst leaving others open. I considered the
possibility that it might be feasible in Jquery to act on div's with a
certain pattern in the id name. Not sure if this is true tho; for example

div id-=contact_blah
div id=contact_yak
div id=nothanks

so that the first two div's would be subject to being hidden, and the third
left alone.

I wish essentially to have a series of links toggle the visibility of some
div's, but when a link is clicked and a div is unhidden, - all other divs to
hide.

Any ideas?

best wishes and thanks

Steve / Nibb



[jQuery] Re: style selector (noob question)

2008-11-26 Thread donb

I don't think there's anyway to directly reference what's in a style
declaration, only indirectly through an html element (as you found).
However, you could temporarily create an element, assign the class of
interest to it, and work with that.  Of course, you probably want to
'learn' what classes are defined so you know what to assign to the
temp element, which gets you nowhere because there's no way to read
the style information (that I know of).

On Nov 26, 7:40 pm, Craig [EMAIL PROTECTED] wrote:
 Hi, does anyone know if it's possible to extract a style attribute
 from a style (and not an element)?
 For instance:
 style
 .myclass { background-color:white; }
 /style

 I have some legacy javascript that takes colors as parameters to
 functions and i'd like to be able to define those in a style sheet and
 then 'extract' the colors from that.

 I can only get it to work if I do something like this:
 div class=myclass /
 ...
 var color = $(.myclass).css(background-color);

 any ideas?
 Craig.


[jQuery] Re: Fade effects when using replacement technique?

2008-11-26 Thread ricardobeat

n_video.clone().hide().insertAfter(u_video).fadeIn() ?

On Nov 26, 10:38 pm, BigFisch [EMAIL PROTECTED] wrote:
 For an idea, here is a snippet:

     n_video.clone().insertAfter(u_video);

 Is there a way to make it so the content that is inserted, is inserted
 with an effect?

 If anyone can provide an example that would be awesome. Thanks!


[jQuery] Re: style selector (noob question)

2008-11-26 Thread ricardobeat

You could access the CSS rules via document.stylesheets[x].cssRules
[x].style.color, for example, but cross-browser support is not very
good:

http://www.quirksmode.org/dom/w3c_css.html

- ricardo

On Nov 26, 10:40 pm, Craig [EMAIL PROTECTED] wrote:
 Hi, does anyone know if it's possible to extract a style attribute
 from a style (and not an element)?
 For instance:
 style
 .myclass { background-color:white; }
 /style

 I have some legacy javascript that takes colors as parameters to
 functions and i'd like to be able to define those in a style sheet and
 then 'extract' the colors from that.

 I can only get it to work if I do something like this:
 div class=myclass /
 ...
 var color = $(.myclass).css(background-color);

 any ideas?
 Craig.


[jQuery] Re: style selector (noob question)

2008-11-26 Thread seasoup

I don't think jQuery is designed to get an attribute from a class.
The code you wrote

div class=myclass /
...
var color = $(.myclass).css(background-color);

works by pulling the background color from the DOM object.  A
different hack that would work in one line:

$('div/div').addClass('myclass').css('background-color');

That would create a div, add a class to it, and fetch the background
color.


On Nov 26, 4:40 pm, Craig [EMAIL PROTECTED] wrote:
 Hi, does anyone know if it's possible to extract a style attribute
 from a style (and not an element)?
 For instance:
 style
 .myclass { background-color:white; }
 /style

 I have some legacy javascript that takes colors as parameters to
 functions and i'd like to be able to define those in a style sheet and
 then 'extract' the colors from that.

 I can only get it to work if I do something like this:
 div class=myclass /
 ...
 var color = $(.myclass).css(background-color);

 any ideas?
 Craig.


[jQuery] Re: style selector (noob question)

2008-11-26 Thread seasoup

ok, found a plugin for you:

http://flesler.webs.com/jQuery.Rule/



On Nov 26, 4:40 pm, Craig [EMAIL PROTECTED] wrote:
 Hi, does anyone know if it's possible to extract a style attribute
 from a style (and not an element)?
 For instance:
 style
 .myclass { background-color:white; }
 /style

 I have some legacy javascript that takes colors as parameters to
 functions and i'd like to be able to define those in a style sheet and
 then 'extract' the colors from that.

 I can only get it to work if I do something like this:
 div class=myclass /
 ...
 var color = $(.myclass).css(background-color);

 any ideas?
 Craig.


[jQuery] Re: trying to act on certain DIV's and not others

2008-11-26 Thread seasoup

I'm not sure exactly what it is you are trying to do, so can't answer
with exact code but this code will make all divs have a click event
that will hide all divs except the one you clicked on.

$('div').click(function(){
   $('div').not($(this)).hide();
});

Try thinking in terms of all of the selector options instead of just
ids.  When clicking on an a tag with a class of className, the
following code will hide all divs except for the div with and index of
3.

$('.className a').click(function() {
   $('div').not($('div :eq(3)').hide();
});

Hopefully, you can adapt the above logic to what you need.  The above
code also hasn't been tested, so might not work without some
adjustment.

On Nov 26, 5:47 pm, David Andrews [EMAIL PROTECTED] wrote:
 Hey Steve,

 I think regex is possible in the selector so using \\S* as your wildcard..

 $('#contact_\\S*').each();

 Sorry haven't tested the above - but hope it helps you out.

 Dave

 -Original Message-
 From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of [EMAIL PROTECTED]
 Sent: 26 November 2008 16:18
 To: jQuery (English)
 Subject: [jQuery] trying to act on certain DIV's and not others

 Hi folks,
 apologies if this is a completely noob question. I wish to close
 (hide) and number of div's whilst leaving others open. I considered the
 possibility that it might be feasible in Jquery to act on div's with a
 certain pattern in the id name. Not sure if this is true tho; for example

 div id-=contact_blah
 div id=contact_yak
 div id=nothanks

 so that the first two div's would be subject to being hidden, and the third
 left alone.

 I wish essentially to have a series of links toggle the visibility of some
 div's, but when a link is clicked and a div is unhidden, - all other divs to
 hide.

 Any ideas?

 best wishes and thanks

 Steve / Nibb


[jQuery] Re: Fade effects when using replacement technique?

2008-11-26 Thread BigFisch

Thank you.

On Nov 26, 6:27 pm, ricardobeat [EMAIL PROTECTED] wrote:
 n_video.clone().hide().insertAfter(u_video).fadeIn() ?

 On Nov 26, 10:38 pm, BigFisch [EMAIL PROTECTED] wrote:

  For an idea, here is a snippet:

      n_video.clone().insertAfter(u_video);

  Is there a way to make it so the content that is inserted, is inserted
  with an effect?

  If anyone can provide an example that would be awesome. Thanks!


[jQuery] jquery load and get function

2008-11-26 Thread ts

hi, i've been going through some ajax tutorial, and most of the
tutorial show something like:
(let just say test.php and /test both return me a string of hello
world

$(document).ready(function(){
$(#quote p.load('test.php')
};
);

the load and get function is trying to get the result from test.php
and i got a hello world, this is ok for CGI style.

then i try to use short/pretty url like, (for example in Rails)

$(document).ready(function(){
$(#quote p.load('/test')
};
);

i suppose it will try to call the test controller in Rails(which will
give me the output hello world, but i failed to get any output.

Just wonder if anyone has any idea on this?



[jQuery] Re: jQuery timing out on page load

2008-11-26 Thread harryhobbes

Unfortunately that is not a feasible solution. The site will
eventually use jquery quite heavily and I cannot run a script to
determine if the page will need the jquery library or not.


On Nov 11, 9:39 pm, Dodi Rahmaninoff [EMAIL PROTECTED] wrote:
 Is the web is in php? if it is, why don't you try not to load the jquery
 file when the file is not needed, by addding the condition before the
 script tag, hope it can solve your problem

 harryhobbes wrote:
  Hi,

  I've got jQuery loading by default on my site. The library is only
  used on some pages in my site, however when I load a page that isn't
  using jquery (but still loading the file in the html header) Firefox
  pops up with a warning that jquery is timing out.

  Any suggestions?

  Cheers


  1   2   >