[jQuery] Re: Using jQuery Multiple File Upload Plugin and jQuery Form Plugin together

2008-10-17 Thread Stefan Sturm

Hello,

thanks for your answer.

 The multi file upload seems to work fine for me.  I copied your test
 file and modified it slightly to print the response to the page:

I found the difference between our two  implementations:
You use MultiFile 1.1 and I use 1.3 ( the newest one ).

With 1.3 it is not working, with 1.1 it is working...

I hope the MultiFile developers are reading here :-)

 The json issue is a tricky one.  I don't have an answer for that yet.

I hope you find a solutions soon :-)

Greetings,
Stefan Sturm


[jQuery] Re: Using jQuery Multiple File Upload Plugin and jQuery Form Plugin together

2008-10-17 Thread Stefan Sturm

Hello,

I tried some versions. Last working version is 1.24...

Greetings,
Stefan Sturm


[jQuery] Accordion movement not smooth + other weird stuff

2008-10-17 Thread David D.

Hi there,

Luckily I've never had to ask about Jquery's performance or anything
like that - it's a SOLID tool, but I'm trying to use the accordion in
a unique way and am honestly not experiencing great results. I'm
hoping it's just my own mistake :-p

Take a look: http://militiamarketing.com/temp/index.html

Some issues:
- clicking on panels results in jumpy animation, this mostly happens
on longer panels which extend beyond the length of the window. ie. try
opening about us and clicking on another
- click on porfolio then select the first submenu item. I simply added
an accordion in an accordion (which was the only way I thought of
doing this). the panel doesn't extend out, but if you click on the
item below it then the first again...it works.
- sometimes when you click on the bottom panels (I haven't been able
to replicate this, but apparently a client mentioned it to me) the
panel does this weird extension beyond the page but opens the panel
properly, so it looks like it's opening a bigger panel but it opens
smaller. this happens usually on the last 3 items in the accordion.

Help on this would be great. I'm almost thinking of coding my own semi-
accordion with the functionality I need. :-/

Thanks,

Dave


[jQuery] Re: Question to parent() versa DOM parentNode

2008-10-17 Thread Olaf Gleba


Hi.

Sorry for the late reply.

Am 16.10.2008 um 02:33 schrieb Mike Alsup:

I ask because i get different results while traversing some Nodes  
with

DOM Style and jquery approach.


How are the results different?


I have to revoke my question ;) It was a mistake by myself ;-)
While the DOM Function returns the attribute (for), i expected the  
same for the jquery syntax i wrote. But i missed that  my jquery  
syntax only contains the object itself at this point.


Thanks for your asking.

greets
Olaf

--
Olaf Gleba : creatics media.systems
Tel. +49 (0)221 170 67 224 : Fax. +49 (0)221 170 67 225
[EMAIL PROTECTED] : http://www.creatics.de
PGP-Key http://www.creatics.de/keys/







[jQuery] Re: [Validation] DOM changes, adding validation rules to new objects

2008-10-17 Thread Jörn Zaefferer
Take a look at rules(add, ...):
http://docs.jquery.com/Plugins/Validation/rules#.22add.22rules

Jörn

