[jQuery] (validate) Problems with additional methods...

2010-01-07 Thread Andrea Puddu
Hello everybody!

I'm trying to use a custom method for validate one of my input's form,
but no way.

Neither the 'additional-methods.js' included in the plugin pack work
for me Seems to be ok,  but no idea.

This is a resume of my code:

-JAVASCRIPT-

script type=text/javascript
$.validator.setDefaults({
submitHandler: function() {
$(#cForm).ajaxSubmit({
url:'inc/request.php',
target: '#form-box',
success: function(){
return false;
},
resetForm: true
});
}
});

$(document).ready(function(){
$(#cForm).validate({
rules:{
nif: alphanumeric,
},
messages: {
nombre: campo obligatorio,
email: {
required: campo obligatorio,
email: email no valido
},
telefono: {
required: campo obligatorio,
digits: solo numeros
},
nif: campo obligatorio,
legal: campo obligatorio
},
errorElement: em,
errorPlacement: function(error, element) {
if ( element.is(:radio) )
error.appendTo(element.parent().parent());
else if ( element.is(:checkbox) )
error.appendTo(element.parent());
else
error.prependTo( element.parent() );
}
});
});
/script

-HTML-
...

form action= method=post id=cForm
div
label for=nombreNombre y Apellidos/label
input class=required type=text size=25
name=nombre id=nombre value= maxlength=100/
/div
div
label for=nifNIF/label
input class=required type=text size=9
name=nif id=nif value= maxlength=9/
/div
div
label for=telefonoTeléfono/label
input class=required digits type=text
size=10 name=telefono id=telefono value= maxlength=15/
/div
div
label for=emailE-mail/label
input class=required email type=text
size=25 name=email id=email value= maxlength=100/
/div
div class=row
input class=required name=legal id=legal
type=checkbox/
label for=legalHe leído y acepto las bases
legales/a/label
input type=submit name=submit id=send
value= /
/div
/form
...


Thanks in advance!

Best Regards,

Andrea


[jQuery] Re: How to build this effect

2009-10-24 Thread Andrea - Aosta

Thank you

On 23 Ott, 19:20, DanDan dan.d...@gmail.com wrote:
 That is cool... I have seen this before as JQuery but not yet tried
 it:

 http://webdev.stephband.info/parallax.html

 On Oct 23, 9:46 am, Andrea - Aosta andreabe...@gmail.com wrote:



  At this URLhttp://www.smsbig.it/ityousee an effect build with
  mootools.
  THis js change the css style of the background when the mouse
  moved.With jquery it is possible?
  Thank you


[jQuery] How to build this effect

2009-10-23 Thread Andrea - Aosta

At this URL http://www.smsbig.it/it you see an effect build with
mootools.
THis js change the css style of the background when the mouse
moved.With jquery it is possible?
Thank you


[jQuery] Re: permission to redistribute Superfish

2009-09-26 Thread andrea

Update: I opened the Superfish source file and found the license
information (GPL and MIT) so that answers my own question. Thank you!

On Sep 23, 12:29 pm, andrea anan...@gmail.com wrote:
 Attention: Joel Birch

 Hello Joel,

 thank you for your work withSuperfish!

 I'd like to integrateSuperfishinto Menubar (http://wordpress.org/
 extend/plugins/menubar), a WordPress plugin I wrote which simplifies
 menu creation and management in WordPress.

 I won't modifySuperfish, but I'd like to distribute a copy of the
 script bundled with Menubar, for users convenience. Of course full
 credit will be given to you as the script author.

 Is that ok with you? I'm looking forward to receiving your permission.
 Thank you!

 Regards
 Andrea Tarantini
 and...@dontdream.it


[jQuery] Superfish bug report

2009-09-26 Thread andrea

For the author of Superfish:

I just found a small bug in Superfish that leaves a submenu open in
special circumstances. Steps to reproduce the bug - the description
would be easier if the example menu items were all named
differently :-)

1) go to http://users.tpg.com.au/j_birch/plugins/superfish/#examples
- basic style;

2) mouse over the second sub-item of the first menu item, so a second
sub-menu opens up;

3) tricky part: leave the second sub-item of the first menu item from
the left, and from the left enter quickly the first sub-item of the
first menu item; the second submenu remains open indefinitely if you
don't move the mouse furtherly.

Thanks a lot for your work with Superfish, and I apologize if this bug
was already known.


[jQuery] permission to redistribute Superfish

2009-09-23 Thread andrea

Attention: Joel Birch

Hello Joel,

thank you for your work with Superfish!

I'd like to integrate Superfish into Menubar (http://wordpress.org/
extend/plugins/menubar), a WordPress plugin I wrote which simplifies
menu creation and management in WordPress.

I won't modify Superfish, but I'd like to distribute a copy of the
script bundled with Menubar, for users convenience. Of course full
credit will be given to you as the script author.

Is that ok with you? I'm looking forward to receiving your permission.
Thank you!

Regards
Andrea Tarantini
and...@dontdream.it


[jQuery] Re: KFManager v1.0

2009-08-21 Thread Andrea - Aosta

In the tinymce page the file manager dont'work.

On Aug 20, 5:55 pm, Ken kenpha...@gmail.com wrote:
 sorry. because the time busy, can the next time I will put it to MCE.

 2009/8/20 Sam Sherlock sam.sherl...@gmail.com





  great work Ken

  on the mce page the normal mce manager opens for me - and as Cyril said the
  page is title FCK
  on the fck page you open KFManager by clicking in the text box above the
  editor whereas the mce example does not have a way of opening kfmanager

  it would be better to replace normal function of the image icon (and other
  media too eg flash) witht the kfmanager

  - S

  2009/8/20 Cyril Lopez loveisthe...@gmail.com

  On your tinyMce page :http://trinhvietcuong.com/ken/tinymce.htmlyou
  have KFManager for FCKeditor as page label...

  --
  Cyril Lopez
  Développeur web
 www.nethik.fr

  2009/8/20 Ken kenpha...@gmail.com

  without license GPL, MIT. I'm happy when you want to use and develop KFM

  2009/8/20 Meroe whme...@gmail.com

  Well yea.  Let's say I want to put this into a commercial app.  I need
  to
  know the type of license this was released under so I can make a
  decision
  and be legit  The download has no license information..GPL? MIT?

  -Original Message-
  From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
  Behalf Of Ken Phan
  Sent: Wednesday, August 19, 2009 3:15 PM
  To: jQuery (English)
  Subject: [jQuery] Re: KFManager v1.0

  u want licensing terms ?

  On Aug 19, 2:54 am, Meroe whme...@gmail.com wrote:
   What are the licensing terms?

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

   Behalf Of Ken Phan
   Sent: Tuesday, August 18, 2009 12:21 PM
   To: jQuery (English)
   Subject: [jQuery] KFManager v1.0

   KFManager (Ken's File Manager) is a plugin of jquery. It uses AJAX to
   manage image files in a web browser and it was developed to help
   programmer gently in the file manager. It is easy to use

   demo http://trinhvietcuong.com/ken/index.html

  --
  --
  -
  Administrator : Ken Phan
  Websmater :www.goldengate.com.vn
  Listen to music is free :  www.enghe.info
  Ajax pagination:www.goldengate.com.vn/pagination
  jQuery navigation:www.goldengate.com.vn/navigation
  MP3 Ajax Flash webplayer:www.goldengate.com.vn/mp3
  Blog me:http://my.opera.com/kenphan19/blog/
  --

 --
 --
 -
 Administrator : Ken Phan
 Websmater :www.goldengate.com.vn
 Listen to music is free :  www.enghe.info
 Ajax pagination:www.goldengate.com.vn/pagination
 jQuery navigation:www.goldengate.com.vn/navigation
 MP3 Ajax Flash webplayer:www.goldengate.com.vn/mp3
 Blog me:http://my.opera.com/kenphan19/blog/
 --


[jQuery] News scroller

2009-07-28 Thread Andrea - Aosta

I have found thsi example made width mootools
http://javascript.html.it/demo/javascript/5338/esempio.htm
A similar plugin for jquery exists? Thank you


[jQuery] Jquer.live and facebox

2009-04-23 Thread Andrea - Aosta

I have used the facebox plugin with a simple

a rel=facebox href=#2121/a

in the head i have set

jQuery(document).ready(function($) {

  $(\'a[rel*=facebox]\').facebox({
faceboxHtml: \'div 
id=facebox style=display:none; \
  div class=popup \
table \
  tbody \
tr \
  td 
class=tl/td class=b/td class=tr/ \
/tr \
tr \
  td class=b/ \
  td class=body 
\
div 
class=content \
/div \
div 
class=footer \

  /a \
/div \
  /td \
  td class=b/ \
/tr \
tr \
  td 
class=bl/td class=b/td class=br/ \
/tr \
  /tbody \
/table \
  /div \
/div\',
  })
})

If i call an ajax function and recreate the

a rel=facebox href=#210210/a

obvious the link don't work. It is neccesary the live query plugin,...
but i have not event to bind the live query plugin. I have try with

jQuery(document).ready(function($) {

$(\'a[rel*=facebox]\').livequery(\'click\', function(event) {
$(\'a[rel*=facebox]\').facebox({

faceboxHtml: \'div id=facebox style=display:none; \
  div 
class=popup \
table 
\
  
tbody \

tr \
  
td class=tl/td class=b/td class=tr/
\

/tr \

tr \
  
td class=b/ \
  
td class=body \

div class=content \

/div \

div class=footer \


  /a \

/div \
  
/td \
  
td class=b/ \

/tr \

tr \
  
td class=bl/td class=b/td class=br/
\

/tr \
  
/tbody \

/table \
  /div \
/div\',
  })
});
});

but the code is 

[jQuery] Upgrade to jquery 1.3.2 and the ajax function not work....

2009-03-14 Thread Andrea - Aosta

Width jquery 1.2.6 i have a function as

