[jQuery] Re: JCarouselLite - pause scrolling

2009-09-07 Thread Jonathan Vanherpe (T T NV)


Steffan A. Cline wrote:

on 8/28/09 5:37 PM, Steffan Cline at stef...@hldns.com wrote:


I have a carousel that auto scrolls images. I was asked if there is a way to
make it so that if you mouse over the carousel, it stops and when you mouse
out, it starts up again.

Is this possible?



Anyone?



Thanks

Steffan



The plain jcarousel has this option:
http://sorgalla.com/projects/jcarousel/examples/static_auto.html

Jonathan
--
Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be


[jQuery] Re: TableSorter and colspans

2009-09-07 Thread Christian Bach
Hi Mike.

Tablesorter used to support colspan until i found a bug in the
checkCellColSpan function. I quick fixed it by removing the function called
and forgot to update the docs.

I have a new implementation on the way.

Regards
Christian

2009/9/5 Mike Alsup mal...@gmail.com


  Ive used the tablesorter alot in my projects, and Ive had the need for
  this as well.
  I found a DataTables plugin which looks like it can do colspans, but I
  havent tried it.
  I actually looked after reading your post to see if it supported the
  colspans now, as earlier versions didnt and I see it looks like it
  does.


 I figured out how to get this working in my project via TableSorter's
 textExtraction option.  Would like to understand why the docs claim to
 support this however.




-- 
Christian Bach

Polyester*
Wittstocksgatan 2nb
11524 Stockholm, Sweden
+46 70 443 91 90


[jQuery] autocomplete accents

2009-09-07 Thread sebastien creme

Hello, i'm trying to use automplete plugin and deal with accents in
data and in search.

The main problem is how to display 'déb...' or 'dèb...' when user
inputs 'deb'.

I have started to modify autocomplete code in order to make this
happen.
The main parts are in matchSubset and highlight method.

Do you think that an option like matchAccents could be a valuated
addition to autocomplete ?

cheers

sebastien


[jQuery] Re: autocomplete accents

2009-09-07 Thread alexbodn . groups

maybe the matching could be done in a callback function?

On Mon, Sep 7, 2009 at 12:15, sebastien cremesebastien.cr...@gmail.com wrote:


Hello, i'm trying to use automplete plugin and deal with accents in
data and in search.

The main problem is how to display 'déb...' or 'dèb...' when user
inputs 'deb'.

I have started to modify autocomplete code in order to make this
happen.
The main parts are in matchSubset and highlight method.

Do you think that an option like matchAccents could be a valuated
addition to autocomplete ?

cheers

sebastien




--
alex



smime.p7s
Description: S/MIME Cryptographic Signature


[jQuery] validation for multiple element in a form is not working with the new jQuery validation plug in

2009-09-07 Thread Mr J

hi all,
before upgrading to the new jQuery i have the function below working
just fine. it validate according to the id sent to the fucntion. last
week i upgraded to the new jQuery which force me to use also the new
jQuery validation and from that date the function is not working good.
it validate just the first case but not the second one. if i commented
the first part then the second part is validated and the third part
not.
i do not know what is changed in the new jQuery validation or how to
fix it.
i debug it and it is goign into the case but not validating the id's.
the case 1 and 2 are working but the 3 and the 4 not.

any help will be very very appriciated.
here is the code:

function showStep(intStep, intValidate){

 var blnValidated = false;
if(intValidate!=0) {
blnValidated = validateStep(intValidate);
}
else {
blnValidated = true;
}
if(blnValidated) {
for (i=1; i6; i++)
{
jQuery('#step'+ i).hide();
}
jQuery('#step'+intStep).show();
}
}