On Thu, Oct 16, 2008 at 7:34 PM, Mike [EMAIL PROTECTED] wrote:

 Hi Jörn,

 Brilliant plug-in, it may be that I can do what I need to but i can't
 seem to make it work.   I'm building a form with lots of fields, after
 the DOM is ready I then bind the validation rules for the known
 fields.  I then have functionality which allows the user to add new
 fields, table rows with multiple fields, etc.  What I would like to be
 able to do is to bind the validation rules for these newly added DOM
 elements.  I've looked at your dynamic demo and this is all achieved
 by the class attribute (which I don't particularly want to do).   I'm
 building up a rule object and binding it to the fields using $
 (#form).validate(ruleObj).  This works brilliantly for the known DOM
 fields after the initial load.  I would then like to call the $
 (#form).validate(ruleObj) with the ruleObj and appended field
 validation rules or (ideally) with just the new field validation rules
 after a new field (or row of fields) has been added to the DOM.  I've
 tried both of these after adding a new field and none of the rules are
 bound.  To highlight another jQuery plug-in which has similar
 functionality but for a different application (table data sorting)
 look at tablesorter where it provides a trigger function to tell the
 plug-in that the DOM has changed [$(table).trigger(update);].
 Ideally some sort of append rules functionality would be great.

 Again fantastic work on a great tool,

 Best Regards

 Michael



[jQuery] Re: [validate] ignore an iframe element

2008-10-17 Thread Jörn Zaefferer
I see two issues here: For one, you've nested two forms, which isn't
really that well supported by browsers, and the validation plugin is
unable to handle that - events are bubbled up to the parent form,
which can't handle the event. I'm not sure if and how that should be
handled.

The other issue is that the ignore option is applied only to the
submit event validation. Validation on key or blur events doesn't
respect the ignore option. Could you file a ticket for this?
http://dev.jquery.com/newticket (requires registration)

As a workaround: I've implemented a background-fileupload by putting
the input into the main form while selecting a file, but appending it
to a hidden form beneath the main one to submit it. That worked quite
well.

Jörn

On Fri, Oct 17, 2008 at 3:26 AM, Jeff Strahl [EMAIL PROTECTED] wrote:

 Here is a simple mock up of the elements in question.  The error persists 
 when you click the 'button' to upload an image.

 http://prolabor.com/testform/

 Thanks for your help with this matter.

 -jeff

 -Original Message-
 From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jeff 
 Strahl
 Sent: Thursday, October 16, 2008 5:18 PM
 To: jquery-en@googlegroups.com
 Subject: [jQuery] Re: [validate] ignore an iframe element


 Due to the sensitivity of the application, I will put something similar 
 together tonight that best reproduces the scenario.

 Thanks,
 -jeff

 -Original Message-
 From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jörn 
 Zaefferer
 Sent: Thursday, October 16, 2008 5:10 PM
 To: jquery-en@googlegroups.com
 Subject: [jQuery] Re: [validate] ignore an iframe element

 Could you provide a testpage?

 Jörn

 On Thu, Oct 16, 2008 at 7:44 PM, -Jeff- [EMAIL PROTECTED] wrote:


 I am using the Validation plugin, which is working well overall.  Is there a
 way to have it ignore an entire iframe?  I have added the { ignore:
 .ignore, ... } parameter to the configuration and applied the ignore class
 to every element possible in regards to that respective div and all
 elements within the iframe's contents, however when the element within the
 iframe is selected, I get the following error:

 validator is undefined
 http://somedomain.com/js/jquery.validate.js
 Line 287

 Which is:
 function delegate(event) {
  var validator = $.data(this[0].form, validator);
  validator.settings[on + event.type]  validator.settings[on +
 event.type].call(validator, this[0] );
 }

 Is there any way to have the Validate plugin not check anything in this div,
 iframe, or form?

 Thanks in advance for any assistance,
 -jeff
 --
 View this message in context: 
 http://www.nabble.com/-validate--ignore-an-iframe-element-tp20015960s27240p20015960.html
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.






[jQuery] Re: [Validation] DOM changes, adding validation rules to new objects

2008-10-17 Thread Mike

Thanks Jörn,

Typically I spend hours looking and it's right under my nose.

Regards

Michael

On Oct 17, 8:39 am, Jörn Zaefferer [EMAIL PROTECTED]
wrote:
 Take a look at rules(add, 
 ...):http://docs.jquery.com/Plugins/Validation/rules#.22add.22rules

 Jörn

 On Thu, Oct 16, 2008 at 7:34 PM, Mike [EMAIL PROTECTED] wrote:

  Hi Jörn,

  Brilliant plug-in, it may be that I can do what I need to but i can't
  seem to make it work.   I'm building a form with lots of fields, after
  the DOM is ready I then bind the validation rules for the known
  fields.  I then have functionality which allows the user to add new
  fields, table rows with multiple fields, etc.  What I would like to be
  able to do is to bind the validation rules for these newly added DOM
  elements.  I've looked at your dynamic demo and this is all achieved
  by the class attribute (which I don't particularly want to do).   I'm
  building up a rule object and binding it to the fields using $
  (#form).validate(ruleObj).  This works brilliantly for the known DOM
  fields after the initial load.  I would then like to call the $
  (#form).validate(ruleObj) with the ruleObj and appended field
  validation rules or (ideally) with just the new field validation rules
  after a new field (or row of fields) has been added to the DOM.  I've
  tried both of these after adding a new field and none of the rules are
  bound.  To highlight another jQuery plug-in which has similar
  functionality but for a different application (table data sorting)
  look at tablesorter where it provides a trigger function to tell the
  plug-in that the DOM has changed [$(table).trigger(update);].
  Ideally some sort of append rules functionality would be great.

  Again fantastic work on a great tool,

  Best Regards

  Michael


[jQuery] detecting if Firebug is installed

2008-10-17 Thread pere roca



  hi all,
  I have an application that fails when Firebug is installed in Firefox 3
(with FF2 works). does someone know any way to detect if Firebug is
installed (I know how to detect FF, but not Firebug)

  thanks!
  

  Pere Roca Ristol
  Biòleg i especialista GIS
  Museo Nacional de Ciencias Naturales (CSIC)
  Visita l'EDIT mapViewer! 
  http://edit.csic.es/edit_geo/prototype/edit.html
-- 
View this message in context: 
http://www.nabble.com/detecting-if-Firebug-is-installed-tp20029518s27240p20029518.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] stop hover

2008-10-17 Thread weidc

hi,

well i got a little problem.

i got some images which get a border if i hover over it. if i click an
image it gets big and in front of the others but it still gets a
border if i hover over it. that sucks and i don't know how to stop it.
i didn't programmed this hover so i don't know something about it
except it does a border!

i'll be happy about every idea. thanks for reading.

-weidc


[jQuery] Re: detecting if Firebug is installed

2008-10-17 Thread pere roca



  I answer to myself; just googling a little I found this (not jQuery)
solution (http://groups.google.com/group/firebug/msg/c5368294b82baad1)

  

pere roca wrote:
 
 
   hi all,
   I have an application that fails when Firebug is installed in Firefox 3
 (with FF2 works). does someone know any way to detect if Firebug is
 installed (I know how to detect FF, but not Firebug)
 
   thanks!
   
 
   Pere Roca Ristol
   Biòleg i especialista GIS
   Museo Nacional de Ciencias Naturales (CSIC)
   Visita l'EDIT mapViewer! 
   http://edit.csic.es/edit_geo/prototype/edit.html
 

-- 
View this message in context: 
http://www.nabble.com/detecting-if-Firebug-is-installed-tp20029518s27240p20030495.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: stop hover

2008-10-17 Thread tlob

Hallo

CSS = border:0;

or do you see the dottet border? Thats the browserhighlighting a
linked element. Cant surpress that. Its diffrent in every browser

cu
tom

On Oct 17, 11:56 am, weidc [EMAIL PROTECTED] wrote:
 hi,

 well i got a little problem.

 i got some images which get a border if i hover over it. if i click an
 image it gets big and in front of the others but it still gets a
 border if i hover over it. that sucks and i don't know how to stop it.
 i didn't programmed this hover so i don't know something about it
 except it does a border!

 i'll be happy about every idea. thanks for reading.

 -weidc


[jQuery] Re: question.

2008-10-17 Thread Klaus Hartl

Yeah, otherwise the radio and checkbox controls would be rather
useless.

--Klaus



On 17 Okt., 06:27, Karl Swedberg [EMAIL PROTECTED] wrote:
 On Oct 16, 2008, at 2:06 PM, ricardobeat wrote:



  on a side note, name attributes should be unique (just like IDs), they
  are identifiers for an element. If you want valid HTML/XHTML you
  should use a class instead.

  - ricardo

 this is not necessarily true.

 name attributes must be unique when they are used as a unique  
 identifier for the following elements: a, applet, form, frame, iframe,  
 img, map  -- just like IDs.

 But, they don't have to be unique when used as a parameter key for the  
 param element or when they're used for form controls such as input,  
 button, and select.

 --Karl
 
 Karl Swedbergwww.englishrules.comwww.learningjquery.com


[jQuery] strange bytes marker at head of jquery.blockUI.js?

2008-10-17 Thread Jeffrey 'jf' Lim

not too sure if anybody noticed this (I did a cursory search through
the archives - but didnt find anything), but what is with those first
3 non-ascii bytes at the head of the js? (0xef, 0xbb, 0xbf) Are they
supposed to mean or do anything? They arent present in the old
version, btw 
(http://jqueryjs.googlecode.com/svn/trunk/plugins/blockUI/jquery.blockUI.js)
- I am led to think that they are there somehow as an accident of
editting, or something... If i could get a confirmation here (one
doubts whether these characters have any functionality role to play as
part of the js), that would be great.

thanks,
-jf

---
In the meantime, here is your PSA:
It's so hard to write a graphics driver that open-sourcing it would not help.
-- Andrew Fear, Software Product Manager, NVIDIA Corporation
http://kerneltrap.org/node/7228


[jQuery] JDate picker image comes again and again

2008-10-17 Thread thesmartmind

Thanks every body

---
In my application we are using the JQuery datepicker

and we are calling
the function

jQuery(#fromDate).datepicker({
showOn: button,
buttonImage: /TCSFramework/images/icon.gif,
buttonImageOnly: true ,
 dateFormat: gPreferences.dateFormat
}).addClass(embed);

to show the date picker
i am disabling it with

jQuery(#fromDate).datepicker(disable);

but problem is when i revisit that page it is adding the image again
and again

how can i solve it.

Actually i am a newbie to JQery datePicker

thanks once again for reply.


[jQuery] google's gadget API implementation on jQuery

2008-10-17 Thread Bernard Shyu

Hi all,

I've implemented a web site (http://www.heremypage.com/), which works
like netvibes or igoogle (www.google.com/ig), the so called
personalized home portal. The gadgets implementation are almost 80~90%
compatible to google gadget APIs 
http://code.google.com/apis/gadgets/docs/overview.html.
I believe that they can be a good foundation for jQuery based gadgets
development, if continual development efforts are drawn to improve it
by more developers.

Certainly it isn't up to date:
   The version of jQuery adopted is 1.2.2.
   The google gadget API spec was based on April's version

There are also some quick hacks on the jquery library itself, in order
to allow the communication between the child windows in gadgets'
iframe and the TOP window -- the jQuery library is included only once
in the home HTML page, with every child iframe's leverage the parent
window's jquery object via the mentioned communication mechanism. It
works, but I believe there should be some defects undetected.

I'm new to open source community, let alone jQuery itself. I just
wonder if HereMyPage's gadgets work is interested and welcome or not.
Therefore, by this post, If someones out there are interested, drop me
some comments, encouragements :-), I will then start to study how to
create an open source project, maybe hosted at code.google.com (teach
me how if you like).

By the way, the web site of HereMyPage wasn't intended to be a
commercial one, but for developer's playground, and far from completed
as today. To test it, you have to use 'test1' or 'test2' as the
username, '' as the password at this moment. The user registration
and activation will be realized soon later.

Don't blame me for its being very preliminary status. My own
professional discipline is actually more on Linux Kernel  drivers,
web development is a new skills to me and only as a hobby now.

Welcome comment at my blog here:
http://bshyu.blogspot.com/

My web site:
http://www.heremypage.com/

Cheers.
Banal Banana


[jQuery] Re: stop hover

2008-10-17 Thread weidc

Hi,

well thanks I guess it would work but I just saw in firebug - border:
1px solid #66 !important
Allready tried that too. I wondered why it doesn't work. So I have to
talk with these guys when they are back.

Thanks for your help.

-weidc

On 17 Okt., 12:24, tlob [EMAIL PROTECTED] wrote:
 Hallo

 CSS = border:0;

 or do you see the dottet border? Thats the browserhighlighting a
 linked element. Cant surpress that. Its diffrent in every browser

 cu
 tom

 On Oct 17, 11:56 am, weidc [EMAIL PROTECTED] wrote:

  hi,

  well i got a little problem.

  i got some images which get a border if i hover over it. if i click an
  image it gets big and in front of the others but it still gets a
  border if i hover over it. that sucks and i don't know how to stop it.
  i didn't programmed this hover so i don't know something about it
  except it does a border!

  i'll be happy about every idea. thanks for reading.

  -weidc


[jQuery] JCarousel - How to scoll a fixed width of pixels?

2008-10-17 Thread greencube

I'm testing JCarousel for a project and trying to figure out if it is
possible to scroll a fixed with of pixel when I click on prev and next
buttons instead of a specified number of items.

I need this because the images will be of varying width, but the same
height. One clip-window will have 3 images, another 2 etc.

Have anyone tried something like this?


[jQuery] [jquery ui autocomplete] setData problem

2008-10-17 Thread wahyudinata

Hi,
I am trying to add a pagination capability to my autocomplete


I am having trouble when I click the pagination link , I call
setData , flushCache and then trigger a search event and pass the
page, but the setData is not setting the extraParams.
help?
this is my autocomplete call:
 $('input [type=text]'). autocomplete(
{
url:'/ajax/search',
cacheLength:30,
width:380,
formatItem:function(results,index,total)
   {
   var zebra=true;
   results=eval('('+results+')');

   if (results.length=0)
   {
   $('#ac_extra_menu').hide();
   return 'li found nothing/li';
   }

   if (!$('#ac_extra_menu').length)//if we
dont find the extra menu for pagination then add it
   {
   $('div.ui-autocomplete-
results').prepend(
'div id=ac_extra_menu'+
'Showing span
id=ac_current_page/span of span id=ac_total_result/span'+
'a href=#
id=ac_paginate_leftimg src=/assets/img/header/arw_kr.png //
a'+
'a href=#
id=ac_paginate_right img src=/assets/img/header/arw_kn.png / /
a'+
'/div'
   );
   $('#ac_paginate_left').click(
function()
{
//paginate left
}
   );
   $('#ac_paginate_right').click(
function()
{
$('#search_box
input[type=text]')

.autocomplete('setData',
{page:2}).
autocomplete('flushCache')

 
.autocomplete('search');

return false;
}
   );
   hack_to_style_ac=true;
   }

   list_of_elements='';
   for (var i=0;iresults.length;i++)
   {
zebra=!zebra;
   list_of_elements+='li class='+
(zebra?'zebra':'')+'a onclick=window.location=$(this).attr(\'href
\'); href=/map/index/'+results[i]['location_x']+
  '/'+results[i]
['location_y']+'img src=/assets/img/header/thumb_'
  +
(Math.floor(Math.random()*2))+'.png /'
  +cut_text(results[i]
['name'])+ ' - of - '
  +results[i]
['username']+'/a/li';
   }
   $('#ac_total_result').text(results.length);
   return list_of_elements;

   }

}
);


[jQuery] Image displays again and again

2008-10-17 Thread thesmartmind

Hi every body,

In my application we are using the JQuery datepicker

and we are calling
the function

jQuery(#fromDate).datepicker({
showOn: button,
buttonImage: /TCSFramework/images/icon.gif,
buttonImageOnly: true ,
 dateFormat: gPreferences.dateFormat
}).addClass(embed);

like this

i am disabling it with

jQuery(#fromDate).datepicker(disable);

but problem is when i revisit that page it is adding the image again
and again

how can i solve it.

Actually i am a newbie to JQery datePicker

-

I have a requirement that i need to disable datepicker
thats y i used jQuery(#fromDate).datepicker(disable);

but when i revisit that page it is displaying again and again
can any body solve it .,...


[jQuery] Re: jqGrid 3.3 version

2008-10-17 Thread Tony

Hello,
You can use the new custom filter feature. The groups GroupA, B ...
can be obtained via separate ajax request from the db.
Also refer to docs for this purpose.
Regards

On Oct 15, 9:29 pm, patrick davey [EMAIL PROTECTED] wrote:
 Hi Tony,

 Very nicely done - will definitely take a look at it.

 Is there a plan to add filtering too?  For example, I do a search
 which returns 3000 records (say split over GroupA,GroupB,GroupC
 etc).   Now, if I want to filter on just GroupA (say 500 records) and
 then return just that info in the grid is that possible?

 Obviously it would require some sneaky server side Ajax to do too -
 but it would require filtering drop downs on each column in the grid
 too?

 Great work!

 Thanks,
 Patrick

 On Oct 15, 11:13 am, Rey Bango [EMAIL PROTECTED] wrote:

  Wow Tony! Just WOW! :D

  Rey...

  Tony wrote:
   Hello all,
   A new version ofjqGridis available.
   All the new features and bug fixes can be found here
  http://www.secondpersonplural.ca/jqgriddocs/index.htm

   Be a sure to visit the demo page for the new features.
  http://trirand.com/jqgrid/jqgrid.html

   ThejqGridhome page is here
  http://trirand.com/blog/

   Enjoy
   Tony


[jQuery] Re: question.

2008-10-17 Thread Klaus Hartl

No need to apologize of course :)

On 16 Okt., 16:22, GARIL [EMAIL PROTECTED] wrote:
 Excellent!  Thank you both.  And I apologize. I hit the send button
 too quickly.


[jQuery] Re: strange bytes marker at head of jquery.blockUI.js?

2008-10-17 Thread Mike Alsup

 not too sure if anybody noticed this (I did a cursory search through
 the archives - but didnt find anything), but what is with those first
 3 non-ascii bytes at the head of the js? (0xef, 0xbb, 0xbf) Are they
 supposed to mean or do anything? They arent present in the old
 version, btw 
 (http://jqueryjs.googlecode.com/svn/trunk/plugins/blockUI/jquery.block...)
 - I am led to think that they are there somehow as an accident of
 editting, or something... If i could get a confirmation here (one
 doubts whether these characters have any functionality role to play as
 part of the js), that would be great.

Definitely an accident.  In what version do you see this?


[jQuery] Re: jQuery Cycle pagerAnchorBuilder with Div Tags

2008-10-17 Thread Zach Dunn

Thanks Mike!

It's currently on the development page at www.imagine.yidio.com. I've
put some placeholders in for the time being.

Besides that the pertinent files are:

www.imagine.yidio.comscripts/jquery-code.js
www.imagine.yidio.com/jquery-style.css

Zach

On Oct 16, 10:53 pm, Mike Alsup [EMAIL PROTECTED] wrote:
 Hi Zach,

 Post a link or send me one.  We'll get it worked out.

 Mike

 On Oct 16, 6:35 pm, Zach Dunn [EMAIL PROTECTED] wrote:

  Appreciate the help Mike, unfortunately when I plugged that in it
  stopped the slideshow all together. Is there something that might
  interfere with that?

  On Oct 16, 6:26 pm, Mike Alsup [EMAIL PROTECTED] wrote:

$('#headline-rotation').before('ul id=nav').cycle({
            fx:'fade',
                speed:'slow',
                timeout: 4000,
                pager:'#nav',

                // callback fn that creates a thumbnail to use as pager 
anchor
                pagerAnchorBuilder: function(idx, slide) {
                        slide = $('#headline-rotation .headline-item 
img:eq('idx')').src
                        return 'lia href=#img src=' + slide.src 
+ ' width=100
height=50 //a/li';
                }
        });

   Try this:

       pagerAnchorBuilder: function(idx, slide) {
           var src = $('img',slide).attr('src');
           return 'lia href=#img src='+src+' width=100
   height=50 //a/li';
       }


[jQuery] Re: Rounded Corners and IE 6

2008-10-17 Thread k3liutZu

Just convince everyone that it is ok to send IE6 a squared corner
look ;)

On Oct 17, 12:46 am, caruso_g [EMAIL PROTECTED] wrote:
 Thanks Tim, tried.
 Unluckily, no anti-alias, no background images and a messy rendering
 on IE6.

 On 16 Ott, 23:32, TimW66 [EMAIL PROTECTED] wrote:

  I've played around with this one:http://malsup.com/jquery/corner/

  On Oct 16, 4:19 pm, caruso_g [EMAIL PROTECTED] wrote:

   I searched for a plugin to round corners using jQuery.
   I tried any plugin I was able to find but sadly none of them was able
   to work on IE 6.
   Some of them didn't even work on std compliant browsers.
   I then, chosen to use Nifty Cube by Alessandro Fulciniti, but I found
   that shows some bugs too. (http://skitch.com/caruso_g/2hb3/ie-rounded-
   bugs-01http://skitch.com/caruso_g/2hn8/ie-rounded-bugs-02)
   Now, it is probably due to the complexity of the page html code that
   uses a lot of padding and margins but I was not able to get them work.
   Can someone help me to understand where I am doing wrong?

   Herehttp://www.bonsai-studio.net/live_preview/pro-001/youcanfind a
   sample of the page I am trying to round corners.

   I essentially need some rounded corners that work. But background
   images (both in content then in container) and anti-alias would be a
   great plus.

   Thanks you all in advance. I really don't know what else to do or
   where to ask for help.


[jQuery] disappearing content with IE7 (slideToggle vs toggle)

2008-10-17 Thread AstroIvan

Not sure what it's doing wrong, but slideToggle appears to have a
negative affect on IE7 blocks.

http://www.nabble.com/issue-with-slideToggle-td9984489s27240.html

I was able to see this with Jquery 1.2.3.  Does anyone know if it was
fixed for 1.2.6?

toggle successfully re-shows a div for all browsers, while slideToggle
and IE7 can't and pushes it up and left for some reason.

doctype: !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;

Unfortunately I can't switch to 1.2.6 becuase I'm working with
RichFaces which doesn't use the latest version of Jquery.

Any suggestions here?


[jQuery] Re: disappearing content with IE7 (slideToggle vs toggle)

2008-10-17 Thread AstroIvan

.animate({
height: toggle
  }, 1500);

also triggers the disappearing content block.  I'll try to get a
working html sample later that doesn't use the server side framework.


[jQuery] Re: disappearing content with IE7 (slideToggle vs toggle)

2008-10-17 Thread AstroIvan

ok found a solution but not sure if it's the cause.

when i add opacity to the animate function i posted above, the ie7
block does not disappear.
maybe slideToggle removes opacity after it is finished?  not sure.
putting this info here so others might take advantage of it.


[jQuery] Re: Jquery tab

2008-10-17 Thread [EMAIL PROTECTED]

Works amazing. I adjusted the ui.tabs.js file so that i targets to css
stuff of my own site.

Last question, i have another menu where i want to add this, but it
uses different css styles hoe do i make this si that he uses other
styles for that part?

Erwin

On 16 okt, 15:59, Klaus Hartl [EMAIL PROTECTED] wrote:
 Tabs already attaches/detaches a class for the selected tab and the
 first tab is active by default. Thus you don't need to attach your
 class at all.

 If you want to roll your own style look for .ui-tabs-selected:

 .ui-tabs-selected {
     border: 1px solid red !important; /* just an example */

 }

 --Klaus

 On 16 Okt., 13:43, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:



  I found the function add and remove class.

  I tried:

    $(document).ready(function(){
      $(#nieuws  ul).tabs( { event: 'mouseover'});
     $(#tab1_actief).removeClass();
    });

  But that doenst seem to work. How do i have to use this?

  On 16 okt, 12:45, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

   Works amazing, thanks for your reply!

   Another litle question i have this:

               ul class=tabs
                   li class=tab1_actiefa href=#fragment-1
   class=tabNieuwste berichten/a/li
                   li class=tab2a href=#fragment-2
   class=tabBest bekeken/a/li
                   li class=tab3a href=#fragment-3
   class=tabMeeste reacties/a/li
               /ul

   So the first tab is avtive when the page is loaded and the tab has a
   different color then. Thats: tab1_actief

   How do i make it so that the li class actief also changes to the one
   where the user went over with his mouse?

   On 15 okt, 23:37, Klaus Hartl [EMAIL PROTECTED] wrote:

The jQuery UI Tabs plugin can do this.

Use it with event set to mouseover and Ajax links.

   http://docs.jquery.com/UI/Tabs

--Klaus

On 15 Okt., 16:38, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:

 Hello,

 I am looking for a jQuery ajax script that can do the following:

http://www.doublemedia.nl/nieuws.jpg

 When someone goes with his mouse over one of the tab's you see in the
 image he has to load the content that belongs to the chosen tab.

 Any one hoe knows a jquery plugin that can do this?

 Erwin- Tekst uit oorspronkelijk bericht niet weergeven -

- Tekst uit oorspronkelijk bericht weergeven -- Tekst uit 
oorspronkelijk bericht niet weergeven -

   - Tekst uit oorspronkelijk bericht weergeven -- Tekst uit oorspronkelijk 
   bericht niet weergeven -

 - Tekst uit oorspronkelijk bericht weergeven -


[jQuery] Resizing Images in jQuery

2008-10-17 Thread Adam

I am trying to display images on the page via ajax, but they are slow
loading.  What I'd like to do is show a 'loading' image while the
image is loading, and then load the image.

The problem is, all of the images are different sizes, and so I can't
set the 'loading' image to the exact size of whatever image is
loading.  Once I load an image, the image stretches overtop of the
content below it or to the side.  Is there a way with jQuery to
dynamically resize everything around it so that the image will fit
into its space?


[jQuery] Re: disappearing content with IE7 (slideToggle vs toggle)

2008-10-17 Thread AstroIvan

.animate({
height: toggle,
opacity:toggle
  }, 1500);


[jQuery] Re: JCarousel - How to scoll a fixed width of pixels?

2008-10-17 Thread Eric Shepherd

I seem to remember this being addressed in the jCarousel blog comments
and that it is not possible to have variable size objects.

On Oct 17, 5:53 am, greencube [EMAIL PROTECTED] wrote:
 I'm testing JCarousel for a project and trying to figure out if it is
 possible to scroll a fixed with of pixel when I click on prev and next
 buttons instead of a specified number of items.

 I need this because the images will be of varying width, but the same
 height. One clip-window will have 3 images, another 2 etc.

 Have anyone tried something like this?


[jQuery] draggable plugin problem

2008-10-17 Thread weidc

Hi,

well i used and still use the draggable plugin in a script. it worked
fine 'till they changed the site a bit. after i changed my script
firebug says:

$[namespace][name] is not a constructor
[Break on this error] return this.each(function(){var
instance...==undefined){return this._getData(key);}

and it somehow clones all the time the image and buttons in every
browser.

i don't know whats wrong.
the script works fine without the draggable.

that is the only drag thing:

$(this).draggable(
{
handle:'#move'
});

if i remove this everything works (except the dragging).

i was searching for the mistake for so long. i hope someone can help
me.
thanks a lot.

-weidc


[jQuery] Re: dialog box position

2008-10-17 Thread Zemian Deng
Can some one help?
Thanks,
-Z

On Tue, Oct 14, 2008 at 3:34 PM, Zemian Deng [EMAIL PROTECTED]wrote:

 Hello list,
 I am trying to show a dialog box when user hover a link. The following
 works on firefox only. Is there better way to do it via jQuery(or browser
 independent) way?

 a href=# onmouseover=$('#my_hidden_div_box').dialog({autoOpen: true,
 draggable: false, resizable: false, position: [event.pageX, 
 event.pageY]});$('#help_user_priority').dialog('open');My
 link/a

 I think event.pageX is the culprit, but any other advice is appreciated.

 Thanks in advance,
 -Z

 --
 http://code.google.com/p/sweetscala - a Scala web framework.




-- 
http://code.google.com/p/sweetscala - a Scala web framework.


[jQuery] Multiple JQuery Bottleneck

2008-10-17 Thread dvdavid2001


Hi guys,

This is my 1st time asking the questions hence please bear with me if I did
it wrongly or etc.

I have a J2EE application that used jQuery quite a lot. There is one page
that called jQuery 4 times upon loading. Out of these 4 calls, there is one
jQuery call that took around 20-30 seconds depending on the criteria that
user chose. 

However, unfortunately, I found that the other 3 jQuery calls are in fact
waiting for that 1 jQuery call that took some time to complete before the
rest can also be completed. I have added the debugging, it seems that the
bottleneck occurred at the success method of .ajax. The other 3 calls are
simply stuck there to wait for the 1 call to complete before they can
proceed to implement their success methods.

Any idea how to fix it?

Thanks
David
-- 
View this message in context: 
http://www.nabble.com/Multiple-JQuery-Bottleneck-tp19938671s27240p19938671.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Using jquery with thickbox causes I.E. 6 to lose scrollbar

2008-10-17 Thread livewire9174

Hi,
Has anybody tried this yet? When i use the latest jquery + thickbox,
when i display a modal window, i.e. 6.0 loses its scrollbar, to the
content appears to move, does anybody have a solution?


[jQuery] how to use index instead of ID (adding class to A element in UL LI list)

2008-10-17 Thread Tomas25

Hi everyone,

i have this code:

$(document).ready(function() {
   var element = $(.mainSubNav ul li a);
   element.mouseover(function() {
  idLi = $(this).attr(id);
  $(.mainSubNav ul li a# + (parseInt(idLi) -
1)).addClass(bgNone2);
   }).mouseout(function() {
  $(.mainSubNav ul li a# + (parseInt(idLi) -
1)).removeClass(bgNone2);
   });
});


how can I change it that it will be catching index of LI A elements,
instead of ID's ?? because I don't want to use ID's for A elements if
I can use index [0,1,3,...,i] of LI or A elements

thx a lot for help... If this explanation is not enough, let me know,
I will try to explain it with further information


[jQuery] issue with datepicker setDate

2008-10-17 Thread [EMAIL PROTECTED]

Hi,

The following set my two input range to today's date:

 $(#fStartDate, #fEndDate).datepicker(setDate, null, null);

However if I try to set the range to the last week, by setting the
first input to -1w and the next one to today's date :

$(#fStartDate, #fEndDate).datepicker(setDate, -1w, null);


This doesn'  t work : both input are set to today's date

Am I doing something wrong ?

Thanks


[jQuery] Re: Jquery tab

2008-10-17 Thread Klaus Hartl

On 17 Okt., 15:37, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Works amazing. I adjusted the ui.tabs.js file so that i targets to css
 stuff of my own site.

Well, it's usually not the best idea to adjust the file itself
(maintenance, e.g. updating gets more work), especially if everything
you need is already provided by the plugin.

That said, to change the class name for the selected tab - without
changing the source - initialize it like so:

$('#foo').tabs({
selectedClass: 'your-own-special-name'
});

And even that is not really required since you could just adjust the
given CSS. Whatever, maybe I got your problem wrong.


 Last question, i have another menu where i want to add this, but it
 uses different css styles hoe do i make this si that he uses other
 styles for that part?

I usually do such styling by context. Say one of your tab panes is
inside a div with the id one and another one is inside a div with
the id 'two'. You can then write your CSS like:

#one .your-own-special-name {
color: green;
}

#two .your-own-special-name {
color: red;
}

HTH, --Klaus


[jQuery] Re: jQuery Cycle pagerAnchorBuilder with Div Tags

2008-10-17 Thread Mike Alsup

 Thanks Mike!

 It's currently on the development page atwww.imagine.yidio.com. I've
 put some placeholders in for the time being.


Zach, it really looks to me like this should work:

$('#headline-rotation').before('ul id=nav').cycle({
speed:  'slow',
timeout: 4000,
pager:  '#nav',
pagerAnchorBuilder: function(idx, slide) {
var src = $('img',slide).attr('src');
return 'lia href=#img src=' + src + ' width=100
height=50 //a/li';
}
});




[jQuery] Re: Multiple JQuery Bottleneck

2008-10-17 Thread John Resig

Kind of hard to debug what you're talking about without seeing it. Do
you have an example?

--John



On Fri, Oct 17, 2008 at 10:17 AM, dvdavid2001 [EMAIL PROTECTED] wrote:


 Hi guys,

 This is my 1st time asking the questions hence please bear with me if I did
 it wrongly or etc.

 I have a J2EE application that used jQuery quite a lot. There is one page
 that called jQuery 4 times upon loading. Out of these 4 calls, there is one
 jQuery call that took around 20-30 seconds depending on the criteria that
 user chose.

 However, unfortunately, I found that the other 3 jQuery calls are in fact
 waiting for that 1 jQuery call that took some time to complete before the
 rest can also be completed. I have added the debugging, it seems that the
 bottleneck occurred at the success method of .ajax. The other 3 calls are
 simply stuck there to wait for the 1 call to complete before they can
 proceed to implement their success methods.

 Any idea how to fix it?

 Thanks
 David
 --
 View this message in context: 
 http://www.nabble.com/Multiple-JQuery-Bottleneck-tp19938671s27240p19938671.html
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.




[jQuery] Re: how to use index instead of ID (adding class to A element in UL LI list)

2008-10-17 Thread MorningZ

Can you post some of the HTML of mainSubNav?


On Oct 17, 8:56 am, Tomas25 [EMAIL PROTECTED] wrote:
 Hi everyone,

 i have this code:

 $(document).ready(function() {
    var element = $(.mainSubNav ul li a);
    element.mouseover(function() {
       idLi = $(this).attr(id);
       $(.mainSubNav ul li a# + (parseInt(idLi) -
 1)).addClass(bgNone2);
    }).mouseout(function() {
       $(.mainSubNav ul li a# + (parseInt(idLi) -
 1)).removeClass(bgNone2);
    });

 });

 how can I change it that it will be catching index of LI A elements,
 instead of ID's ?? because I don't want to use ID's for A elements if
 I can use index [0,1,3,...,i] of LI or A elements

 thx a lot for help... If this explanation is not enough, let me know,
 I will try to explain it with further information


[jQuery] Re: Rounded Corners and IE 6

2008-10-17 Thread Isaak Malik
Personally, I find it a big waste to use JavaScript for this purpose. Why
not simply create rounded corner 10x10 (or whatever) images and use them?

On Fri, Oct 17, 2008 at 2:59 PM, k3liutZu [EMAIL PROTECTED] wrote:


 Just convince everyone that it is ok to send IE6 a squared corner
 look ;)

 On Oct 17, 12:46 am, caruso_g [EMAIL PROTECTED] wrote:
  Thanks Tim, tried.
  Unluckily, no anti-alias, no background images and a messy rendering
  on IE6.
 
  On 16 Ott, 23:32, TimW66 [EMAIL PROTECTED] wrote:
 
   I've played around with this one:http://malsup.com/jquery/corner/
 
   On Oct 16, 4:19 pm, caruso_g [EMAIL PROTECTED] wrote:
 
I searched for a plugin to round corners using jQuery.
I tried any plugin I was able to find but sadly none of them was able
to work on IE 6.
Some of them didn't even work on std compliant browsers.
I then, chosen to use Nifty Cube by Alessandro Fulciniti, but I found
that shows some bugs too. (
 http://skitch.com/caruso_g/2hb3/ie-rounded-
bugs-01http://skitch.com/caruso_g/2hn8/ie-rounded-bugs-02)
Now, it is probably due to the complexity of the page html code that
uses a lot of padding and margins but I was not able to get them
 work.
Can someone help me to understand where I am doing wrong?
 
Herehttp://www.bonsai-studio.net/live_preview/pro-001/youcanfind a
sample of the page I am trying to round corners.
 
I essentially need some rounded corners that work. But background
images (both in content then in container) and anti-alias would be a
great plus.
 
Thanks you all in advance. I really don't know what else to do or
where to ask for help.




-- 
Isaak Malik
Web Developer


[jQuery] Re: JCarousel - How to scoll a fixed width of pixels?

2008-10-17 Thread Ariel Flesler

You can try SerialScroll:
   http://flesler.blogspot.com/2008/02/jqueryserialscroll.html

It handles situations where elements have different dimensions and can
be even unaligned (x and/or y).


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

On Oct 17, 6:53 am, greencube [EMAIL PROTECTED] wrote:
 I'm testing JCarousel for a project and trying to figure out if it is
 possible to scroll a fixed with of pixel when I click on prev and next
 buttons instead of a specified number of items.

 I need this because the images will be of varying width, but the same
 height. One clip-window will have 3 images, another 2 etc.

 Have anyone tried something like this?


[jQuery] Re: Newbie question: how to reference an element via XML attribute.

2008-10-17 Thread JFQueralt

Hi, Mike.

Thanks for the hint. Will try it tonite at home :-)


Jean

On Oct 16, 2:28 am, Mike Alsup [EMAIL PROTECTED] wrote:
  Second, I´ve found a solution using the DOM while it works is far from
  being jQuery pure code:

          //Iterate among all retrieved items.
          $('item', xml).each(function(i){
                  //Retrieve the Node of the item.
                  Item = $('item',xml).get(i);
                  //Point to the Text to be changed.
                  Elem = 
  document.getElementById(Item.attributes[0].nodeValue);
                  //Perform the change.
                  Elem.innerHTML = Item.childNodes[0].nodeValue

  Obviously I am using some middle vars that are not really necessary
  but so far I prefer it this way.

  Yes, it works now but I would like to learn how to do the same with
  pure jQuery so any help is still appreciated.

 This should work:

 $.get(Thefile.xml, function (xml) {
     $('item', xml).each(function() {
         var $this = $(this);
         var id = $this.attr('id');
         $('#'+id).html($this.text());
     });

 });


[jQuery] Problems parsing XML with jQuery

2008-10-17 Thread Gissur Þórhallsson
I'm trying to parse this little XML document here:
http://pastebin.com/m5f0e4300 with this code: function(response) {
console.log(response.responseText) console.log(response.responseXML) try {
console.log(Try and find nafn)
console.log($j(response.responseXML).find(nafn).text())
console.log($j(response.responseXML).find(LM:nafn).text()) } catch(e) {
console.log(WMS GetFeatureInfo XML Error) } }
(JS code: http://pastebin.com/m5efc6214 )
And for some reason I get the following from the Firebug log:

[The xml text]
Document [A Document object of the XML]
Try and find nafn
[Empty line]
[Empty line]

Instead of those Empty lines I would like to get Kópavogur.
Anybody have any idea what I'm doing wrong?

Kind regards from Iceland,
gzur


[jQuery] How to stop change event from firing

2008-10-17 Thread newkid85

I have a form with three dependent location select fields and a text
field which lets a user add a new city if it is missing from the
dropdown. The following function works fine when I create a new form.
It puts the fields in sync to start with and keeps them that way when
the user makes their selections.

There is a problem though when the form is edited. This is because
once the page loads the function below automatically puts the fields
back in sync before the user does anything like on the initial
creation. So the previously selected values are overwritten.

When the form is being edited I would like to have the change event
only fire if the user actually changes any of the dropdowns
themselves. I am able to check if the form is being edited or created
but not sure how to change my function.

function() {
$(#update-button).hide();
if ($(#field-city-text).val() == '') {
$(#field-city-text-wrapper).hide();
}
$(#field-country).change(function () {
var country = $(this).val();
$(#field-city-wrapper).hide();
$(#field-city).val('');
updateState();
})
  .change();
  $(#field-state).change(updateCity).change(addCity);
  $(#field-city).change(addCity);
}

Any thoughts appreciated.


[jQuery] treeview

2008-10-17 Thread [EMAIL PROTECTED]

Hi, I love this plug in, it is great. However, I was wondering if it
was possible to add a close/hide submenu/files function to the submenu/
files when clicked on. What I'm trying to get at is when you click on
an expanded submenu item, the parent menu would close so that the
viewer does not have to click on the main menu item to close out the
sub. and how would I go about integrating this? Thank you in advance.


[jQuery] Safari/WebKit bug with maxWidth?

2008-10-17 Thread Dan G. Switzer, II

This doesn't look like a jQuery issue per-se, but webkit doesn't seem to
return a value for:

$el.css(max-width) or $el[0].style.maxWidth

IE and FF both return the correct value, but Webkit returns none. Is there
a way in Webkit to get the maxWidth of an element?

-Dan



[jQuery] Re: Problems parsing XML with jQuery

2008-10-17 Thread Richard D. Worth
See

http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_select_an_element_that_has_weird_characters_in_its_ID.3F

- Richard

On Fri, Oct 17, 2008 at 8:28 AM, Gissur Þórhallsson [EMAIL PROTECTED]wrote:

 I'm trying to parse this little XML document here:
 http://pastebin.com/m5f0e4300 with this code: function(response) {
 console.log(response.responseText) console.log(response.responseXML) try {
 console.log(Try and find nafn)
 console.log($j(response.responseXML).find(nafn).text())
 console.log($j(response.responseXML).find(LM:nafn).text()) } catch(e) {
 console.log(WMS GetFeatureInfo XML Error) } }
 (JS code: http://pastebin.com/m5efc6214 )
 And for some reason I get the following from the Firebug log:

 [The xml text]
 Document [A Document object of the XML]
 Try and find nafn
 [Empty line]
 [Empty line]

 Instead of those Empty lines I would like to get Kópavogur.
 Anybody have any idea what I'm doing wrong?

 Kind regards from Iceland,
 gzur





[jQuery] Re: Problems parsing XML with jQuery

2008-10-17 Thread Robert Koberg


Hi,

Do jQuery functions actually work over an XML DOM or just an HTML DOM?

best,
-Rob


On Oct 17, 2008, at 12:32 PM, Richard D. Worth wrote:


See

http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_select_an_element_that_has_weird_characters_in_its_ID.3F

- Richard

On Fri, Oct 17, 2008 at 8:28 AM, Gissur Þórhallsson [EMAIL PROTECTED] 
 wrote:
I'm trying to parse this little XML document here: http://pastebin.com/m5f0e4300 
 with this code:
function(response) { console.log(response.responseText)  
console.log(response.responseXML) try { console.log(Try and find  
nafn) console.log($j(response.responseXML).find(nafn).text())  
console.log($j(response.responseXML).find(LM:nafn).text()) }  
catch(e) { console.log(WMS GetFeatureInfo XML Error) } }

(JS code: http://pastebin.com/m5efc6214 )
And for some reason I get the following from the Firebug log:

[The xml text]
Document [A Document object of the XML]
Try and find nafn
[Empty line]
[Empty line]

Instead of those Empty lines I would like to get Kópavogur.
Anybody have any idea what I'm doing wrong?

Kind regards from Iceland,
gzur







[jQuery] Re: Rounded Corners and IE 6

2008-10-17 Thread caruso_g

I think I will adopt
k3liutZu suggesion… :P

@Isaak
The theme is is intended for people that just want to change colors
directly from Rapidweaver (it is a Rapidweaver theme) with no tech
skill.

@all
The problem seems that no corner plugin is able to keep paddings and
margins, and above all, the original size of the element rounded. This
just screw up any layout.
I, then, adopted Nifty cube solution. I just debugged css that were
messing the extra divs created.

I don't like this solution at all, but That's it.

On 17 Ott, 17:30, Isaak Malik [EMAIL PROTECTED] wrote:
 Personally, I find it a big waste to use JavaScript for this purpose. Why
 not simply create rounded corner 10x10 (or whatever) images and use them?





 On Fri, Oct 17, 2008 at 2:59 PM, k3liutZu [EMAIL PROTECTED] wrote:

  Just convince everyone that it is ok to send IE6 a squared corner
  look ;)

  On Oct 17, 12:46 am, caruso_g [EMAIL PROTECTED] wrote:
   Thanks Tim, tried.
   Unluckily, no anti-alias, no background images and a messy rendering
   on IE6.

   On 16 Ott, 23:32, TimW66 [EMAIL PROTECTED] wrote:

I've played around with this one:http://malsup.com/jquery/corner/

On Oct 16, 4:19 pm, caruso_g [EMAIL PROTECTED] wrote:

 I searched for a plugin to round corners using jQuery.
 I tried any plugin I was able to find but sadly none of them was able
 to work on IE 6.
 Some of them didn't even work on std compliant browsers.
 I then, chosen to use Nifty Cube by Alessandro Fulciniti, but I found
 that shows some bugs too. (
 http://skitch.com/caruso_g/2hb3/ie-rounded-
 bugs-01http://skitch.com/caruso_g/2hn8/ie-rounded-bugs-02)
 Now, it is probably due to the complexity of the page html code that
 uses a lot of padding and margins but I was not able to get them
  work.
 Can someone help me to understand where I am doing wrong?

 Herehttp://www.bonsai-studio.net/live_preview/pro-001/youcanfinda
 sample of the page I am trying to round corners.

 I essentially need some rounded corners that work. But background
 images (both in content then in container) and anti-alias would be a
 great plus.

 Thanks you all in advance. I really don't know what else to do or
 where to ask for help.

 --
 Isaak Malik
 Web Developer


[jQuery] Re: Problems parsing XML with jQuery

2008-10-17 Thread Gissur Þórhallsson
Thank you very much, that was the issue exactly, and now it works perfectly.
Kind regards and thanks,
gzur



On Fri, Oct 17, 2008 at 4:32 PM, Richard D. Worth [EMAIL PROTECTED] wrote:

 See


 http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_select_an_element_that_has_weird_characters_in_its_ID.3F

 - Richard


 On Fri, Oct 17, 2008 at 8:28 AM, Gissur Þórhallsson [EMAIL PROTECTED]wrote:

 I'm trying to parse this little XML document here:
 http://pastebin.com/m5f0e4300 with this code: function(response) {
 console.log(response.responseText) console.log(response.responseXML) try {
 console.log(Try and find nafn)
 console.log($j(response.responseXML).find(nafn).text())
 console.log($j(response.responseXML).find(LM:nafn).text()) } catch(e) {
 console.log(WMS GetFeatureInfo XML Error) } }
 (JS code: http://pastebin.com/m5efc6214 )
 And for some reason I get the following from the Firebug log:

 [The xml text]
 Document [A Document object of the XML]
 Try and find nafn
 [Empty line]
 [Empty line]

 Instead of those Empty lines I would like to get Kópavogur.
 Anybody have any idea what I'm doing wrong?

 Kind regards from Iceland,
 gzur






[jQuery] Re: Problems parsing XML with jQuery

2008-10-17 Thread Richard D. Worth
jQuery relies on the browser to parse an (X)HTML string you give it, so it's
going to be treated as a browsers treats it, as html. You'll have mixed
success in this area, feeding xml. It's not an xml parser.

- Richard

On Fri, Oct 17, 2008 at 9:34 AM, Robert Koberg [EMAIL PROTECTED] wrote:


 Hi,

 Do jQuery functions actually work over an XML DOM or just an HTML DOM?

 best,
 -Rob



 On Oct 17, 2008, at 12:32 PM, Richard D. Worth wrote:

  See


 http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_select_an_element_that_has_weird_characters_in_its_ID.3F

 - Richard

 On Fri, Oct 17, 2008 at 8:28 AM, Gissur Þórhallsson [EMAIL PROTECTED]
 wrote:
 I'm trying to parse this little XML document here:
 http://pastebin.com/m5f0e4300 with this code:
 function(response) { console.log(response.responseText)
 console.log(response.responseXML) try { console.log(Try and find nafn)
 console.log($j(response.responseXML).find(nafn).text())
 console.log($j(response.responseXML).find(LM:nafn).text()) } catch(e) {
 console.log(WMS GetFeatureInfo XML Error) } }
 (JS code: http://pastebin.com/m5efc6214 )
 And for some reason I get the following from the Firebug log:

 [The xml text]
 Document [A Document object of the XML]
 Try and find nafn
 [Empty line]
 [Empty line]

 Instead of those Empty lines I would like to get Kópavogur.
 Anybody have any idea what I'm doing wrong?

 Kind regards from Iceland,
 gzur







[jQuery] Re: jQuery Cycle pagerAnchorBuilder with Div Tags

2008-10-17 Thread Zach Dunn

Mike,

Thanks, I figured out my issue, I just had to add a closing bracket.

$('#headline-rotation').before('ul id=nav').cycle({
fx: 'fade',
speed:  'slow',
timeout: 4000,
pager:  '#nav',
pagerAnchorBuilder: function(idx, slide) {
var src = $('img',slide).attr('src');
return 'lia href=#img src=' + src + ' 
width=100
height=50 //a/li';
}
});

Final code. Works beautifully. Thank you so much.

Zach

On Oct 17, 10:58 am, Mike Alsup [EMAIL PROTECTED] wrote:
  Thanks Mike!

  It's currently on the development page atwww.imagine.yidio.com. I've
  put some placeholders in for the time being.

 Zach, it really looks to me like this should work:

 $('#headline-rotation').before('ul id=nav').cycle({
     speed:  'slow',
     timeout: 4000,
     pager:  '#nav',
     pagerAnchorBuilder: function(idx, slide) {
         var src = $('img',slide).attr('src');
         return 'lia href=#img src=' + src + ' width=100
 height=50 //a/li';
     }

 });


[jQuery] Re: Loading Mask

2008-10-17 Thread Ashley

If I understand you, this should do the trick - 
http://www.malsup.com/jquery/block/#element


[jQuery] Animate with IE6 artifacts

2008-10-17 Thread Sigurd

Hi everyone,

I'm having a problem with IE6 and animate({opacity: hide, height:
hide},300);
In all browsers including IE6 the feature works, however with IE6 it
produces artifacts as if it is jumping up and down before it completes
the animation.

I have simplified my code into one html file that reproduces the
problem on IE6:
http://spacefellowship.com/uploads/debug/debug_simplified_IE6.html

I have tried myself to find a solution, but no luck so far, that's why
I was wondering if someone has experience with this and or if someone
could look into this and try to help me.

Thanks in advance,

Sigurd


[jQuery] Re: How to stop change event from firing

2008-10-17 Thread ricardobeat

You can do $(#field-state).unbind('change'); when it starts being
edited and bind the function again when it's done, or you can put
everything in the function inside an IF statement which depends on the
edit mode.

- ricardo

On Oct 17, 12:41 pm, newkid85 [EMAIL PROTECTED] wrote:
 I have a form with three dependent location select fields and a text
 field which lets a user add a new city if it is missing from the
 dropdown. The following function works fine when I create a new form.
 It puts the fields in sync to start with and keeps them that way when
 the user makes their selections.

 There is a problem though when the form is edited. This is because
 once the page loads the function below automatically puts the fields
 back in sync before the user does anything like on the initial
 creation. So the previously selected values are overwritten.

 When the form is being edited I would like to have the change event
 only fire if the user actually changes any of the dropdowns
 themselves. I am able to check if the form is being edited or created
 but not sure how to change my function.

 function() {
         $(#update-button).hide();
         if ($(#field-city-text).val() == '') {
                 $(#field-city-text-wrapper).hide();
         }
         $(#field-country).change(function () {
         var country = $(this).val();
         $(#field-city-wrapper).hide();
         $(#field-city).val('');
         updateState();
         })
   .change();
   $(#field-state).change(updateCity).change(addCity);
   $(#field-city).change(addCity);

 }

 Any thoughts appreciated.


[jQuery] Way to use a Multi-Line Example Prompt in a Single-line Text Input Field

2008-10-17 Thread Wayne

I'm trying to prompt for input within the field using the Example
plugin (http://plugins.jquery.com/project/example). The idea is that
I'm styling my input field to be unsually large when the user types
(it will be no more than a 4 or 5 digits), so I can use closer to
normal size text as the prompt.

I know I can do this with a textarea, but it's semantically incorrect,
and using the return key creates a new line. I don't want to shoehorn
the simple input into a textarea, but I want the prompt to be
meaningful, like Enter a measurement for this baseline, instead of
type here or whatever short message I could use. I also like the
amount of space that it takes up visually with two lines.

What is a better way of doing this? Should I just use a jEditable
element and style it to look like a form input?

-Wayne


[jQuery] Re: dot separated id

2008-10-17 Thread ricardobeat

Yeah, that's a fault in the specs. XHTML specs also allow dots in IDs:

'only strings matching the pattern [A-Za-z][A-Za-z0-9:_.-]* should be
used.'  - http://www.w3.org/TR/xhtml1/#C_8

But that causes problems for CSS too:

div id=tom class=cat
div id=tom.cat

#tom.cat { which one are you referring to? }

- ricardo

On Oct 16, 7:41 pm, Mauricio \(Maujor\) Samy Silva
[EMAIL PROTECTED] wrote:
 Specs at  link pointed out says:
  ID and NAME tokens must begin with a letter ([A-Za-z]) and may be followed
 by any number of letters, digits ([0-9]), hyphens (-), underscores (_),
 colons (:), and periods (.).

 Aren't dots and periods the same?

 -

 double backslashes are the short term fix, but remember for the long
 term that dots are illegal in ID's and will cause your page to not
 validate.

 seehttp://www.w3.org/TR/html401/types.html#type-namefor reference.

 -micah


[jQuery] Re: how to detect current toggle setting?

2008-10-17 Thread ricardobeat

Hi,

I didn't mean to be rude, it's just a tip.

It is there on the docs page under 'Visibility Filters:', right after
the left sidebar content ends.

Invisible elements are the ones that have display:none or inputs of
type 'hidden'.

As Josh pointed out, you can use is() to check an existing object for
the property, I thought you would figure that out (http://
docs.jquery.com/Traversing). I did some testing and it works for both
toggle() and slideToggle(); when the element slides up it ends with
display:none too. Make sure you are referencing the right object, a
child of a hidden element will be considered ':visible' even if it's
actually hidden by the parent.

- ricardo

On Oct 16, 6:43 pm, Jay [EMAIL PROTECTED] wrote:
 On Oct 16, 3:53 pm, ricardobeat [EMAIL PROTECTED] wrote:

  Read the docs, read the docs.

 http://docs.jquery.com/Selectors

 I did. I use them frequently.
 There's no mention of those two functions on the selectors page In
 docs.jquery.com or the downloadable version.
 There's no detail on how they actually work on the effects page
 either.



  $('#element:visible') or $('#element:hidden')

 Tried it and it didn't work for me. This also requires javascript
 search the dom to find '#element'.
 Not terribly efficient if I already have a reference to the object in
 question. Wouldn't
 obj.attr('some_property_I_dont_know_about')
 or
 obj.get(0).some_property_I_dont_know_about
 be much faster?


[jQuery] Re: event.preventDefault() seems to fail

2008-10-17 Thread ricardobeat

It should work... but in jQuery 'return false' is the standard cross-
browser way of preventing the default action anyway, so I'd recommend
sticking to that.

- ricardo

On Oct 16, 11:16 pm, Hullah [EMAIL PROTECTED] wrote:
 I have a page with input textboxes and input buttons on it.  All are
 contained in a form.  I don't want the Enter button to submit the
 form, so I call preventDefault() on all texboxes.  I also don't want
 the input button to submit the form, so I call preventDefault() on the
 input button.

 But, if I call the button.click() event for when Enter is pressed in a
 textbox (to simulate a click on the button) it submits the form.  It
 seems as if something is not working like it should.

 Now...if I return false instead of preventDefault(), it works as I
 would expect.  But I would have thought that the purpose of
 preventDefault() is to cancel the default action of the event, as in
 this case to cancel form submission.

 Any help with this is greatly appreciated!  Following is some sample
 code that exhibts the behavoir.

 Thanks,
 Hullah

 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
   http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 html xmlns=http://www.w3.org/1999/xhtml;
     head
         titleTest/title
         script language=javascript type=text/javascript
 src=jquery-1.2.6.js/script
         script language=javascript type=text/javascript
           $(function() {
             $(:text).keypress(function(e) {
               if (e.which == 13) {
                 e.preventDefault();
               }
             });
             $(#txt).keypress(function(e) {
               if (e.which == 13) {
                 $(#btn).click();
               }
             });
             $(#btn).click(function(e) {
               e.preventDefault();
               alert(Button clicked);
             });
           });
         /script
     /head
     body
       form method=post action=test.html
         div
           input id=txt type=text /
           input id=btn type=submit value=Submit /
         /div
       /form
     /body
 /html


[jQuery] JQuerry Select Box problem

2008-10-17 Thread Robert Djurasaj

Hi,

http://i34.tinypic.com/n3rsso.jpg

I'm trying to do this using jQuery (in RoR ) and i need some help...

So let me explain it in a few steps. Lets say Selection Box 1 is list
of Continets. I want to be able to fill Selection Box 2 (list of all
countries on selected continent). After that is shown, I want to be
able to handpick few countries and put them in Selection Box 3 in
which i would be able to move them up or down.


Any solutions?

Thanks in advance

Robert



[jQuery] Display a div if and id is found

2008-10-17 Thread Taylor

Is there a simple way with jQuery to find a div with a specific id,
and display a different div if the id is found?  I know this may not
be the best way to accomplish something, but I am trying to avoid
rewriting a shopping cart plugin.



[jQuery] Re: how to detect current toggle setting?

2008-10-17 Thread Jay


 I did some testing and it works for both
 toggle() and slideToggle(); when the element slides up it ends with
 display:none too. Make sure you are referencing the right object, a
 child of a hidden element will be considered ':visible' even if it's
 actually hidden by the parent.

I bet it's probably hidden the parent and I'm checking a child.
Thanks Ricardo :)


[jQuery] Re: Display a div if and id is found

2008-10-17 Thread MorningZ

if (document.getElementById(FirstDiv)) { $(#SecondDiv).hide(); }



On Oct 17, 1:47 pm, Taylor [EMAIL PROTECTED] wrote:
 Is there a simple way with jQuery to find a div with a specific id,
 and display a different div if the id is found?  I know this may not
 be the best way to accomplish something, but I am trying to avoid
 rewriting a shopping cart plugin.


[jQuery] Re: how to detect current toggle setting?

2008-10-17 Thread Jay

 I didn't mean to be rude, it's just a tip.

 It is there on the docs page under 'Visibility Filters:', right after
 the left sidebar content ends.

 Invisible elements are the ones that have display:none or inputs of
 type 'hidden'.

 As Josh pointed out, you can use is() to check an existing object for
 the property, I thought you would figure that out (http://
 docs.jquery.com/Traversing). I did some testing and it works for both
 toggle() and slideToggle(); when the element slides up it ends with
 display:none too. Make sure you are referencing the right object, a
 child of a hidden element will be considered ':visible' even if it's
 actually hidden by the parent.

It's a timing issue. I incorrectly assumed slideToggle() completed the
animation before it returns.
If you immediately test the state of a control after toggling it you
get the wrong answer since it
hasn't finished sliding it closed yet.


Thanks for the help everyone


[jQuery] Adding a double click event to a form element

2008-10-17 Thread Devin

Hi,
I'm new at this and I wasn't able to find what I was looking for by
searching.

On my form there is a few fields that will be populated when the page
is loaded.  These are fields that would rarely - if ever - be
changed.  So I want the user to have to double click the field to
enable it.  Thus ensuring that the fields aren't unintentionally
modified.

Any help appreciated!

D


[jQuery] Re: dot separated id

2008-10-17 Thread Jeffrey Kretz

It's not useful to claim that the specs are faulty.  Until they change, dots
in IDs are legal and valid.

JK

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of ricardobeat
Sent: Friday, October 17, 2008 10:21 AM
To: jQuery (English)
Subject: [jQuery] Re: dot separated id


Yeah, that's a fault in the specs. XHTML specs also allow dots in IDs:

'only strings matching the pattern [A-Za-z][A-Za-z0-9:_.-]* should be
used.'  - http://www.w3.org/TR/xhtml1/#C_8

But that causes problems for CSS too:

div id=tom class=cat
div id=tom.cat

#tom.cat { which one are you referring to? }

- ricardo

On Oct 16, 7:41 pm, Mauricio \(Maujor\) Samy Silva
[EMAIL PROTECTED] wrote:
 Specs at  link pointed out says:
  ID and NAME tokens must begin with a letter ([A-Za-z]) and may be
followed
 by any number of letters, digits ([0-9]), hyphens (-), underscores
(_),
 colons (:), and periods (.).

 Aren't dots and periods the same?



-

 double backslashes are the short term fix, but remember for the long
 term that dots are illegal in ID's and will cause your page to not
 validate.

 seehttp://www.w3.org/TR/html401/types.html#type-namefor reference.

 -micah



[jQuery] Suspending Requests in JSUGGEST

2008-10-17 Thread aimhier

I am using JSuggest for autocompleting fields. Now if I go on typing
the characters in the field, for every character that i type a request
is made. Thus, a new request is made before the old one is serviced.
Can anything be done such that all the old requests are suspended and
only the new request stays when there is an request.


[jQuery] Re: dot separated id

2008-10-17 Thread chris thatcher
I agree that a spec is a spec.  The problem is rigidly adhering to it will
break to rest of the specs that work along side the html specs to produce
the intended result in the presentation layer.  I too had to change the way
I assigned id's to accommodate css and js that used css selectors.  If
anyone wants to use periods, they should feel free, but I doubt the css and
javascript communities will feel obligated to accommodate them.  No offense
meant whatsoever, I had the same issue.

On Fri, Oct 17, 2008 at 2:55 PM, Jeffrey Kretz [EMAIL PROTECTED]wrote:


 It's not useful to claim that the specs are faulty.  Until they change,
 dots
 in IDs are legal and valid.

 JK

 -Original Message-
 From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of ricardobeat
 Sent: Friday, October 17, 2008 10:21 AM
 To: jQuery (English)
 Subject: [jQuery] Re: dot separated id


 Yeah, that's a fault in the specs. XHTML specs also allow dots in IDs:

 'only strings matching the pattern [A-Za-z][A-Za-z0-9:_.-]* should be
 used.'  - http://www.w3.org/TR/xhtml1/#C_8

 But that causes problems for CSS too:

 div id=tom class=cat
 div id=tom.cat

 #tom.cat { which one are you referring to? }

 - ricardo

 On Oct 16, 7:41 pm, Mauricio \(Maujor\) Samy Silva
 [EMAIL PROTECTED] wrote:
  Specs at  link pointed out says:
   ID and NAME tokens must begin with a letter ([A-Za-z]) and may be
 followed
  by any number of letters, digits ([0-9]), hyphens (-), underscores
 (_),
  colons (:), and periods (.).
 
  Aren't dots and periods the same?
 
 

 
 -
 
  double backslashes are the short term fix, but remember for the long
  term that dots are illegal in ID's and will cause your page to not
  validate.
 
  seehttp://www.w3.org/TR/html401/types.html#type-namefor reference.
 
  -micah




-- 
Christopher Thatcher


[jQuery] Re: dot separated id

2008-10-17 Thread Dave Methvin

 It's not useful to claim that the specs are faulty.  Until they change, dots
 in IDs are legal and valid.

Re-read Ricardo's answer. You are free to use dots in your ids if you
want. He is saying that by permitting a dot in an id string, the specs
allow a confusing ambiguity that has to be resolved somehow. The W3C
says this:

http://www.w3.org/TR/CSS21/selector.html
A CSS ID selector contains a # immediately followed by the ID
value, which must be an identifier

http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
In CSS, identifiers  (including element names, classes, and IDs in
selectors) can contain only the characters [a-z0-9] and ISO 10646
characters U+00A1 and higher, plus the hyphen (-) and the underscore
(_); they cannot start with a digit, or a hyphen followed by a digit.
Identifiers can also contain escaped characters and any ISO 10646
character as a numeric code (see next item). For instance, the
identifier BW? may be written as B\W\? or B\26 W\3F.

Notice that CSS allows you to escape characters that are not valid in
an identifier, such as the period. Similarly, as Ricardo points out,
jQuery allows you to resolve the problem:

$(tom.cat)  selects div id=tom class=cat

$(tom\\.cat) selects div id=tom.cat





[jQuery] Re: dot separated id

2008-10-17 Thread Dave Methvin

 $(tom.cat)  selects div id=tom class=cat

 $(#tom.cat)  selects div id=tom class=cat

 $(tom\\.cat) selects div id=tom.cat

$(#tom\\.cat) selects div id=tom.cat


[jQuery] Re: Adding a double click event to a form element

2008-10-17 Thread aimhier

You can do this-
Set the field to readOnly by setting value of readOnly=true
Then, bind action of $(#field).dbclick(function(){ set readOnly to
false }); and then change it.
See if your purpose is met.


[jQuery] Re: Display a div if and id is found

2008-10-17 Thread Mauricio (Maujor) Samy Silva


Another approach:
if ( $('#FirstDiv').length  0 ) { $('#SecondDiv').show(); }
--
De: MorningZ [EMAIL PROTECTED]
if (document.getElementById(FirstDiv)) { $(#SecondDiv).hide(); }
--

On Oct 17, 1:47 pm, Taylor [EMAIL PROTECTED] wrote:

Is there a simple way with jQuery to find a div with a specific id,
and display a different div if the id is found? 


[jQuery] Re: dot separated id

2008-10-17 Thread Jeffrey Kretz

Ah, I actually confused Micah's and Ricardo's answers.

Micah was claiming dots are illegal in IDs, referencing the w3 spec, which
Ricardo then pointed out as faulty.

Personally I don't use anything but \w in IDs, but I felt it was important
to point out using a dot in the ID does not make illegal markup.

JK

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Dave Methvin
Sent: Friday, October 17, 2008 12:54 PM
To: jQuery (English)
Subject: [jQuery] Re: dot separated id


 It's not useful to claim that the specs are faulty.  Until they change,
dots
 in IDs are legal and valid.

Re-read Ricardo's answer. You are free to use dots in your ids if you
want. He is saying that by permitting a dot in an id string, the specs
allow a confusing ambiguity that has to be resolved somehow. The W3C
says this:



[jQuery] History Plugin

2008-10-17 Thread Pedram

Dear Folks ,
I need to make my webpages bookMarkable and do remember some history .
does any one has a link for us ..
thanks .



[jQuery] Re: event.preventDefault() seems to fail

2008-10-17 Thread Choan Gálvez


On Oct 17, 2008, at 7:37 PM, ricardobeat wrote:



It should work... but in jQuery 'return false' is the standard cross-
browser way of preventing the default action anyway,


Not exactly.

- `preventDefault()` **is** the cross-browser way of preventing the  
default action.


- `return false` prevents the default action and stops the event  
propagation.





On Oct 16, 11:16 pm, Hullah [EMAIL PROTECTED] wrote:

I have a page with input textboxes and input buttons on it.  All are
contained in a form.  I don't want the Enter button to submit the
form, so I call preventDefault() on all texboxes.  I also don't want
the input button to submit the form, so I call preventDefault() on  
the

input button.

But, if I call the button.click() event for when Enter is pressed  
in a

textbox (to simulate a click on the button) it submits the form.  It
seems as if something is not working like it should.

Now...if I return false instead of preventDefault(), it works as I
would expect.  But I would have thought that the purpose of
preventDefault() is to cancel the default action of the event, as in
this case to cancel form submission.

Any help with this is greatly appreciated!  Following is some sample
code that exhibts the behavoir.

Thanks,
Hullah

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
  http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml;
head
titleTest/title
script language=javascript type=text/javascript
src=jquery-1.2.6.js/script
script language=javascript type=text/javascript
  $(function() {
$(:text).keypress(function(e) {
  if (e.which == 13) {
e.preventDefault();
  }
});
$(#txt).keypress(function(e) {
  if (e.which == 13) {
$(#btn).click();
  }
});
$(#btn).click(function(e) {
  e.preventDefault();
  alert(Button clicked);
});
  });
/script
/head
body
  form method=post action=test.html
div
  input id=txt type=text /
  input id=btn type=submit value=Submit /
/div
  /form
/body
/html




[jQuery] Re: Autocomplete result sorting help

2008-10-17 Thread Alex

I've got some php available, but I wasn't really planning on fiddling
with it. There's just a cgimail that is being submitted to. Any other
ideas?

On Oct 16, 3:54 pm, MorningZ [EMAIL PROTECTED] wrote:
 I don't know what you use for the server-side code, but it looks like
 that would be a lot easier on that side. i don't see any events
 you can over ride in the autocomplete plugin where you actually over
 ride how it matches and what it looks at (for instance:  matches the
 abbrevation or the name starts with)

 but i've never used local data, so i couldn't say for sure


[jQuery] Re: event.preventDefault() seems to fail

2008-10-17 Thread Hullah

I would think preventDefault() is the right way to do it too.

So, given that this isn't working like I would have thought it should,
did I code this incorrectly? Or is this something more serious like a
bug?

On Oct 17, 4:36 pm, Choan Gálvez [EMAIL PROTECTED] wrote:
 On Oct 17, 2008, at 7:37 PM, ricardobeat wrote:



  It should work... but in jQuery 'return false' is the standard cross-
  browser way of preventing the default action anyway,

 Not exactly.

 - `preventDefault()` **is** the cross-browser way of preventing the  
 default action.

 - `return false` prevents the default action and stops the event  
 propagation.



  On Oct 16, 11:16 pm, Hullah [EMAIL PROTECTED] wrote:
  I have a page with input textboxes and input buttons on it.  All are
  contained in a form.  I don't want the Enter button to submit the
  form, so I call preventDefault() on all texboxes.  I also don't want
  the input button to submit the form, so I call preventDefault() on  
  the
  input button.

  But, if I call the button.click() event for when Enter is pressed  
  in a
  textbox (to simulate a click on the button) it submits the form.  It
  seems as if something is not working like it should.

  Now...if I return false instead of preventDefault(), it works as I
  would expect.  But I would have thought that the purpose of
  preventDefault() is to cancel the default action of the event, as in
  this case to cancel form submission.

  Any help with this is greatly appreciated!  Following is some sample
  code that exhibts the behavoir.

  Thanks,
  Hullah

  !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
  html xmlns=http://www.w3.org/1999/xhtml;
      head
          titleTest/title
          script language=javascript type=text/javascript
  src=jquery-1.2.6.js/script
          script language=javascript type=text/javascript
            $(function() {
              $(:text).keypress(function(e) {
                if (e.which == 13) {
                  e.preventDefault();
                }
              });
              $(#txt).keypress(function(e) {
                if (e.which == 13) {
                  $(#btn).click();
                }
              });
              $(#btn).click(function(e) {
                e.preventDefault();
                alert(Button clicked);
              });
            });
          /script
      /head
      body
        form method=post action=test.html
          div
            input id=txt type=text /
            input id=btn type=submit value=Submit /
          /div
        /form
      /body
  /html




[jQuery] Re: dynamically generated form

2008-10-17 Thread TimW66

You could always set the ID of the cloned row:

$rowToInsert = $parentRow.clone(true);
newId = $parentRow.attr('id') + '_cloned';
$rowtoInsert.attr('id', newId);


On Oct 16, 5:51 pm, Felix [EMAIL PROTECTED] wrote:
 I have a form that allows user to add and delete rows as they desire,
 I tried to use the clone function but the problem is the clone give
 the same id as the previous row and causes trouble duirng form
 submission.
 Also, one of the column have input that is a JQuery datepicker, I am
 wondering if the action is going to be preserved?

 Thanks,

 Felix


[jQuery] Re: dot separated id

2008-10-17 Thread ricardobeat

Hmm, I didn't know CSS allowed escaping characters. This works on
firefox:

#tom.cat { selects id=tom class=cat }
#tom\.cat { selects id=tom.cat }

Anyway, i find that confusing. Add the fact that things like ▒☃╋☎★☄☂
are valid IDs/class names, put some dots in the middle, and then
you've got a huge mess. Except that it's fun :D

- ricardo

On Oct 17, 4:54 pm, Dave Methvin [EMAIL PROTECTED] wrote:
  It's not useful to claim that the specs are faulty.  Until they change, dots
  in IDs are legal and valid.

 Re-read Ricardo's answer. You are free to use dots in your ids if you
 want. He is saying that by permitting a dot in an id string, the specs
 allow a confusing ambiguity that has to be resolved somehow. The W3C
 says this:

 http://www.w3.org/TR/CSS21/selector.html
 A CSS ID selector contains a # immediately followed by the ID
 value, which must be an identifier

 http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
 In CSS, identifiers  (including element names, classes, and IDs in
 selectors) can contain only the characters [a-z0-9] and ISO 10646
 characters U+00A1 and higher, plus the hyphen (-) and the underscore
 (_); they cannot start with a digit, or a hyphen followed by a digit.
 Identifiers can also contain escaped characters and any ISO 10646
 character as a numeric code (see next item). For instance, the
 identifier BW? may be written as B\W\? or B\26 W\3F.

 Notice that CSS allows you to escape characters that are not valid in
 an identifier, such as the period. Similarly, as Ricardo points out,
 jQuery allows you to resolve the problem:

 $(tom.cat)  selects div id=tom class=cat

 $(tom\\.cat) selects div id=tom.cat


[jQuery] Re: Display a div if and id is found

2008-10-17 Thread Taylor

Thank you.  They both worked great.

On Oct 17, 3:09 pm, Mauricio \(Maujor\) Samy Silva
[EMAIL PROTECTED] wrote:
 Another approach:
 if ( $('#FirstDiv').length  0 ) { $('#SecondDiv').show(); }
 --
 De: MorningZ [EMAIL PROTECTED]
 if (document.getElementById(FirstDiv)) { $(#SecondDiv).hide(); }
 --

 On Oct 17, 1:47 pm, Taylor [EMAIL PROTECTED] wrote:

  Is there a simple way with jQuery to find a div with a specific id,
  and display a different div if the id is found?


[jQuery] Re: Display a div if and id is found

2008-10-17 Thread Ryura

Actually, you don't need the  0 part. 0 evaluates to false anyway, so
just if($(#whatev).length) works fine

On Oct 17, 4:09 pm, Mauricio \(Maujor\) Samy Silva
[EMAIL PROTECTED] wrote:
 Another approach:
 if ( $('#FirstDiv').length  0 ) { $('#SecondDiv').show(); }
 --
 De: MorningZ [EMAIL PROTECTED]
 if (document.getElementById(FirstDiv)) { $(#SecondDiv).hide(); }
 --

 On Oct 17, 1:47 pm, Taylor [EMAIL PROTECTED] wrote:

  Is there a simple way with jQuery to find a div with a specific id,
  and display a different div if the id is found


[jQuery] autocomplete - custom pagination + jquery UI autocomplete charade

2008-10-17 Thread wahyudinata

caveat: this is actually my second post, the first one I forgot to put
autocomplete at the title that might result in the author not being
able to find it.

Hi,
I am trying to add a pagination capability to my autocomplete

I am having trouble when I click the pagination link that I
dynamically added , the steps that I do are:
setData {page:next_page}  - flushCache and then trigger a search
event, but the setData is not setting the extraParams. As in, it's not
sending the page.

help?
this is my autocomplete call:

 $('input [type=text]'). autocomplete(
{
url:'/ajax/search',
cacheLength:30,
width:380,
formatItem:function(results,index,total)
   {
   var zebra=true;
   results=eval('('+results+')');

   if (results.length=0)
   {
   $('#ac_extra_menu').hide();
   return 'li found nothing/li';
   }

   if (!$('#ac_extra_menu').length)//if we
dont find the extra menu for pagination then add it
   {
   $('div.ui-autocomplete-
results').prepend(
'div id=ac_extra_menu'+
'Showing span
id=ac_current_page/span of span id=ac_total_result/span'+
'a href=#
id=ac_paginate_leftimg src=/assets/img/header/arw_kr.png //
a'+
'a href=#
id=ac_paginate_right img src=/assets/img/header/arw_kn.png / /
a'+
'/div'
   );
   $('#ac_paginate_left').click(
function()
{
//paginate left
}
   );
   $('#ac_paginate_right').click(
function()
{
$('#search_box
input[type=text]')

.autocomplete('setData',
{page:2}).
autocomplete('flushCache')

 
.autocomplete('search');

return false;
}
   );
   hack_to_style_ac=true;
   }

   list_of_elements='';
   for (var i=0;iresults.length;i++)
   {
zebra=!zebra;
   list_of_elements+='li class='+
(zebra?'zebra':'')+'a onclick=window.location=$(this).attr(\'href
\'); href=/map/index/'+results[i]['location_x']+
  '/'+results[i]
['location_y']+'img src=/assets/img/header/thumb_'
  +
(Math.floor(Math.random()*2))+'.png /'
  +cut_text(results[i]
['name'])+ ' - of - '
  +results[i]
['username']+'/a/li';
   }
   $('#ac_total_result').text(results.length);
   return list_of_elements;

   }

}
);


[jQuery] Re: Display a div if and id is found

2008-10-17 Thread Klaus Hartl

Here's another trick to accomplish it:

$('#first, #second').eq(1).show();


--Klaus


On 18 Okt., 00:00, Ryura [EMAIL PROTECTED] wrote:
 Actually, you don't need the  0 part. 0 evaluates to false anyway, so
 just if($(#whatev).length) works fine

 On Oct 17, 4:09 pm, Mauricio \(Maujor\) Samy Silva

 [EMAIL PROTECTED] wrote:
  Another approach:
  if ( $('#FirstDiv').length  0 ) { $('#SecondDiv').show(); }
  --
  De: MorningZ [EMAIL PROTECTED]
  if (document.getElementById(FirstDiv)) { $(#SecondDiv).hide(); }
  --

  On Oct 17, 1:47 pm, Taylor [EMAIL PROTECTED] wrote:

   Is there a simple way with jQuery to find a div with a specific id,
   and display a different div if the id is found


[jQuery] Re: Question: Using Autocomplete to pass the fields name to query URL

2008-10-17 Thread The Hamburgler

Excellent,
Both solutions worked great!

Thanks a lot for your help

On Oct 16, 3:26 pm, adexcube [EMAIL PROTECTED] wrote:
 Hi, have you tried something like this?

 $(input:text).focus( function() { alert($
 (this).attr(name)); } ).autocomplete(server.php, {
                        extraParams: {
                        fieldname: function() { return $(this).attr(name); }
                         }
                 });

 I hope this helps

 Cheers

 On Oct 16, 1:59 pm, The Hamburgler [EMAIL PROTECTED] wrote:

  Hi,

  I wish topassan extra parameter to theAutocompletequeryURLthat
  will determine thenameof the current input field. TheURLwill then
  know what field is requesting the data and can return the relevant
  data.
  E.g. It could be list of countries or a group of surnames already in
  the database.

  I have read the documentation and thought the extraParams option would
  do this but i'm struggling with the correct syntax.

  The example below willpassan undefined value for 'fieldname' as $
  (this) is out of scope within the extraParams function. Is there a way
  I can access the inputs fieldnamedynamically so i don't have to bind
  theautocompletefunction to each individual input?

  $(.autocomlete).autocomplete(url, {
     extraParams: {
         fieldname: function() { return $(this).attr(name); }
     }

  });

 http://docs.jquery.com/Plugins/Autocomplete

  Thanks for your time.


[jQuery] Re: event.preventDefault() seems to fail

2008-10-17 Thread Choan Gálvez


On Oct 17, 2008, at 11:22 PM, Hullah wrote:



I would think preventDefault() is the right way to do it too.

So, given that this isn't working like I would have thought it should,
did I code this incorrectly? Or is this something more serious like a
bug?


While I don't fully understand what you want to do, I suspect that  
what you need is the `triggerHandler` method. See http://docs.jquery.com/Events/triggerHandler 
.


Or... submit the form instead of clicking the button.






On Oct 17, 4:36 pm, Choan Gálvez [EMAIL PROTECTED] wrote:

On Oct 17, 2008, at 7:37 PM, ricardobeat wrote:



It should work... but in jQuery 'return false' is the standard  
cross-

browser way of preventing the default action anyway,


Not exactly.

- `preventDefault()` **is** the cross-browser way of preventing the
default action.

- `return false` prevents the default action and stops the event
propagation.




On Oct 16, 11:16 pm, Hullah [EMAIL PROTECTED] wrote:
I have a page with input textboxes and input buttons on it.  All  
are

contained in a form.  I don't want the Enter button to submit the
form, so I call preventDefault() on all texboxes.  I also don't  
want

the input button to submit the form, so I call preventDefault() on
the
input button.



But, if I call the button.click() event for when Enter is pressed
in a
textbox (to simulate a click on the button) it submits the form.   
It

seems as if something is not working like it should.


Now...if I return false instead of preventDefault(), it works  
as I

would expect.  But I would have thought that the purpose of
preventDefault() is to cancel the default action of the event, as  
in

this case to cancel form submission.


Any help with this is greatly appreciated!  Following is some  
sample

code that exhibts the behavoir.



Thanks,
Hullah



!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
  http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml;
head
titleTest/title
script language=javascript type=text/javascript
src=jquery-1.2.6.js/script
script language=javascript type=text/javascript
  $(function() {
$(:text).keypress(function(e) {
  if (e.which == 13) {
e.preventDefault();
  }
});
$(#txt).keypress(function(e) {
  if (e.which == 13) {
$(#btn).click();
  }
});
$(#btn).click(function(e) {
  e.preventDefault();
  alert(Button clicked);
});
  });
/script
/head
body
  form method=post action=test.html
div
  input id=txt type=text /
  input id=btn type=submit value=Submit /
/div
  /form
/body
/html







[jQuery] JQuery $ function

2008-10-17 Thread blasto333

How does this work...(This actually does what I want it to, but I am
amazed that JQuery can figure out how to select from an array)

function get_selected_rows()
{
var selected_rows = new Array();

$(#sortable_table tbody :checkbox:checked).each(function()
{
selected_rows.push($(this).parent().parent());
});

return selected_rows;
}

$(get_selected_rows()).parent().parent().remove();




[jQuery] few improvements for autocomplete widget

2008-10-17 Thread alex bodnaru
hello friends,

i took autocomplete to make some ajax field choices from a database poered site.

it works great, but i had the pleasure to add a small contribution too.

1. the ability to send additional fields data in the ajax call could
of course be achieved with extraParams option. but i needed it for
multiple fields, and to add multiple other fields to each ajax call.
hence i made an additional list[] option, extraFields, that will add a
key-value pair for each field in the list. if the field name is
preceeded by an '#', this will be considered the id of the field (but
the '#' will be stripped on the ajax url). otherwise, the field will
be searched in the same form with our input, by it's name.

2. after i used the alt-shift keys combination to switch the keyboard
mapping before inputing data to a field, the autocomplete process
wouldn't start when minchars (=1) was reached. with a little
debugging, i found 2 key events are being sent in sequence, 18 and 0.i
have disabled changes check on 18, but also 16 and 17: control, alt
and shift keys.

3. probably out of ignorance, i have refocused the input after user
selects from the list with return. if the user selects using the
keyboard, s?he may certainly wish to use the keyboard and tab to the
next field, while bluring it moves, in firefox, the focus to the form,
so that pressing tab will move focus to the first field.
in case that's a terrible mistake on my part, do you have any better
idea? i would certainly add an option to move focus to the next field
after selecting completion, whether by return or by click.

4. for the case the user programmer would select jquery compatible
mode, where jQuery() won't be aliased by $(), autocomplete would fail,
since it still calls jQuery() by $(). as a disciplined programmer, i'd
definitely change that.

jquery.autocomplete.ja is naturally attached. please diff to see my changes.

best regards,
alex


jquery.autocomplete.js
Description: JavaScript source


[jQuery] Remove JS if statement from other script

2008-10-17 Thread hubbs

How possible is it to remove ONLY part of a script, specifically an if
statement from another script?  We have a script that is in the header
of our document, and it screws up a few of our pages, so I don't want
to delete it, since it is needed for some pages, but for specific
pages, I would like it to not execute the if statement.

Is this possible?


[jQuery] Re: History Plugin

2008-10-17 Thread Rey Bango


You have a couple of options available:

http://stilbuero.de/jquery/history/
http://plugins.jquery.com/project/jHistory

One suggestion to help you out in the future is to be sure to check out 
the plugin repo. It has a ton of extensions for many different use cases.


http://plugins.jquery.com/

Rey


Pedram wrote:

Dear Folks ,
I need to make my webpages bookMarkable and do remember some history .
does any one has a link for us ..
thanks .




[jQuery] Re: event.preventDefault() seems to fail

2008-10-17 Thread Hullah

Hmm...it looks like triggerHandler() is what I want.  Because my goal
is to not submit the form, which was the reason I was calling
event.preventDefault() inside the click event.

I just thought it was confusing because in the click even of the
button I was trying to prevent the default action of submitting the
form by calling preventDefault, yet the form was still submitting.

Thanks for pointing out triggerHandler.

On Oct 17, 8:24 pm, Choan Gálvez [EMAIL PROTECTED] wrote:
 While I don't fully understand what you want to do, I suspect that  
 what you need is the `triggerHandler` method. See 
 http://docs.jquery.com/Events/triggerHandler
  .

 Or... submit the form instead of clicking the button.


[jQuery] Re: Remove JS if statement from other script

2008-10-17 Thread closure octopus


Of course it is. You'll have to follow the logic of the script and
edit it accordingly, that's really all that can be suggested.

Add a condition to the if that detects the pages you want to run/not
run it on.

like, if it's currently

if(cow37){page.screwup();}

change it to

if (cow37||document.getElementById('frab_div')){page.screwup('wont be
screwed up since it only runs on pages that have frabdiv);}