function get_dati_gerachia(volte){
var chosenItemText = $(select[name='dati_gerarchia']).val();

 a=volte=+volte
+id=2ordine_per=2pagine=1master=4dati=+chosenItemText
+livello=3menu_pagine_aggiunte=6;
 $.ajax({
  type: POST,
  url:  ad/dati_gerarchia.php,
  data: a,
  success: function(msg){
.
 And a php function with a



$volte=$_POST['volte'];
$id=$_POST['id'];
. eccc

When i have chenge the jquery 1.2.6 with the 1.3.2 i get an error PHP
Undefined index : volte...

I don't understand the error; i have also set the
dataType:text,
for the ajax js function but i get also the error... My php is 5.2
Thank you


[jQuery] Re: Upgrade to jquery 1.3.2 and the ajax function not work....

2009-03-14 Thread Andrea - Aosta

Same problem with the most simple $post wrapper; i have this
javascript function

function anteprima(){

dati = new Array();
dati [0]=tinyMCE.get('txtitaliano').getContent();
dati [1]=$(#paginaitaliano).val();
dati [2]=$(select[name='gmap']).val();
$.post(ad/anteprima.php, { txtitaliano: dati[0],paginaitaliano: dati
[1],gmap: dati[2] } );
}

into the anteprima.php file a simple var_dump($_POST) output this

array(0){
}

But with jquery 1.2.6 the same line in the php file (i.e. var_dump
($_POST)) output the correct post ,

array(3) {
  [txtitaliano]=
  string(11) ptxt example/p
  [paginaitaliano]=
  string(5) pagina
  [gmap]=
  string(1) 0
}

I have read the documentation but i have not found a tip for manage
the problem


[jQuery] Re: Upgrade to jquery 1.3.2 and the ajax function not work....

2009-03-14 Thread Andrea - Aosta

I apologize for my request: i have try on another MAC and all work
fine My MAMP is crazy... i reinstall


[jQuery] Re: animate problem with IE7

2008-11-29 Thread ^AndreA^

well, I did not think about that because the carousel is elastic...
that's why I'm using the percentage.

I could probably solve it calculating the width and therefore resizing
the li elements as well and move them back and forth of the same
pixels...

It's just a bit more tricky for nothing... I hate IE6, IE7 and for
sure, I'm gonna hate IE8... ;-)

Anyway I'll give it a try, thanks again...

On 28 Nov, 00:16, Jeffrey Kretz [EMAIL PROTECTED] wrote:
 Well, have you thought of using fixed pixel positions, rather than
 percentages?

 When you click prev or next, use the offset() function to grab the exact
 position, then animate += 245px (or whatever).

 It's less convenient, but it may be more successful.

 JK

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

 Behalf Of ^AndreA^
 Sent: Thursday, November 27, 2008 2:49 AM
 To: jQuery (English)
 Subject: [jQuery] Re: animate problem with IE7

 The answer for the ticket is:

 That's a matter of css. Different browser have different whims when
 it comes to scrolling. Try adding height and width to the containing
 UL. 

 I tried adding width and height to the UL but nothing changes...
 to the div wrapping the UL but again, nothing is changed.
 The LI elements are already fixed... :-|

 Any other idea?!?

 On Nov 25, 11:42 pm, ^AndreA^ [EMAIL PROTECTED] wrote:
  Ticket opened...http://dev.jquery.com/ticket/3650

  bye,
  Andrea

  On Nov 24, 11:35 pm, ^AndreA^ [EMAIL PROTECTED] wrote:

   Yesterday I tried to open a ticket but the server
 (onhttp://dev.jquery.com/)
   was not responding as it should so I posted a thread also in the
   jQuery development google group.

  http://groups.google.com/group/jquery-dev/browse_thread/thread/945f3c...

   Nobody has replied so far...

   I wait a couple of days to see if somebody knows something about it
   and then I'll report it.

   BTW, Jeffrey, thank you very much for your time!!!

   Andrea

   On Nov 24, 6:20 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote:

Regardless, it is possible that the actual bug may be in the core
 animate
function as regards to animating relative percentages.

Don't forget to open a ticket on it (dev.jquery.com)

JK

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

Behalf Of ^AndreA^
Sent: Monday, November 24, 2008 3:06 AM
To: jQuery (English)
Subject: [jQuery] Re: animate problem with IE7

jQuery cycle plugin is very nice but I have had bad experiences with
plugins...

Usually they do a lot of things but not exactly what I need, therefore
I have to start tweaking them and 'often' it would take less time
doing it from scratch...

often... ;-)

On Nov 24, 12:09 am, Anyulled [EMAIL PROTECTED] wrote:
 why don´t you use Jquery Cycle plugin?

 On Nov 22, 10:17 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote:

  I'm not an expert in the animation sytem -- you should open a
 ticket
  (dev.jquery.com) and get some others to take a look at it.

  When I stepped through the code, I found a potential problem here,
 line
3043
  of jquery.js

  // We need to compute starting value
  if ( unit != px ) {
          self.style[ name ] = (end || 1) + unit;
          start = ((end || 1) / e.cur(true)) * start;
          self.style[ name ] = start + unit;

  }

  The div in question has a starting position of: left:-50%;

  The value of end is 50, unit is %.

  All of the other divs that had a positive percentage were handled
correctly.

  While processing this div the starting position was somehow
 altered to
-4%,
  leaving the ending position at 46% (-4 + 50).

  I'm not that familiar with the animation plumbing, so I'm not sure
 why
this
  is occurring.

  JK

  -Original Message-
  From: jquery-en@googlegroups.com
 [mailto:[EMAIL PROTECTED] On
  Behalf Of ^AndreA^
  Sent: Saturday, November 22, 2008 4:26 PM
  To: jQuery (English)
  Subject: [jQuery] Re: animate problem with IE7

  Hi Jeffrey, thanks.

  I deleted the float: left;, i didn't know was useless with
  position:absolute;

  Anyway, I noted the strange behaviour of the li elements too.

  I uploaded jQuery unpacked... if you still want to have a look...
 ;-)

  BTW, there could be something wrong with animate('left','+=50%');
 but
  that would mean a bug... :-|

  Thanks,
  Andrea

  On Nov 22, 11:51 pm, Jeffrey Kretz [EMAIL PROTECTED]
 wrote:
   I watched the animation with the IE developer toolbar, and
 noticed a
  couple
   of oddities.

   Firstly, the CSS for the divs are set to both position:absolute
 and
   float:left.  This is not the source of the problem (I overwrite
 to
   float:none and tried it), but float:left is unnecessary if with
absolute
   positioning.

   Anyway, then I monitored

[jQuery] Re: animate problem with IE7

2008-11-27 Thread ^AndreA^

The answer for the ticket is:

That's a matter of css. Different browser have different whims when
it comes to scrolling. Try adding height and width to the containing
UL. 

I tried adding width and height to the UL but nothing changes...
to the div wrapping the UL but again, nothing is changed.
The LI elements are already fixed... :-|

Any other idea?!?

On Nov 25, 11:42 pm, ^AndreA^ [EMAIL PROTECTED] wrote:
 Ticket opened...http://dev.jquery.com/ticket/3650

 bye,
 Andrea

 On Nov 24, 11:35 pm, ^AndreA^ [EMAIL PROTECTED] wrote:

  Yesterday I tried to open a ticket but the server (onhttp://dev.jquery.com/)
  was not responding as it should so I posted a thread also in the
  jQuery development google group.

 http://groups.google.com/group/jquery-dev/browse_thread/thread/945f3c...

  Nobody has replied so far...

  I wait a couple of days to see if somebody knows something about it
  and then I'll report it.

  BTW, Jeffrey, thank you very much for your time!!!

  Andrea

  On Nov 24, 6:20 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote:

   Regardless, it is possible that the actual bug may be in the core animate
   function as regards to animating relative percentages.

   Don't forget to open a ticket on it (dev.jquery.com)

   JK

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

   Behalf Of ^AndreA^
   Sent: Monday, November 24, 2008 3:06 AM
   To: jQuery (English)
   Subject: [jQuery] Re: animate problem with IE7

   jQuery cycle plugin is very nice but I have had bad experiences with
   plugins...

   Usually they do a lot of things but not exactly what I need, therefore
   I have to start tweaking them and 'often' it would take less time
   doing it from scratch...

   often... ;-)

   On Nov 24, 12:09 am, Anyulled [EMAIL PROTECTED] wrote:
why don´t you use Jquery Cycle plugin?

On Nov 22, 10:17 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote:

 I'm not an expert in the animation sytem -- you should open a ticket
 (dev.jquery.com) and get some others to take a look at it.

 When I stepped through the code, I found a potential problem here, 
 line
   3043
 of jquery.js

 // We need to compute starting value
 if ( unit != px ) {
         self.style[ name ] = (end || 1) + unit;
         start = ((end || 1) / e.cur(true)) * start;
         self.style[ name ] = start + unit;

 }

 The div in question has a starting position of: left:-50%;

 The value of end is 50, unit is %.

 All of the other divs that had a positive percentage were handled
   correctly.

 While processing this div the starting position was somehow altered to
   -4%,
 leaving the ending position at 46% (-4 + 50).

 I'm not that familiar with the animation plumbing, so I'm not sure why
   this
 is occurring.

 JK

 -Original Message-
 From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of ^AndreA^
 Sent: Saturday, November 22, 2008 4:26 PM
 To: jQuery (English)
 Subject: [jQuery] Re: animate problem with IE7

 Hi Jeffrey, thanks.

 I deleted the float: left;, i didn't know was useless with
 position:absolute;

 Anyway, I noted the strange behaviour of the li elements too.

 I uploaded jQuery unpacked... if you still want to have a look... ;-)

 BTW, there could be something wrong with animate('left','+=50%'); but
 that would mean a bug... :-|

 Thanks,
 Andrea

 On Nov 22, 11:51 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote:
  I watched the animation with the IE developer toolbar, and noticed a
 couple
  of oddities.

  Firstly, the CSS for the divs are set to both position:absolute and
  float:left.  This is not the source of the problem (I overwrite to
  float:none and tried it), but float:left is unnecessary if with
   absolute
  positioning.

  Anyway, then I monitored the left: position as the animations
   happened.

  While going to the right, everything went as usual.

  Div#0    0% to -50%
  Div#1   25% to -25%
  Div#2   50% to   0%
  Div#3   75% to  25%
  Div#4  100% to  50%
  Div#5  125% to  75%

  All good.

  Then I refreshed and tried going to the left.

  Div#0    0% to  50%
  Div#1   25% to  75%
  Div#2   50% to 100%
  Div#3   75% to 125%
  Div#4  100% to  45%
  Div#5  125% to  48%

  As you can see, divs 0-3 were fine.

  Divs 4 and 5 got WEIRD settings.

  Now, I tried stepping through the code, but your jQuery is minified.

  My guess is there is something wrong with the 
  animate('left','+=50%');

  Cheers,
  JK

  -Original Message-
  From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED]
   On
  Behalf Of ^AndreA^
  Sent: Saturday, November 22, 2008 3:29 PM
  To: jQuery (English)
  Subject: [jQuery] animate problem with IE7

  Hi all,

  I'm working

[jQuery] Re: animate problem with IE7

2008-11-25 Thread ^AndreA^

Ticket opened...
http://dev.jquery.com/ticket/3650

bye,
Andrea

On Nov 24, 11:35 pm, ^AndreA^ [EMAIL PROTECTED] wrote:
 Yesterday I tried to open a ticket but the server (onhttp://dev.jquery.com/)
 was not responding as it should so I posted a thread also in the
 jQuery development google group.

 http://groups.google.com/group/jquery-dev/browse_thread/thread/945f3c...

 Nobody has replied so far...

 I wait a couple of days to see if somebody knows something about it
 and then I'll report it.

 BTW, Jeffrey, thank you very much for your time!!!

 Andrea

 On Nov 24, 6:20 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote:

  Regardless, it is possible that the actual bug may be in the core animate
  function as regards to animating relative percentages.

  Don't forget to open a ticket on it (dev.jquery.com)

  JK

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

  Behalf Of ^AndreA^
  Sent: Monday, November 24, 2008 3:06 AM
  To: jQuery (English)
  Subject: [jQuery] Re: animate problem with IE7

  jQuery cycle plugin is very nice but I have had bad experiences with
  plugins...

  Usually they do a lot of things but not exactly what I need, therefore
  I have to start tweaking them and 'often' it would take less time
  doing it from scratch...

  often... ;-)

  On Nov 24, 12:09 am, Anyulled [EMAIL PROTECTED] wrote:
   why don´t you use Jquery Cycle plugin?

   On Nov 22, 10:17 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote:

I'm not an expert in the animation sytem -- you should open a ticket
(dev.jquery.com) and get some others to take a look at it.

When I stepped through the code, I found a potential problem here, line
  3043
of jquery.js

// We need to compute starting value
if ( unit != px ) {
        self.style[ name ] = (end || 1) + unit;
        start = ((end || 1) / e.cur(true)) * start;
        self.style[ name ] = start + unit;

}

The div in question has a starting position of: left:-50%;

The value of end is 50, unit is %.

All of the other divs that had a positive percentage were handled
  correctly.

While processing this div the starting position was somehow altered to
  -4%,
leaving the ending position at 46% (-4 + 50).

I'm not that familiar with the animation plumbing, so I'm not sure why
  this
is occurring.

JK

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of ^AndreA^
Sent: Saturday, November 22, 2008 4:26 PM
To: jQuery (English)
Subject: [jQuery] Re: animate problem with IE7

Hi Jeffrey, thanks.

I deleted the float: left;, i didn't know was useless with
position:absolute;

Anyway, I noted the strange behaviour of the li elements too.

I uploaded jQuery unpacked... if you still want to have a look... ;-)

BTW, there could be something wrong with animate('left','+=50%'); but
that would mean a bug... :-|

Thanks,
Andrea

On Nov 22, 11:51 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote:
 I watched the animation with the IE developer toolbar, and noticed a
couple
 of oddities.

 Firstly, the CSS for the divs are set to both position:absolute and
 float:left.  This is not the source of the problem (I overwrite to
 float:none and tried it), but float:left is unnecessary if with
  absolute
 positioning.

 Anyway, then I monitored the left: position as the animations
  happened.

 While going to the right, everything went as usual.

 Div#0    0% to -50%
 Div#1   25% to -25%
 Div#2   50% to   0%
 Div#3   75% to  25%
 Div#4  100% to  50%
 Div#5  125% to  75%

 All good.

 Then I refreshed and tried going to the left.

 Div#0    0% to  50%
 Div#1   25% to  75%
 Div#2   50% to 100%
 Div#3   75% to 125%
 Div#4  100% to  45%
 Div#5  125% to  48%

 As you can see, divs 0-3 were fine.

 Divs 4 and 5 got WEIRD settings.

 Now, I tried stepping through the code, but your jQuery is minified.

 My guess is there is something wrong with the animate('left','+=50%');

 Cheers,
 JK

 -Original Message-
 From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED]
  On
 Behalf Of ^AndreA^
 Sent: Saturday, November 22, 2008 3:29 PM
 To: jQuery (English)
 Subject: [jQuery] animate problem with IE7

 Hi all,

 I'm working on a

  slideshow/carousel:http://www.lesperimento.netsons.org/various/my_carousel/

 It's works fine except than in IE7/6 (basically as usual... ;-) )

 It's weird also because the next button/arrow works well under IE
 but NOT the prev button/arrow; and that's the problem.

 I explain briefly how the script works.

 When you click the arrows you call next_f(); and prev_f(); that do
 exactly the same thing but in different direction.
 They call three functions:

 1) choose_element_to_move