function validateStep(step)
{
var blnValid = true;
switch(step)
{
case 1:
blnValid = jQuery(#TandartsenGroepKind).validate({
focusCleanup: true,
onkeyup: false,
rules: {
Voorletters:{ required: true },
Naam:{ required: true, Alpha: true },
Straat:{ required: true },
Postcode:{ required: true, Postcode: 
true },
Woonplaats:{ required: true, Alpha: 
true},
Geboortedatum:{ required: true, date1: 
true},
Geslacht:{ required: true},
HuisTelefoonnummer:{ required: true},
A1 : { required: true},
A3 : { required: true},
Verzekerd:{ required: true}
},
messages:{
Voorletters:{ required: nbsp; },
Naam:{ required: nbsp; , Alpha: 
nbsp;},
Straat:{ required: nbsp;},
Postcode:{ required: nbsp;, 
Postcode: nbsp;},
Woonplaats:{ required: nbsp; , 
Alpha: nbsp;},
Geboortedatum:{ required: nbsp;, 
date1: nbsp;},
Geslacht:{ required: nbsp;},
HuisTelefoonnummer:{ required: 
nbsp;},
A1 : { required: nbsp;},
A3 : { required: nbsp;},
Verzekerd:{ required: nbsp;}
},
success: function(label) {
label.html(nbsp;).addClass(checked);
}
}).form();
break;
case 2:
blnValid = jQuery(#TandartsenGroepKind).validate({
focusCleanup: true,
onkeyup: false,
rules: {
VVoorletters:{ required: true },
VNaam:{ required: true, Alpha: true },
VStraat:{ required: true },
VPostcode:{ required: true, Postcode: 
true },
VWoonplaats:{ required: true, Alpha: 
true},
VGeboortedatum:{ required: true, date1: 
true},
VGeslacht:{ required: true},
VHuisTelefoonnummer:{ required: true},
VVerzekerd:{ required: true}
},
messages:{
VVoorletters:{ required: nbsp; },
VNaam:{ required: nbsp; , Alpha: 
nbsp;},
VStraat:{ required: nbsp;},
VPostcode:{ required: nbsp;, 
Postcode: nbsp;},
VWoonplaats:{ required: nbsp; , 
Alpha: nbsp;},
VGeboortedatum:{ required: nbsp;, 
date1: nbsp;},

[jQuery] Re: Maybe Jquery ? Bug with firefox 3.5

2009-09-07 Thread Pierre Bellan
Hello,

I'll restart this subject because our problem still exists.

Deactivate the jquery solve the problem, so we think that's maybe a link
between the javascripts we have in our website.

In the following page : http://www.lequipe.fr/Experts/index.html, we can
trigger the rerender event by change the content of a div via the link on
LES DERNIERS POST
LES + COMMENTES

We find that if we remove the javascript's code of googlesyndication , the
rerender dissapears.
But in the Home page, the same procedure doesn't had the same result and we
had to remove another block that contain a document.write('iframe ');.
So we think the problem is the dynamic generation of iframes.

But, this method is used by a lot of advertisers and we can't force them to
work in our way.

I find it very strange that nobody have the same problem, but if some of you
can confirm that the iframe may be the source of the problem, we can move
forward.
Pierre

2009/8/19 Pierre Bellan fcy...@gmail.com

 Hi all,

 I don't know if it's a bug in jquery but some of you can have encounter the
 same problem with their website.

 Recently, we had changed our website ( http://www.lequipe.fr ) using the
 jquery 1.3.2 version.

 With the last version of Firefox ( 3.5.2 ), the site is render twice during
 the loading.
 We can't isolate which element can produce this problem and it happens only
 with the firefox 3.5 ( not in 3.7pre or 3.0.12, not in ie, etc... )
 We load some js from external source ( facebook, googlesyndication, etc...
 )

 If someone would have a clue on this problem, i would appreciate him.

 Thanks

 Pierre



[jQuery] Re: Superfish I need some help please

2009-09-07 Thread terabyte

Hello,

you need to change a tag of sf-menu class:

form:

.sf-menu a {
display:block;
position:   relative;
}

to:

.sf-menu a {
display:block;
text-align:  right;
position:   relative;
}

On 6 Sep., 23:13, Bahman Zendesher zendes...@gmail.com wrote:
 Thanks a milon
 and how kan change teh direction forr all menu to RTl and the text align?
 wich codes must be changed ?
 Best regards
 Bahman Zendesher



 On Mon, Sep 7, 2009 at 12:28 AM, Charlie charlie...@gmail.com wrote:
   script will work either way without modification. CSS change left float to
  right. If need dropdowns to switch sides, change li.sfHover ul from left:0
  to right:0

  Gunash wrote:

  Hello
  I need to make this menu RTL can you please assist me wich files must
  be changed ?
  Best regard
  Bahman Zendesher.- Zitierten Text ausblenden -

 - Zitierten Text anzeigen -


[jQuery] Timers plugin and IE8 trouble

2009-09-07 Thread Petar

Hi all,

I'm using timers plugin (http://plugins.jquery.com/project/timers),
so far it worked great. But lately, I'm having trouble with IE8 which
doesn't trigger everyTime event. This is the code which causes
trouble:

$(function() {
  $('.sidebar').everyTime(1000, function() {
 $('.sidebar').load('getjobs.php');
  });
});

Firefox, IE7 and Chrome updates the sidebar div every second, but
IE8 does not. Any ideas?

Petar


[jQuery] Re: Autocomplete -- Autofill Comma Seperator Issues

2009-09-07 Thread Patrick Wolf

Hi,

have you tried to set the option selectFirst to false?

Regards
Patrick

On Sep 3, 8:15 am, Mil formboardem...@wdoenterprises.com wrote:
 Does anyone have any ideas for this issue?

 On Sep 1, 4:49 am, Mil formboardem...@wdoenterprises.com wrote:



  Hi,

  I am trying to use this 
  autocompletehttp://docs.jquery.com/Plugins/Autocomplete
  but I'm having some issues with it.  I'm trying to create a simple tag
  autocomplete feature.

  This is what I want to type (Example 1)
  TextArea: Cake, Ca, Caldren, Calimari,

  This is what I get (Example 2)
  TextArea: Cake, Cake, Caldren, Calimari,

  In Javascript, my var data = [Cake, Caldren, Calimari];

  As you can see, I cannot type Ca because the information will
 autofillto Cake every time I type acomma.  The only way I can
  avoid this is to do something very un-user friendly.  That is to type
  Ca then press space and then type mycomma.  That's the only way I
  can do it to make Example 1 work.

  This is my code:
  jQuery(#TagBox).autocomplete(data, {
                  multiple: true,
                  highlight: false,
                  multipleSeparator: , 
              });

  What am I doing wrong?


[jQuery] Use the validation outside the form.

2009-09-07 Thread Jozef A. Habdank

Hello Everybody,

this is my first post here - please forgive me any stupid questions.

My idea is to have a fully AJAX based form that will validate the
input, then via AJAX post it, and accordingly to the AJAX response
display some messages (no full postback). I have no problem with the
AJAX itself, the only issue I face is that my 'form' is not actually a
form - it is a simple div with some textboxes (I am using Asp, and
using forms is not so easy here, sine you can not have nested forms).
Unfortunately the jQuery validation (http://docs.jquery.com/Plugins/
Validation) does not work for div. Is there any way to use jQuery
validation without having to use form tag?

Best regards,
Jozef A. Habdank

ps. awesome work done jQuery :)


[jQuery] Re: Clickable div?

2009-09-07 Thread ConstantMeiring

As far as I know the correct way of pointing to an a in a div is
through $('#divname a).click.. Not sure tho, but try it!

On Sep 4, 9:00 pm, lukas animod...@gmail.com wrote:
 Thank you everybody! I made it work by applying display:block and
 width/height to the a tag within the div.
 The confusion was created by IE treating the image-containing div
 differently than the rest of the crop. It tried everything that the
 next div would not jump below the logo div in IE. The
 display:block markup in IE is stronger than in all the other browsers
 unfortunately...


[jQuery] Re: Use the validation outside the form.

2009-09-07 Thread Jörn Zaefferer

Nope, you really need a form. Whats the problem with just using a form
element, at least nested within your div?

Jörn

On Mon, Sep 7, 2009 at 10:28 AM, Jozef A. Habdankjahabd...@gmail.com wrote:

 Hello Everybody,

 this is my first post here - please forgive me any stupid questions.

 My idea is to have a fully AJAX based form that will validate the
 input, then via AJAX post it, and accordingly to the AJAX response
 display some messages (no full postback). I have no problem with the
 AJAX itself, the only issue I face is that my 'form' is not actually a
 form - it is a simple div with some textboxes (I am using Asp, and
 using forms is not so easy here, sine you can not have nested forms).
 Unfortunately the jQuery validation (http://docs.jquery.com/Plugins/
 Validation) does not work for div. Is there any way to use jQuery
 validation without having to use form tag?

 Best regards,
 Jozef A. Habdank

 ps. awesome work done jQuery :)



[jQuery] Re: Clickable autocomplete, like google

2009-09-07 Thread Patrick Wolf

Ladksak,

try to set the option matchContains to true.

Regards
Patrick

On Sep 3, 5:59 pm, ladksak slingrs...@gmail.com wrote:
 the problem is that i need it to work with the script i posted the
 link

 thats because the UIAutocompleteis not as good...
 if i type ODE in the ui he doesn't show CODE

 i need it to ODE show CODE and ODESSA, like he could find the string
 in any part of the keywords and highlight that
 thats what the dyve script does
 thanks anyway man!


[jQuery] Re: AJAX-queries in Internet Explorer

2009-09-07 Thread nubcake

Heya!

The In IE I need to wait 5-6 seconds means that in IE I need to wait
5-6 seconds after I have made my first selection in the drop-down
menu, if I change too quick it doesn't send the query to query.php.
So pressing keyup/keydown in IE doesn't work unless I wait 5-6 seconds
on each 'selection', while in FF/Chrome I can jump between them as
fast as I like.

Removing the keyup-event didn't make any difference to the behavior in
IE.

On 3 Sep, 21:36, James james.gp@gmail.com wrote:
 Hmm.. It looks okay to me.
 Could you define In IE I need to wait 5-6 seconds a little more?
 Does that mean you have wait for the page to finish loading, then wait
 5-6 seconds, then do any drop-down selection?
 Or does it mean you do a drop-down selection, then wait 5-6 seconds
 (with a setTimeout or something) before the AJAX call?

 Also, what happens if you remove the 'keyup' event and try it? Just
 'change' should be sufficient, I think.

 On Sep 2, 10:45 pm, nubcake unniw...@gmail.com wrote:

  Hello!

  I've having troubles in Internet Explorer with AJAX-queries using
  jQuery.
  When I change 'option', located in the below code, in FF/Chrome the
  $.post is sent almost instantly.
  In IE I need to wait 5-6 seconds otherwise the $.post will not be sent
  to query.php.

  Is there any solution to this? I've experienced it in both IE7 and
  IE8.

  script type=text/javascript
  function shopQuery() {
    var countrycode = $(#shopcountry).val();
    if (countrycode !== ) {
      $.post(query.php, { queryString: +countrycode+ }, function
  (data) {
        $(#shopbrand).html(data);
        $(#shopbrand).show();
      });
    } else {
      $(#shopbrand).hide();
    }

  }

  $(document).ready(function(){
    $(#shopbrand).hide();

    $(#shopcountry).keyup(function() {
      shopQuery();
    });

    $(#shopcountry).change(function() {
      shopQuery();
    });

  });

  /script

    div class=container

      label for=shopcountry
        span class=labelCountry:/span
        select id=shopcountry name=shopcountry
          option value=Choose a country/option
          ?php
          while ($row = mysql_fetch_array($countries)) {
            echo option value=\.$row['countrycode'].\.$row
  ['country']./option\n;
          }
          ?
        /select
      /label

     div id=shopbrand style=border:1px solid black;
     /div

    /div

  Do you have any ideas what's going wrong?


[jQuery] Re: AJAX-queries in Internet Explorer

2009-09-07 Thread Ken
hi you ! i need use *focusNode *for jquery but i don't know it where and
what is it action ! pls ! help me


[jQuery] [jqGrid] Shift+End doesn't works in input field - .filterToolbar()

2009-09-07 Thread Massimiliano Marini

Hi all,

I can't select the text pressing the Shift+End keys and with the mouse
double-click or mouse selection in the input field after using
filterToolbar().

The problem appear only with IE8, any of you had the same problem and solved?

.navButtonAdd(#pager-1,{caption:Search,title:Search toolbar,
buttonicon :'ui-icon-search',
  onClickButton:function(){
gP[0].toggleToolbar();
   }
});
gP.filterToolbar();


PS: The online examples on trirand site works well.

-- 
Massimiliano Marini - http://www.linuxtime.it/massimilianomarini/
It's easier to invent the future than to predict it.  -- Alan Kay


[jQuery] .load is adding extra markup

2009-09-07 Thread Fluffica

Good afternoon all,

Please forgive me if this is a rookie error. (I'm a designer).

I have this bit of code  $(#pageArea).load(urlToLoad+ #pageArea);
which, for the most part, is doing what I'd expect it to. Swapping out
the #pageArea in the current page, for the #pageArea in another page.

However it's generously adding empty paragraph tags to the content
it's loading in, can't for the life of me work out why.

Chunk of code is, (I'm using the jQuery Address plug-in, by the way)

$('a').click(function() {
urlToLoad = $(this).attr(href);
$.address.value(urlToLoad);
// Animate #pageArea off the page
$(#pageArea).load(urlToLoad+ #pageArea);
// Animate #pageArea back into the page
return false
});

If anyone can help me figure out where these mystery empty paragraph
tags are coming from I'd be very very grateful.

Thanks,
Tom


[jQuery] Re: JCarouselLite - pause scrolling

2009-09-07 Thread Steffan A. Cline

on 9/6/09 11:54 PM, Jonathan Vanherpe (T  T NV) at jonat...@tnt.be wrote:

 
 Steffan A. Cline wrote:
 on 8/28/09 5:37 PM, Steffan Cline at stef...@hldns.com wrote:
 
 I have a carousel that auto scrolls images. I was asked if there is a way to
 make it so that if you mouse over the carousel, it stops and when you mouse
 out, it starts up again.
 
 Is this possible?
 
 
 Anyone?
 
 
 
 Thanks
 
 Steffan
 
 
 The plain jcarousel has this option:
 http://sorgalla.com/projects/jcarousel/examples/static_auto.html
 
 Jonathan
Thanks. I saw that option but I have already integrated the lite version :(
I hope the author of the lite version speaks up.


Thanks

Steffan

---
T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
Steffan A. Cline  
stef...@execuchoice.net Phoenix, Az
http://www.ExecuChoice.net  USA
AIM : SteffanC  ICQ : 57234309
YAHOO : Steffan_Cline   MSN : stef...@hldns.com
GOOGLE: Steffan.Cline Lasso Partner Alliance Member
---





[jQuery] Re: Using attr in an tab AJAX call. Is it possible?

2009-09-07 Thread Cesar Sanz


maybe you can ask it here http://groups.google.com/group/jquery-ui?hl=en

- Original Message - 
From: noahT nippon...@gmail.com

To: jQuery (English) jquery-en@googlegroups.com
Sent: Sunday, September 06, 2009 8:25 PM
Subject: [jQuery] Using attr in an tab AJAX call. Is it possible?




Hi, I am trying to set an html attribute after an AJAX call. Works
great on the initial tab I can't get it to work on the rest:

$('#content').tabs({

load: function(){
var postContainerHeight = $('#post_container').height() + 30;
$('#hellishpixel').attr({
height:postContainerHeight
});
}
});


[jQuery] Re: Remote Success message

2009-09-07 Thread Danny

This is of course the Validator Plugin, but someone must have some
insight into how to add this functionality? I've looked, it's not
there.


[jQuery] Loading external text in to a text area?

2009-09-07 Thread ximo wallas
Hello, I would like to know if I can load a small text from a external source 
into a textarea.
the external source is a php that will write some clean text depending on the 
vars received.
I know load() can do the job for a div but I don't think it will work for a 
textarea.



  

[jQuery] Re: Loading external text in to a text area?

2009-09-07 Thread Ken
You use the plugin *jquery.addSelector.js * download 
http://kenphan.info/clientscript/js/jquery.addSelector.js


2009/9/8 ximo wallas igguan...@yahoo.com

 Hello, I would like to know if I can load a small text from a external
 source into a textarea.
 the external source is a php that will write some clean text depending on
 the vars received.
 I know load() can do the job for a div but I don't think it will work for a
 textarea.




-- 
-- 
-
My blog site: http://kenphan.info
--


[jQuery] Re: Shift+End doesn't works in input field - .filterToolbar()

2009-09-07 Thread Tony

Hello,
The problem is fixed in 3.5.3 release, which is published yesterday.
Please upgrade to this release.
Best Regards
Tony

On Sep 7, 6:26 pm, Massimiliano Marini max.linuxt...@gmail.com
wrote:
 Hi all,

 I can't select the text pressing the Shift+End keys and with the mouse
 double-click or mouse selection in the input field after using
 filterToolbar().

 The problem appear only with IE8, any of you had the same problem and solved?

 .navButtonAdd(#pager-1,{caption:Search,title:Search toolbar,
 buttonicon :'ui-icon-search',
   onClickButton:function(){
     gP[0].toggleToolbar();
    }});

 gP.filterToolbar();

 PS: The online examples on trirand site works well.

 --
 Massimiliano Marini -http://www.linuxtime.it/massimilianomarini/
 It's easier to invent the future than to predict it.  -- Alan Kay


[jQuery] Re: Loading external text in to a text area?

2009-09-07 Thread Nic Hubbard

If you use $.ajax and the success option, you could do:

$('textarea'+html+'/textarea').appendTo('#yourDiv');

On Sep 7, 10:48 am, ximo wallas igguan...@yahoo.com wrote:
 Hello, I would like to know if I can load a small text from a external source 
 into a textarea.
 the external source is a php that will write some clean text depending on the 
 vars received.
 I know load() can do the job for a div but I don't think it will work for a 
 textarea.


[jQuery] Re: $.getScript()

2009-09-07 Thread Ross Hadden
Anyone? Please?

On Sat, Sep 5, 2009 at 6:14 PM, rosshadden rosshad...@gmail.com wrote:


 Is it a known issue that $.getScript() does not work in Chrome, or
 could I be doing something wrong?

 I am able to load scripts using this function in any browser, but in
 order for me to be able to use their contents in Chrome I need to put
 blocks of code in the callback of $.getScript.  While it makes sense
 that I would not be able to utilize a script's functions outside of
 its callback, why then does it work in both Firefox and IE?

 For me using the ol' script/ works without any issues, but I was
 trying to use $.getScript() in place of that for experimental
 purposes.  Is this the wrong application for the function?  Should I
 only use it if I need to load a script on the fly?

 Thanks,
 ~Ross




-- 
~Ross


[jQuery] improve/extend the selectors

2009-09-07 Thread jeanluca

Hi All

I need some help with the following:

Suppose I have the following object

var obj = new XYZ() ;

Now I want to do:

$(div, obj).each(function(){.}) ;

Now, of course, jquery will throw an error because it doesn't know
what to do with 'obj'. So I want to add/extend jquery, so it knows how
to treat 'obj'.  Can this be done ? Is there documentation explaining
how to do this ?

thnx a lot
LuCa


[jQuery] Re: Looking for more efficient code: String Matching

2009-09-07 Thread Michael Geary
Off the top of my head, I think I would do it like this:
$(document).ready( function() {
$('#edit-jump-goto option').each( function() {
var $option = $(this);
var indent = $option.text().match(/^-*/)[0].length;
if( indent )
$option.css( 'margin-left', indent * 5 );
else
$option.addClass( 'jumptop1' );
});
});

How this works:

The *.match(/^-*/)* matches all leading hyphens, even if there are none. It
returns an array of a single element, a string containing the matched
hyphens.

*[0]* of course gets that array element, and then we get its *.length* -
which tells us how many leading hyphens there are.

If that count is zero, we add the class, otherwise we multiply by 5 and set
the margin-left. You don't need the 'px' since jQuery will provide it for
you, or if you prefer you can include it in your code:

$option.css( 'margin-left', indent * 5 + 'px' );

Other minor changes: I took out the *select* in your *select#edit-jump-goto
option* selector. You don't need it and it may actually make the code a
little slower. (If you were using a class selector here instead of the id
selector, it would be a good idea to include the tagname.) Also I changed to
single quotes throughout, something I highly recommend because if you want
to include HTML strings in your JavaScript, the attributes in that HTML code
should use double quotes. By using single quotes consistently, you'll make
that easier.

-Mike

On Sun, Sep 6, 2009 at 1:48 PM, Mat matsh...@gmail.com wrote:


 Hi all,

 I have a site with a drop down select box which I am using as a jump
 menu. This select box contains a long list of product types (generated
 via php) and is structured like this

 books
 -cat1
 -cat2
 cards
 -cat1
 -cat2
 --subcat1
 toys
 -cat1
 --subcat1
 ---subsubcat1

 Because I don't want to hack around in PHP too much I am using JQuery
 to style the options in this select box to highlight the top level
 item and indent the subcategories. The further down the subcategory
 the more the indent. My current code achieves this by matching the
 '-'character in the option tag text value as follows:

 $(document).ready(function() {
$(select#edit-jump-goto option).each(function(){
matchOne = $(this).text().match(-);
matchTwo = $(this).text().match(--);
matchThree = $(this).text().match(---);
if (matchOne != -) {

  $(this).addClass(jumptop1);
}
else if (matchTwo == --) {
$(this).css(margin-left,
 10px);
}
else{
$(this).css(margin-left, 5px);
}
if (matchThree == ---) {
$(this).css(margin-left, 15px);
}
});
 });

 Although this works I'm sure there must be a cleaner way of doing
 this. Any suggestions JQuery gurus?

 Thanks,
 Mat



[jQuery] serialScroll ie6/7 problems

2009-09-07 Thread less than zero


Hello,

I'm having problems getting the scroll plugins to work properly on ie6/7 -
it seems to work fine on all other browsers. The problem is with the second
scroll container that is nested within the first.

Take a look at my code here - the relevant parts would be a bit long to
paste in.

www.richardlayte.com

Thanks
Rich
-- 
View this message in context: 
http://www.nabble.com/serialScroll-ie6-7-problems-tp25336179s27240p25336179.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: improve/extend the selectors

2009-09-07 Thread Michael Geary
You need to explain a little more about what you want. If you've created an
object of your own, I don't think it will have div elements in it, will
it? What *is* in your object, and what do you want to happen when you
iterate over it? Could you give a complete specific example, with the actual
object that you want to use and the results you're looking for?
-Mike

On Mon, Sep 7, 2009 at 1:04 PM, jeanluca lca...@gmail.com wrote:


 Hi All

 I need some help with the following:

 Suppose I have the following object

 var obj = new XYZ() ;

 Now I want to do:

 $(div, obj).each(function(){.}) ;

 Now, of course, jquery will throw an error because it doesn't know
 what to do with 'obj'. So I want to add/extend jquery, so it knows how
 to treat 'obj'.  Can this be done ? Is there documentation explaining
 how to do this ?

 thnx a lot
 LuCa



[jQuery] Re: $.getScript()

2009-09-07 Thread Michael Geary
Unless there is a known issue, I don't think anyone can answer your question
based on the information you've provided.
Can you post a link to a test page that demonstrates the problem you've
encountered? That would allow people to actually take a look at it and try
it for themselves in Chrome and other browsers.

-Mike

On Mon, Sep 7, 2009 at 12:58 PM, Ross Hadden rosshad...@gmail.com wrote:

 Anyone? Please?


 On Sat, Sep 5, 2009 at 6:14 PM, rosshadden rosshad...@gmail.com wrote:


 Is it a known issue that $.getScript() does not work in Chrome, or
 could I be doing something wrong?

 I am able to load scripts using this function in any browser, but in
 order for me to be able to use their contents in Chrome I need to put
 blocks of code in the callback of $.getScript.  While it makes sense
 that I would not be able to utilize a script's functions outside of
 its callback, why then does it work in both Firefox and IE?

 For me using the ol' script/ works without any issues, but I was
 trying to use $.getScript() in place of that for experimental
 purposes.  Is this the wrong application for the function?  Should I
 only use it if I need to load a script on the fly?

 Thanks,
 ~Ross




 --
 ~Ross



[jQuery] Autocomplete plugin - Hide completion list on Enter

2009-09-07 Thread janid1967

Hi, I've just started using the jQuery Autocomplete plugin (http://
docs.jquery.com/Plugins/Autocomplete).
I get my completions from a serverside service. Currently I'm using
the option selectFirst: false.

When I'm using Enter without selecting from the completion list, this
submits my form. This is fine, but the displayed completions stay
visible after submit. How can I hide displayed completions when
hitting Enter without selecting a entry?
(As expected, displayed completion list disappear when selecting a
entry and hit Enter or Tab)

Please advice
JI


[jQuery] Re: validate - Change the message language

2009-09-07 Thread Avangelist

I guess that you could shorten it further by creating a pseudo boot
file to initialise all your scripts rather than requesting them all?
Think if you were to expand your language set even further you could
end up with a lot of conditional includes there.


[jQuery] Some questions about selector

2009-09-07 Thread TSAI

I have the following source code:

head
titleUntitled/title
script type=text/javascript src=js/jquery-1.3.2.js/script
script type=text/javascript
!--
$(function () {
var $d = $('p  div');
$d.css('border', '1px solid gray');
});
//--
/script
/head

body

p
div
p - div
/div
/p
/body

I can't get the div inside p.
and I changed the source code, upset the div and p, and the
selector $('p  div') → $('div  p'):

head
titleUntitled/title
script type=text/javascript src=js/jquery-1.3.2.js/script
script type=text/javascript
!--
$(function () {
var $d = $('div  p');
$d.css('border', '1px solid gray');
});
//--
/script
/head

body

div
p
div - p
/p
/div
/body

and i can get p inside div.
Who can tell me why?


[jQuery] mootools class to jquery

2009-09-07 Thread bez4pieci

i haven't had anything to do with jquery so far. as much as i've dug
through the forums and docs, it does not support anything similar to
mootools class syntax, right? i've made a simple and reusable class in
mootools, the i need to re-make in jquery. can anybody helm me with
this?

in short - it checks an input field for a specifig string and extracts
a number out of it and puts it back into the input field. this is used
with usb card readers.

here's the instantiation (inside another class):
new CardInputCheck($('card_num_input'), { onSuccess:
this.validateAndSubmit.bind(this) });


here's the class:
var CardInputCheck = new Class({

Implements: [ Options, Events ],

element: null,
options: {
readerOutputLength: 117,// length of the card input
readerOutputRE: /^\%B\d{16}\^\s+\^\d+\?;\d+=\d+\?$/,  // regexp 
for
the card input

focusOnSuccess: null,   // element to focus on success
onSuccess: $empty   // function to execute on success
},

initialize: function(inputFieldElement, options) {
this.setOptions(options);
this.element = $(inputFieldElement);
if(this.element  $type(this.element) == 'element') {
this.element.addEvent('keyup', 
this.elementOnKeyPress.bindWithEvent
(this));
this.focusElement();// for 
firefox (the delayed focus does not
work for some reason)
this.focusElement.delay(200, this); // for all 
other browsers, who
are not ready for immediate focusing
}
},

elementOnKeyPress: function(event) {
var v = this.element.get('value').trim();
if(v.length == this.options.readerOutputLength  v.test
(this.options.readerOutputRE)) {
this.element.set('value', v.substr(8, 10));
this.success();
}
},

success: function() {
if(this.options.focusOnSuccess  
this.options.focusOnSuccess.focus)
{
try {
this.options.focusOnSuccess.focus();
} catch(e) {
}
}

this.fireEvent('success');
},

focusElement: function() {
try {
// focus method sometimes throw errors...
this.element.focus();
} catch(e) {
}
}

});


will terribly appreciate any solution!
respect


[jQuery] Re: improve/extend the selectors

2009-09-07 Thread jeanluca

suppose you could ask for an array of div's like:

   obj-get_me _all_divs() ; // -- gives an array with div elements

Or:

  $.ajax({
   type: GET,
   url: 'myxml.xml',
   dataType: 'xml',
   success: function(xml){
   alert( $(body, xml) ) ; // this cannot be done!!
   }
   }) ;

(In this case xml is een XML object and this doesn't work)

or

  $.ajax({
   type: GET,
   url: 'myhtml.html',
   dataType: 'html',
   success: function(text){// 'text' is a string
   alert( $(body, text) ) ; // this doesn't seem to work
too
   }
   }) ;


On Sep 7, 10:58 pm, Michael Geary m...@mg.to wrote:
 You need to explain a little more about what you want. If you've created an
 object of your own, I don't think it will have div elements in it, will
 it? What *is* in your object, and what do you want to happen when you
 iterate over it? Could you give a complete specific example, with the actual
 object that you want to use and the results you're looking for?
 -Mike

 On Mon, Sep 7, 2009 at 1:04 PM, jeanluca lca...@gmail.com wrote:

  Hi All

  I need some help with the following:

  Suppose I have the following object

  var obj = new XYZ() ;

  Now I want to do:

  $(div, obj).each(function(){.}) ;

  Now, of course, jquery will throw an error because it doesn't know
  what to do with 'obj'. So I want to add/extend jquery, so it knows how
  to treat 'obj'.  Can this be done ? Is there documentation explaining
  how to do this ?

  thnx a lot
  LuCa


[jQuery] Re: improve/extend the selectors

2009-09-07 Thread jeanluca

suppose you could ask for an array of div's like:

   obj-get_me _all_divs() ; // -- gives an array with div elements

Or:

  $.ajax({
   type: GET,
   url: 'myxml.xml',
   dataType: 'xml',
   success: function(xml){
   alert( $(body, xml) ) ; // this cannot be done!!
   }
   }) ;

(In this case xml is een XML object and this doesn't work)

or

  $.ajax({
   type: GET,
   url: 'myhtml.html',
   dataType: 'html',
   success: function(text){// 'text' is a string
   alert( $(body, text) ) ; // this doesn't seem to work
too
   }
   }) ;


On Sep 7, 10:58 pm, Michael Geary m...@mg.to wrote:
 You need to explain a little more about what you want. If you've created an
 object of your own, I don't think it will have div elements in it, will
 it? What *is* in your object, and what do you want to happen when you
 iterate over it? Could you give a complete specific example, with the actual
 object that you want to use and the results you're looking for?
 -Mike

 On Mon, Sep 7, 2009 at 1:04 PM, jeanluca lca...@gmail.com wrote:

  Hi All

  I need some help with the following:

  Suppose I have the following object

  var obj = new XYZ() ;

  Now I want to do:

  $(div, obj).each(function(){.}) ;

  Now, of course, jquery will throw an error because it doesn't know
  what to do with 'obj'. So I want to add/extend jquery, so it knows how
  to treat 'obj'.  Can this be done ? Is there documentation explaining
  how to do this ?

  thnx a lot
  LuCa


[jQuery] Re: live() help

2009-09-07 Thread Cam Spiers
Hi I'm not exactly sure what you mean by loaded into a div but I assume
that this script is being loaded into the document after the document/window
is already ready.

It is possible you need to remove the $(window).ready event. Maybe the bound
ready functions have been triggered already and are not being triggered
again.

Regards,
Cam

On Tue, Sep 8, 2009 at 10:29 AM, Dave Maharaj :: WidePixels.com 
d...@widepixels.com wrote:

  I have this on a page that gets loaded into a div but its not working
 when loaded. I originally had the page load normally in the browser and it
 worked, only since loading it into the div has it stopped. Not sure if it
 has anything to do with it but i want to add

 .live() to the function and give it a try but no idea where to add it just
 to see if that does anything.

 Or does anyone have any ideas that might help me to get this working again.

 $(window).ready(function() {
  $('.sliderGallery').each(function(){
   var id_parts = $(this).attr('id').split('_');
   var id = id_parts[id_parts.length - 1];
   var container = $('#sliderGallery_' + id) ;


   var ul = $('ul', container);
   var itemsWidth = ul.innerWidth() - container.outerWidth();

$('.slider', container).slider({
  min: 0,
  max: itemsWidth,
  handle: '.handle',
  stop: function (event, ui) {
   ul.animate({'left' : ui.value * -1}, 500);
  },
  slide: function (event, ui) {
   ul.css('left', ui.value * -1);
  }
});
  });
 });

 Thanks,

 Dave



[jQuery] live() help

2009-09-07 Thread Dave Maharaj :: WidePixels.com
I have this on a page that gets loaded into a div but its not working when
loaded. I originally had the page load normally in the browser and it
worked, only since loading it into the div has it stopped. Not sure if it
has anything to do with it but i want to add 
 
.live() to the function and give it a try but no idea where to add it just
to see if that does anything.
 
Or does anyone have any ideas that might help me to get this working again.
 
$(window).ready(function() {

 $('.sliderGallery').each(function(){
  var id_parts = $(this).attr('id').split('_');
  var id = id_parts[id_parts.length - 1];
  var container = $('#sliderGallery_' + id) ;
  
 
  var ul = $('ul', container);
  var itemsWidth = ul.innerWidth() - container.outerWidth();
 
   $('.slider', container).slider({
 min: 0,
 max: itemsWidth,
 handle: '.handle',
 stop: function (event, ui) {
  ul.animate({'left' : ui.value * -1}, 500);
 },
 slide: function (event, ui) {
  ul.css('left', ui.value * -1);
 }
   });
 });
});
 
Thanks,
 
Dave 


[jQuery] Re: live() help

2009-09-07 Thread Dave Maharaj :: WidePixels.com

Correctpage initially loads with 3 tabs. Clicking on 1 tab loads the
gallery into the current page. div id=ajax_contentall content loads
here/div
 
Will try you suggestion about removing $(window).ready and see what happens.
 
Dave



From: Cam Spiers [mailto:camspi...@gmail.com] 
Sent: September-07-09 8:07 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: live() help


Hi I'm not exactly sure what you mean by loaded into a div but I assume
that this script is being loaded into the document after the document/window
is already ready.

It is possible you need to remove the $(window).ready event. Maybe the bound
ready functions have been triggered already and are not being triggered
again.

Regards,
Cam


On Tue, Sep 8, 2009 at 10:29 AM, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:


I have this on a page that gets loaded into a div but its not
working when loaded. I originally had the page load normally in the browser
and it worked, only since loading it into the div has it stopped. Not sure
if it has anything to do with it but i want to add 
 
.live() to the function and give it a try but no idea where to add
it just to see if that does anything.
 
Or does anyone have any ideas that might help me to get this working
again.
 
$(window).ready(function() {

 $('.sliderGallery').each(function(){
  var id_parts = $(this).attr('id').split('_');
  var id = id_parts[id_parts.length - 1];
  var container = $('#sliderGallery_' + id) ;
  
 
  var ul = $('ul', container);
  var itemsWidth = ul.innerWidth() - container.outerWidth();
 
   $('.slider', container).slider({
 min: 0,
 max: itemsWidth,
 handle: '.handle',
 stop: function (event, ui) {
  ul.animate({'left' : ui.value * -1}, 500);
 },
 slide: function (event, ui) {
  ul.css('left', ui.value * -1);
 }
   });
 });
});
 
Thanks,
 
Dave 





[jQuery] Re: Some questions about selector

2009-09-07 Thread Karl Swedberg
You probably can't get a div inside a p because they aren't allowed  
there, per the w3c spec:


The P element represents a paragraph. It cannot contain block-level  
elements (including P itself).


(and DIV is a block-level element)

http://www.w3.org/TR/html401/struct/text.html#h-9.3.1

--Karl


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




On Sep 7, 2009, at 11:35 AM, TSAI wrote:



I have the following source code:

head
titleUntitled/title
script type=text/javascript src=js/jquery-1.3.2.js/script
script type=text/javascript
!--
$(function () {
var $d = $('p  div');
$d.css('border', '1px solid gray');
});
//--
/script
/head

body

p
div
p - div
/div
/p
/body

I can't get the div inside p.
and I changed the source code, upset the div and p, and the
selector $('p  div') → $('div  p'):

head
titleUntitled/title
script type=text/javascript src=js/jquery-1.3.2.js/script
script type=text/javascript
!--
$(function () {
var $d = $('div  p');
$d.css('border', '1px solid gray');
});
//--
/script
/head

body

div
p
div - p
/p
/div
/body

and i can get p inside div.
Who can tell me why?




[jQuery] Re: $.getScript()

2009-09-07 Thread Ross Hadden
The website in question is http://os.rosshadden.com/

The only change needed to change it from working to the state it is in now
is changing the script calls from script/ to $.getScript



On Mon, Sep 7, 2009 at 5:00 PM, Michael Geary m...@mg.to wrote:

 Unless there is a known issue, I don't think anyone can answer your
 question based on the information you've provided.
 Can you post a link to a test page that demonstrates the problem you've
 encountered? That would allow people to actually take a look at it and try
 it for themselves in Chrome and other browsers.

 -Mike

 On Mon, Sep 7, 2009 at 12:58 PM, Ross Hadden rosshad...@gmail.com wrote:

 Anyone? Please?


 On Sat, Sep 5, 2009 at 6:14 PM, rosshadden rosshad...@gmail.com wrote:


 Is it a known issue that $.getScript() does not work in Chrome, or
 could I be doing something wrong?

 I am able to load scripts using this function in any browser, but in
 order for me to be able to use their contents in Chrome I need to put
 blocks of code in the callback of $.getScript.  While it makes sense
 that I would not be able to utilize a script's functions outside of
 its callback, why then does it work in both Firefox and IE?

 For me using the ol' script/ works without any issues, but I was
 trying to use $.getScript() in place of that for experimental
 purposes.  Is this the wrong application for the function?  Should I
 only use it if I need to load a script on the fly?

 Thanks,
 ~Ross




 --
 ~Ross





-- 
~Ross


[jQuery] Re: live() help

2009-09-07 Thread Dave Maharaj :: WidePixels.com

Still no go.
 
I now have this:
 
script type=text/javascript charset=utf-8
$(document).ready(function() {
init_gallery(); 


function init_gallery()
{

$('.sliderGallery').each(function(){
var id_parts = $(this).attr('id').split('_');
var id = id_parts[id_parts.length - 1];
var container = $('#sliderGallery_' + id) ;
var ul = $('ul', container);
alert(id);
var itemsWidth = ul.innerWidth() -
container.outerWidth();

$('.slider', container).slider({
min: 0,
max: itemsWidth,
handle: '.handle',
stop: function (event, ui) {
ul.animate({'left' : ui.value * -1},
500);
},
slide: function (event, ui) {
ul.css('left', ui.value * -1);
}
});
}); 
}
});
/script

Works if not loaded into a div, will not work if loaded into div, yet the
alert(id); still shows in both cases.

Ideas?

Dave


From: Cam Spiers [mailto:camspi...@gmail.com] 
Sent: September-07-09 8:07 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: live() help


Hi I'm not exactly sure what you mean by loaded into a div but I assume
that this script is being loaded into the document after the document/window
is already ready.

It is possible you need to remove the $(window).ready event. Maybe the bound
ready functions have been triggered already and are not being triggered
again.

Regards,
Cam


On Tue, Sep 8, 2009 at 10:29 AM, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:


I have this on a page that gets loaded into a div but its not
working when loaded. I originally had the page load normally in the browser
and it worked, only since loading it into the div has it stopped. Not sure
if it has anything to do with it but i want to add 
 
.live() to the function and give it a try but no idea where to add
it just to see if that does anything.
 
Or does anyone have any ideas that might help me to get this working
again.
 
$(window).ready(function() {

 $('.sliderGallery').each(function(){
  var id_parts = $(this).attr('id').split('_');
  var id = id_parts[id_parts.length - 1];
  var container = $('#sliderGallery_' + id) ;
  
 
  var ul = $('ul', container);
  var itemsWidth = ul.innerWidth() - container.outerWidth();
 
   $('.slider', container).slider({
 min: 0,
 max: itemsWidth,
 handle: '.handle',
 stop: function (event, ui) {
  ul.animate({'left' : ui.value * -1}, 500);
 },
 slide: function (event, ui) {
  ul.css('left', ui.value * -1);
 }
   });
 });
});
 
Thanks,
 
Dave 





[jQuery] Re: $.getScript()

2009-09-07 Thread Michael Geary
Why do you want to use $.getScript to load those .js files? Is there a
reason you don't want to use script tags?

I would never expect this code to work properly, in any browser:

$.getScript(root+'scripts/ui/1.8a1/ui/ui.core.js');

$.getScript(root+'scripts/ui/1.8a1/ui/ui.draggable.js');
$.getScript(root+'scripts/ui/1.8a1/ui/ui.resizable.js');
$.getScript(root+'scripts/ui/1.8a1/ui/ui.dialog.js');

It's just a lucky bonus that it ever works in some browsers. Even there I
wouldn't count on it working in all situations.

The problem is that $.getScript is *asynchronous* and does not guarantee any
particular order of loading. script tags, OTOH, behave as if they were
synchronous: The scripts will always be executed in the same order as the
script tags. (The actual file loading may be asynchronous, but the script
*execution* is always in the order you expect.)

When you load those files with script tags, ui.core.js always executes
first, and the other ui.*.js files - which depend on ui.core.js - execute
later. This is guaranteed behavior in all browsers.

When you use $.getScript, the scripts are loaded willy-nilly and executed
whenever they happen to be ready. ui.core.js could easily get loaded
*after*the scripts that depend on it.

Another problem with $.getScript() is that any script that uses
document.write() will fail when loaded this way. document.write() only works
when the page is being initially loaded, not when you load a script
asynchronously with $.getScript() or equivalent. That's probably not the
problem here, but it's something to watch out for.

-Mike

On Mon, Sep 7, 2009 at 3:51 PM, Ross Hadden rosshad...@gmail.com wrote:

 The website in question is http://os.rosshadden.com/

 The only change needed to change it from working to the state it is in now
 is changing the script calls from script/ to $.getScript



 On Mon, Sep 7, 2009 at 5:00 PM, Michael Geary m...@mg.to wrote:

 Unless there is a known issue, I don't think anyone can answer your
 question based on the information you've provided.
 Can you post a link to a test page that demonstrates the problem you've
 encountered? That would allow people to actually take a look at it and try
 it for themselves in Chrome and other browsers.

 -Mike

 On Mon, Sep 7, 2009 at 12:58 PM, Ross Hadden rosshad...@gmail.comwrote:

 Anyone? Please?


 On Sat, Sep 5, 2009 at 6:14 PM, rosshadden rosshad...@gmail.com wrote:


 Is it a known issue that $.getScript() does not work in Chrome, or
 could I be doing something wrong?

 I am able to load scripts using this function in any browser, but in
 order for me to be able to use their contents in Chrome I need to put
 blocks of code in the callback of $.getScript.  While it makes sense
 that I would not be able to utilize a script's functions outside of
 its callback, why then does it work in both Firefox and IE?

 For me using the ol' script/ works without any issues, but I was
 trying to use $.getScript() in place of that for experimental
 purposes.  Is this the wrong application for the function?  Should I
 only use it if I need to load a script on the fly?

 Thanks,
 ~Ross




 --
 ~Ross





 --
 ~Ross



[jQuery] Re: improve/extend the selectors

2009-09-07 Thread Michael Geary
Whoa, that's three things. (And the first one isn't even JavaScript.)

Could we get this down to one specific, concrete case that you want to
solve?

I'm not very good at solving general problems that handle a lot of
possibilities, but if there is one specific piece of code that you'd like to
get working, and there's one particular missing link in it, I'm pretty sure
I could help you find or code that missing link. But without actual data to
look at, I don't have a way of testing any possible solution I might come up
with. That means a link to a test page that shows what you're trying to do.

Now somebody else may come along who understands the problem better and can
give you a good solution - that would be great and I would be off the hook.
:-) but since I volunteered, I'm just saying what I need to understand it
and try to help you solve it. Send that link and I'll be happy to take a
look!

-Mike

On Mon, Sep 7, 2009 at 2:27 PM, jeanluca lca...@gmail.com wrote:


 suppose you could ask for an array of div's like:

   obj-get_me _all_divs() ; // -- gives an array with div elements

 Or:

  $.ajax({
   type: GET,
   url: 'myxml.xml',
   dataType: 'xml',
   success: function(xml){
   alert( $(body, xml) ) ; // this cannot be done!!
   }
   }) ;

 (In this case xml is een XML object and this doesn't work)

 or

  $.ajax({
   type: GET,
   url: 'myhtml.html',
   dataType: 'html',
   success: function(text){// 'text' is a string
   alert( $(body, text) ) ; // this doesn't seem to work
 too
   }
   }) ;


 On Sep 7, 10:58 pm, Michael Geary m...@mg.to wrote:
  You need to explain a little more about what you want. If you've created
 an
  object of your own, I don't think it will have div elements in it, will
  it? What *is* in your object, and what do you want to happen when you
  iterate over it? Could you give a complete specific example, with the
 actual
  object that you want to use and the results you're looking for?
  -Mike
 
  On Mon, Sep 7, 2009 at 1:04 PM, jeanluca lca...@gmail.com wrote:
 
   Hi All
 
   I need some help with the following:
 
   Suppose I have the following object
 
   var obj = new XYZ() ;
 
   Now I want to do:
 
   $(div, obj).each(function(){.}) ;
 
   Now, of course, jquery will throw an error because it doesn't know
   what to do with 'obj'. So I want to add/extend jquery, so it knows how
   to treat 'obj'.  Can this be done ? Is there documentation explaining
   how to do this ?
 
   thnx a lot
   LuCa



[jQuery] Re: $.getScript()

2009-09-07 Thread Ross Hadden
Alright Thank you.  That is exactly the kind of answer I was looking for.
 See, I don't use $.getScript in place of script, and I wasn't planning on
it either.  I read about the function and wanted to test it, and was
confused as to why it did not work.
Thank you,
On Mon, Sep 7, 2009 at 8:07 PM, Michael Geary m...@mg.to wrote:

 Why do you want to use $.getScript to load those .js files? Is there a
 reason you don't want to use script tags?

 I would never expect this code to work properly, in any browser:

   $.getScript(root+'scripts/ui/1.8a1/ui/ui.core.js');



   $.getScript(root+'scripts/ui/1.8a1/ui/ui.draggable.js');
   $.getScript(root+'scripts/ui/1.8a1/ui/ui.resizable.js');
   $.getScript(root+'scripts/ui/1.8a1/ui/ui.dialog.js');

 It's just a lucky bonus that it ever works in some browsers. Even there I
 wouldn't count on it working in all situations.

 The problem is that $.getScript is *asynchronous* and does not guarantee
 any particular order of loading. script tags, OTOH, behave as if they were
 synchronous: The scripts will always be executed in the same order as the
 script tags. (The actual file loading may be asynchronous, but the script
 *execution* is always in the order you expect.)

 When you load those files with script tags, ui.core.js always executes
 first, and the other ui.*.js files - which depend on ui.core.js - execute
 later. This is guaranteed behavior in all browsers.

 When you use $.getScript, the scripts are loaded willy-nilly and executed
 whenever they happen to be ready. ui.core.js could easily get loaded *
 after* the scripts that depend on it.

 Another problem with $.getScript() is that any script that uses
 document.write() will fail when loaded this way. document.write() only works
 when the page is being initially loaded, not when you load a script
 asynchronously with $.getScript() or equivalent. That's probably not the
 problem here, but it's something to watch out for.

 -Mike


 On Mon, Sep 7, 2009 at 3:51 PM, Ross Hadden rosshad...@gmail.com wrote:

 The website in question is http://os.rosshadden.com/

 The only change needed to change it from working to the state it is in now
 is changing the script calls from script/ to $.getScript



 On Mon, Sep 7, 2009 at 5:00 PM, Michael Geary m...@mg.to wrote:

 Unless there is a known issue, I don't think anyone can answer your
 question based on the information you've provided.
 Can you post a link to a test page that demonstrates the problem you've
 encountered? That would allow people to actually take a look at it and try
 it for themselves in Chrome and other browsers.

 -Mike

 On Mon, Sep 7, 2009 at 12:58 PM, Ross Hadden rosshad...@gmail.comwrote:

 Anyone? Please?


 On Sat, Sep 5, 2009 at 6:14 PM, rosshadden rosshad...@gmail.comwrote:


 Is it a known issue that $.getScript() does not work in Chrome, or
 could I be doing something wrong?

 I am able to load scripts using this function in any browser, but in
 order for me to be able to use their contents in Chrome I need to put
 blocks of code in the callback of $.getScript.  While it makes sense
 that I would not be able to utilize a script's functions outside of
 its callback, why then does it work in both Firefox and IE?

 For me using the ol' script/ works without any issues, but I was
 trying to use $.getScript() in place of that for experimental
 purposes.  Is this the wrong application for the function?  Should I
 only use it if I need to load a script on the fly?

 Thanks,
 ~Ross




 --
 ~Ross





 --
 ~Ross





-- 
~Ross


[jQuery] jquery validate and datepicker.

2009-09-07 Thread Williamk

For some reason, and this is baffling me, if I use both the validation
plugin and the datepicker plugin, some voodoo is occurring.
I have to select the date twice for it to validate.
For example, here are the steps I took:
I try to submit the form without dates in the fields.
The form is not sent and the date fields are flagged.
If you open it once and select a date, the calendar closes, but it
still shows as invalid.
If you repeat this action, selecting the same exact field and opening
the calendar and selecting the date again, then it shows as valid.
I'm not sure how to shoehorn this into validating on the first click
on the calendar.
And to be honest, I'm terrified I'm going to get flamed  over this.
I generally consider myself pretty resourceful, but this is making me
a little bit loco.


[jQuery] Re: droppable limit

2009-09-07 Thread Richard D. Worth
The accept option can take a function. That function gets called when a
draggable starts being dragged and the draggable item is sent as the first
argument to the function. So if your droppable already has an item, simply
return false in that function, otherwise return true. The other option would
be to disable or destroy your droppable, once it has an item.
- Richard

On Sat, Sep 5, 2009 at 10:16 AM, pEeLL milan.h...@gmail.com wrote:


 Hi

 i use for drag and drop this easy code

 $(function() {

$(.ui-draggable).draggable({ revert: 'invalid' });

$(.ui-droppable).droppable({
accept: '.ui-draggable',
drop: function(event, ui) {
$(this).addClass('red');
},
out: function(event, ui) {
$(this).removeClass('red');
}
});
 });

 i have some boxes and some containers. i  want add ONLY one box to one
 container. How can i limit number of boxex that will container
 accept?  thanks for every help.



[jQuery] Re: remove() and empy() not work for xml

2009-09-07 Thread RobG



On Sep 7, 3:42 pm, g...@iec abhi.pur...@gmail.com wrote:
 Hi.can anybody  help me out to come out of this

You many need to use getElementsByTagNameNS('*',tagName). To remove
nodes try:

  this.parentNode.removeChild(this);


--
Rob


[jQuery] Limiting character input, also displaying input fields contetns

2009-09-07 Thread Scott Haneda


I have a pretty basic set of things I want to do:

Capture key press, compare against an allowed list, block keys that  
are not in that list, replace a space by a dash if entered.


As this is happening, I have a span I wanted to be updated with the  
live values.  The username field at https://twitter.com/signup is  
exactly what I am trying to do, though I have trouble dissecting how  
they did it.


Here is my attempt, which is off by one keypress for some reason.  Any  
help is appreciated.  Using 1.3.2 JQ.


script type=text/javascript charset=utf-8
$(document).ready(function() {
 $('input#the-name').bind('keypress', function(e) {
  console.log('keycode: ' + e.which + ' actual: [' +  
String.fromCharCode(e.which) + ']');


  // Limit characters that can even be pressed
  var c = String.fromCharCode(e.which); // Actual character  
pressed on keyboard
  var allowed =  
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890- ';

  // if we do not find actual letter in the list, stop.
  if (e.which != 8  allowed.indexOf(c)  0) return  
false; // 8 is backspace


 })

 $('#the-name').keypress(function() {
  var entered = $('#the-name').val();
  $('#live').text(entered);
  console.log(entered);
 });
});
/script

html parts:
input type=text name=the_name value= id=the-name  
autocomplete=off /br /

http://example.com/span id=live/spanbr /
--
Scott * If you contact me off list replace talklists@ with scott@ *



[jQuery] Re: Limiting character input, also displaying input fields contetns

2009-09-07 Thread Scott Haneda


Here is a test link:
http://dl.getdropbox.com/u/340087/Drops/09.07.09/user-21bbf008-212305.html

There is a good deal going on I am not able to solve, delete key being  
one of them. I can not keep the span updated as I want to.  I suspect  
because the function returns false in order to block the key entry.


On Sep 7, 2009, at 8:31 PM, Scott Haneda wrote:


I have a pretty basic set of things I want to do:

Capture key press, compare against an allowed list, block keys that  
are not in that list, replace a space by a dash if entered.


As this is happening, I have a span I wanted to be updated with the  
live values.  The username field at https://twitter.com/signup is  
exactly what I am trying to do, though I have trouble dissecting how  
they did it.


Here is my attempt, which is off by one keypress for some reason.   
Any help is appreciated.  Using 1.3.2 JQ.


--
Scott * If you contact me off list replace talklists@ with scott@ *



[jQuery] Anything wrong with this ajax syntax?

2009-09-07 Thread Rick Faircloth
Is there something missing that would keep it from functioning?

 

This ajax function only serves to cause a ColdFusion function to create

HTML that is then loaded as specified in the code.

 

However, the success part of the function is not executed.

No errors or anything.it's as if the ajax function just doesn't work at all.

 

If I put alert('Inside function');  just after the first line of the
function and

before the $.ajax line below, the alert fires properly.  If I add an alert

in the response section in the first line of the if section, the alert
doesn't fire.

Again, no errors from my server-side code or for the jQuery.

 

So, the question is whether or not the $.ajax function will work as coded,

or are other parameters needed?  (I tried 'post' for type, as well.)

 

Here's the $.ajax function:

 

script type=text/javascript

 

 function buildLoginDialog() {

 

 $.ajax = ({ cache: false,

 type:  'get',

 url:
'components/login.cfc?method=mBuildLoginDialogreturnType=json',

 success:   function(response) {



 if   (   (response.STATUS = 'Login Dialog
Build Successful')   )

  {   var loginDialogHTML =
'components/loginDialogHTML.cfm?' + new Date().getTime();

 
$('.loginDialog').load(loginDialogHTML);

  login();
}

 


 else {   alert('Login Dialog Build
Failed');   }

   

}

 });

  }

 

/script

 

Thoughts or suggestions, anyone?

 

Thanks,

 

Rick

 


---

Those who hammer their guns into plows will plow for those who do not.  -
Thomas Jefferson

 



[jQuery] Re: Anything wrong with this ajax syntax?

2009-09-07 Thread Shawn


Your URL indicates you are returning json (returnType=json).  But, you 
do not specify a dataType for the $.ajax() call.  So, your response 
variable is plain text, I think.


Two things to try:

1) put  dataType: json,  before the success line.
2) first line of the success function, do something like 
console.log(response); and see what you get.  If it is plain text, you 
will see the text.  if it is JSON, you should get an object or array 
shown (firebug will color code these for you.  um.. you ARE using 
Firebug aren't you? lol )


HTH

Shawn

Rick Faircloth wrote:

Is there something missing that would keep it from functioning?

 


This ajax function only serves to cause a ColdFusion function to create

HTML that is then loaded as specified in the code.

 


However, the success part of the function is not executed.

No errors or anything…it’s as if the ajax function just doesn’t work at all.

 

If I put “alert(‘Inside function’); “ just after the first line of the 
function and


before the $.ajax line below, the alert fires properly.  If I add an alert

in the response section in the first line of the “if” section, the alert 
doesn’t fire.


Again, no errors from my server-side code or for the jQuery.

 


So, the question is whether or not the $.ajax function will work as coded,

or are other parameters needed?  (I tried ‘post’ for type, as well…)

 


Here’s the $.ajax function:

 


script type=”text/javascript”

 


 function buildLoginDialog() {

 


 $.ajax = ({ cache: false,

 type:  'get',

 url: 
  'components/login.cfc?method=mBuildLoginDialogreturnType=json',


 success:   function(response) {

   

 if   (   (response.STATUS = 'Login 
Dialog Build Successful')   )


  {   var loginDialogHTML = 
'components/loginDialogHTML.cfm?' + new Date().getTime();


   
   $('.loginDialog').load(loginDialogHTML);



  login();  }


   



 else {   alert('Login Dialog Build 
Failed');   }


  


}

 });

  }

 


/script

 


Thoughts or suggestions, anyone?

 


Thanks,

 


Rick

 


/---/

/Those who hammer their guns into plows will plow for those who do 
not.  - Thomas Jefferson/