[jQuery] Re: Superfish - random menu widths

2008-04-18 Thread Joel Birch

Hi Kelly,

The JavaScript component of Superfish is only responsible for the
showing and hiding behaviour of a menu and whilst a small parts of the
Superfish CSS (the hover and sfHover parts) are required to make this
happen whilst retaining accessibility when JS is not available, most
of it is just for presentational purposes and can be altered however
you like.

You will need to alter your CSS to achieve the layout you require.
Therefore, you might be better off looking for examples of what you
want to achieve on sites that focus on CSS and Suckerfish menus in
general. cssplay.com comes to mind - I remember that site having lots
of menu examples so it might be worth a look. Basically, you don't
need to look for Superfish-specific examples as it is all about the
CSS. That said - if someone does happen to have a Superfish example of
said menu-type, then that would certainly help you get started.

I think if you need specific widths for each submenu then you may not
be able to avoid assigning widths to each one individually using CSS
(via classes or ids).

Joel Birch.


[jQuery] Re: jCarousel - highlight current external control

2008-04-18 Thread Jan Sorgalla

Hi,

could you please show an example page.

Jan

On 16 Apr., 08:19, Ryan M. [EMAIL PROTECTED] wrote:
 I'm attempting to use thejCarouselplugin, and have been able to set
 up what I want, for the most part. In the carousel I've built, I'm
 only showing one image at a time, and am using external controls to
 allow for access to the set of images. I'd like to be able to
 highlight the control that matches the current image, but haven't been
 able to figure out how to do that. I presume there might be a way to
 do it using the callback functions, but, since I'm a javascript
 newbie, I'm having a difficult time.

 The callback example shows this function: function
 mycarousel_itemVisibleInCallbackAfterAnimation which  identifies the
 idx that is visible. Is there a way to use this function to assign a
 css class to the external control associated with the currently
 visible idx?

 Anyone else done something like this with success? Or know how to use
 the callback functions?

 Thanks,

 Ryan M.


[jQuery] Shadowbox.js related question

2008-04-18 Thread Giovanni Battista Lenoci

Hi, I know that shadowbox.js isn't a jquery plugin, but I think that
most of you had take a look at this fantastic plugin.

I'm using in it in a site for displaying images, and I'm wondering if
it's possible to display a caption in the bottom like other plugins
do.

Thank you for your answers :-)


[jQuery] [validate] $.valid() issue with IE6

2008-04-18 Thread Up-Works

$('input#step2').livequery('click',function() {
 if($('form#order').valid()) {
$('div#stepOne').hide();
$('div.step').html('Stepbr\/Two');
$('div#stepTwo').show();
 }
return false;
});

The line - if($('form#order').valid()) {

Cause IE 6 to throw and error stating 'Object doesn't  support this
property or method.

Works in IE7 , FF+ and Safari+

Thank you in advance


[jQuery] Binding submit events via Taconite

2008-04-18 Thread lvp1138


Hi guys,

Due to the problem with IE unable to rebind onclick events, I am now
binding click events via Taconite's EVAL command.

All I want to do is, when the user clicks on the submit button, a
loading animation to appear. Before going any further, please be
aware that the way our app is designed, this is the only way to do it.

So the submit INPUT is similar to:

input id=myinput type=submit onclick=$('#anim').show('fast')

Works fine. When the form is submitted, and the form is re-inserted
(ReplaceContent) by Taconite, the following EVAL is done after the re-
insertion:


eval
$('#myinput').click(function()
{
$('#anim').show('fast')
return false;
}
);
/eval

If I click again on the submit button, for some reason, the animation
doesn't show up. The form gets submitted fine though.

To make sure it worked, I put an image with ID imagetest and put the
eval:

eval
$('#imagetest').click(function()
{
$('#anim').show('fast')
return false;
}
);
/eval

When I click the image, the animation shows up. That always works fine
so the eval code is correct.

The EVALs are not necessary with Firefox, since Firefox seems to re-
bind the onclick events called through AJAX. And it works fine 100% of
the time in Firefox, with just the onclick on the input button. The
animation always shows up, even if it's just for a second until the
form gets submitted and re-inserted.

This whole workaround is for IE.

Any ideas? I also try with submit instead of click. I'm assuming
that the jquery is not getting executed because the form is being
submitted. But why does it work always with just the onclick in the
input button?

I'd greatly appreciate some feedback.

Peter :)


[jQuery] Re: Select multiple elements with almost same id

2008-04-18 Thread Anton

Hi Zlocho,

Couldn't you do something like $(input[name^='quantity']) here? They
seem to share the same name.

cheers,

/Anton

On 17 Apr, 18:30, Zlochko [EMAIL PROTECTED] wrote:
 Hallo everyone. My name is Gjoko Pargo. I am a new member of this
 group, in fact - this is my first message here. I work mainly as a web
 applications developer and have extensive experience in php, asp,
 coldfusion, javascript and several types of databases.
 Although I do have some pretty good experience in JavaScript I still
 can't seem to get the grasp of some of the jQuery concepts. So I have
 two pretty basic questions which I was not able to find answers for.

 1. In one of my projects, I am building a shopping cart. The product
 list quantity fields are made of input fields with id's consisted of a
 reserved word and product_id combination. They look something like
 this:
 input type=text name=quantity[] id=quantity[23] /
 input type=text name=quantity[] id=quantity[563] /
 For those with web application experience the name quantity with it's
 two square brackets gives the browser the ability to make a list of
 each entry in one associative array and send it to the browser on
 submit.

 My problem is - I need to select all of the form elements which have
 quantity[something] in their id and then apply some action to them.
 Could anyone please help me on how to achieve this? Is this done with
 regular expressions or is there some native jQuery way to do this?

 2. On the same page where the product list is, there is also a
 shopping basket. What happens is that after the visitor populates the
 quantities of the desired products he/she hits on the submit button,
 and if everything is ok, the data is transfered to the server over
 ajax submit and then the contents of the shopping basket is changed in
 real time. Everything works ok, but I would like to add some eye
 candy...
 Namely, after submit, I want to fadeOut the shopping basket (or a
 specific element), and then do a fedeIn to make the shopping basket
 visible again with the new value. I was able to succeed in this, but
 unfortunately the fedeOut, changeOfQuantityValue and fadeIn are not
 synchronized. This means that depending on the speed of the connection
 the list starts to fade out, changes the item list values (while still
 visible), and then fades back in... or for slower connections: it
 fades out, fades in and then change the item list values.
 Any help with this?

 Thank you very much,
 Gjoko Pargo.


[jQuery] Problem positioning an absolute element

2008-04-18 Thread AsymF

I recently implemented the following CSS layout on a site in place of
a previous table layout:
http://www.pmob.co.uk/temp/3colfixedtest_sourcenone.htm

After doing so I cannot get DIVs to position correctly in some
instances when using jQuery to do so. One in particular is too far
down and over to the right.

Unfortunately I don't have a page to show because the code is on a
backend area that requires login. However, the code I was previously
using that worked great to cause a box to display right below a link
is this:
__
$('div#box').css('position', 'absolute');
$('div#box').css('left', $('a#link').offset().left);
$('div#box').css('top', ($('a#link').offset().top + $
('a#link').outerHeight() + 2));
$('div#box').show('normal');
__


However, I found that I now need to add or subtract the padding and
margins from enclosing DIVs due to the new CSS layout and I am
perplexed as to why:
__
$('div#box').css('position', 'absolute');

margin_left = $('div#outer').css('margin-left');
margin_left = margin_left.substring(0, margin_left.indexOf('px'));
pad_right = $('div#centrecontent').css('padding-right');
pad_right = pad_right.substring(0, pad_right.indexOf('px'));

$('div#box').css('left', ($('a#link').offset().left + pad_right -
margin_left));

pad_top = $('div#outer').css('padding-top');
pad_top = pad_top.substring(0, pad_top.indexOf('px'));

$('div#box').css('top', ($('a#link').offset().top + $
('a#link').outerHeight() + 2 - pad_top));
$('div#box').show('normal');
__

Even more perplexing is that if I leave pad_right inside those
calculations it causes the box to fly about 5160 pixels off to the
right of the screen. Checking the value in the console shows that
pad_right has a value of 6. If I remove pad_right and directly
substitute in the number 6 then the box positions normally.

Can anyone help explain to me what I am doing wrong here?


[jQuery] Re: Select multiple elements with almost same id

2008-04-18 Thread Morgan Allen
el[id^='quantity'] should do it for you. the ^= is starts with.