[jQuery] Re: animate problem with IE7

2008-11-24 Thread ^AndreA^

jQuery cycle plugin is very nice but I have had bad experiences with
plugins...

Usually they do a lot of things but not exactly what I need, therefore
I have to start tweaking them and 'often' it would take less time
doing it from scratch...

often... ;-)

On Nov 24, 12:09 am, Anyulled [EMAIL PROTECTED] wrote:
 why don´t you use Jquery Cycle plugin?

 On Nov 22, 10:17 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote:

  I'm not an expert in the animation sytem -- you should open a ticket
  (dev.jquery.com) and get some others to take a look at it.

  When I stepped through the code, I found a potential problem here, line 3043
  of jquery.js

  // We need to compute starting value
  if ( unit != px ) {
          self.style[ name ] = (end || 1) + unit;
          start = ((end || 1) / e.cur(true)) * start;
          self.style[ name ] = start + unit;

  }

  The div in question has a starting position of: left:-50%;

  The value of end is 50, unit is %.

  All of the other divs that had a positive percentage were handled correctly.

  While processing this div the starting position was somehow altered to -4%,
  leaving the ending position at 46% (-4 + 50).

  I'm not that familiar with the animation plumbing, so I'm not sure why this
  is occurring.

  JK

  -Original Message-
  From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
  Behalf Of ^AndreA^
  Sent: Saturday, November 22, 2008 4:26 PM
  To: jQuery (English)
  Subject: [jQuery] Re: animate problem with IE7

  Hi Jeffrey, thanks.

  I deleted the float: left;, i didn't know was useless with
  position:absolute;

  Anyway, I noted the strange behaviour of the li elements too.

  I uploaded jQuery unpacked... if you still want to have a look... ;-)

  BTW, there could be something wrong with animate('left','+=50%'); but
  that would mean a bug... :-|

  Thanks,
  Andrea

  On Nov 22, 11:51 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote:
   I watched the animation with the IE developer toolbar, and noticed a
  couple
   of oddities.

   Firstly, the CSS for the divs are set to both position:absolute and
   float:left.  This is not the source of the problem (I overwrite to
   float:none and tried it), but float:left is unnecessary if with absolute
   positioning.

   Anyway, then I monitored the left: position as the animations happened.

   While going to the right, everything went as usual.

   Div#0    0% to -50%
   Div#1   25% to -25%
   Div#2   50% to   0%
   Div#3   75% to  25%
   Div#4  100% to  50%
   Div#5  125% to  75%

   All good.

   Then I refreshed and tried going to the left.

   Div#0    0% to  50%
   Div#1   25% to  75%
   Div#2   50% to 100%
   Div#3   75% to 125%
   Div#4  100% to  45%
   Div#5  125% to  48%

   As you can see, divs 0-3 were fine.

   Divs 4 and 5 got WEIRD settings.

   Now, I tried stepping through the code, but your jQuery is minified.

   My guess is there is something wrong with the animate('left','+=50%');

   Cheers,
   JK

   -Original Message-
   From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
   Behalf Of ^AndreA^
   Sent: Saturday, November 22, 2008 3:29 PM
   To: jQuery (English)
   Subject: [jQuery] animate problem with IE7

   Hi all,

   I'm working on a
  slideshow/carousel:http://www.lesperimento.netsons.org/various/my_carousel/

   It's works fine except than in IE7/6 (basically as usual... ;-) )

   It's weird also because the next button/arrow works well under IE
   but NOT the prev button/arrow; and that's the problem.

   I explain briefly how the script works.

   When you click the arrows you call next_f(); and prev_f(); that do
   exactly the same thing but in different direction.
   They call three functions:

   1) choose_element_to_move(some_params); it's quite clear the meaning,
   anyway it choose which li elements have to be moved.

   2) place_elem_right_pos(some_params); once it knows which elements
   have to be moved, it moves them in the right position and ready for
   the animation.

   3) move(elem,imgs); it moves the elements...
   elem: is an array containing all the id of the elements to move
   imgs: is an int, it's the number of images to move (I need it
   because via php ,when the page is generated, I can change the number
   of elements)

   The problem is in move(elem,imgs), in this part that is the
   prev_button where sing0:

   JS:
   else if(sign0) //prev button
           {
                   for(var i=imgs-1; i=0;i--)
                   {
                           $('#' + elem[i]).animate({
                                   left:  '+=' + perc + '%'
                                   },
                                   1000);
                   }
         }

   I cut part of the code that was not useful for the purpose...

   Basically it does not do anything else than taking each element to
   move e move them, but I don't understand why it does not want to work
   with IE. arghhh!!!

   any idea?!?

   I'm sure the problem

[jQuery] Re: animate problem with IE7

2008-11-24 Thread ^AndreA^

Yesterday I tried to open a ticket but the server (on http://dev.jquery.com/)
was not responding as it should so I posted a thread also in the
jQuery development google group.

http://groups.google.com/group/jquery-dev/browse_thread/thread/945f3c71a53c88b9

Nobody has replied so far...

I wait a couple of days to see if somebody knows something about it
and then I'll report it.

BTW, Jeffrey, thank you very much for your time!!!

Andrea

On Nov 24, 6:20 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote:
 Regardless, it is possible that the actual bug may be in the core animate
 function as regards to animating relative percentages.

 Don't forget to open a ticket on it (dev.jquery.com)

 JK

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

 Behalf Of ^AndreA^
 Sent: Monday, November 24, 2008 3:06 AM
 To: jQuery (English)
 Subject: [jQuery] Re: animate problem with IE7

 jQuery cycle plugin is very nice but I have had bad experiences with
 plugins...

 Usually they do a lot of things but not exactly what I need, therefore
 I have to start tweaking them and 'often' it would take less time
 doing it from scratch...

 often... ;-)

 On Nov 24, 12:09 am, Anyulled [EMAIL PROTECTED] wrote:
  why don´t you use Jquery Cycle plugin?

  On Nov 22, 10:17 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote:

   I'm not an expert in the animation sytem -- you should open a ticket
   (dev.jquery.com) and get some others to take a look at it.

   When I stepped through the code, I found a potential problem here, line
 3043
   of jquery.js

   // We need to compute starting value
   if ( unit != px ) {
           self.style[ name ] = (end || 1) + unit;
           start = ((end || 1) / e.cur(true)) * start;
           self.style[ name ] = start + unit;

   }

   The div in question has a starting position of: left:-50%;

   The value of end is 50, unit is %.

   All of the other divs that had a positive percentage were handled
 correctly.

   While processing this div the starting position was somehow altered to
 -4%,
   leaving the ending position at 46% (-4 + 50).

   I'm not that familiar with the animation plumbing, so I'm not sure why
 this
   is occurring.

   JK

   -Original Message-
   From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
   Behalf Of ^AndreA^
   Sent: Saturday, November 22, 2008 4:26 PM
   To: jQuery (English)
   Subject: [jQuery] Re: animate problem with IE7

   Hi Jeffrey, thanks.

   I deleted the float: left;, i didn't know was useless with
   position:absolute;

   Anyway, I noted the strange behaviour of the li elements too.

   I uploaded jQuery unpacked... if you still want to have a look... ;-)

   BTW, there could be something wrong with animate('left','+=50%'); but
   that would mean a bug... :-|

   Thanks,
   Andrea

   On Nov 22, 11:51 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote:
I watched the animation with the IE developer toolbar, and noticed a
   couple
of oddities.

Firstly, the CSS for the divs are set to both position:absolute and
float:left.  This is not the source of the problem (I overwrite to
float:none and tried it), but float:left is unnecessary if with
 absolute
positioning.

Anyway, then I monitored the left: position as the animations
 happened.

While going to the right, everything went as usual.

Div#0    0% to -50%
Div#1   25% to -25%
Div#2   50% to   0%
Div#3   75% to  25%
Div#4  100% to  50%
Div#5  125% to  75%

All good.

Then I refreshed and tried going to the left.

Div#0    0% to  50%
Div#1   25% to  75%
Div#2   50% to 100%
Div#3   75% to 125%
Div#4  100% to  45%
Div#5  125% to  48%

As you can see, divs 0-3 were fine.

Divs 4 and 5 got WEIRD settings.

Now, I tried stepping through the code, but your jQuery is minified.

My guess is there is something wrong with the animate('left','+=50%');

Cheers,
JK

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED]
 On
Behalf Of ^AndreA^
Sent: Saturday, November 22, 2008 3:29 PM
To: jQuery (English)
Subject: [jQuery] animate problem with IE7

Hi all,

I'm working on a

 slideshow/carousel:http://www.lesperimento.netsons.org/various/my_carousel/

It's works fine except than in IE7/6 (basically as usual... ;-) )

It's weird also because the next button/arrow works well under IE
but NOT the prev button/arrow; and that's the problem.

I explain briefly how the script works.

When you click the arrows you call next_f(); and prev_f(); that do
exactly the same thing but in different direction.
They call three functions:

1) choose_element_to_move(some_params); it's quite clear the meaning,
anyway it choose which li elements have to be moved.

2) place_elem_right_pos(some_params); once it knows which elements
have to be moved, it moves them in the right position

[jQuery] animate problem with IE7

2008-11-22 Thread ^AndreA^

Hi all,

I'm working on a slideshow/carousel:
http://www.lesperimento.netsons.org/various/my_carousel/

It's works fine except than in IE7/6 (basically as usual... ;-) )

It's weird also because the next button/arrow works well under IE
but NOT the prev button/arrow; and that's the problem.

I explain briefly how the script works.

When you click the arrows you call next_f(); and prev_f(); that do
exactly the same thing but in different direction.
They call three functions:

1) choose_element_to_move(some_params); it's quite clear the meaning,
anyway it choose which li elements have to be moved.

2) place_elem_right_pos(some_params); once it knows which elements
have to be moved, it moves them in the right position and ready for
the animation.

3) move(elem,imgs); it moves the elements...
elem: is an array containing all the id of the elements to move
imgs: is an int, it's the number of images to move (I need it
because via php ,when the page is generated, I can change the number
of elements)

The problem is in move(elem,imgs), in this part that is the
prev_button where sing0:

JS:
else if(sign0) //prev button
{
for(var i=imgs-1; i=0;i--)
{
$('#' + elem[i]).animate({
left:  '+=' + perc + '%'
},
1000);
}
  }

I cut part of the code that was not useful for the purpose...