On Thu, Apr 17, 2008 at 3:30 PM, Zlochko [EMAIL PROTECTED] wrote:


 Hallo everyone. My name is Gjoko Pargo. I am a new member of this
 group, in fact - this is my first message here. I work mainly as a web
 applications developer and have extensive experience in php, asp,
 coldfusion, javascript and several types of databases.
 Although I do have some pretty good experience in JavaScript I still
 can't seem to get the grasp of some of the jQuery concepts. So I have
 two pretty basic questions which I was not able to find answers for.

 1. In one of my projects, I am building a shopping cart. The product
 list quantity fields are made of input fields with id's consisted of a
 reserved word and product_id combination. They look something like
 this:
 input type=text name=quantity[] id=quantity[23] /
 input type=text name=quantity[] id=quantity[563] /
 For those with web application experience the name quantity with it's
 two square brackets gives the browser the ability to make a list of
 each entry in one associative array and send it to the browser on
 submit.

 My problem is - I need to select all of the form elements which have
 quantity[something] in their id and then apply some action to them.
 Could anyone please help me on how to achieve this? Is this done with
 regular expressions or is there some native jQuery way to do this?

 2. On the same page where the product list is, there is also a
 shopping basket. What happens is that after the visitor populates the
 quantities of the desired products he/she hits on the submit button,
 and if everything is ok, the data is transfered to the server over
 ajax submit and then the contents of the shopping basket is changed in
 real time. Everything works ok, but I would like to add some eye
 candy...
 Namely, after submit, I want to fadeOut the shopping basket (or a
 specific element), and then do a fedeIn to make the shopping basket
 visible again with the new value. I was able to succeed in this, but
 unfortunately the fedeOut, changeOfQuantityValue and fadeIn are not
 synchronized. This means that depending on the speed of the connection
 the list starts to fade out, changes the item list values (while still
 visible), and then fades back in... or for slower connections: it
 fades out, fades in and then change the item list values.
 Any help with this?

 Thank you very much,
 Gjoko Pargo.




-- 
http://morglog.alleycatracing.com
Lets make up more accronyms!

http://www.alleycatracing.com
LTABOTIIOFR! ROFL! ROFL! ROFL!
Upcoming alley cats, reviews, touring logs, and a general congregation of
bike nerdity.


[jQuery] Re: Anyone have trouble viewing this site on Vista?

2008-04-18 Thread Chris Jones





It falls apart when you arrive at the URL in Opera 9. Hitting refresh
doesn't make a difference. If you click into another page the design is
fixed.Hitting refresh after the page is fixed, displays the correct
layout as well. 

So the problem is when you land on your site.

Download Opera 9 from www.opera.com and test it. Maybe others reading
this can test it too. I'm pretty sure Opera is working OK on mine,
seems to display every other site ok. Weird eh :).

Chris.




Rick Faircloth wrote:

  Are you saying that coming to the page straight from the URL
or after refreshing that the page falls apart, but getting to a
page via the menu makes the page line up properly?

Thanks for the screen shots!

Rick

  
  
-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery-en@googlegroups.com] On Behalf Of Chris Jones
Sent: Thursday, April 17, 2008 4:18 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Anyone have trouble viewing this site on Vista?

Hi Rick,

There should be 2 images attached. I took a snapshot of the header and
footer. Just to re-cap. if I refresh the page it still looks like it
does in the screen shots. If I press any link (including home) on the
top navigation bar it re-loads the page as it should - looks perfect.

Chris.


Rick Faircloth wrote:


  Thanks for the feedback, Chris.

I think the primary reason for the slowness of the sight's loading
is the images involved.  It's fairly heavy on the image side.  Plus,
it's loading a lot of jQuery.  But, the images are what the client wanted...

A screenshot in Opera 9 would be welcome, if you don't mind.

Thanks for the help!

Rick


  
  
-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery-en@googlegroups.com] On Behalf Of cjant83
Sent: Wednesday, April 16, 2008 5:18 PM
To: jQuery (English)
Subject: [jQuery] Re: Anyone have trouble viewing this site on Vista?


Hi Rick,

I have a Vista laptop (unfortunately) with Sp1. The crossfade and web
site seems to be working fine with IE7, Firefox 2(.0.0.13), but
problems with Opera 9. I experience the weird slow downloading of
images under the menu, but also underneath that big image the body is
aligned to the left with no background images until I press on one of
the navigation buttons i.e. Home. I can take a screen grab if you want
or if you download Opera 9 you'll get the same thing. It's a nice
looking site but very slow loading (on a 1mb broadband connection UK).
Dont know if thats because its on dev space.

Chris.


On Apr 16, 8:02 pm, "Rick Faircloth" [EMAIL PROTECTED] wrote:



  Hi, all..

I was attempting to demo this site and show off
the Cycle plug-in to a prospective client, but the
Cycle plug-in was acting very strangly... flickering, not
showing images, etc.

The other plug-ins were working properly.

The client's laptop runs Vista.

Anyone with Vista care to look at this site and check out
the large photos under the menu and see if they crossfade?

http://c21ar.wsm-dev.com

Thanks!

Rick

  

  
  

  

  
  
  





[jQuery] Re: WYSIWYG Editor

2008-04-18 Thread Kinch Zhang
On 4/17/08, Richard D. Worth [EMAIL PROTECTED] wrote:

 Take a look at jWysiwyg:

 http://code.google.com/p/jwysiwyg/

 - Richard


It's great ! Thank you for the link because I'm looking for a jQuery WYSIWYG
editor for a long time


On Wed, Apr 16, 2008 at 7:59 PM, Donald J Organ IV [EMAIL PROTECTED]
 wrote:

  Does anyone know of a lightweight(code size) WYSIWYG editor that works
  with jQuery it needs to only do basic HTML editing.
 
  Insert links
  bullets
  images from a given path
  and formating of text.
 




-- 
Kinch::The Missing Hacker


[jQuery] Converting PHP tabbed page to jQuery

2008-04-18 Thread keen2learn

I've built a test module with PHP using three tabs - each tab loads a
separate page containing the tabs styled to indicate which one is in
use.

Here's the test module: http://www.bloogle.com.au/mapping-test.php

When I put this module into the site's Home Page, it will have to load
all the other stuff on the Home Page, so I'm exploring some way to
update just the module using Ajax.

This is a fairly complex operation as two of the PHP pages carry a
form with a Select box - one chooses a Google map and the other a
Flash file.  The third page carries a JavaScript linked to a Weather
Service in Australia.

It all works fairly fast, but I want to use Ajax where I can on the
site but it must be unobtrusive JavaScript.

I'm an intermediate level programmer familiar with PHP, ASP and some
ASP.NET and a little JavaScript.

Am I attempting too complex an operation for jQuery?

Would I be better to stay with what I've built so far?

My concern is that some jQuery sites seem to take longer to load than
what I've created with this module.

I think jQuery is excellent and I'm keen to use it. Congratulations to
your team.

I would welcome any opinions about the dilemma I face with this
module.
Best regards
keen2learn











[jQuery] {Plugin] jQuery.Modularize

2008-04-18 Thread Ariel Flesler

Hi

Added this small plugin (673 bytes) that lets you namespace jQuery
methods.
You can use claim only one name ofjQuery.fn, and have multiple sub-
functions under that name.
This is one possible approach to keep the rule of only claiming one
name from the jQuery namespace.

You declare this:

$.fn.foo = function(){ ... };
$.fn.foo.bar = function(){ ... };
$.fn.foo.baz = function(){ ... };

And use it like this:

$(...).foo().bar( ... );
$(...).foo(  );
$(...).foo().baz( ... ).foo().bar( ... ).foo( ... );

The plugin is code in such a way, that no closure is formed, and
there're no references to variables on other scope. Making this super
garbage-collection friendly.

It can be used for plugins, to access helper functions, or execute
commands on the base call.
Something like this was requested before, a few times, these are the
last 2:
http://groups.google.com/group/jquery-en/browse_thread/thread/95c88db9c89fb802
http://groups.google.com/group/jquery-en/browse_thread/thread/c19ffee3d784aa8a

It's another approach for the command pattern, or the event pattern:
http://groups.google.com/group/jquery-en/browse_thread/thread/3c6a35bbb7ff7e82

It can also be useful for people that structure their code into
modules/plugins, even though they aren't actually doing real plugins.

Here's the homepage: http://flesler.blogspot.com/2008/04/jquerymodularize.html

It has documentation, an example, and a link to the demo.

Any feedback/bug reporting is much appreciated.

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


[jQuery] ui.tabs + ajax question

2008-04-18 Thread Alexandre Plennevaux

Hi friends,

While trying to use the ui.tabs plugin, i noticed with delight that
since the links controlling the tabs are real urls, the plugin
switches to ajax mode.
The thing is, it doesn't quite work yet, and i suspect it's the html
markup that i get wrong, because the tabs are rendered correctly, but
the content does not get fetched. See, i'm not sure how the plugin
understands in which div it must load the fetched html, so i added the
div anchor name in the url, as for non ajax tabs.

Is this correct ?

here is a sample of my markup:

div id=section_content
ul id=tabNav

lia 
href=news.php?todo=overviewfilter=current#currentContentspancurrent/span/a/li
lia 
href=news.php?todo=overviewfilter=time#timeContentspantime/span/a/li
lia 
href=news.php?todo=overviewfilter=country#countryContentspancountry/span/a/li
lia 
href=news.php?todo=overviewfilter=type#typeContentspantype/span/a/li

/ul

div class=tab id=currentContent/div
div class=tab id=timeContent/div
div class=tab id=countryContent/div
div class=tab id=typeContent/div

/div


here is my tabs javascript call:

$('#tabNav').tabs({
fx: {
opacity: 'toggle',
duration: 'fast'
},
show: updateUI
});


thank you for your help!

Alexandre


[jQuery] Re: Anyone have trouble viewing this site on Vista?

2008-04-18 Thread Rick Faircloth
That is weird.

 

I wonder if somehow some of the CSS or jQuery is not being applied

when arriving via URL?

 

Any ideas, Chris or anyone?

 

Rick

 

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Chris 
Jones
Sent: Thursday, April 17, 2008 9:03 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Anyone have trouble viewing this site on Vista?

 

It falls apart when you arrive at the URL in Opera 9. Hitting refresh doesn't 
make a difference. If
you click into another page the design is fixed.Hitting refresh after the page 
is fixed, displays
the correct layout as well. 

So the problem is when you land on your site.

Download Opera 9 from www.opera.com and test it. Maybe others reading this can 
test it too. I'm
pretty sure Opera is working OK on mine, seems to display every other site ok. 
Weird eh :).

Chris.




Rick Faircloth wrote: 

Are you saying that coming to the page straight from the URL
or after refreshing that the page falls apart, but getting to a
page via the menu makes the page line up properly?
 
Thanks for the screen shots!
 
Rick
 
  

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Chris 
Jones
Sent: Thursday, April 17, 2008 4:18 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Anyone have trouble viewing this site on Vista?
 
Hi Rick,
 
There should be 2 images attached. I took a snapshot of the header and
footer. Just to re-cap. if I refresh the page it still looks like it
does in the screen shots. If I press any link (including home) on the
top navigation bar it re-loads the page as it should - looks perfect.
 
Chris.
 
 
Rick Faircloth wrote:


Thanks for the feedback, Chris.
 
I think the primary reason for the slowness of the sight's loading
is the images involved.  It's fairly heavy on the image side.  Plus,
it's loading a lot of jQuery.  But, the images are what the client wanted...
 
A screenshot in Opera 9 would be welcome, if you don't mind.
 
Thanks for the help!
 
Rick
 
 
  

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of cjant83
Sent: Wednesday, April 16, 2008 5:18 PM
To: jQuery (English)
Subject: [jQuery] Re: Anyone have trouble viewing this site on Vista?
 
 
Hi Rick,
 
I have a Vista laptop (unfortunately) with Sp1. The crossfade and web
site seems to be working fine with IE7, Firefox 2(.0.0.13), but
problems with Opera 9. I experience the weird slow downloading of
images under the menu, but also underneath that big image the body is
aligned to the left with no background images until I press on one of
the navigation buttons i.e. Home. I can take a screen grab if you want
or if you download Opera 9 you'll get the same thing. It's a nice
looking site but very slow loading (on a 1mb broadband connection UK).
Dont know if thats because its on dev space.
 
Chris.
 
 
On Apr 16, 8:02 pm, Rick Faircloth  mailto:[EMAIL PROTECTED] [EMAIL 
PROTECTED]
wrote:
 


Hi, all..
 
I was attempting to demo this site and show off
the Cycle plug-in to a prospective client, but the
Cycle plug-in was acting very strangly... flickering, not
showing images, etc.
 
The other plug-ins were working properly.
 
The client's laptop runs Vista.
 
Anyone with Vista care to look at this site and check out
the large photos under the menu and see if they crossfade?
 
http://c21ar.wsm-dev.com
 
Thanks!
 
Rick
 
  

 
 
  

 
  


[jQuery] Re: Strange jQuery behavior in IE (67)

2008-04-18 Thread Dmitry Bykadorov

Here is my code:

$.search = function() {
$.ajax({
url: /search/engine,
dataType: html,
type: POST,
timeout: 1,
cache: false,
data: {
a: $(#a).val(),
b: $(#b).val(),
c: $(#c).val(),
page: 1,
records_per_page: 10
},
complete: function(){
 // empty now
},
success: function(data, status){
$(#tab1).html(data);
},
error: function(XMLHttpRequest, textStatus, errorThrown){
$(#tab1).html(div id=\searchError\Search Error/
div);
}
});
}

On Apr 18, 12:48 am, Dmitry Bykadorov [EMAIL PROTECTED]
wrote:
 Hello all!

 I have some funny things with jquery.

 In developing my first application was confronted with such a problem:
 $.ajax () incorrectly works in IE6 and IE7.

 Example 1. jquery.autocomplete plugin. FF, Opera, Safari - all is
 well. In IE request sent to the server returns the data (text /
 plain), but the data do not appear on the autocomplete box.

 Example 2. simply jQuery.ajax (). The situation is similar, but I
 decided to find a solution. First it turned out that - IE does not
 consider a request successfully completed - triggered error callback
 (textStatus = parsererror).

 The sequence of roughly this:

 about line 2712 (jquery.js) if request successfull, we enter in the
 function jQuery.httpData (xml, s.dataType). In this feature, it seems
 the problem is in command of these lines:

 var data = xml ? r.responseXML : r.responseText;
 if (xml  data.documentElement.tagName == parsererror)
 (
 throw parsererror;
 )

 in that place I have a xml = false, r.responseText not even displayed
 as follows:

 alert (r.responseText)

 Does someone have seen such ajax trouble? What it involves, and how to
 avoid it?


[jQuery] Re: ui.tabs + ajax question

2008-04-18 Thread Alexandre Plennevaux


ah ah, i found the answer on claus 's blog archive:

the plugin is actually THAT smart that it generates the markup, which is 
*really* smart move in terms of nonobtrusiveness.

oh man, code is definitely an art form

congratz Claus!

PS: for others in the need of help with this issue, here is the only 
markup that is necessary:


ul id=tabNav

lia 
href=news.php?todo=overviewfilter=currentspancurrent/span/a/li
lia href=news.php?todo=overviewfilter=timespantime/span/a/li
lia 
href=news.php?todo=overviewfilter=countryspancountry/span/a/li
lia href=news.php?todo=overviewfilter=typespantype/span/a/li

/ul


that's it, no tab container...


[jQuery] Re: Converting PHP tabbed page to jQuery

2008-04-18 Thread Andrew Wagner

Hi,

I certainly do like jQuery a lot. Doing it unobtrusively in this case
could be tricky though. To re-load only part of the page, you really
want AJAX, which inherently requires javascript, for the most part.
There is an exception, though: you culd be to put the module within in
iFrame. This way, when you hit the links, only the module reloads.
Since this module seems pretty self-contained, that would be a fine
use of iFrames, and it would be a very easy solution. In this way,
javascript wouldn't be required at all. Again, I'm not saying that
jQuery can't handle it, but this seems a better solution to me.

On Thu, Apr 17, 2008 at 10:20 PM, keen2learn
[EMAIL PROTECTED] wrote:

  I've built a test module with PHP using three tabs - each tab loads a
  separate page containing the tabs styled to indicate which one is in
  use.

  Here's the test module: http://www.bloogle.com.au/mapping-test.php

  When I put this module into the site's Home Page, it will have to load
  all the other stuff on the Home Page, so I'm exploring some way to
  update just the module using Ajax.

  This is a fairly complex operation as two of the PHP pages carry a
  form with a Select box - one chooses a Google map and the other a
  Flash file.  The third page carries a JavaScript linked to a Weather
  Service in Australia.

  It all works fairly fast, but I want to use Ajax where I can on the
  site but it must be unobtrusive JavaScript.

  I'm an intermediate level programmer familiar with PHP, ASP and some
  ASP.NET and a little JavaScript.

  Am I attempting too complex an operation for jQuery?

  Would I be better to stay with what I've built so far?

  My concern is that some jQuery sites seem to take longer to load than
  what I've created with this module.

  I think jQuery is excellent and I'm keen to use it. Congratulations to
  your team.

  I would welcome any opinions about the dilemma I face with this
  module.
  Best regards
  keen2learn












[jQuery] Re: Do I need Livequery?

2008-04-18 Thread [EMAIL PROTECTED]

@ripple:

'.showlayer' = selector
'#div1' = the thing I want to fade in when you click the selector.
There are lots of divs and one class, '.showlayer' for all of the fade
triggers.

My question was: How do I get jQuery to know which div to fade in, by
looking at the href for the selector that was clicked?

Two good answers provided, both illustrating how to get a target out
of the href attribute.

@David:

Thank you, that helped me understand what Ariel's solution was
doing :))

Cherry.

On Apr 17, 1:44 am, David McFarland [EMAIL PROTECTED] wrote:
 On Apr 16, 2008, at 5:25 PM, [EMAIL PROTECTED] wrote:



  Hello there :)

  I've got a bit stuck. I suspect this is a job for Livequery, but can't
  understand how to use it (sorry, Ariel).

  With this:
  $( '.showlayer' ).click( function () {
 $( '#div1 ).fadeIn( 750 );

  I'm trying to make each link with a class of 'showlayer' show the div
  which is named in its href:
  a href=#div1 class=showlayer

 $('.showlayer').click( function() {
var target = $(this).attr('href');
$(target).fadeIn(750);

 });


[jQuery] tablesorter 2.0.3: sorter: false issue

2008-04-18 Thread tlphipps

I upgraded to the latest tablesorter release yesterday and noticed a
regression in how the {sorter: false} is handled (at least when
applied via metadata).  When you click on tds that have that
applied, the sortStart event is triggered (which was not the case
previously) and then the sortEnd event is never triggered.

Can anyone else confirm this issue?
Any ideas for a fix?


[jQuery] Re: Superfish with top-level background images - 2nd level hover not completely working

2008-04-18 Thread waldo-web

thanks Joel.  that did the trick in Firefox  IE7 - still contending
with IE6 but probably that looks to be a general nav issue - superfish
seems to be fine.


[jQuery] window.home() or location.href='about:home' and Safari 3.1

2008-04-18 Thread Bill

I'm trying to put together a cross-browser function for
programmatically taking the user to their home page.  So far I have
found this:

  script language=javascript
function gohome(){
  if (typeof window.home == 'function'){
window.home();
  } else if (document.all) {
window.location.href = about:home;
  } else {
document.write(pPlease click on your browser's Home
button./p);
  }
}
  /script

Firefox and Opera like window.home() and IE likes href=about:home.
But Safari 3.1 (for Windows) falls through to the else clause.

Does Safari have a different place in the DOM where the home page can
be triggered using Javascript?  So far I haven't been able to find
anything.

Thanks,
Bill



[jQuery] Re: flicking screen on fade in FF Mac

2008-04-18 Thread Richard W

I thank you 120 times dave.
This fix appears to solve the problem.

On Apr 17, 10:59 pm, David McFarland [EMAIL PROTECTED] wrote:
 On Apr 17, 2008, at 1:08 PM, Richard W wrote:



  Hi There
  I was wondering if anyone else has noticed or experience the weird
  effect that fade has on the screen when viewed in FF on a mac
  (leopard). In safari and opera, even IE run under parallels, there is
  no screen flicker.
  When the fade is occuring, some colours, even the font changes
  slighty, then returns to normal state once the fade has finished. This
  does not occur with a simple timed opacity change, using regular
  javascript. I cannot say I have experienced this with other libraries.
  Is it just the type of screen i'm using, or is this common for FF(2)
  Mac

 This is a bug with Firefox. Whenever you use a fade you'll see this.
 The solution is to set the opacity of the body to .999 for Firefox. In
 your stylesheet, just add this rule (or if, you've already got a body
 rule, just add the -moz-opacity: .999;)

 body {
 -moz-opacity: .999;

 }

 I prefer to use -moz-opacity instead of opacity, because this only
 appplies to Firefox.

 --dave


[jQuery] jQuery.data and metadata plugin

2008-04-18 Thread howa

Hi,

Is it true that metadata plugin should be replaced by the jQuery.data?

But I found no way to query the data value stored in css class just
like metadata.

Thanks.


[jQuery] select box replacement

2008-04-18 Thread Donald J Organ IV





Has anyone found a select box replacement
plugin??

I need the ability to have HTML inside of this "select box"






[jQuery] Downloading docs

2008-04-18 Thread gehel

Hello !

I often working on the train, or in places where I dont have internet
connection. So I would like to be able to have the documentation for
jQuery on my computer. I could not find an easy way to download it. I
tried to download the jquery-nightly.release.zip which is said to
contain the docs, I tried to do a SVN checkout (of both trunk and tag
1.2.3 and run ant docs (the target doesnt exist) or make
docs (only an empty docs directory is created).

The last option I see is to spider the website, but there should be an
easier way ...

Could you please point me to the right place ?

   Thx !


MrG


[jQuery] Re: IE XML Parsing problem - newb

2008-04-18 Thread Dmitry Bykadorov

I have some problem in IE (http://groups.google.com/group/jquery-en/
browse_thread/thread/dad0aabfe9361fb6?hl=en)

Can you add error handler in your request? Something like this:

error: function(XMLHttpRequest, textStatus, errorThrown){
alert(textStatus);
}

On Apr 17, 11:56 pm, nmadg [EMAIL PROTECTED] wrote:
 Do I need to add an ActiveXObject.  I thought one of the great things
 about JQuery was you don't need to do browser specific stuff?

 On Apr 17, 3:43 pm, nmadg [EMAIL PROTECTED] wrote:

  I swear I'm not blind, I believe I have an original problem. I've been
  stuck on it for hours.  PLEASE HELP!  My code works perfectly in FF
  and Safari on both PC and Mac.  I am NOT using the meta plugin. The
  only other code i'm using is the YUI Grid CSS.  Please advise and I
  will be forever indebted to the jQuery community.

  Here's my code:
  script type=application/javascript
              $(function(){
                  $(document).ready(function(){
                      $.ajax({
                          type: GET,
                          url: _xmls/page_0001.xml,
                          dataType: xml,
                          success: function(xml){
                              $(xml).find('headers').each(function(){
                                  var headerText = $
  (this).find('header').text()
                                  $('h2/
  h2').html(headerText).appendTo('#hd #headerText')
                              })
                          }
                      }) //close $.ajax(
                  }) //close click(
              }) //close $(
          /script

  In my BODY
              div id=hd
                  div id=headerText
                  /div
              /div

  What am I doing wrong!!!  Thank you so much for your help.


[jQuery] ANNOUNCE: Free AIR v1.0 for JavaScript Developers Pocketguide from Adobe

2008-04-18 Thread Rey Bango


For all jQuerians interested in producing AIR applications, Ajaxian.com 
has posted about the new AIR for JavaScript Developers Pocketguide 
which has been updated for Adobe AIR v1.0. The PDF download is FREE! Get 
it while it's hot!


http://ajaxian.com/archives/adobe-air-for-javascript-developers-pocketguide

Rey


[jQuery] Re: Can jQuery do this?

2008-04-18 Thread [EMAIL PROTECTED]

Well, yes - it's not too hard to fix the size of a drop-down  add
hover actions to your list elements.

I don't know if there's a plugin that does specifically what you're
looking for, but this one seems quite versatile:
http://jquery.sanchezsalvador.com/jquery/page/jquerycombobox.aspx


On Apr 18, 1:02 am, sutra [EMAIL PROTECTED] wrote:
 In this site, at the left column, the Model Number, when you click on
 Select a Phone, the dropdown stay and you can hover through each phone
 model with viewable thumbnails.

 http://www.nokiausa.com/A4409001

 thanks!
 sutra


[jQuery] Re: ANNOUNCE: Free AIR v1.0 for JavaScript Developers Pocketguide from Adobe

2008-04-18 Thread Andy Matthews

Building HTML/JS AIR apps with jQuery couldn't be easier. Plus the fact that
you only have to deal with one browser (WebKIT) makes it a no-brainer.

I'm planning on doing a writeup of my experiences building on my recent HTML
AIR app.


andy

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Rey Bango
Sent: Friday, April 18, 2008 10:25 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] ANNOUNCE: Free AIR v1.0 for JavaScript Developers
Pocketguide from Adobe


For all jQuerians interested in producing AIR applications, Ajaxian.com has
posted about the new AIR for JavaScript Developers Pocketguide 
which has been updated for Adobe AIR v1.0. The PDF download is FREE! Get it
while it's hot!

http://ajaxian.com/archives/adobe-air-for-javascript-developers-pocketguide

Rey




[jQuery] Convert string into jQuery array

2008-04-18 Thread Cronlajoon

Hi!

I have a PHP script which returns a string in a jQuery-format array.
Unfortunately doesn't jQuery recognize the string as an Array. How can
I convert the string so that jQuery understands that the string is
actually an array?


This is what the PHP-script returns at the moment:
{  'item1': {
'key1': 'value1',
'key2': 'value2'
},
'item2': {
'key1': 'value1',
'key2': 'value2'
}
}

This is what I want jQuery to handle:

{   'item1': {
'key1': 'value1',
'key2': 'value2'
},
'item2': {
'key1': 'value1',
'key2': 'value2'
}
}

Does anyone know how I can solve this?

Thank you!

// Carl-Fredrik Herö


[jQuery] validate() and multiple forms that arrive via ajax

2008-04-18 Thread Jan Limpens

In a wizard I have a container page with a few divs, every div can
host a certain form, that post it's result to another div. Everything
via ajax.
On the bottom of these forms, I call something like this:
jQuery(function($){
setupAddressForm();
});

which looks like this
function setupAddressForm(){
var form = setupForm($(#formAddressStep));
createAjaxContext(form, $(#panelpaymentoption));
}

function setupForm(form){
$(input.ajax-invisible).hide();
$(form).validate({
submitHandler: function(form) {
$(form).ajaxSubmit();
},
currentForm : form
});
return form;
}

function createAjaxContext(form, nextStep, onSuccess){
form.ajaxForm({
target: nextStep,
success: onSuccess
});
}

But only the very first form is actually validated, Firebug tells me
that it always remains the currentForm.

How can I set subsequent forms to be the currentForm?


[jQuery] Re: jCarousel infinite loop problem w/ multiple carousels on display: none

2008-04-18 Thread Jan Sorgalla

Hi,

On 17 Apr., 21:00, jack [EMAIL PROTECTED] wrote:

 Could anyone tell me the purpose of binding the window resize to
 reload the carousel? Why would this need to happen by default, it
 seems unnecessary...?

thats because you can control the behaviour of the width from outside
with css.
On resize, the number of visible items can change and jcarousel needs
to know that for firing the callbacks.

See: http://sorgalla.com/projects/jcarousel/examples/static_callbacks.html

But i'll keep that in mind and will add an noOnResizeBind option to
the next version.

Jan


[jQuery] SOT: Using iframe to load in a Flash movie with dynamic height

2008-04-18 Thread Andy Matthews
I've been dealing with this irritating issue on and off now for about a
month. I'm finally going to ask for help.
 
I have a page here:
http://lexusofdanversma.redlinecontent.com/Pages/Page.cfm?pageID=118873
 
It contains a Flash movie whose height is set dynamically based on it's
content. The Flash movie might be 250px tall, or it might be 700px tall
depending on what it's currently displaying. This page works perfectly.
 
However the client has another site on which they have an iframe which loads
in the above page. On THAT page, the content of the Flash movie is getting
cut off for some reason. You can see my quick example here:
 
http://www.commadelimited.com/uploads/iframe.html
 
Notice that when the Flash movie first loads, the bottom inch or so is
getting cut off.
 
Does anyone have any idea why this is happening, or how I might go about
fixing it? Thanks in advance for any help you can provide.
 
 

 
Andy Matthews
Senior ColdFusion Developer

Office:  615.627.9747
Fax:  615.467.6249
www.dealerskins.com http://www.dealerskins.com/ 
 
Total customer satisfaction is my number 1 priority! If you are not
completely satisfied with the service I have provided, please let me know
right away so I can correct the problem, or notify my manager Aaron West at
[EMAIL PROTECTED]
 
2008 Email NADA.jpg

[jQuery] Re: Can jQuery do this?

2008-04-18 Thread Andy Matthews

It looks like all they're doing is to display a DIV when the select a
phone dropdown is clicked. That div contains a multi-select box, with
associated images. There's nothing built in to jQuery to this completely,
but jQuery could make doing this quite simple. 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of sutra
Sent: Thursday, April 17, 2008 7:02 PM
To: jQuery (English)
Subject: [jQuery] Can jQuery do this?


In this site, at the left column, the Model Number, when you click on Select
a Phone, the dropdown stay and you can hover through each phone model with
viewable thumbnails.

http://www.nokiausa.com/A4409001

thanks!
sutra




[jQuery] Re: SOT: Using iframe to load in a Flash movie with dynamic height

2008-04-18 Thread Andy Matthews
Neglected to mention that it appears to only display this behaviour in IE.

  _  

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Andy Matthews
Sent: Friday, April 18, 2008 11:32 AM
To: [jQuery]
Subject: [jQuery] SOT: Using iframe to load in a Flash movie with dynamic
height


I've been dealing with this irritating issue on and off now for about a
month. I'm finally going to ask for help.
 
I have a page here:
http://lexusofdanversma.redlinecontent.com/Pages/Page.cfm?pageID=118873
 
It contains a Flash movie whose height is set dynamically based on it's
content. The Flash movie might be 250px tall, or it might be 700px tall
depending on what it's currently displaying. This page works perfectly.
 
However the client has another site on which they have an iframe which loads
in the above page. On THAT page, the content of the Flash movie is getting
cut off for some reason. You can see my quick example here:
 
http://www.commadelimited.com/uploads/iframe.html
 
Notice that when the Flash movie first loads, the bottom inch or so is
getting cut off.
 
Does anyone have any idea why this is happening, or how I might go about
fixing it? Thanks in advance for any help you can provide.
 
 

 
Andy Matthews
Senior ColdFusion Developer

Office:  615.627.9747
Fax:  615.467.6249
www.dealerskins.com http://www.dealerskins.com/ 
 
Total customer satisfaction is my number 1 priority! If you are not
completely satisfied with the service I have provided, please let me know
right away so I can correct the problem, or notify my manager Aaron West at
[EMAIL PROTECTED]
 
2008 Email NADA.jpg

[jQuery] Re: SOT: Using iframe to load in a Flash movie with dynamic height

2008-04-18 Thread Andy Matthews
Interestingly enough, the iframe page crashes Safari everytime it loads.

  _  

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Andy Matthews
Sent: Friday, April 18, 2008 11:32 AM
To: [jQuery]
Subject: [jQuery] SOT: Using iframe to load in a Flash movie with dynamic
height


I've been dealing with this irritating issue on and off now for about a
month. I'm finally going to ask for help.
 
I have a page here:
http://lexusofdanversma.redlinecontent.com/Pages/Page.cfm?pageID=118873
 
It contains a Flash movie whose height is set dynamically based on it's
content. The Flash movie might be 250px tall, or it might be 700px tall
depending on what it's currently displaying. This page works perfectly.
 
However the client has another site on which they have an iframe which loads
in the above page. On THAT page, the content of the Flash movie is getting
cut off for some reason. You can see my quick example here:
 
http://www.commadelimited.com/uploads/iframe.html
 
Notice that when the Flash movie first loads, the bottom inch or so is
getting cut off.
 
Does anyone have any idea why this is happening, or how I might go about
fixing it? Thanks in advance for any help you can provide.
 
 

 
Andy Matthews
Senior ColdFusion Developer

Office:  615.627.9747
Fax:  615.467.6249
www.dealerskins.com http://www.dealerskins.com/ 
 
Total customer satisfaction is my number 1 priority! If you are not
completely satisfied with the service I have provided, please let me know
right away so I can correct the problem, or notify my manager Aaron West at
[EMAIL PROTECTED]
 
2008 Email NADA.jpg

[jQuery] Re: ui.tabs + ajax question

2008-04-18 Thread Klaus Hartl

On Apr 18, 3:18 pm, Alexandre Plennevaux [EMAIL PROTECTED] wrote:
 ah ah, i found the answer on claus 's blog archive:

 the plugin is actually THAT smart that it generates the markup, which is
 *really* smart move in terms of nonobtrusiveness.
 oh man, code is definitely an art form

 congratz Claus!

 PS: for others in the need of help with this issue, here is the only
 markup that is necessary:

 ul id=tabNav

 lia 
 href=news.php?todo=overviewfilter=currentspancurrent/span/a/li
 lia href=news.php?todo=overviewfilter=timespantime/span/a/li
 lia 
 href=news.php?todo=overviewfilter=countryspancountry/span/a/li
 lia href=news.php?todo=overviewfilter=typespantype/span/a/li

 /ul

 that's it, no tab container...

Hehe, yes, I tried to make it as unobtrusive - and easy to use - as
possible :-)

On the other hand, if you want to reuse an existing container, you
could do so, by matching a title attribute and the containers id:

lia href=news.php?todo=overviewfilter=current title=Todo
Overview ... /a/li

and a container like:

div id=Todo_Overview ... /div

(Note how white space is replaced with an underscore)

This is useful if you want a human readable hash in the URL instead of
a cryptic generated one. Makes more sense later on after I have
reimplemented bookmarking/history support.

If that container doesn't exist, it is generated as well of course
with that id. Long story short, if a container already exists it won't
be generated and vice versa.

--Klaus


--Klaus





[jQuery] Re: Can jQuery do this?

2008-04-18 Thread spinnach


maybe i'm looking at a different page than you, but isn't this page in 
flash :) ?


dennis.

Andy Matthews wrote:


It looks like all they're doing is to display a DIV when the select a
phone dropdown is clicked. That div contains a multi-select box, with
associated images. There's nothing built in to jQuery to this completely,
but jQuery could make doing this quite simple. 


-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of sutra
Sent: Thursday, April 17, 2008 7:02 PM
To: jQuery (English)
Subject: [jQuery] Can jQuery do this?


In this site, at the left column, the Model Number, when you click on Select
a Phone, the dropdown stay and you can hover through each phone model with
viewable thumbnails.

http://www.nokiausa.com/A4409001

thanks!
sutra







[jQuery] Re: IE XML Parsing problem - newb

2008-04-18 Thread nmadg

It didn't return anything.

On Apr 18, 12:27 am, Dmitry Bykadorov [EMAIL PROTECTED]
wrote:
 I have some problem in IE (http://groups.google.com/group/jquery-en/
 browse_thread/thread/dad0aabfe9361fb6?hl=en)

 Can you add error handler in your request? Something like this:

 error: function(XMLHttpRequest, textStatus, errorThrown){
 alert(textStatus);

 }

 On Apr 17, 11:56 pm, nmadg [EMAIL PROTECTED] wrote:

  Do I need to add an ActiveXObject.  I thought one of the great things
  about JQuery was you don't need to do browser specific stuff?

  On Apr 17, 3:43 pm, nmadg [EMAIL PROTECTED] wrote:

   I swear I'm not blind, I believe I have an original problem. I've been
   stuck on it for hours.  PLEASE HELP!  My code works perfectly in FF
   and Safari on both PC and Mac.  I am NOT using the meta plugin. The
   only other code i'm using is the YUI Grid CSS.  Please advise and I
   will be forever indebted to the jQuery community.

   Here's my code:
   script type=application/javascript
   $(function(){
   $(document).ready(function(){
   $.ajax({
   type: GET,
   url: _xmls/page_0001.xml,
   dataType: xml,
   success: function(xml){
   $(xml).find('headers').each(function(){
   var headerText = $
   (this).find('header').text()
   $('h2/
   h2').html(headerText).appendTo('#hd #headerText')
   })
   }
   }) //close $.ajax(
   }) //close click(
   }) //close $(
   /script

   In my BODY
   div id=hd
   div id=headerText
   /div
   /div

   What am I doing wrong!!!  Thank you so much for your help.


[jQuery] Re: Can jQuery do this?

2008-04-18 Thread millitheKidd

sutra,
I think they did that in Flash because if you right-click on the
dropdown, or several places on the page for that matter, it gives you
that context menu that says Settings... and below that About Adobe
Flash Player 9 Also, www.telerik.com has some cool comboboxes
that can do a LOT of stuff like that, for instance pulling in
information from a database and sticking it in a combobox, displaying
grid-like features in a combobox, displaying images in a combo; just
different things like that. We use telerik stuff a lot. Awesome
controls.

hope this helps...
~milli


[jQuery] Re: What do you use?

2008-04-18 Thread cmvonner

CFML (ColdFusion/BlueDragon) with JSON.cfc for converting server-side
data into JSON to pass to jQuery.

Carl

On Apr 16, 4:31 am, Chalkers [EMAIL PROTECTED] wrote:
 Hi jQueryers,

 I am curious what people use as on the server side with jQuery?

 PHP, ASP, Groovy/Java/Spring, RoR, something else or nothing, just
 plain old (x)HTML?

 I generally use PHP but have used it with Java and Grails.

 Regards,
 Andrew


[jQuery] Problems with selectors

2008-04-18 Thread JAT

Hi friends,

I've just discovering jQuery and it's a great library.

My Javascript's knowledge is not so good than I wish, I'm a newby in
this world.

I've problems to select a certain element on code HTML generated by
php. Following tutorials, api's and rest of very good docs I can't
resolve this problem.

,[ HTML Code ]
| div class=box-general
|  div class=box-articles
|   [...]
|   {Article options linked with a or img tags}
|   [...]
|   img class=box-slide id=article-id
|   [...]
|   div class=box-slide-hidden id=article-id
|div class=article-slide
| {Info about article selected}
|/div  
|   /div
|  /div
| /div
`

,[ CSS Code ]
| [...]
| .box-slide-hidden {
| display:none
| }
| [...]
`

,[ jQuery Code ]
| $(img.box-slide).click(function() {
|  // Get unique id;
|  var $match-img-id = $(this).attr('id');
| 
|  $(div.box-slide-hidden).each(function (i){
|  // Get unique id to compare with $match-img-id
|  // and, if true, run slide effect.
|  var $match-div-id = $(this).eq(i).attr('id')
|  [...]
|  });
| });
`

This code works but only shows the first div.box-slide-hidden
occurrence. Something was wrong in, each loop, that don't iterate rest
of html code generated.

I've proved with next(), filter(), finder() and rest of selectors
functions in order to get right element but I'm not able to do
it. 

There's one solution to this problem, change div.box-slide-hidden
position, putting it just after img tag and, with next(), accessing to
next element, in this case, searched element. If I apply this method,
obviously, all html code elements (img, a, and rest of tags from img
clicked to final of design) was changed, moved down and disaster.

How can I get a right loop to show right reference only?
  
Greetings.
-- 
Julio Antúnez Tarín
jat en escomposlinux punto org


[jQuery] Dynamic table column resizing when adding/removing nowrap attribute

2008-04-18 Thread mistercam

Hello,

I am having an issue when adding/removing the white-space:nowrap style
from a span element contained within a table cell.

Basically I have a complex table, with one column of cells (among
others) that contain text. I've created a link that when clicked will
toggle the wrapping on the text in these cells.

The idea being that if the line is wrapped, the column will shrink
(thus showing more of the table w/out scrolling.) Similarly, when a
line is not-wrapped, the column width will increase to accommodate the
text.

The problem is in firefox; adding the nowrap attribute to the element
causes the column width to increase. But when removing the nowrap
attribute, the text will not wrap and the column width will not
shrink. I've used firebug to confirm the nowrap style is being toggled
on these elements.

The desired functionality works fine in IE and Safari.

Is this simply a limitation of Firefox? or is there a way to do this
through jQuery?

Below is a snippet of code I'm using (note: the table html is not the
exact table I'm using, but I think it demonstrates what I want to do.)

if anyone has any suggestions or ideas, please let me know.

Thanks!

--
.nowrap {
  white-space:nowrap;
}
--
function toggleLabels() {
  jQuery('.expandCollapseLabel').each(function() {
jQuery(this).toggleClass('nowrap');
  });
}
--
a href=javascript:toggleLabels()toggle link/a

table
tr
tdspan class=expandCollapseLabelsome long text/spantd
tdsome other stuff/td
/tr
tr
tdspan class=expandCollapseLabelsome long text/spantd
tdsome other stuff/td
/tr
...
tr
tdspan class=expandCollapseLabelsome long text/spantd
tdsome other stuff/td
/tr
/table


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

2008-04-18 Thread sannoble

Hi,

I just want to share what I found out today.

I was trying to update records of a table with the html-response of an
ajax request. First I tried $('#list').load() to just replace the
content of $('#list') with the ajax-response. The performance was
remarkable poor. I thought it's due to the ajax request and replaced
load() with a call to $.ajax() and assigned the response data with $
('#list').html(data), but the performance didn't get better. Thanks to
Firebug I realized that the performance was not an issue of the ajax
request but the replacing of the content of $('#list').

When poking around with different approaches to replace the records, I
found out, that the clearing of the content is the critical point.
More precisely the method empty().

Digging into jQuery Core I noticed that load() and html() both use
empty() - to be exact load() just calls html(). The empty() method
properly removes nodes from the DOM to prevent memory leaks but has a
significant impact on performance.

Replacing empty() with just setting the property innerHTML to '', e.g.

$('#list')[0].innerHTML = '';
$('#list').append(data);

instead of

$('#list').html(data);

the performance can be dramatically improved. In my case you don't
have to measure the difference, you can see it.

As I'm not a JavaScript guru I didn't dig any deeper, if the empty
method can be improved. Surely it does a good job to remove nodes
properly but in my case
the approach with html() is so slow that it's just not applicable.

To be on the save side I extended jQuery and defined a html()-method
of my own. So in the case of occuring problems in the future you just
have to fix the problem at one place.

$.fn.stkbaseHtml = function(value){
   return this.each(function() {
  if(value == undefined) {
 return (this.length ? this.innerHTML : null)
  } else {
 this.innerHTML = '';
 $(this).append(value);
  }
   });
};

Any comments to this approach especially concerning the memory leak
problem are welcomed!

michael


[jQuery] Problems with selectors

2008-04-18 Thread Jat

Hi friends,

I've just discovering jQuery and it's a great library.

My Javascript's knowledge is not so good than I wish, I'm a newby in
this world.

I've problems to select a certain element on code HTML generated by
php. Following tutorials, api's and rest of very good docs I can't
resolve this problem.

,[ HTML Code ]
| div class=box-general
|  div class=box-articles
|   [...]
|   {Article options linked with a or img tags}
|   [...]
|   img class=box-slide id=article-id
|   [...]
|   div class=box-slide-hidden id=article-id
|div class=article-slide
| {Info about article selected}
|/div
|   /div
|  /div
| /div
`

,[ CSS Code ]
| [...]
| .box-slide-hidden {
| display:none
| }
| [...]
`

,[ jQuery Code ]
| $(img.box-slide).click(function() {
|  // Get unique id;
|  var $match-img-id = $(this).attr('id');
|
|  $(div.box-slide-hidden).each(function (i){
|  // Get unique id to compare with $match-img-id
|  // and, if true, run slide effect.
|  var $match-div-id = $(this).eq(i).attr('id')
|  [...]
|  });
| });
`

This code works but only shows the first div.box-slide-hidden
occurrence. Something was wrong in, each loop, that don't iterate rest
of html code generated.

I've proved with next(), filter(), finder() and rest of selectors
functions in order to get right element but I'm not able to do
it.

There's one solution to this problem, change div.box-slide-hidden
position, putting it just after img tag and, with next(), accessing to
next element, in this case, searched element. If I apply this method,
obviously, all html code elements (img, a, and rest of tags from img
clicked to final of design) was changed, moved down and disaster.

How can I get a right loop to show right reference only?

Greetings.
--
Julio Antúnez Tarín
jat en escomposlinux punto org


[jQuery] Re: large string performance problem with html or append function

2008-04-18 Thread wesbird

I thought I have a alert in gmail so I don't have to back here to
check if I have reply. obvious I'm wrong. I just found I have reply
till now. Thank you, Shawn and Brian, it  helps. I apologize about
post a big message. I will not do this again.



Wes

On Mar 27, 7:10 pm, Shawn [EMAIL PROTECTED] wrote:
 k, that was fun... not.  Trying to reply to your message and waiting,
 and waiting, and waiting for ThunderChicken to catch up... then do it
 again after deleting the large block of text... :)

 Any way... my question would be why you are using a string in the first
 place?

 A possible smarter alternative is to use a DOM object in memory.
 Something like this:

 var myTable = $(table/table);
 for (var x = 0; x  json.length; x++) {
var row = $(tr/tr);
row.append(tdmy stuff:  + json[x] + /td);
myTable.append(row);

 }

 $(body).append(myTable);

 Now, this will do nothing for the sheer volume of data you are dealing
 with.  But it gets rid of the string and creates DOM objects
 immediately.  So, the overall processing *should* be a little faster.

 The other option is to NOT show so much data, but to introduce paging,
 or a smart scroll that will only load data as needed...  But dealing
 with large volumes are always troublesome.  a 7 or 8 second turnaround
 isn't tooo bad.  I have one page that is closer to 30 seconds (customer
 asked for it though - wider date range = more data = more time).  The
 point is that when large volumes are being dealt with, a delay is
 expected.  We *should* try to eliminate the delays where we can, but

 HTH

 Shawn

 wesbirdwrote:
  Hi
I just start use jQuery about 2 month ago, so please bear with me if
  I ask some question which already answered.
I'm working a ajax project, I use JSON to get result from server and
  then generate a table on the fly. the problem I have is, my end table
  string is huge, length is 935895.
$(#m).html( str ); take
  about 7000-8000ms
var m = document.getElementById(m);
m.innerHTML = str;  tabke about 2000-3000ms

m is div, str is my test string.

Is there something wrong? How I can improve it?
Thank you very much.


[jQuery] round corner slideout

2008-04-18 Thread wesbird

Hi,
  I just start use jQuery for about 3 month. It really save me a lot
of work.
  Now I have this problem, I have a div with 4 round corner. I made by
picture. there are all kind elements inside, dropdown list, button,
list, textarea, checkbox, ...
  Now we decide to change it to this, initially it will collapse with
only title show up, when you click a image in the title, it will
expand to full size. It will save a lot space for beneath datagrid.
  the problem is, we would like to still show 4 round corner when it
collapse as title, and expand as full size.
  I'm looking in the corner plugin.
  How to implment it? I really appreciate your help


  Thank you very much and have a nice weekend.



Wes






[jQuery] Re: Can jQuery do this?

2008-04-18 Thread sutra

Thank you all.

I am going to play with the jQuey combobox.

sutra


[jQuery] Re: validate() and multiple forms that arrive via ajax

2008-04-18 Thread Jan Limpens

In the meantime I refactored this to:

function setupForm(form, target){
$(input.ajax-invisible).hide();
$(form).validate({
currentForm : $(form)
});
if ($(target) != null) {
$(form).ajaxForm({
beforeSubmit: function(){$(form).valid()},
target: $(target)
});
}
}

but the problem persists... any help?

On Fri, Apr 18, 2008 at 1:06 PM, Jan Limpens [EMAIL PROTECTED] wrote:

  In a wizard I have a container page with a few divs, every div can
  host a certain form, that post it's result to another div. Everything
  via ajax.
  On the bottom of these forms, I call something like this:
  jQuery(function($){
 setupAddressForm();
  });

  which looks like this
  function setupAddressForm(){
 var form = setupForm($(#formAddressStep));
 createAjaxContext(form, $(#panelpaymentoption));
  }

  function setupForm(form){
 $(input.ajax-invisible).hide();
 $(form).validate({
 submitHandler: function(form) {
 $(form).ajaxSubmit();
 },
 currentForm : form
 });
 return form;
  }

  function createAjaxContext(form, nextStep, onSuccess){
 form.ajaxForm({
 target: nextStep,
 success: onSuccess
 });
  }

  But only the very first form is actually validated, Firebug tells me
  that it always remains the currentForm.

  How can I set subsequent forms to be the currentForm?




-- 
Jan
___
[EMAIL PROTECTED]
www.limpens.com
+55 (11) 3082-1087
+55 (11) 3097-8339


[jQuery] Problems with selectors [SOLVED]

2008-04-18 Thread Jat

On 18 abr, 19:48, JAT [EMAIL PROTECTED] wrote:

 [...]
 I've problems to select a certain element on code HTML generated by
 php.
 [...]
 ,[ HTML Code ]
 | div class=box-general
 |  div class=box-articles
 |   [...]
 |   {Article options linked with a or img tags}
 |   [...]
 |   img class=box-slide id=article-id
 |   [...]
 |   div class=box-slide-hidden id=article-id
 |div class=article-slide
 | {Info about article selected}
 |/div
 |   /div
 |  /div
 | /div
 `

 ,[ CSS Code ]
 | [...]
 | .box-slide-hidden {
 | display:none
 | }
 | [...]
 `

 ,[ jQuery Code ]
 | $(img.box-slide).click(function() {
 |  // Get unique id;
 |  var $match-img-id = $(this).attr('id');
 |
 |  $(div.box-slide-hidden).each(function (i){
 |  // Get unique id to compare with $match-img-id
 |  // and, if true, run slide effect.
 |  var $match-div-id = $(this).eq(i).attr('id')
 |  [...]
 |  });
 | });
 `

 This code works but only shows the first div.box-slide-hidden
 occurrence.
 [...]
 How can I get a right loop to show right reference only?

Finally I've get it, simple and beauty.

,[ jQuery Code ]
| $(img.box-slide).click(function() {
| $('~ div.box-slide-hidden:first', this).slideToggle('slow');
| });
`

Greetings.


[jQuery] jscrollpane

2008-04-18 Thread narolis

Hi,

I'm using your jscrollpane plugin and it's working very well. I only
have little bugs, maybe you know how to fix it.

When we use the tab key of the keyboard. The focus of the page
change between each element. If the content of the scrollpane have
elements that can have the focus and the focus go to it the content
scroll to make the element visible but the scrollpane disapear because
it move with the content. It the same thing that it did with the
anchor but I fixed that one.

When we do ctrl+f to search word on page and the word is in the
content the scrollpane don't go automatically to the found word. We
have to scroll it to see if any word is found.

-

And I just want to know how did you do to make the page body scroll to
stop scrolling when we use the mousewheel. To make only the content to
scroll and when the scroll is at the top or bottom and we continue
scrolling the page body scroll is working back. Because I modified the
plugin to support the keyboard direction keys. It work very good, all
I have to do now is the same thing, because the scrollpane and the
page body scroll are scrolling at the same time. I want it to do it
like the mousewheel, the page body scroll don't scroll until we reach
the top or bottom of the content or we give the focus back to the page
body.

Thank you


[jQuery] Re: validate() and multiple forms that arrive via ajax

2008-04-18 Thread Jan Limpens

solution for dynamically loaded, multiple ajax forms with jquery validate:

function setupForm(form, target){
$(input.ajax-invisible).hide();
$(form).validate({ // ataches the validator
currentForm : $(form),
submitHandler: function() { submit(form, target) }
});
}

function submit(form, target){
if ($(target) != null) {
$(form).ajaxSubmit({target: $(target)});
} else {
form.submit();
}
}

On Fri, Apr 18, 2008 at 6:19 PM, Jan Limpens [EMAIL PROTECTED] wrote:
 In the meantime I refactored this to:

  function setupForm(form, target){

 $(input.ajax-invisible).hide();
 $(form).validate({
 currentForm : $(form)
 });
 if ($(target) != null) {
 $(form).ajaxForm({
 beforeSubmit: function(){$(form).valid()},
 target: $(target)
 });
 }
  }

  but the problem persists... any help?



  On Fri, Apr 18, 2008 at 1:06 PM, Jan Limpens [EMAIL PROTECTED] wrote:
  
In a wizard I have a container page with a few divs, every div can
host a certain form, that post it's result to another div. Everything
via ajax.
On the bottom of these forms, I call something like this:
jQuery(function($){
   setupAddressForm();
});
  
which looks like this
function setupAddressForm(){
   var form = setupForm($(#formAddressStep));
   createAjaxContext(form, $(#panelpaymentoption));
}
  
function setupForm(form){
   $(input.ajax-invisible).hide();
   $(form).validate({
   submitHandler: function(form) {
   $(form).ajaxSubmit();
   },
   currentForm : form
   });
   return form;
}
  
function createAjaxContext(form, nextStep, onSuccess){
   form.ajaxForm({
   target: nextStep,
   success: onSuccess
   });
}
  
But only the very first form is actually validated, Firebug tells me
that it always remains the currentForm.
  
How can I set subsequent forms to be the currentForm?
  



  --
  Jan
  ___
  [EMAIL PROTECTED]
  www.limpens.com
  +55 (11) 3082-1087
  +55 (11) 3097-8339




-- 
Jan
___
[EMAIL PROTECTED]
www.limpens.com
+55 (11) 3082-1087
+55 (11) 3097-8339


[jQuery] Ajax post and link

2008-04-18 Thread poncjusz

I'm sure that solution is simple but I can't find it... :/
I'v got such problem:
$(.show_subpages).click(function() {
$.post(/pages/get_subpages, { id: $(this).attr(rel) },
function(data) {
$(.show_subpages).parent().append(data);
});
return false;
});

I want to add results of ajax query to the link which call the
query... (In example is adding to all with class .show_subpages.

thanks in advance
Tomek


[jQuery] Re: performance $(o).html(val)

2008-04-18 Thread sannoble

Hi Hans,

I noticed the same problem today and realized that the reason is the
empty()-method which is called by html. May be you want to read this
post:

http://groups.google.com/group/jquery-en/browse_thread/thread/fea89caebdbb8453

in which I explained my opinion of the problem and solution in more
detail.

regards
michael


On 12 Mrz., 12:55, hans [EMAIL PROTECTED] wrote:
 Hi,

 I noticed that when i replace a large table(1000 tr's) in a div with

 $('#div_id).html(val);

 The performance gets poor, i got over 1 calls to the functions
 nodeName() and unique(). Replacing the line with
 document.getElementById('div_id).innerHTML=val; is more then 4
 seconds faster in my case.

 Is the html() function meant for something else or am i using it wrong
 or is this still a performance issue?

 regards.
 Hans


[jQuery] Re: conflict

2008-04-18 Thread fib

can anyone help on this
the question is why can I get one to work and not the other an visa
versa

I want them both to work..

I am sure it is a simple issue can someone please help

d

On Apr 17, 2:03 am, fib [EMAIL PROTECTED] wrote:
 Hi

 I am getting into jquery and quite excited

 issue
 I am using 2 plugins and can only get one to work at a time
 I am sure this is a simple issue and it is just a colon or some such
 but I am stuck
 I have tried putting the 2 pieces of script together and I have tried
 adding the 2 plugin scripts together

 if I do the following neither works

       script type=text/javascript src=jquery.js/script
       script type=text/javascript src=jquery.corner.js/script
       script type=text/javascript src=corner.js/script
       script type=text/javascript src=ddaccordion.js/script
       script type=text/javascript src=dd.js/script

 where dd.js and corner.js are the specific code.


[jQuery] Re: Ajax post and link

2008-04-18 Thread Jack Killpatrick


Try something like:

$(.show_subpages).click(function() {
  var $this = $(this);
   $.post(/pages/get_subpages, { id: $this.attr(rel) }, 
function(data) {

   $this.parent().append(data);
   });
   return false;
});

That will preserve the this during the ajax call and will append the 
results to only that item's parent and not to all that match the 
selector $(.show_subpages).


- Jack

poncjusz wrote:

I'm sure that solution is simple but I can't find it... :/
I'v got such problem:
$(.show_subpages).click(function() {
$.post(/pages/get_subpages, { id: $(this).attr(rel) },
function(data) {
$(.show_subpages).parent().append(data);
});
return false;
});

I want to add results of ajax query to the link which call the
query... (In example is adding to all with class .show_subpages.

thanks in advance
Tomek

  





[jQuery] tablesorter and pager question - getting data from mysql

2008-04-18 Thread ktpmm5


I'm missing something basic I think in using the tablesorter function.  

I have an index.php that does the following:
 - sets up my divs, including one called content where I want all my
data to go
 - included jquery, superfish.js (menus), data.js, tablesorter, and
tablesorter pager

My data.js file has all my jquery calls - when I click a menu item such as
Search by Last Name the fie by-lastname.html is loaded into the content
div.  This is a simple form - I type in a last name and click search.  The
form in by-lastname.html calls searchlastname.php - this file contains the
following code:

$(#content)
.tablesorter({
widthFixed: true,
widgets: ['zebra'],
debug: true
})
   .tablesorterPager({
container: $(#pager),
positionFixed: false
});

This file connects to a mysql database, and queries for the appropriate
info. At the bottom of this file I have some includes:  nav.inc (which loads
the menu's), header-table.inc (which prints out the header for the table)
and table.php.  Table.php contains the following info:

echo(div id = 'data');
# now display data itself

echo(tbody);
while  ($row = mysql_fetch_array($query))
{
echo(tr\ntd);
echo($row[last name]);
echo(/td\ntd);
echo($row[firstname]);
.. rest of the data..and I close tbody, the table and the data div.
At the bottom of this file, I copy everything from the data div to the
content div:
script type=text/javascript
   
document.getElementById(content).innerHTML=document.getElementById(data).innerHTML;
/script


My problem is that the data prints out, but the next and previous buttons
print out at the top of the table, not the bottom.  I have tried the
fixedPosition: true, but that did nothing. The zebra widget is also not
working, which leads me to believe there is more wrong here than I think.  I
have tried debug: true, but that also produces nothing.  Can someone see
what I am doing wrong?  I know I am close, just cannot figure out what is
going wrong.
-- 
View this message in context: 
http://www.nabble.com/tablesorter-and-pager-question---getting-data-from-mysql-tp16767295s27240p16767295.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.