Basically it does not do anything else than taking each element to
move e move them, but I don't understand why it does not want to work
with IE. arghhh!!!

any idea?!?

I'm sure the problem is in this part of code because before I was
using another function instead of animate (two setTimeout in cascade)
and was working also under IE (I'm trying to use animate because is
much much smoother).

If you are still reading, thanks for your time... hehe...



[jQuery] Re: animate problem with IE7

2008-11-22 Thread ^AndreA^

Hi Jeffrey, thanks.

I deleted the float: left;, i didn't know was useless with
position:absolute;

Anyway, I noted the strange behaviour of the li elements too.

I uploaded jQuery unpacked... if you still want to have a look... ;-)

BTW, there could be something wrong with animate('left','+=50%'); but
that would mean a bug... :-|

Thanks,
Andrea


On Nov 22, 11:51 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote:
 I watched the animation with the IE developer toolbar, and noticed a couple
 of oddities.

 Firstly, the CSS for the divs are set to both position:absolute and
 float:left.  This is not the source of the problem (I overwrite to
 float:none and tried it), but float:left is unnecessary if with absolute
 positioning.

 Anyway, then I monitored the left: position as the animations happened.

 While going to the right, everything went as usual.

 Div#0    0% to -50%
 Div#1   25% to -25%
 Div#2   50% to   0%
 Div#3   75% to  25%
 Div#4  100% to  50%
 Div#5  125% to  75%

 All good.

 Then I refreshed and tried going to the left.

 Div#0    0% to  50%
 Div#1   25% to  75%
 Div#2   50% to 100%
 Div#3   75% to 125%
 Div#4  100% to  45%
 Div#5  125% to  48%

 As you can see, divs 0-3 were fine.

 Divs 4 and 5 got WEIRD settings.

 Now, I tried stepping through the code, but your jQuery is minified.

 My guess is there is something wrong with the animate('left','+=50%');

 Cheers,
 JK

 -Original Message-
 From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of ^AndreA^
 Sent: Saturday, November 22, 2008 3:29 PM
 To: jQuery (English)
 Subject: [jQuery] animate problem with IE7

 Hi all,

 I'm working on a 
 slideshow/carousel:http://www.lesperimento.netsons.org/various/my_carousel/

 It's works fine except than in IE7/6 (basically as usual... ;-) )

 It's weird also because the next button/arrow works well under IE
 but NOT the prev button/arrow; and that's the problem.

 I explain briefly how the script works.

 When you click the arrows you call next_f(); and prev_f(); that do
 exactly the same thing but in different direction.
 They call three functions:

 1) choose_element_to_move(some_params); it's quite clear the meaning,
 anyway it choose which li elements have to be moved.

 2) place_elem_right_pos(some_params); once it knows which elements
 have to be moved, it moves them in the right position and ready for
 the animation.

 3) move(elem,imgs); it moves the elements...
 elem: is an array containing all the id of the elements to move
 imgs: is an int, it's the number of images to move (I need it
 because via php ,when the page is generated, I can change the number
 of elements)

 The problem is in move(elem,imgs), in this part that is the
 prev_button where sing0:

 JS:
 else if(sign0) //prev button
         {
                 for(var i=imgs-1; i=0;i--)
                 {
                         $('#' + elem[i]).animate({
                                 left:  '+=' + perc + '%'
                                 },
                                 1000);
                 }
       }

 I cut part of the code that was not useful for the purpose...

 Basically it does not do anything else than taking each element to
 move e move them, but I don't understand why it does not want to work
 with IE. arghhh!!!

 any idea?!?

 I'm sure the problem is in this part of code because before I was
 using another function instead of animate (two setTimeout in cascade)
 and was working also under IE (I'm trying to use animate because is
 much much smoother).

 If you are still reading, thanks for your time... hehe...


[jQuery] Re: Js traditional to jquery syntax.... how?

2008-11-20 Thread Andrea - Aosta

thank you: but this only set the selected value, and not the set the
selected index

On 19 Nov, 19:19, aquaone [EMAIL PROTECTED] wrote:
 $(select).val(value); // for simple select
 $(select).val([value1,value2]); // for select multiple

 stephen

 On Wed, Nov 19, 2008 at 10:15, Andrea - Aosta [EMAIL PROTECTED] wrote:



  i Have this traditional style js script

  function Select_Value_Set(SelectName, Value) {
   eval('SelectObject = document.' +  SelectName + ';');
   for(index = 0;  index  SelectObject.length;    index++) {
    if(SelectObject[index].value == Value)
      SelectObject.selectedIndex = index;
    }
  }

  simply set the index of a select  to value choosed.
  In jquery it is possible to do this? How? Thank you


[jQuery] Js traditional to jquery syntax.... how?

2008-11-19 Thread Andrea - Aosta

i Have this traditional style js script


function Select_Value_Set(SelectName, Value) {
  eval('SelectObject = document.' +  SelectName + ';');
  for(index = 0;  index  SelectObject.length;index++) {
   if(SelectObject[index].value == Value)
 SelectObject.selectedIndex = index;
   }
}

simply set the index of a select  to value choosed.
In jquery it is possible to do this? How? Thank you


[jQuery] editing the content of a new window...

2008-11-18 Thread andrea varnier

hi :)
is it possible to edit the content of a freshly open window?
if I open it this way, for example:

var p = window.open('popup.html');

then if I do

var d = p.document;

and use

d.write('foo');

the document gets cleaned up and there's just 'foo' in the source.
that coul be ok, but if there's a div in the popup.html, with id
'bar', can I put some text in it?
$('#bar', d).html('foo');
doesn't work :(
thank you very much!


[jQuery] Re: Previous TD

2008-11-18 Thread andrea varnier

On 18 Nov, 04:12, Randy  Johnson [EMAIL PROTECTED] wrote:
 When I click on the date above I want to be able to change the rowSpan
 on the td that surrounds it.  I cannot seem to get it right.

try this:
$('#r2').parent().parent().attr('rowspan', '1');


[jQuery] Re: jqRevolve - new, simplistic carousel-like plugin released!

2008-11-16 Thread Andrea - Aosta

The web site don't work (Safari e FF under MAC).

On Nov 12, 11:38 pm, Brice Burgess [EMAIL PROTECTED] wrote:
 Ladies and Gentlemen,

   I'm writing to inform you all of a new addition to the jQuery plugin
 family... Please welcome jqRevolve!

   jqRevolve is a carousel-like plugin for jQuery. It provides a
 component that scrolls arbitrary content (Images, Markup, Text, Iframes,
 You Name it) in a defined 'clip region'. Yes, there are many out there.
 I needed a lightweight component that features automatic clip region
 sizing as well as pressure based scrolling. It is easy to use and customize.

   Checkout the plugin page for demonstrations. It is adequately boring
 enough for science. The examples can use some sprucing up by a
 designer -- if any volunteer.

 http://dev.iceburg.net/jquery/jqRevolve/

   Regards,

 ~ Brice


[jQuery] Re: My first attempt at showing/hiding div with jQuery

2008-10-24 Thread andrea varnier

On 24 Ott, 03:52, dsizemore [EMAIL PROTECTED] wrote:
 Hi,

 In my first attempt at showing and hiding a div with jQuery, I've
 hacked together this code and I'm looking for any thoughts on what I
 did wrong (if anything?) The code seems to work in FireFox, IE7, and
 Safari/Chrome. Opera and IE6 seem to work at random, so I'm not
 exactly sure what's up with them, but I assume my code is flawed?

hi :)
your code's fine.
just one pointer, if you use the id, you don't need the tag.
so instead of $('a#subscribeRollover'), you can write simply:
$('#subscribeRollover')
it's not wrong, simply redundant.

should be a bit faster, too, I think.


[jQuery] Re: drag drop not working under IE and Safari

2008-10-23 Thread ^AndreA^

I finally found out the problem...

I had called a js variable class (var class;), which is a keyword.

That's why it didn't work at all!!!

bye

On Oct 21, 4:44 pm, ^AndreA^ [EMAIL PROTECTED] wrote:
 Hi,

 I'm working on this drag  drop 
 script:http://www.lesperimento.netsons.org/various/jquery-mousemove/

 It works on Firefox and Opera but not at all on IE and Safari.

 The events seemed not to start at all...

 Any idea how to solve it?

 I tried to put some alert as well but they don't start, like if
 javascript were disabled.
 But it's not because in some other pages it works.

 Thank you in advance


[jQuery] Re: ajax upload file deletes input's paths...

2008-10-23 Thread ^AndreA^

I didn't solve the problem,

I just found a workaround.

bye

On Sep 30, 10:13 am, ^AndreA^ [EMAIL PROTECTED] wrote:
 Hello everyone,

 I'm uploading some images with AJAX (using ajaxfileupload), with a for
 loop I upload more than one image...

 It works very well but I've got an issue under IE7...

 After that the images have been uploaded the paths in the input fields
 are deleted!!!
 This does not happen on FF2/3, Safari and Opera...
 It's very annoying because, using AJAX, I don't refresh the page and I
 need the paths to be there untill the last submission with the normal
 php/html form...

 I cant' write in it because, for security reasons, the type=file
 attribute of the input field does not allow me to do that.

 Anyone knows why are deleted in IE7 and not under the other browsers?

 Should I try another plugin for the upload?

 Any advice would be very appreciate!!!

 Thanks,
 Andrea


[jQuery] drag drop not working under IE and Safari

2008-10-21 Thread ^AndreA^

Hi,

I'm working on this drag  drop script: 
http://www.lesperimento.netsons.org/various/jquery-mousemove/

It works on Firefox and Opera but not at all on IE and Safari.

The events seemed not to start at all...

Any idea how to solve it?

I tried to put some alert as well but they don't start, like if
javascript were disabled.
But it's not because in some other pages it works.

Thank you in advance


[jQuery] ajax upload file deletes input's paths...

2008-09-30 Thread ^AndreA^

Hello everyone,

I'm uploading some images with AJAX (using ajaxfileupload), with a for
loop I upload more than one image...

It works very well but I've got an issue under IE7...

After that the images have been uploaded the paths in the input fields
are deleted!!!
This does not happen on FF2/3, Safari and Opera...
It's very annoying because, using AJAX, I don't refresh the page and I
need the paths to be there untill the last submission with the normal
php/html form...

I cant' write in it because, for security reasons, the type=file
attribute of the input field does not allow me to do that.

Anyone knows why are deleted in IE7 and not under the other browsers?

Should I try another plugin for the upload?

Any advice would be very appreciate!!!

Thanks,
Andrea


[jQuery] Replace html class with rel attribute into an anchor

2008-09-21 Thread Andrea - Aosta

I need to replace an attribute inside a tag a...
I have this code html

a href=url.html class=iframe Link/a

And, for all link with iframe class, i need to have

a href=iframe.html rel=myrel  Link /a

I have try with


$(.iframe).append(rel='highslide-iframe');

but this append outside the a...

I think this is better:

$(.iframe).replaceWith(rel='highslide-iframe');

but how to set a replace saving the url target?
Thank you


[jQuery] Re: get an image from an input field just with javascript

2008-09-18 Thread ^AndreA^

yeah, unfortunately you are both right... :-|

In fact I was afraid to receive this answer...

Anyway, how can I upload the image just with js and without submitting
the form?

jQuery standard function ($.ajax) does not seem to allow a file/image
as a file type...

I also looked to some plugins and they allow just xml,json...

Have you got any idea about what I can use?

Thanks,
Andrea

On Sep 17, 6:53 pm, tlphipps [EMAIL PROTECTED] wrote:
 You could certainly accomplish this with a little bit of AJAX thrown
 in.

 Scenario:
 - user selects image (using input type='file')
 - user clicks 'preview' button
 - system submits selected image file via AJAX to server
 - server processes image upload and stores file on server
 - In the AJAX 'success' handler, create new img tag on page which
 references newly stored image file on server.

 On Sep 17, 12:04 pm, config [EMAIL PROTECTED] wrote:

  You can't view the file because of security restrictions.

  A *long* time ago one could grab the path and call it with the file://
  protocol, but this is now blocked in most (all?) browsers. Similarly,
  one can't write a path into the file input.

  G.


[jQuery] Re: get an image from an input field just with javascript

2008-09-18 Thread ^AndreA^

yeah, unfortunately you are both right... :-|

In fact I was afraid to receive this answer...

Anyway, how can I upload the image just with js and without submitting
the form?

jQuery standard function ($.ajax) does not seem to allow a file/image
as a file type...

I also looked to some plugins and they allow just xml,json...

Have you got any idea about what I can use?

Thanks,
Andrea

On Sep 17, 6:53 pm, tlphipps [EMAIL PROTECTED] wrote:
 You could certainly accomplish this with a little bit of AJAX thrown
 in.

 Scenario:
 - user selects image (using input type='file')
 - user clicks 'preview' button
 - system submits selected image file via AJAX to server
 - server processes image upload and stores file on server
 - In the AJAX 'success' handler, create new img tag on page which
 references newly stored image file on server.

 On Sep 17, 12:04 pm, config [EMAIL PROTECTED] wrote:

  You can't view the file because of security restrictions.

  A *long* time ago one could grab the path and call it with the file://
  protocol, but this is now blocked in most (all?) browsers. Similarly,
  one can't write a path into the file input.

  G.


[jQuery] get an image from an input field just with javascript

2008-09-17 Thread ^AndreA^

Hello everybody,

I wonder, is it possible to load an image (which the user is choosing
by a form) directly with javascript without submitting the form?

For instance, I could have:

form
  strongPage Background: /strong
  input id=bg_image_path type=file name=bg_image  /
  emUpload the image that you want to use as a background./
em

  a id=preview_btn href=javascript:void(0); PREVIEW/a

  input type=submit value=SUBMIT class=form_button
/form

If they press SUBMIT the form goes to the server but, if before, they
want to see a preview they can have it clicking the PREVIEW link... of
course. ;-)

I'm working on this preview just using javascript, is there a way to
get the picture and not the just path???

Because if I write:

$(#bg_image_path).val();

I'll get just the path.

Thanks in advance.

Andrea


[jQuery] Re: form plugin and a progress bar

2008-09-05 Thread andrea varnier

On 5 Set, 01:24, Mike Alsup [EMAIL PROTECTED] wrote:
 Unfortunately there is no way to know the progress of the upload with
 just HTML/JavaScript.  But you can do this with Flash.  Here's an
 example:

 http://www.pixeline.be/experiments/jqUploader/

 Mike

thanks mike :)


[jQuery] form plugin and a progress bar

2008-09-04 Thread andrea varnier

Hi :)
what I am trying to do is a file-upload form that uses ajax (and so
I'm using the form plugin) and that shows a progress bar while
uploading.
I've tried many solutions that I found over the internet but none
seemed to work.
possibly I am making mistakes somewhere in the process.
question is: is there a way to get the data I need? (i.e.: the
temporary file size)
the server is running php 5.1

could anyone please help me?

for example, see this:
http://t.wits.sg/misc/jQueryProgressBar/demo.php
the form seem to do what I need.
can this be used along with the form plugin?
maybe I'm asking a silly question, but I've tried so many times and I
don't really know what to do... :/

thank you in advance
andrea


[jQuery] Re: form plugin and a progress bar

2008-09-04 Thread andrea varnier

On 4 Set, 14:21, Giovanni Battista Lenoci [EMAIL PROTECTED] wrote:
 Hi andrea, it depends on what server side language you are using.

 Since you're italian I think this link can help you understand how to
 work with the apc extension for doing it in php:

 http://forum.html.it/forum/showthread.php?s=45a4891980adf6a46be2e9801...

thank you, the post is really good, but the server here is running PHP
5.1 :(


[jQuery] Re: Question about variable declaration

2008-08-20 Thread andrea varnier

thank you very much, all of you! :)

Now I got it, I really appreciate your help.

andrea


[jQuery] Re: Understanding JSON

2008-08-20 Thread andrea varnier

On 20 Ago, 09:35, Giovanni Battista Lenoci [EMAIL PROTECTED] wrote:
 For example, if you do an ajax request to a page.php that do a query to
 the db, and return the data, you'll user the function json_encode (php5,
 or PEAR on php4) to write the response for javascript.

if you cannot use that function (older version of PHP, or no modules
installed), you can simply write (echo) the json output.
like:

echo user = { 'firstName': 'John', /* and so on... */;

and jQuery will still get the data correctly


[jQuery] Re: how do I stop a further event will be ahppened again if current event has not yet finished

2008-08-19 Thread andrea varnier

On 19 Ago, 04:29, jack [EMAIL PROTECTED] wrote:
 If an event hasn't finished how do I prevent the same event being
 triggered again? Thank you in advance!

you could just unbind() the action from the element that triggers it,
and then re-bind it once the event has completed :)


[jQuery] Question about variable declaration

2008-08-19 Thread andrea varnier

Hi :)
in your plugins (I'm studying from the best here :))) I often find
variable assignments like this:

options = $.extend({
url:  this.attr('action') || window.location.toString(),
type: this.attr('method') || 'GET'
}, options || {});

it's like url = this OR that. right?
then I try, for example:

var $sel = $('.left_selected') || $('.right_selected');

meaning $sel = $('.left_selected') but if you don't find any element
with that class, $sel = $('.right_selected').
but this WON'T work :|
where is my mistake? at first I thought those declarations were just a
matter of true or false, but the example I reported above (taken from
alsup's form plugin) is clearly something more interesting!
can anyone help me please?
thank you
andrea


[jQuery] form plugin and select()

2008-07-21 Thread andrea varnier

Hi
first of all I wish to thank mike for his great form plugin :)
letely I've been developing a sort of remote file manager using PHP,
MySQL and jQuery.
for seamless file uploads I've integrated Mike's form plugin in it,
and it works sweet.

but I noticed that there was a little problem. at some point in
developing the normal jQuery select() method stopped working
correctly.
I used that to simulate window's behaviour on actions like 'create new
folder', where you get something like an input with the text 'New
folder' selected inside. for example:
$('input type=text value=New folder id=folderNew/
').appendTo('body').select();
the input appears, but the text inside is not selected.

after some tests I discovered that this was some kind of side effect
of having the form plugin included in the page.
so I took a look at the code, and I came out with this solution. I
added this at line #865

 else if (this.tagName.toLowerCase() == 'input') {
this.select();
}

don't know if it's a valid patch though, or if I messed up something
else.
for now it seems to work, I just wanted to share, and have your
opinions.
thanks
andrea


[jQuery] Re: contradictory between jquery and pure javascript

2008-07-03 Thread andrea varnier

On 3 Lug, 11:11, yazid [EMAIL PROTECTED] wrote:
 such a contradictory problems appear frequently, solution please.

maybe http://docs.jquery.com/Core/jQuery.noConflict

:)


[jQuery] Re: Code not working in IE

2008-06-27 Thread andrea varnier

On 27 Giu, 02:41, Pegpro [EMAIL PROTECTED] wrote:
 IE sucks. What is wrong here?

one question: why are these quotes backslashed?
 jQuery(\a:contains('Home')\)


[jQuery] Re: how to eliminate easing on animation?

2008-06-26 Thread andrea varnier

On 26 Giu, 00:02, Ariel Flesler [EMAIL PROTECTED] wrote:
 Yay! it works!

thanks Ariel, you ROCK!! ^^

another pointer. I'm using an ul, as said.
the cycle option doesn't seem to have any effect.
after finishing with the last element it returns to the first, by
doing a slow animation.
is there a way to have the first element coming out after the last, as
if it was 'appended' there?
thanks a lot!

andrea


[jQuery] Re: Add class on click, then remove when click another, and add to that.

2008-06-26 Thread andrea varnier

On 26 Giu, 07:47, hubbs [EMAIL PROTECTED] wrote:
 I have a list of links, and when one is clicked, I would like a class
 to be added.  I understand how to do this, but when you click another
 link, I would like the class removed from the first click and added to
 the second click, and so on, so that there is always only one link
 with the class applied.

this should do the trick:

var $a = $('a');
$a.click(function(){
$a.removeClass('myClass');
$(this).addClass('myClass');
});

:)


[jQuery] Re: Select option name attribute

2008-06-26 Thread andrea varnier

On 26 Giu, 05:08, Brad [EMAIL PROTECTED] wrote:
 Your options should have value attributes and not name.

 select name=textselector
 option value=11Text/option
 option value=12Text 2/option
 /select

 Try something like

 $(textselector option:selected).val();

This works, but since the selected option is the actual value of the
select, I would do something like this:

var x;
$('select[name=textselector]').change(function(){
x = $(this).val();
});

while keeping the names (if that is really what you want):

var x;
$('select[name=textselector]').change(function(){
x = $(this).children('option:selected').attr('name');
});


[jQuery] Re: submitting a form by pressing enter

2008-06-26 Thread andrea varnier

On 26 Giu, 06:20, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 Hi,

 I have a form, with id=myForm, with a number of text fields (input
 with type=text).  How do I cause a form submission by pressing enter
 in any of those form fields?

hi. shouldn't this be a default?


[jQuery] [serialScroll] how to eliminate easing on animation?

2008-06-25 Thread andrea varnier

Hi, how can I eliminate that sort of easing in the animations of the
SerialScroll plugin?
when an action starts, for example on an ul with images in its
li's, the images start moving slow, then they reach full speed, and
finally they stop by slowing down again. then the next animation is
fired.

I got say 16 pics, and I'd like to achieve a smooth animation for all
of them, as if they were actually cycling, not sliding one by one.
I tried step: 16 with a duration of 10 in the settings, but the
problem is that in this way the animation starts vry slowly :)
thanks


[jQuery] Re: How to make jquery do a link?

2008-06-25 Thread andrea varnier

On 25 Giu, 11:07, Pegpro [EMAIL PROTECTED] wrote:
 How can I make jquery do an effect when clicking a link and when it is
 finished animating follow the link?

you can use a callback function, that is to say a function that is
called when the effect has finished :)
fadeOut, for example:

$('a.myClass').click(function(e){
e.preventDefault();
var $this = $(this), link = $this.attr('href');
$this.fadeOut(function(){
window.location = link;
});
});


[jQuery] Re: how to eliminate easing on animation?

2008-06-25 Thread andrea varnier

I put a tag on the subject, but it disappeared... :|
anyway, the question is about the SerialScroll plugin, how can I
change the subject now?
thank you anyway :)


[jQuery] Re: select all divs with the same name

2008-06-20 Thread andrea varnier

On 19 Giu, 21:50, ontguy [EMAIL PROTECTED] wrote:
 Hello,

 How would I select all divs with a certain name?

what do you mean 'name'?
id? that would be $('#mydelete')

but it's like css, if you want a certain class $('.mydelete')

and so on...
http://docs.jquery.com/Selectors

:)


[jQuery] Re: select all divs with the same name

2008-06-20 Thread andrea varnier

On 20 Giu, 22:16, jggube [EMAIL PROTECTED] wrote:
 He meant id. In his example he used #mydelete. To select everything
 with class=test in mootools, you would do $$(.test).

so let's say that jQuery is cheaper, cause it uses less dollars :)


[jQuery] Re: Reversing slideDown/slideUp behavior

2008-06-16 Thread andrea varnier

On 15 Giu, 20:45, fallingandlaughing [EMAIL PROTECTED] wrote:
 Hello,

try and take a look at this great tutorial by karl swedberg
http://www.learningjquery.com/2008/02/simple-effects-plugins

:)


[jQuery] Re: ui.datepicker trouble

2008-06-16 Thread andrea varnier

On 15 Giu, 08:48, Shawn [EMAIL PROTECTED] wrote:
$(#criteriaStart).datepicker(setDate, sd);
$(#criteriaEnd).datepicker(setDate, ed);

I think you're missing curly brackets here:

$(#criteriaStart).datepicker({setDate: sd});


[jQuery] Re: Working with text

2008-06-16 Thread andrea varnier

On 15 Giu, 14:55, Ariel Flesler [EMAIL PROTECTED] wrote:
 var n = +forum-list-1.slice(-1);   ;-)

I think this won't work if the number has 2 or more digits.
The split('-').pop() way works better imho :)


[jQuery] Re: ui.datepicker trouble

2008-06-16 Thread andrea varnier

On 16 Giu, 11:48, Shawn [EMAIL PROTECTED] wrote:
 However, the docs found 
 athttp://docs.jquery.com/UI/Datepicker/datepicker#.22setDate.22dateendDate
 (scroll to the bottom of the page), do not seem to indicate an object is
 being used to pass the parameters.

you're right, and maybe my suggestion is wrong.
actually I use an older version of the datepicker.
but I gave the same piece of advice on this same ml a couple of days
ago, and it worked, so I just tried with you, too :D

in production here I don't use the latest ui.datepicker, so I can't
help that much.
sorry :)


[jQuery] Re: .load and asp.net postback

2008-06-16 Thread andrea varnier

On 16 Giu, 08:06, Mike [EMAIL PROTECTED] wrote:
 Any?

it would help if you posted some code, I think :)


[jQuery] Re: Clicking an image and changing a div's html content.

2008-06-16 Thread andrea varnier

On 16 Giu, 06:07, Jordban [EMAIL PROTECTED] wrote:
 I'd like to create an image that when clicked changes the html of a
 div. I'd like to have many different images that change the content of
 many different divs with different html.

hi :)
you don't need to create functions and pass parameters, neither you
need to use old 'onclick' attribute.
you simply attach a jQuery handle to images that have a certain class
(for example).
let's say those images are '.textChanger'.

$('.textChanger').click(function(){
// code here
});

now this is listening for a click on those images. each and every one
of them.
every time the event is fired, the code is executed.

what code?
I would do something like this (but it's just my way, there are surely
many other, and better).
I'd use the class name to store the id of the div that is going to be
changed.
if the class was like 'textChanger_div1', you could use a split()
method to get the id of the div.
like this:

$('img[class^=textChanger]').click(function(){
var $this = $(this);
var the_id = $this.attr('class').split('_')[1];
$('#' + the_id).html('strongcool this is bold/strong');
});

$('img[class^=textChanger]') means: look for the images that have a
class whose name starts with the string 'textChanger'.
hope this helps

andrea


[jQuery] Re: Use different CSS class

2008-06-16 Thread andrea varnier

On 16 Giu, 11:58, shapper [EMAIL PROTECTED] wrote:
 Hello,

 As far as I know to style the error messages a error CssClass is
 used.
 Can I use another CSS Class? For example, ShowError?

hi
you can use any class you want, as long as it is defined in your style
sheet :)


[jQuery] Re: reusing events on freshly ajax updated content

2008-06-16 Thread andrea varnier

On 16 Giu, 11:29, C. Feldmann [EMAIL PROTECTED]
wrote:
 I assume that the newly ajax updated content has not been initialized.

you're right.

 What do I have to call after an ajax updating function to ensure
 working events?

you could simply re-initialize the elements, or, better, read these:
http://www.learningjquery.com/2008/03/working-with-events-part-1
http://www.learningjquery.com/2008/05/working-with-events-part-2


[jQuery] Re: datepicker setDate

2008-06-09 Thread andrea varnier

On 8 Giu, 05:36, mark [EMAIL PROTECTED] wrote:
 but if i do this

  $('#date').datepicker(setDate, new Date ( January 6, 1972 ));

try adding curly braces, to define an object, like this:

$('#date').datepicker({defaultDate: new Date ( January 6, 1972 )});


[jQuery] form plugin doesn't want to submit a file

2008-05-23 Thread andrea varnier

hi :)
I have this form:

form id=sub_immagini enctype=multipart/form-data method=post
action=./../js/ajax/upload_files.php
input type=hidden name=sub_tipo value=foto/
div class=materiale
label for=new_foto_1File:/label
input type=file name=new_foto_1 id=new_foto_1 /
label for=alias_foto_1Nome:/label
input type=text name=alias_foto_1 id=alias_foto_1 /
label for=tags_foto_1Tags per l'immagine:/label
textarea name=tags_foto_1 id=tags_foto_1/textarea
div style=clear:both/div
input type=submit value=Carica/
/div !-- .materiale --
/form

jquery code is simple:

$('#sub_immagini').ajaxForm();

if I submit it while it's empty it seems to work (with firebug I see
the post request, even if I get no response, and that's strange), if I
try to upload a file, it does nothing (the page is reloaded, as if
there was no ajaxForm bind)...

what am I doing wrong?
thanks :)


[jQuery] Re: Color animation on textarea

2008-05-23 Thread andrea varnier

On 23 Mag, 13:48, yabado [EMAIL PROTECTED] wrote:
 Nice, but I thought this was built into JQ and did not require a
 plugin to work?

no, it is not :)


[jQuery] Re: Create slide box like yahoo

2008-05-16 Thread andrea varnier

On 16 Mag, 09:05, thiendv [EMAIL PROTECTED] wrote:
 Hi all! I want create slide box like click on More Yahoo! Services
 inhttp://www.yahoo.com. Please help me thanks

I'd suggest you read this great tutorial by Karl Swedberg
http://www.learningjquery.com/2008/02/simple-effects-plugins
:)


[jQuery] Re: how i can access classes in my div?

2008-05-14 Thread andrea varnier

On 13 Mag, 16:29, canadaduane [EMAIL PROTECTED] wrote:
 I wonder if you're looking for 'filter' instead of 'next'?

 $('.bloc-top').click(function(){
   $(this).filter('.bloc-center').slideToggle('slow');
 });

well... first of all I'm not quite sure about the html Luciano posted.
I supposed something like this:

 div id=box1 class=box
  div class=bloc-topcontent top/div
  div class=bloc-centercontent slideToggle/div
 /div

because the code he posted at the beginning contains the class
selector $('.bloc-center'), but there is no class=bloc-center in the
sample html.

anyway, filter() will not work in this case, because bloc-center is
not inside bloc-top, but it's next to it.
so I'm using next()

but maybe I went too far.
correct jQuery for an xml like this:

div id=box2 class=box
 bloc-topcontent top/bloc-top
 bloc-centercontent slideToggle/bloc-center
/div

would be:

$('bloc-top').click(function(){
$(this).next().slideToggle('slow');
});


[jQuery] Re: Disable Submit button if no text entered

2008-05-14 Thread andrea varnier

On 14 Mag, 11:01, sashabe [EMAIL PROTECTED] wrote:
 Hello!

hi :)
you'd better use the submit() method and 'return false'.
Then a quick solution to your problem could look like this:

$(document).ready(function(){
$('form').submit(function(){
if ($('input:first', 'form').val() == ''  $('textarea',
'form').val() == '') return false;
});
});

it would be better if you gave id's to the elements you're going to
check ;)


[jQuery] Re: how i can access classes in my div?

2008-05-13 Thread andrea varnier

On 13 Mag, 01:35, Luciano [EMAIL PROTECTED] wrote:
 how i can access classes in my div?
 div id=box1 class=box
  bloc-topcontent top/bloc-top
  bloc-centercontent slideToggle/bloc-center
 /div

 div id=box2 class=box
  bloc-topcontent top/bloc-top
  bloc-centercontent slideToggle/bloc-center
 /div

looking at your code, the action is something like this:
when the user clicks on a bloc-top element, slide-toggle the next
bloc-center element
right? this is done in jQuery like this (assuming bloc-top and bloc-
center are classes):

$('.bloc-top').click(function(){
$(this).next('.bloc-center').slideToggle('slow');
});

:)


[jQuery] Re: fastest way to edit a select

2008-05-12 Thread andrea varnier

On 9 Mag, 23:05, Wizzud [EMAIL PROTECTED] wrote:
 An alternative...

thanks Wizzud, your code is much faster than mine!!
thank you very much ^^


[jQuery] Re: Is there a way of counting the number of id's with the same name, and then renaming them _1, _2, _3 etc.

2008-05-12 Thread andrea varnier

On 12 Mag, 12:31, quirksmode [EMAIL PROTECTED] wrote:
 Hi,

 I am dynamically generating html which looks like this:

since you're generating the html dynamically, I'd suggest you do it
server side (i.e. a for loop).
if that is not possible, change div id=wrapper with div
class=wrapper, if you need the wrapper string, or simply div,
because having the same id over the page is definitely a bad thing :)
the a solution could be:

$('div').each(function(i){
var $this = $(this);
var the_id = $this.attr('class');
$this.attr('id', the_id + '_' + i)
});

this would be zero-based. change to (i+1) to have them starting with
wrapper_1.
without the class, shorter:
$('div').each(function(i){
$(this).attr('id', 'wrapper_' + i)
});

if those div's are inside something else (let's assume a div
id=container_div, you can add a context to the first selector, to
speed up the process:

$('div', '#container_div').each(function(i){
var $this = $(this);
var the_id = $this.attr('class');
$this.attr('id', the_id + '_' + i)
});


[jQuery] Re: IE7, simple AJAX, and nothing!

2008-05-12 Thread andrea varnier

On 12 Mag, 12:57, Bruce MacKay [EMAIL PROTECTED] wrote:
 Hello folks,

uhm... it's kinda strange O_o
maybe this line:

  $(#justlist,#tech).hide();

is hiding something it should not?
just guessing ^^


[jQuery] Re: List ul slideDown/Up Menu

2008-05-10 Thread andrea varnier

On 9 Mag, 23:11, Panman [EMAIL PROTECTED] wrote:
 Andrea, when I changed to hover() the stopPropagation() effected
 negatively. Once I removed that it started working ok. Also, what is
 variable e when passing it to the function? Thanks

e stands for event (you can use the entire word as well).
the stopPropagation() method is useful when you want to limit the
action of an handler.
because, say, if you click on a li, you're implicitly clicking on a
ul, and if the ul's inside a div, you've clicked that div,
too. so if you have actions bound to those elements, you'll fire them.
I thought it might have helped, but it did not :))
anyway I checked the page, and now it works way better!


[jQuery] Re: fastest way to edit a select

2008-05-10 Thread andrea varnier

thank you very much to the both of you!
I'll try and let you know :)

just a question for Wizzud: what is this? O_o

 me[sel_val=='' || me.is('.'+sel_val) ? 'show' : 'hide']();

if I get it, writing
me.show();
or
me['show']();
is the same? I didn't know.
thanks
andrea


[jQuery] fastest way to edit a select

2008-05-09 Thread andrea varnier

Hi :)
what is the fastest way to edit a select item?
I need to show some option's and hide some others, depending on the
value of another select.
let's say if the user selects a country for his holiday, in the
'#hotel_paese' select, the '#hotel_destinazione' select will show only
the hotels of that country.
problem is that the '#hotel_destinazione' select has already got its
values, so I'm using the class attribute to keep track of the country.
so if, say, egypt has code '001', then sharm el sheik, abu simbel,
aswan, luxor, and so on will all have class '001'.

the .show() and .hide() methods seem to be a little too slow.
or maybe is my code?

// this is the select
$('#hotel_paese').change(function(){
var $this = $(this);
var sel_val = $this.val();
$('#hotel_destinazione option').show()
if (sel_val != '') $('#hotel_destinazione option').not('.' +
sel_val).hide();
});

thank you very much :)


[jQuery] Re: List ul slideDown/Up Menu

2008-05-09 Thread andrea varnier

not sure but you could try something like this, to get more
specific...

$('#Main_Nav li:has(ul)').mouseover(function(e) {
e.stopPropagation();
$(this).children('ul').slideDown('normal');
}).mouseout(function(e) {
e.stopPropagation();
$(this).children('ul').slideUp('normal');
});

btw you don't need the .end() method at the end ;)


[jQuery] Re: Ajax: Posting Xml Data

2008-05-09 Thread andrea varnier

On 9 Mag, 17:17, NeilM [EMAIL PROTECTED] wrote:
 success : function(data) {
 // Process data here
 }

what is this function supposed to do?
it seems that it doesn't get the correct data (like the data var is
empty or something).
are you sure that your serverside script gives the correct answer?
and what about the xmlString you're sending via post? is it exactly
what the server is expecting?

:)


[jQuery] Re: .load() problem

2008-05-03 Thread ^AndreA^

Hi,

I think it's a normal issue with jQuery, and happens to everyone
before or late... ;-)

The problem is that when you load the whole DOM at the beginning, the
external html file is not loaded yet... and so It doesn't exist at
all.
Then you load it but it's not bound to any event... that's the
problem!

You could avoid this problem by using a plugin, livequery plugin works
pretty well for me...

You can find it here: http://plugins.jquery.com/project/livequery/

Hope this helps



On May 3, 7:58 am, Sid [EMAIL PROTECTED] wrote:
 Hi,

 I've tried searching for a solution to this, but haven't found
 anything.

 I load an external html file into a div using .load()
 The external file contains only a huge div tag with the id 'inText'
 The CSS rules apply to it, but the jQuery doesn't.

 However, when I put in an alert or a setTimeout between the load and
 the next jQuery, it works perfectly.

 1)  The first issue here is that the next jQuery instruction is
 executed before the external div has loaded. Is there a jQuery way to
 check whether the load is complete? document.ready doesn't work here.

 2) The classes contained within the newly loaded div are not
 recognised by jQuery. It's as if a snapshot was created of the
 original DOM, but new additions are not recognised. For example, I
 have a Downloads link on my mainpage with the class 'downloads'. This
 works perfectly.
 Then i have another 'downloads' class link on my 'Thanks To' page
 (loaded from outside), and this doesn't work.

 Check this athttp://sid-deswal.110mb.com

 Regards
 Sid


[jQuery] Re: .load() problem

2008-05-03 Thread ^AndreA^

or again... in this case, if you want to avoid the plugin use, you
could load also the javascript within the html file...

FILE_TO_LOAD.php

?php

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

   /* DO SOME jQuery CODE */
   };
/script

div 

   /* DO SOME HTML CODE */
/div
END;
?

byeee...

On May 3, 2:41 pm, ^AndreA^ [EMAIL PROTECTED] wrote:
 Hi,

 I think it's a normal issue with jQuery, and happens to everyone
 before or late... ;-)

 The problem is that when you load the whole DOM at the beginning, the
 external html file is not loaded yet... and so It doesn't exist at
 all.
 Then you load it but it's not bound to any event... that's the
 problem!

 You could avoid this problem by using a plugin, livequery plugin works
 pretty well for me...

 You can find it here:http://plugins.jquery.com/project/livequery/

 Hope this helps

 On May 3, 7:58 am, Sid [EMAIL PROTECTED] wrote:

  Hi,

  I've tried searching for a solution to this, but haven't found
  anything.

  I load an external html file into a div using .load()
  The external file contains only a huge div tag with the id 'inText'
  The CSS rules apply to it, but the jQuery doesn't.

  However, when I put in an alert or a setTimeout between the load and
  the next jQuery, it works perfectly.

  1)  The first issue here is that the next jQuery instruction is
  executed before the external div has loaded. Is there a jQuery way to
  check whether the load is complete? document.ready doesn't work here.

  2) The classes contained within the newly loaded div are not
  recognised by jQuery. It's as if a snapshot was created of the
  original DOM, but new additions are not recognised. For example, I
  have a Downloads link on my mainpage with the class 'downloads'. This
  works perfectly.
  Then i have another 'downloads' class link on my 'Thanks To' page
  (loaded from outside), and this doesn't work.

  Check this athttp://sid-deswal.110mb.com

  Regards
  Sid


[jQuery] Re: get a a inside a div

2008-04-28 Thread ^AndreA^

Ok alexandre... you got it! ;-)

yes, the markup for the login div is loaded on page load while the
logout button markup is loaded later via ajah trough sign_in.php.
In fact the server send this command:
$(#welcome_div).html(bWelcome/b i$_user/i!!! br/ a
href='#' id='log_out_link' Log out /a);
and then Javascript evals it.

As you told me this issue is quite usual and in fact I had though
about that... but now I tell you why I still did that mistake.

Anyway, the problem is solved... the livequery plugin is amazing!
Thanks Alexandre.
This is just a pour parle... maybe in order to clarify an
issue... ;-)

Well, in the website on which I'm working when you click on the Sign
Up link the server sends the form and all the javascript functions I
need to make it works:
$(#sign_up_div).load(server_scripts/
sign_up_div.php).css({visibility: visible});
so, now the DOM has been modified but anyway it still works and I
though because of the fact that I loaded also the javascript functions
together with the new markup...

In the mistake of the Log Out link I though to do the same... via
ajax (instead than with a load function) I changed the content of a
div with html markup language and I loaded the javascript functions
evaluating them...
Here the js code is:
$(document).ready(function(){
$(#log_out_link).click(function(){
alert(Log out in progress...);
$.post(server_scripts/log_out.php,
function(response){
alert(log out succesfully done...);
eval(response);
}
);
});
});
$(#welcome_div).html(bWelcome/b i$_user/i!!! br/ a
href='#' id='log_out_link' Log out /a);

The two way of proceeding seem similar to me...

Anyone can find out what's the difference?!?

If you think I'm a bit confused 'cause I don't see the real
difference... yes, I'm a bit confused!!! hehe...



By the way guys, thank you very much at all for the great support!!!

Cheers



On Apr 26, 10:06 pm, Alexandre Plennevaux [EMAIL PROTECTED]
wrote:
 ok ^AndreA^, i think  i got it.

 I think the markup for the login div is loaded on page load, while the
 logout button markup is fetched via your ajax call to sign_in.php, right?

 In such case the issue you are facing is normal, and quite usual: the event
 binding is set on page load. Since your logout link markup does not exist
 yet, the event is not binded, whereas your div markup is available on
 document ready, so its event does work.

 the best solution is to use the livequery plugin, which allows to bind
 events even to markup that is not available at the document.ready time.

 Its a really useful plugin , since you do your application using ajax, i can
 only strongly recommend you to use it.

 after you will have added the link to the plugin in your page header you can
 simply use it like this:

 instead of:

 $('#log_out_link').bind('click',function(){])

 you go:

 $('#log_out_link').livequery('click',function(){])

 hope this helps,

 alexandre


[jQuery] Re: get a a inside a div

2008-04-26 Thread ^AndreA^

OK, Alexandre, let's try!

As you have undestood the problem is on the log out link, so before,
you have to log in... and that's for sure as well!!! ;-)

username: user
password: user

anyway you could create your own user... it takes 3 seconds... no
email check and or confirmation, no nothing at all.
you could invent whatever you want...

I prepared two links...

1) http://lesperimento.netsons.org/click_whole_div/
for the log out you can click on the whole div (#welcome_div)...
after the log out you have to refresh the page because the click event
is always on the whole div... and NOT just on the proper link.

2) http://lesperimento.netsons.org/click_just_link/
here, after the log in, you'd have to click just on the log out link
(#log_out_link)...
but nothing happen!!!

The websites are exactly the same... I've just changed the id on which
the click event works...

Any question about the php server-side just ask...

Hope to find out the mistake...

Cheers

On Apr 25, 12:52 pm, Alexandre Plennevaux [EMAIL PROTECTED]
wrote:
 at this point i suggest you publish online a copy of your page so that we
 can have a look, because the error is somewhere in your markup, that's for
 sure :)



 On Fri, Apr 25, 2008 at 9:26 AM, ^AndreA^ [EMAIL PROTECTED] wrote:

  Good observation Olaf but it doesn't work...

  Actually it's strange, isn't it?

  If I do this it works when you click wherever in the div:
  $(document).ready(function(){
  $(#id_div).click(function(){ etc...

  while like that it doesn't work at all:
  $(document).ready(function(){
  $(#log_out_link).click(function(){ etc...

  That means to me I can't get a a element inside a div directly...
  is that true?
  sounds strange...

  Karl I tried also to put return false in the last line but nothing
  happen...

  Instead for this possibility
  .click(function(event) {
  event.preventDefault();
  etc...

  I really don't know how to use it!

  Anyway I'm not preventing the default event from firing, at least not
  on purpose... ;-)

  any other advice?

  by the way, many thanks guys for the help!!!

  On Apr 24, 11:17 pm, Olaf Bosch [EMAIL PROTECTED] wrote:
   ^AndreA^ schrieb:

Yes, href=#...

Could it be a problem?!?
I put # just in oder to make it a link...

This is what I've got into my div:

bWelcome/b i$_user/i!!! br/ a href='#' id='log_out_link'
Log out /a

   why bind you not direct to the given ID, so:

   $(document).ready(function(){
   $(#log_out_link).click(function(){ etc...

   --
   Viele Grüße, Olaf

   ---
   [EMAIL PROTECTED]://
  olaf-bosch.de/http://ohorn.info/http://www.akitafreund.de/
   ---

 --
 Alexandre Plennevaux
 LAb[au]

 http://www.lab-au.com


[jQuery] Re: get a a inside a div

2008-04-25 Thread ^AndreA^

Good observation Olaf but it doesn't work...

Actually it's strange, isn't it?

If I do this it works when you click wherever in the div:
$(document).ready(function(){
$(#id_div).click(function(){ etc...

while like that it doesn't work at all:
$(document).ready(function(){
$(#log_out_link).click(function(){ etc...

That means to me I can't get a a element inside a div directly...
is that true?
sounds strange...



Karl I tried also to put return false in the last line but nothing
happen...

Instead for this possibility
.click(function(event) {
event.preventDefault();
etc...

I really don't know how to use it!

Anyway I'm not preventing the default event from firing, at least not
on purpose... ;-)

any other advice?

by the way, many thanks guys for the help!!!

On Apr 24, 11:17 pm, Olaf Bosch [EMAIL PROTECTED] wrote:
 ^AndreA^ schrieb:

  Yes, href=#...

  Could it be a problem?!?
  I put # just in oder to make it a link...

  This is what I've got into my div:

  bWelcome/b i$_user/i!!! br/ a href='#' id='log_out_link'
  Log out /a

 why bind you not direct to the given ID, so:

 $(document).ready(function(){
 $(#log_out_link).click(function(){ etc...

 --
 Viele Grüße, Olaf

 ---
 [EMAIL PROTECTED]://olaf-bosch.de/http://ohorn.info/http://www.akitafreund.de/
 ---


[jQuery] get a a inside a div

2008-04-24 Thread ^AndreA^

I think it's simple but it doesn't work... to me. ;-)

I want to fire an event when I click on that a link inside a
div...

Inside of the div id=id_div there are:
b /b
i /i
a /a

So a would be the third element but it's the first and unique
a

I tried something like that:
$(document).ready(function(){
$(#id_div a).click(function(){ etc...

but it doesn't work.

I tried also:
$(document).ready(function(){
$(#id_div).find(a).click(function(){ etc...

and it doesn't work as well...

If I do this it works but not the way I want to:
$(document).ready(function(){
$(#id_div).click(function(){ etc...

because, of course, it fires the event wherever you click inside of
the div...
instead I want to fire the event just when you click on the a link.

any idea?

thanks in advance!!!


[jQuery] Re: get a a inside a div

2008-04-24 Thread ^AndreA^

Yes, href=#...

Could it be a problem?!?
I put # just in oder to make it a link...

This is what I've got into my div:

bWelcome/b i$_user/i!!! br/ a href='#' id='log_out_link'
Log out /a



On Apr 24, 1:08 pm, Alexandre Plennevaux [EMAIL PROTECTED]
wrote:
 do you actually have an HREF attribute to your A tag ? Because its omission
 kills the click event i think.



 On Thu, Apr 24, 2008 at 1:22 PM, ^AndreA^ [EMAIL PROTECTED] wrote:

  I think it's simple but it doesn't work... to me. ;-)

  I want to fire an event when I click on that a link inside a
  div...

  Inside of the div id=id_div there are:
  b /b
  i /i
  a /a

  So a would be the third element but it's the first and unique
  a

  I tried something like that:
  $(document).ready(function(){
  $(#id_div a).click(function(){ etc...

  but it doesn't work.

  I tried also:
  $(document).ready(function(){
  $(#id_div).find(a).click(function(){ etc...

  and it doesn't work as well...

  If I do this it works but not the way I want to:
  $(document).ready(function(){
  $(#id_div).click(function(){ etc...

  because, of course, it fires the event wherever you click inside of
  the div...
  instead I want to fire the event just when you click on the a link.

  any idea?

  thanks in advance!!!

 --
 Alexandre Plennevaux
 LAb[au]

 http://www.lab-au.com


[jQuery] Re: learning jquery

2008-04-11 Thread ^AndreA^

Probably a book is the best solution... but if you are not sure yet
(about if you really like jQuery and want to learn it) you can find
some good tutorials online...

I think you already know this link... but anyway...
http://docs.jquery.com/Tutorials

Some of them are very well made and a good point to start!

byeee

On Apr 11, 3:16 pm, Snef [EMAIL PROTECTED] wrote:
 Received my copy yesterday. Nice to read, easy to understand. I'd
 recommend it.

 (ordered another jQuery book also, that will be delivered next
 week)

 Further: look at examples and google a bit. A lot of examples can be
 found!

 upandhigh wrote:
  Read JQuery in Action book, you can found on main site links to it.
  it's really good and compact written and easy to understand.

  On Apr 11, 11:44 am, sebey [EMAIL PROTECTED] wrote:
   what is the best way to learn jquery? quickly and easliy


[jQuery] jqModal and Submit in existing window

2008-04-10 Thread Andrea-T


Hello,

I have a page which opens a jqModal window. This contains a new php-page via
the AJAX-Request of jqModal (actually the basic example no 2 on page
http://dev.iceburg.net/jquery/jqModal/)

Everything works fine and the window shows the correct content. In this
content I have a form with input fields. If one field is empty I want to
show an error message on this window, but it closes and I am back on my main
window.

What do I have to do (maybe a short example), to stay in the window until I
explicitly close it with jqmClose?

Thank you,
Andrea
-- 
View this message in context: 
http://www.nabble.com/jqModal-and-Submit-in-existing-window-tp16605108s27240p16605108.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] basic problem css

2008-04-09 Thread ^andrea^

Hi everybody,

I'm a new jQuery user and I'm already having some trouble... :-|

simply, I've got a menu:

ul class=main_menu
   li class=main_menu id=menu_id0 
a href=#HomepageHomepage/a
   /li
   li class=main_menu id=menu_id1 
a href=#application_1ONE/a
   /li
   li class=main_menu id=menu_id2 
a href=#application_2TWO/a
   /li
   li class=main_menu id=menu_id3 
a href=#application_3THREE/a
   /li
   li class=main_menu id=menu_id4 
a href=#application_4FOUR/a
   /li
/ul

and I want to change the background-color of the buttons anytime I
change the application...
When I load the website I'll be in the homepage so I want that button
red and the others blue...
when I select application 1, this button red and the others blue...
and so on!!!

actually, now, I'm just trying to change the color of the homepage
button when I load the page and I do this:

$(document).ready(function(){
$(#menu_id0).css({ background-color:red });
});

but Firebug tells me:
missing : after property id
[Break on this error] $(#menu_id0).css({ background-color:red });
\n

and anyway, it doesn't work at all...

any idea?

I hope someone will waste his time to answer... ;-)

cheers


[jQuery] Re: basic problem css

2008-04-09 Thread ^andrea^

wow, you've been as fast as Lightning...

That was exactly the point!

With quotes it work perfectly.

cheers again,

Andrea

On Apr 9, 12:52 pm, Richard D. Worth [EMAIL PROTECTED] wrote:
 On Wed, Apr 9, 2008 at 7:39 AM, ^andrea^ [EMAIL PROTECTED] wrote:

  when I load the page and I do this:

  $(document).ready(function(){
  $(#menu_id0).css({ background-color:red });
  });

  but Firebug tells me:
  missing : after property id
  [Break on this error] $(#menu_id0).css({ background-color:red });
  \n

 the hyphen/dash ( - ) isn't valid in a javascript variable name. You've got
 two options:

 Quotes:
 $(#menu_id0).css({ background-color:red });

 camelCase:
 $(#menu_id0).css({ backgroundColor:red });

 Note: The quotes around the key in a javascript hash can always be used,
 even if they're not needed. This is a case where they are needed.

 - Richard

 Richard D. Worthhttp://rdworth.org/


[jQuery] Re: missing ; before statement in ui.tabs

2008-03-10 Thread andrea varnier

On 9 Mar, 17:16, eyal [EMAIL PROTECTED] wrote:
 Hello,

 For some reason i'm having missing ; before statement error when i'm
 running ui.tabs altough on the demo page it's run just fine.

 What do think might be the problem?

 Thanks!
 Eyal

could you please post some of your code so we can see?
thanks :)


[jQuery] Re: display returned data from posting page

2008-03-10 Thread andrea varnier

On 9 Mar, 04:33, bwdev [EMAIL PROTECTED] wrote:
 I need to do a post and then have the posting page return some data
 into a var.  I've tried a few things but can't seem to get it to
 work.  Please see my pseudo code below.  How can I have the posting
 page return data via json?

hi, here it is your code, that should work:

 jQuery.post(container.url, {
 data1:1},
 function(data){
 var rData=data
   });

:)
andrea


[jQuery] Re: passing form data to $.ajax

2008-03-05 Thread andrea varnier

On 4 Mar, 12:58, Mike Alsup [EMAIL PROTECTED] wrote:
 You cannot upload files with ajax.  Use the form plugin for that 
 functionality.

thank you :)


[jQuery] passing form data to $.ajax

2008-03-04 Thread andrea varnier

hi :)
I'm wondering is there a way to pass form data to $.ajax()?
let's say I want to upload a file, what is the correct way?
passing the content of the input type=file this way
$('#myInput').val()
doesn't work.
How is that done?
thank you
andrea


[jQuery] Re: Div Changer Using Hide And Show

2008-02-22 Thread andrea varnier

On 21 Feb, 23:03, Sientz [EMAIL PROTECTED] wrote:
   $('a#blackbook').click(function() {
 //HIDE DIVS
 hide_divs();
 //SHOW LISTED DIV
 $('.blackbook').show('fast');
 return false;
   });

you see you got all these functions that basically do the same thing.
if an anchor has an id, they show the corresponding div

I think you could do it like this

$('a[id]').click(function(){
hide_divs();
var x = $(this).attr('id');
$('div[class= + x + ]').show('fast');
return false;
});

and should do the same thing.
but you could go further, and use classes in a different way.
let's say that instead of calling them divs with 'human' names, we can
use more 'efficient' names, like:

hs_a
hs_b
hs_c
hs_d
...
where hs stands for hide/show (just an example).
in this way the function hide_divs becomes something like

var hide_divs = function(){
$('div[class^=hs]').hide('fast');  /* this selector looks for
the div(s) that have a classname that starts with the string 'hs' */
};

then you give corresponding id's to the anchors, so the other on I
wrote before:

$('a[id^=hs]').click(function(){
hide_divs();
var x = $(this).attr('id');
$('div[class= + x + ]').show('fast');
return false;
});


[jQuery] Re: How can I make searching not case-sensitive?

2008-02-21 Thread andrea varnier

var xx=$(form#form1 *).fieldValue()[0].toLowerCase();

sorry :p


[jQuery] Re: How can I make searching not case-sensitive?

2008-02-20 Thread andrea varnier

On Feb 20, 8:55 pm, dinu [EMAIL PROTECTED] wrote:
  xx=$(form#form1 *).fieldValue()[0];

hi :)
have you tried this?
xx=$(form#form1 *).fieldValue()[0].toLowerCase;


[jQuery] Re: How to add a CSS Class to this

2008-02-18 Thread andrea varnier

On 18 Feb, 05:06, expresso [EMAIL PROTECTED] wrote:
 I figured maybe I could just append an addClass after the
 element.parent(td).next(td) but not sure if that's correct

that's correct if you want to add tha class to the table cell which is
next to the element you pass (to the function).
if it's the error that you want to apply the class to, instead, the
addClass goes outside, for example:

error.addClass('yourClass').appendTo(element.parent(td).next(td));

 then where and how to define the class itself.  Does that go inside
 the function or outside.  I assume outside.

the class would be defined in the css file :)


[jQuery] Re: How to add a CSS Class to this

2008-02-18 Thread andrea varnier

On 18 Feb, 10:15, andrea varnier [EMAIL PROTECTED] wrote:
 that's correct if you want to add tha class to the table cell which is
 next to the element you pass (to the function).

I'm sorry this is completely wrong!!! :)))
don't know what I wrote. like you would put addClass inside the
appendTo, sorry.
 error.appendTo(element.parent(td).next(td).addClass('yourClass'));
this makes no sense at all.


these two:

 error.addClass('yourClass').appendTo(element.parent(td).next(td));
 error.appendTo(element.parent(td).next(td)).addClass('yourClass');

should have the same effect.


[jQuery] Re: How to add a CSS Class to this

2008-02-18 Thread andrea varnier

On 18 Feb, 13:59, andrea varnier [EMAIL PROTECTED] wrote:
 $(element.parent('td').next('td').addClass('myClass');

errata corrige:
element.parent('td').next('td').addClass('myClass');
assuming var element already contains a jQuery object.

I'm sorry, I really should have stayed home today :|


[jQuery] Re: How to add a CSS Class to this

2008-02-18 Thread andrea varnier

On 18 Feb, 05:17, expresso [EMAIL PROTECTED] wrote:
 Actually I already included my .css page.  How do I just add a class
 to the td here is what I'm really asking.

$(element.parent('td').next('td').addClass('myClass');
this doesn't work?


[jQuery] Re: finding if element is focused

2008-02-18 Thread andrea varnier

On 18 Feb, 16:22, Eridius [EMAIL PROTECTED] wrote:
 anyone?

I think that if you don't post some more infos it will be very
difficult to think of an answer.
what do you need this for?
maybe someone can suggest another approach...
:)


[jQuery] Re: on form submission, how to decide on submit: return true / false

2008-02-15 Thread andrea varnier

On 15 Feb, 06:20, freech [EMAIL PROTECTED] wrote:
 1. I handle the check.php file like:
 ?php
 if (!isset($_POST['username'])) echo please input a username;
 ... if $username already exists, echo the name you try to register is
 already taken;

I think you could insert in your document a div with an
id=errorMessage (or whatever)
and then change the callback function of $.post so that it puts the
response message in the div.
for example

$.post('check.php',
   {
username: $('#username').val(),
password: $('#password').val()
   },
   function(data){
 $('#errorMessage').html(data);
 // but you still need some check to see if the form is ok
 // what does 'check.php' send back in case the form is
ok?
 // I assume nothing, so:
 if (data != ) return false;
  else return true;
   });

now I'm just thinking that maybe doing as I suggested wil not work,
because $.post is an asynchronous request.
you may want to lock the page somehow, and get a synchronous request,
and have the form submit waiting for the response...
not sure (I'm not that expert I fear), so have a look here
http://docs.jquery.com/Ajax/jQuery.ajax#options
:)


 2. I used form TARGET=?php echo $PHP_SELF; ?  to write the
 register form  data insert in same file: register.php, is there any
 way to combine the functions in check.php into register.php, which
 means all of the actions will be executed in 1 file?  looks like
 $.post('register.php'),  (call itself), are there any good solutions?

actually I don't know how that would work.
but you can try and let us know :)
good luck


[jQuery] Re: Animate function. Once I animate how do I er.... de... animate

2008-02-14 Thread andrea varnier

there's a toggle() method, too, that toggles between two functions.
like this:

$(#container).toggle(function() {
$(#container).animate({marginTop: -300px}, slow);
}, function() {
$(#container).animate({marginTop: 300px}, slow);
});

:)


  1   2   >