[jQuery] Re: Cross domain call using JQuery

2009-03-05 Thread baby

Hi,

Thanks for your suggestion. I have gone though this flicker example
and it is perfectly. flicker example is also working fine when i
integrate this code in my application however, when i try to call my
struts application url, it is not working.

do i need to do any configuration for this?

Once again Thanks for you quick response.

On Mar 4, 9:42 pm, mkmanning michaell...@gmail.com wrote:
 You don't have to go any further than the 
 docs:http://docs.jquery.com/Ajax/jQuery.getJSON#urldatacallback
 Run the flickr example and you'll see how JSONP works. In a nutshell,
 to get around crossdomain security issues, the getJSON call creates a
 script tag whose URL is the getJSON url, and the content of that
 script tag from the remote server is the callback function wrapping
 the JSON data.

 You can also use getScript to achieve the same end:

 Here's the flickr script with a callback function called 'foo' (look
 at in a browser, and then change the callback param to see how it
 wraps the payload in a function of that name):

 http://api.flickr.com/services/feeds/photos_public.gne?tags=cattagmo...

 As long as there's a function called 'foo', loading that script will
 call it:
 function foo(data){
     $.each(data.items, function(i,item){
             $(img/).attr(src, item.media.m).appendTo(#images);
             if ( i == 3 ) return false;
           });

 }

 On Mar 4, 6:23 am, MorningZ morni...@gmail.com wrote:

 http://www.ibm.com/developerworks/library/wa-aj-jsonp1/

  On Mar 4, 5:53 am, baby babybaby...@gmail.com wrote:

   Hi,

   We are developing an application where it needs to make a call to
   other web site. I am getting security exception when i tried to call
   it using JSON.

   Could you please guide us?

   Thanks.


[jQuery] Re: [validate] remote option needs name attribute, can't validate XHTML

2009-03-05 Thread Jörn Zaefferer
How is the name attribute invalid?
http://www.w3.org/TR/xhtml-modularization/abstract_modules.html#s_extformsmodule

Jörn

On Thu, Mar 5, 2009 at 10:06 AM, zemm simonenast...@gmail.com wrote:

 Hi,
 using jquery validate plugin seems that I can't avoid to use the
 name attribute in the text field for the captcha.
 Actually the validate plugin's remote method allows to send custom
 data, adding a data object:
  remote:{
                                                  url:captcha_ck.php,
                                                  type: post,
                                                  data:{
                                                                security_code: 
 function() {
                                                                return 
 jQuery(#security_code).val();
                                                                }
                                                        }
                                                  }

 but seems that the plugin itself will always look for the name
 attribute.
 My actual workaround is assigning the name attribute via jquery on
 document.ready, and it works (I mean, the w3c xhtml validator
 validates), but I still think that using the remote method shouldn't
 force me to use an attribute not compatible with w3c. Am I doing
 something wrong - missed something?


[jQuery] varXy.find(':text') or $(varXy).find(':text')

2009-03-05 Thread Ressmann Gerald (ewz)
Hi there
 
thats an easy one for you ;-)
 
if i do:
 
var mySet = $('trtd:nth-child(2n)');
 
how do I use mySet? What's the difference between
 
mySet.find(':text')
 
and
 
$(mySet).find(':text')
 
 
Thanks :-))
GGerri
 
 
 
 


[jQuery] Simple one: difference between varXy.find(':text') and $(varXy).find(':text')

2009-03-05 Thread ggerri


Hi there
 
thats an easy one for you ;-)
 
if i do:
 
var mySet = $('trtd:nth-child(2n)');
 
how do I use mySet? What's the difference between
 
mySet.find(':text')
 
and
 
$(mySet).find(':text')
 
 
Thanks :-))
GGerri
 
-- 
View this message in context: 
http://www.nabble.com/Simple-one%3A-difference-between-varXy.find%28%27%3Atext%27%29-and-%24%28varXy%29.find%28%27%3Atext%27%29-tp22348597s27240p22348597.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: varXy.find(':text') or $(varXy).find(':text')

2009-03-05 Thread ryan.j

mySet is an object or variable, $(mySet) will try to get the element
mySet


[jQuery] Re: Simple one: difference between varXy.find(':text') and $(varXy).find(':text')

2009-03-05 Thread ryan.j

mySet is an object or variable, $(mySet) will try to get an element
using the contents of mySet as the selector.

On Mar 5, 10:04 am, ggerri gerald.ressm...@ewz.ch wrote:
 Hi there

 thats an easy one for you ;-)

 if i do:

 var mySet = $('trtd:nth-child(2n)');

 how do I use mySet? What's the difference between

 mySet.find(':text')

 and

 $(mySet).find(':text')

 Thanks :-))
 GGerri

 --
 View this message in 
 context:http://www.nabble.com/Simple-one%3A-difference-between-varXy.find%28%...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: How do I translate this in jQuery?

2009-03-05 Thread Rick Faircloth

I'll have to set up a public demo, since this is a function
on private site management site!  :o)

Thanks for your help!

Rick

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf 
Of unwiredbrain
Sent: Wednesday, March 04, 2009 7:43 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: How do I translate this in jQuery?


2009/3/5 Rick Faircloth r...@whitestonemedia.com:
 That works great!  Simple and efficient.
 Thanks for the code.

Glad to know that, you're welcome man.

 The part you put together below was the final step of taking data 
 returned from component method in ColdFusion to the calling page and 
 displaying it on the calling page.

 A method had to be worked out to get the info from the target iFrame 
 to the calling page, or parent page, of the iFrame.  And this solution 
 works well.

*tongue-in-cheek* Oh, as a thank-you-gift, feel free to (privately) send me an 
invitation code when the app is up and running...

Meheheh :)
Just kidding :p

See yo around
--
unwiredbrain
Linux user #437712



[jQuery] Re: Trying to change CSS values for .ui-tabs but....

2009-03-05 Thread Charlie Tomlinson







.ui-state-active a {}

this works in firebug on current version of tabs on themeroller page


webspee...@gmail.com wrote:

  I can change the properties that I need to change except the a color
of the clicked tab. I've tried many combos, here is what I have.

/* Tabs
--*/
.ui-tabs {padding: .2em;}
.ui-tabs .ui-tabs-nav { padding: .2em .2em 0 .2em;  position:
relative;background-image: url(/images/blackgradient.jpg);}
.ui-tabs .ui-tabs-nav li
{
float: left;
border-bottom: 0 !important;
margin: 0 .2em -1px 0;
padding: 0;
list-style: none;
background-image: url(/images/blackgradient.jpg);
}
.ui-tabs .ui-tabs-nav li a { display:block; text-decoration: none;
padding: .5em 1em;color: white; }
.ui-tabs .ui-tabs-nav li.ui-tabs-selected
{
padding-bottom: .1em;
border-bottom: 0;
background-image: none;
border: red solid thin;
}
.ui-tabs .ui-tabs-nav li.ui-tabs-selected li.ui-tabs-selected
{
padding-bottom: .1em;
border-bottom: 0;
background-image: none;
}
.ui-tabs-selected {color: black;}
.ui-tabs .ui-tabs-panel { padding: 1em 1.4em;  display: block; border:
0; background: none; }
.ui-tabs .ui-tabs-hide { display: none !important; }

Any ideas?

  






[jQuery] Need to insert an element in DIV at position X Y

2009-03-05 Thread choesang

Hi!

I am trying to create a webpage where users can insert a pin (div) in
between the text using context menu.
My problem is that i do not know how to insert at the exact position.
Using Dom's I can arrive only to the nearest DIV but a DIV contains a
lot of text and the PIN has to be position close to the text.

I can obtain the position of the mouse click using pageX and pageY but
dont know how to insert an element at that position. I tried
insertAfter, prepend, append but not getting the desired result.

Any idea how to solve this problem.

regards,
choesang tenzin


[jQuery] Web Based Inventory

2009-03-05 Thread Sohail Asp

Hello Members.

I have designed Web Based Inventory System in ASP, I want suggestion
and replies  from experts about this sytem.

For demo please visit www.thetimesoft.com.

I am waiting your reply.

Thanks


[jQuery] Form Plugin ajax

2009-03-05 Thread makrohaus

Hi!

I have a form and i submit it with the Form Plugin via ajax.

My problem is that i have some inputs which are loaded on an action
via ajax.

When i submit the form the inputs which are loaded later will not be
submitted.

Has anyone any idea?

Thanks a lot!


[jQuery] Animate using relative %

2009-03-05 Thread Adam Jessop
*   

Hi,

 

I am  working on a site where are wanting to create a full screen site using  
percentages for positioning and displaying of content. As part of the project  
we also want to have some animation to bring objects onto the page.

We have the  objects in their correct positions using relative positioning and 
negative top  values for example: 

 

#myDiv{ top:  -26%;}

 

This is  where we wish the animation to end with the block in position so 
therefore its  starting value in the CSS could be:  “top:  0%”.

 

Now I made  the assumption that my js to achieve this would be:

 

$(‘#myDiv’).animate({top  : “-26%”});

 

After  testing this, it became clear that the animate function was ignoring the 
‘%’  sign and was just applying ‘-26px’ instead.

 

After  positing this directly to John Resig via twitter I got a response asking 
me to  try:

 

$(‘#myDiv’).animate({top  : “-=26%”});

 

However the  object always animates to: “top: 0px” regardless of its starting 
position,  percentage value and the +=, -= notation.

 

Is this a  bug or am I missing something here? – Using JQuery 1.3.2

 

Adam Jessop.

[jQuery] search nodes in XML

2009-03-05 Thread Kranthi

Hi All,

I have a employees.xml, which contains employee nodes.

No in my HTML I should have a text box and a seach button.

Input value is sth like G% or Go%. I need to display all the matching
values like Google, google etc., in a table.

Is it possible to get this kind of output? Please help.

Thanks | Kranthi


[jQuery] Beginner a little stuck

2009-03-05 Thread ashbyrich

I have multiple forms of the nature

[code]
form
input hidden value =1
input submit class=submit
/form
form
input hidden class=qty value =2
input submit class=submit
/form

[/code]

I have the script as follows

[code]

script language=javascript
$(document).ready(function() {
$('.submit').click(function() {

var msg = $('.qty').val();

$.post(?= site_url('cart/add_cart') ?, {qty: msg}, function
() {
$('#sidebar').load('http://localhost/update_records.php');
});
  return false;
});

});
/script

[/code]

Problem is that i whichever submit button i press it only grabs value
1.  This is completely logical, I just don't know how to modify the
script to get the right form...
Apologies for dumb question..I will read the docs/do tuts soon..


[jQuery] Modify hash in Tabs plugin

2009-03-05 Thread fonoteca

I'm learning about JQuery and I'm absolute begginer.
I've looking for help about one issue that imagine is easy but I can't
find the answer till now.
I supose Klaus Hartl has the solution for this: How I modify the hash
of the tabs plugin?

I'm using the version 2 with the remote option:true.

By default appears numbers when I need show the title. With the remote
option and I don't know how make to appear the title of the link in
the hash instead the number.

At last, but no at least: of course sorry about my english. It's not
my native languaje.


I'm making tests and this is my code:


html
head
meta http-equiv=Content-Type content=text/html;
charset=utf-8
meta http-equiv=Content-Style-Type content=text/css
meta http-equiv=Content-Script-Type content=text/
javascript

titleMy web/title

script src=js/jquery-1.2.6.js type=text/javascript/
script
script src=js/jquery.history_remote.js type=text/
javascript/script
script src=js/jquery.tabs.js type=text/javascript/
script
script type=text/javascript
$(document).ready(function() {
$('#menu').tabs({ remote: true, fxFade: { height:
'show', opacity: 'show' }, fxSpeed: '4000'});
});
/script

script type=text/javascript
  $(document).ready(function($) {
   $(#fulla).fadeIn('slow');
  });
/script

link rel=stylesheet href=css/fonoteca.css type=text/css
media=print, projection, screen
!-- Additional IE/Win specific style sheet (Conditional
Comments) --
!--[if lte IE 7]
link rel=stylesheet href=css/fonoteca-ie.css type=text/
css media=projection, screen
![endif]--

/head
body
 !-- Inicio fulla --
 div id=fulla class=fulla style=display:none
  !-- Inicio container --
  div id=container class=container
   !-- Inicio header --
   div id=header class=header
Title
  /div
   !-- Fin header --

   !-- Inicio menu --
div id=menu class=menu
ul id=tabs class=tabs
lia href=html/inicio.html
title=IniciospanInicio/span/a/li
lia href=html/voces.html
title=VocesspanVoces de la Historia/span/a/li
lia href=html/anuncios.html
title=AnunciosspanAnuncios/span/a/li
lia href=html/gazapos.html title=Gazapos y
aneacute;cdotasspanGazapos/span/a/li
lia href=html/sintonias.html
title=Sintoniacute;asspanSintoniacute;as/span/a/li
lia href=html/emisoras.html
title=EmisorasspanEmisoras/span/a/li
/ul
/div
!-- Fin menu --
/div
!-- Fin contingut --
  /div
  !-- Fin container --

  !-- Inicio side --
  div id=side class=side
Lateral
  /div
  !-- Fin side --
  !-- Inicio pie --
  div id=pie class=pie_bis
Pie de la pagina
  /div
  !-- Fin pie --
 /div
 !-- Fin fulla --
/body
/html


[jQuery] jQuery Form Plugin Ajax Problem

2009-03-05 Thread makrohaus

Hi.

I have a form and i submit it with:
$(#form_ajax).ajaxSubmit();

My problem is that some of the inputs are loaded on an action via
ajax.

When i submit the form the inputs which are loaded later are not
submitted.

Has anyone any idea?

Thanks a lot!


[jQuery] Need to insert an element in DIV at position X Y

2009-03-05 Thread choesang

Hi!

I am trying to create a webpage where users can insert a pin (div) in
between the text using context menu.
My problem is that i do not know how to insert at the exact position.
Using Dom's I can arrive only to the nearest DIV but a DIV contains a
lot of text and the PIN has to be position close to the text.

I can obtain the position of the mouse click using pageX and pageY but
dont know how to insert an element at that position. I tried
insertAfter, prepend, append but not getting the desired result.

Any idea how to solve this problem.

regards,
choesang tenzin


[jQuery] Ajax get is not working in IE

2009-03-05 Thread Kranthi

Hi All,

I am new to JQuery. I tried this example from

http://www.webmonkey.com/tutorial/Easy_XML_Consumption_using_jQuery

This works fine in Firefox but in IE I am not able to see the data.

Also, if namespaces are used in XML, how should I handle?

Thanks | Kranthi


[jQuery] Several star ratings on one page

2009-03-05 Thread Dave Redfern

Hello,

I have a listing page with lots of items each having a rating using
http://www.fyneworks.com/jquery/star-rating/.

The first star rating works great but all the others on the page have
issues with removing the hover class.  I have found out that the
reason for this is they all have the same name (although in different
forms).

Does anyone know of a fix?
Dave.


[jQuery] script element added with XMLHTTPRequest

2009-03-05 Thread ruturajv

I added a script element with jQuery as
code
$j('script type=text/javascript src=http://domain.com/script.js;/
script').appendTo(body);
/code
It adds the file correctly, however it uses AJAX or XHR to get the
file and it adds _=1323131546 (some number, I guess to disable
caching) to query the script.

Is there anyway to disable this, ie call it normally as for other
elements eg link (for css). ?


[jQuery] Re: jQuery Form Plugin Ajax Problem

2009-03-05 Thread Mike Alsup

 I have a form and i submit it with:
 $(#form_ajax).ajaxSubmit();

 My problem is that some of the inputs are loaded on an action via
 ajax.

 When i submit the form the inputs which are loaded later are not
 submitted.

 Has anyone any idea?

 Thanks a lot!


If those inputs are added to the form they will be submitted.  Can you
post a link?


[jQuery] Re: Beginner a little stuck

2009-03-05 Thread Liam Potter


you need to first of all, write a valid form.

form
input type=hidden value=1 /
input type=submit class=submit /
/form

then your script needs to be

script language=javascript
$(document).ready(function() {
   $('.submit').click(function() {
$(this).parents('form').each(function(){
   var msg = $('.qty').val();

   $.post(?= site_url('cart/add_cart') ?, {qty: msg}, function
() {
   $('#sidebar').load('http://localhost/update_records.php');
   });
 return false;
});
   });

});
/script


ashbyrich wrote:

I have multiple forms of the nature

[code]
form
input hidden value =1
input submit class=submit
/form
form
input hidden class=qty value =2
input submit class=submit
/form

[/code]

I have the script as follows

[code]

script language=javascript
$(document).ready(function() {
$('.submit').click(function() {

var msg = $('.qty').val();

$.post(?= site_url('cart/add_cart') ?, {qty: msg}, function
() {
$('#sidebar').load('http://localhost/update_records.php');
});
  return false;
});

});
/script

[/code]

Problem is that i whichever submit button i press it only grabs value
1.  This is completely logical, I just don't know how to modify the
script to get the right form...
Apologies for dumb question..I will read the docs/do tuts soon..
  


[jQuery] Re: Web Based Inventory

2009-03-05 Thread Rick Faircloth

From a quick glance...in the Purchase area, why not make the item entry
field
a drop down instead of opening a new window and requiring the user to type
the info in directly?

Rick

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Sohail Asp
Sent: Thursday, March 05, 2009 12:16 AM
To: jQuery (English)
Subject: [jQuery] Web Based Inventory


Hello Members.

I have designed Web Based Inventory System in ASP, I want suggestion and
replies  from experts about this sytem.

For demo please visit www.thetimesoft.com.

I am waiting your reply.

Thanks



[jQuery] Re: Form Plugin ajax

2009-03-05 Thread Rick Faircloth

Why are some inputs submitted later?
Why not all at the same time?

Rick

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of makrohaus
Sent: Thursday, March 05, 2009 3:42 AM
To: jQuery (English)
Cc: m.gillho...@makrohaus.de
Subject: [jQuery] Form Plugin ajax


Hi!

I have a form and i submit it with the Form Plugin via ajax.

My problem is that i have some inputs which are loaded on an action via
ajax.

When i submit the form the inputs which are loaded later will not be
submitted.

Has anyone any idea?

Thanks a lot!



[jQuery] Re: .clone a form

2009-03-05 Thread Rick Faircloth

Not sure, but it might be that the .html() part is telling
the clone function to just clone the html *within* .hook:first.

What happens if you leave off the .html() part?

Rick

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of bstoppel
Sent: Wednesday, March 04, 2009 11:50 PM
To: jQuery (English)
Subject: [jQuery] .clone a form


Hi All.

I am having an issue with cloning a form. When I clone an existing form,
only the input tags are cloned. Here is an example

-- HTML

form class=hook action=do/something method=post
enctype=multipart/form-data
input type=text name=variable
input type=submit
/form

div id=clonehere/div

-- JQuery

$('#clonehere').append($('.hook:first').clone(true).html());

-- Result

#clonehere will only get this part of the form input type=text
name=variable input type=submit

What am I doing wrong?



[jQuery] Current item child index ?

2009-03-05 Thread Liam Byrne


Hi folks

Just wondering if there's a quick/shorthand way of doing this:

I'm doing a navigation system where I want clickable items but I want to 
put the current item number in a footer, e.g.


Any ideas of a quick way (without using each) to get CURRENTSTEPNUMBER 
? Basically the reverse of nth-child ?


CODE OUTLINE (IF IT HELPS) :

script
$(#stepsList li).click(function() {
 // load stepContent  === not a problem

  $(#stepFooter).html(Viewing step +CURRENTSTEPNUMBER+ of  
+$(#stepsList li).length);


})
/script


h1STEPS TO BE COMPLETED/h1
ul id=stepsList
listep one/li
listep two/li
/listep threeli
/ul

div id=stepContent

div id=stepFooter
/div
/div


[jQuery] Re: Simple one: difference between varXy.find(':text') and $(varXy).find(':text')

2009-03-05 Thread ggerri


Thanks Ryan :handshake:

so  mySet.find(':text').each(...) would be right and 
$(mySet).find(':text').each(...) not? :confused:

In examples I often see (within an each function): $(this).something but
also this.something

Still dont get the difference of use :,(

G




ryan.joyce...@googlemail.com wrote:
 
 
 mySet is an object or variable, $(mySet) will try to get an element
 using the contents of mySet as the selector.
 
 On Mar 5, 10:04 am, ggerri gerald.ressm...@ewz.ch wrote:
 Hi there

 thats an easy one for you ;-)

 if i do:

 var mySet = $('trtd:nth-child(2n)');

 how do I use mySet? What's the difference between

 mySet.find(':text')

 and

 $(mySet).find(':text')

 Thanks :-))
 GGerri

 --
 View this message in
 context:http://www.nabble.com/Simple-one%3A-difference-between-varXy.find%28%...
 Sent from the jQuery General Discussion mailing list archive at
 Nabble.com.
 
 

-- 
View this message in context: 
http://www.nabble.com/Simple-one%3A-difference-between-varXy.find%28%27%3Atext%27%29-and-%24%28varXy%29.find%28%27%3Atext%27%29-tp22348597s27240p22350689.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: draggable events not working with 1.3.2 version

2009-03-05 Thread Richard D. Worth
jQuery UI 1.5.3 is only compatible with jQuery 1.2.6. To use jQuery UI with
the latest version of jQuery (1.3+) you'll need the latest preview release:
1.6rc6.

- Richard

On Wed, Mar 4, 2009 at 7:02 AM, valugi val...@gmail.com wrote:


 This code works with 1.2.6 version but not on 1.3.2. The UI library is
 the same on both tries. No errors are reported in the firebug console.

 Anybody got any idea?


 script src=js/jquery-1.2.6.min.js type=text/javascript /script
 script src=js/jquery-ui-personalized-1.5.3.js type=text/
 javascript /script

 script type=text/javascript
$(document).ready( function(){
$(#test).draggable(
{
start: function( ev, ui){
$(#response).html(start);
},
stop: function( ev, ui){
$(#response).html(stop);
}
}
);
});

 /script


[jQuery] Re: Animate using relative %

2009-03-05 Thread John Resig

Not sure - do you have a sample that we can look at?

--John



On Thu, Mar 5, 2009 at 6:16 AM, Adam Jessop a...@infused-gaming.net wrote:
 Hi,



 I am working on a site where are wanting to create a full screen site using
 percentages for positioning and displaying of content. As part of the
 project we also want to have some animation to bring objects onto the page.

 We have the objects in their correct positions using relative positioning
 and negative top values for example:



 #myDiv{ top: -26%;}



 This is where we wish the animation to end with the block in position so
 therefore its starting value in the CSS could be:  “top: 0%”.



 Now I made the assumption that my js to achieve this would be:



 $(‘#myDiv’).animate({top : “-26%”});



 After testing this, it became clear that the animate function was ignoring
 the ‘%’ sign and was just applying ‘-26px’ instead.



 After positing this directly to John Resig via twitter I got a response
 asking me to try:



 $(‘#myDiv’).animate({top : “-=26%”});



 However the object always animates to: “top: 0px” regardless of its starting
 position, percentage value and the +=, -= notation.



 Is this a bug or am I missing something here? – Using JQuery 1.3.2



 Adam Jessop.


[jQuery] Re: Current item child index ?

2009-03-05 Thread Liam Byrne


Found this, which I reckon might be a slightly bigger load ?

$(#stepsList li).each(function(i) {
   $(this).click(function() {
// REFERENCE i IN HERE TO GET THE ITEM NUMBER
   }
}

Pity .click doesn't take the same index parameter :(

Any ideas, or for those in the know is the above much of a load difference ?

TIA
L

Liam Byrne wrote:


Hi folks

Just wondering if there's a quick/shorthand way of doing this:

I'm doing a navigation system where I want clickable items but I want 
to put the current item number in a footer, e.g.


Any ideas of a quick way (without using each) to get 
CURRENTSTEPNUMBER ? Basically the reverse of nth-child ?


CODE OUTLINE (IF IT HELPS) :

script
$(#stepsList li).click(function() {
 // load stepContent  === not a problem

  $(#stepFooter).html(Viewing step +CURRENTSTEPNUMBER+ of  
+$(#stepsList li).length);


})
/script


h1STEPS TO BE COMPLETED/h1
ul id=stepsList
listep one/li
listep two/li
/listep threeli
/ul

div id=stepContent

div id=stepFooter
/div
/div



No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.0.237 / Virus Database: 270.11.8/1984 - Release Date: 03/04/09 19:17:00


  




[jQuery] Re: Beginner a little stuck

2009-03-05 Thread Richard Wheatley


excuse my shorthand/laziness but confirm i have a valid form..

Still ot quite there but will go down this route ...R

Liam Potter wrote:


you need to first of all, write a valid form.

form
input type=hidden value=1 /
input type=submit class=submit /
/form

then your script needs to be

script language=javascript
$(document).ready(function() {
   $('.submit').click(function() {
$(this).parents('form').each(function(){
   var msg = $('.qty').val();

   $.post(?= site_url('cart/add_cart') ?, {qty: msg}, function
() {
   $('#sidebar').load('http://localhost/update_records.php');
   });
 return false;
});
   });

});
/script


ashbyrich wrote:

I have multiple forms of the nature

[code]
form
input hidden value =1
input submit class=submit
/form
form
input hidden class=qty value =2
input submit class=submit
/form

[/code]

I have the script as follows

[code]

script language=javascript
$(document).ready(function() {
$('.submit').click(function() {

var msg = $('.qty').val();

$.post(?= site_url('cart/add_cart') ?, {qty: msg}, function
() {
$('#sidebar').load('http://localhost/update_records.php');
});
  return false;
});

});
/script

[/code]

Problem is that i whichever submit button i press it only grabs value
1.  This is completely logical, I just don't know how to modify the
script to get the right form...
Apologies for dumb question..I will read the docs/do tuts soon..
  




[jQuery] Dynamic mailto: link.

2009-03-05 Thread Sir Rawlins

Hello Guys,

I have a 'mailto' link the emails of which I want to be dynamic based
on a bunch of checkboxes. So lets say my markup looks like this:

input type=checkbox name=UserEmails
value=some...@something.org /
input type=checkbox name=UserEmails value=some...@another.com /

input type=checkbox name=UserEmails value=some...@this.co.uk /
input type=checkbox name=UserEmails value=some...@blah.net /

a href=mailto:;Email These Users/a

I want to be able to tick the users I want to email and then click the
link.

How would I populate the mailto link with the values of the
checkboxes? am I best doing this with an Click() function on the
checkbox, or on a click() for the link perhaps?

I'd appreciate your thoughts on this guys,

Rob


[jQuery] RE: Anchors Images Tutorial

2009-03-05 Thread HM-User

I have had a look at this tutorial by Malsup and simply, you can add
an a link to the image slides.
However, for me like the tutorial with:

function onAfter() {
$('#output').html(Current anchor:  + this.href);

I have for myself:

before: onBefore,
pager: '#featurenav'
});
function onBefore() {
jQuery('#headline').html(this.alt);
}
});

The image slides are held within a div and it is simply: a
href=img src= alt=something //a.

But adding the a link to the img src tag does not make the alt text
appear but the image does link. How can I get the a link to the image
AND the alt text to appear as well?


[jQuery] Re: Simple one: difference between varXy.find(':text') and $(varXy).find(':text')

2009-03-05 Thread Rick Faircloth

Hi, Rayn :handshake: :o)

I think, for shorthand notation (some say for readability, but I think 
otherwise),
some set var's (variables) to represent pieces of code, for instance:

var mySet = '$(mySet)'

and then use it as:

mySet.find(':text')...

Written in longhand, it would be:

$('mySet').find(':text')...


When trying to read someone else's code, where this shorthand is use 
extensively,
I just find it hard to decipher, since I have to trace all the var's down to 
find
out what they stand for...

Someone please correct me if I'm wrong...

Rick

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf 
Of ggerri
Sent: Thursday, March 05, 2009 7:31 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Simple one: difference between varXy.find(':text') and 
$(varXy).find(':text')



Thanks Ryan :handshake:

so  mySet.find(':text').each(...) would be right and
$(mySet).find(':text').each(...) not? :confused:

In examples I often see (within an each function): $(this).something but also 
this.something

Still dont get the difference of use :,(

G




ryan.joyce...@googlemail.com wrote:
 
 
 mySet is an object or variable, $(mySet) will try to get an element 
 using the contents of mySet as the selector.
 
 On Mar 5, 10:04 am, ggerri gerald.ressm...@ewz.ch wrote:
 Hi there

 thats an easy one for you ;-)

 if i do:

 var mySet = $('trtd:nth-child(2n)');

 how do I use mySet? What's the difference between

 mySet.find(':text')

 and

 $(mySet).find(':text')

 Thanks :-))
 GGerri

 --
 View this message in
 context:http://www.nabble.com/Simple-one%3A-difference-between-varXy.find%28%...
 Sent from the jQuery General Discussion mailing list archive at 
 Nabble.com.
 
 

--
View this message in context: 
http://www.nabble.com/Simple-one%3A-difference-between-varXy.find%28%27%3Atext%27%29-and-%24%28varXy%29.find%28%27%3Atext%27%29-tp22348597s27240p22350689.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.




[jQuery] Re: Error: $(#suggest1).autocomplete is not a function

2009-03-05 Thread MorningZ

It doesn't work because you don't have the autocomplete js file
referenced/loaded


On Mar 5, 1:19 am, efet efetun...@gmail.com wrote:
 script type=text/javascript
 $().ready(function() {

   var data = [ {QUERY: $(#QUERY).val(), url:'test.asp?
 Process=CheckCustomer'} ];
   $(#suggest1).autocomplete(data);

 });

 /script
                 div class=required
                     label for=Test...Test.../label
                     input type=text id=suggest1 /
                 /div

 Data needs to be taken as:
 test.asp?Process=CheckCustomerQUERY=a

 Not very familiary with jquery yet. Can anyone tell me why I get the
 following error.

 Error: $(#suggest1).autocomplete is not a function
 Source 
 File:http://www.refinethetaste.com/html/cp/default.asp?Section=ordersProc...
 Line: 162


[jQuery] Re: Animate using relative %

2009-03-05 Thread Adam Jessop
Sure,

The site in question is at: http://be.0wned.co.uk

I have currently got active on there two examples of the situations I'm running 
into but let me run down the scene.

What we are trying to achieve is that the field, city, rocks and sign (divs 
have ID's reflecting those names) are different layers and will animate into 
the page from the bottom at queued intervals.

The rock and sign are in position as pointers.

With the field I am giving you the example where I use: 

$(#field).animate({ 
top:-=2%
  }, 1500);

The above results in an animation setting the result to: top:0px.


With the city... the position where it fits correctly is top:-69% however as 
explained previously, the animate function ignores percentage values and does 
them as px. So for the sake of an example I use:

  $(#city).animate({ 
top:'-565%'
  },1600);

This moves the position into the correct position, but proves the case that it 
uses px instead of % which is no good to me as on browser resize it loses its 
relative position.

I hope this helps, please let me know if I can assist any more.

Adam Jessop.

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf 
Of John Resig
Sent: 05 March 2009 12:34
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Animate using relative %


Not sure - do you have a sample that we can look at?

--John



On Thu, Mar 5, 2009 at 6:16 AM, Adam Jessop a...@infused-gaming.net wrote:
 Hi,



 I am working on a site where are wanting to create a full screen site 
 using percentages for positioning and displaying of content. As part 
 of the project we also want to have some animation to bring objects onto the 
 page.

 We have the objects in their correct positions using relative 
 positioning and negative top values for example:



 #myDiv{ top: -26%;}



 This is where we wish the animation to end with the block in position 
 so therefore its starting value in the CSS could be:  “top: 0%”.



 Now I made the assumption that my js to achieve this would be:



 $(‘#myDiv’).animate({top : “-26%”});



 After testing this, it became clear that the animate function was 
 ignoring the ‘%’ sign and was just applying ‘-26px’ instead.



 After positing this directly to John Resig via twitter I got a 
 response asking me to try:



 $(‘#myDiv’).animate({top : “-=26%”});



 However the object always animates to: “top: 0px” regardless of its 
 starting position, percentage value and the +=, -= notation.



 Is this a bug or am I missing something here? – Using JQuery 1.3.2



 Adam Jessop.

[jQuery] Re: Dynamic mailto: link.

2009-03-05 Thread ryan.j

i've not tested the code so sorry if i've fumbled this, but something
like...

var a = [];
$('input.emailAddress').each(function(i){
 a.push( $(this).val() );
});

should build an array of addresses you can a.join(, )

On Mar 5, 12:46 pm, Sir Rawlins robert.rawl...@thinkbluemedia.co.uk
wrote:
 Hello Guys,

 I have a 'mailto' link the emails of which I want to be dynamic based
 on a bunch of checkboxes. So lets say my markup looks like this:

 input type=checkbox name=UserEmails
 value=some...@something.org /
 input type=checkbox name=UserEmails value=some...@another.com /

 input type=checkbox name=UserEmails value=some...@this.co.uk /
 input type=checkbox name=UserEmails value=some...@blah.net /

 a href=mailto:;Email These Users/a

 I want to be able to tick the users I want to email and then click the
 link.

 How would I populate the mailto link with the values of the
 checkboxes? am I best doing this with an Click() function on the
 checkbox, or on a click() for the link perhaps?

 I'd appreciate your thoughts on this guys,

 Rob


[jQuery] Re: Dynamic mailto: link.

2009-03-05 Thread ryan.j

except i haven't answered your question, have i. :x

as long as the mail link is only ever going to perform one function,
i'd just stick a function call in the onclick event of the anchor.


[jQuery] Re: Dynamic mailto: link.

2009-03-05 Thread ryan.j

and you'd probably want to add :checked onto the end of the selector
too. ;)


[jQuery] Re: Animate using relative %

2009-03-05 Thread Adam Jessop

Sure,

The site in question is at: http://be.0wned.co.uk

I have currently got active on there two examples of the situations I'm running 
into but let me run down the scene.

What we are trying to achieve is that the field, city, rocks and sign (divs 
have ID's reflecting those names) are different layers and will animate into 
the page from the bottom at queued intervals.

The rock and sign are in position as pointers.

With the field I am giving you the example where I use: 

$(#field).animate({ 
top:-=2%  
  }, 1500);

The above results in an animation setting the result to: top:0px.


With the city... the position where it fits correctly is top:-69% however as 
explained previously, the animate function ignores percentage values and does 
them as px. So for the sake of an example I use:

  $(#city).animate({ 
top:'-565%'
  },1600);

This moves the position into the correct position, but proves the case that it 
uses px instead of % which is no good to me as on browser resize it loses its 
relative position.

I hope this helps, please let me know if I can assist any more.

Adam Jessop.

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf 
Of John Resig
Sent: 05 March 2009 12:34
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Animate using relative %


Not sure - do you have a sample that we can look at?

--John



On Thu, Mar 5, 2009 at 6:16 AM, Adam Jessop a...@infused-gaming.net wrote:
 Hi,



 I am working on a site where are wanting to create a full screen site using
 percentages for positioning and displaying of content. As part of the
 project we also want to have some animation to bring objects onto the page.

 We have the objects in their correct positions using relative positioning
 and negative top values for example:



 #myDiv{ top: -26%;}



 This is where we wish the animation to end with the block in position so
 therefore its starting value in the CSS could be:  top: 0%.



 Now I made the assumption that my js to achieve this would be:



 $('#myDiv').animate({top : -26%});



 After testing this, it became clear that the animate function was ignoring
 the '%' sign and was just applying '-26px' instead.



 After positing this directly to John Resig via twitter I got a response
 asking me to try:



 $('#myDiv').animate({top : -=26%});



 However the object always animates to: top: 0px regardless of its starting
 position, percentage value and the +=, -= notation.



 Is this a bug or am I missing something here? - Using JQuery 1.3.2



 Adam Jessop.

***
 
IMPORTANT INFORMATION  CONFIDENTIALITY NOTICE 
The information in this e-mail is confidential and may be legally privileged. 
It is intended solely for the named recipient.  Access to this Email by anyone 
else is unauthorised. 
 If you are not the intended recipient or the employee or agent responsible for 
delivering the message to the recipient named, 
please note that any use, disclosure, copying, distribution of this e-mail or 
any action taken or omitted to be taken in reliance on it is 
prohibited.  If you are not the intended recipient, please inform us by 
returning a copy of the e-mail with the subject 
line marked wrong address and then deleting the e-mail, and any attachments 
and any copies of it.  Any questions should be directed 
to  postmas...@sivltd.com. 

Sheffield International Venues Limited uses regularly updated anti-virus 
software in an attempt to reduce the possibility 
of infection. However we do not guarantee that any attachments to this e-mail 
are virus free. 

***
 



[jQuery] jcarousellite slide widths issue

2009-03-05 Thread jon randahl

Hello all!

I was wondering if anyone could shed some light on a problem I'm
facing? I'm using Ganeshji Marwaha's jcarousellite to create a slide
show of three (possibly more later) definition lists for client
contact details. Each DL contains three contacts.

Each DL is held within an LI which is a child of an UL which is a
child of the containing DIV.

eg1:
div id=carousel
ul
li
dl
dt class=h1 title=Contact NAME AND 
DETAILSimg src=/images/
contact/thumbs/headshot.jpg width=80 height=100 class=left
alt=Contact Image /CONTACT NAMEbr /spanCONTACT POSITION/span/
dt
dd class=p+44 (0)20 7### br /a
href=mailto:cona...@email.com; target=_blank alt=Contact CONTACT
NAME AND DETAILS title=Contact CONTACT NAME AND DETAILS/a/dd
dt class=h1 title=Contact NAME AND 
DETAILSimg src=/images/
contact/thumbs/headshot.jpg width=80 height=100 class=left
alt=Contact Image /CONTACT NAMEbr /spanCONTACT POSITION/span/
dt
dd class=p+44 (0)20 7### br /a
href=mailto:cona...@email.com; target=_blank alt=Contact CONTACT
NAME AND DETAILS title=Contact CONTACT NAME AND DETAILS/a/dd
dt class=h1 title=Contact NAME AND 
DETAILSimg src=/images/
contact/thumbs/headshot.jpg width=80 height=100 class=left
alt=Contact Image /CONTACT NAMEbr /spanCONTACT POSITION/span/
dt
dd class=p+44 (0)20 7### br /a
href=mailto:cona...@email.com; target=_blank alt=Contact CONTACT
NAME AND DETAILS title=Contact CONTACT NAME AND DETAILS/a/dd
/dl
/li
li
dl
dt class=h1 title=Contact NAME AND 
DETAILSimg src=/images/
contact/thumbs/headshot.jpg width=80 height=100 class=left
alt=Contact Image /CONTACT NAMEbr /spanCONTACT POSITION/span/
dt
dd class=p+44 (0)20 7### br /a
href=mailto:cona...@email.com; target=_blank alt=Contact CONTACT
NAME AND DETAILS title=Contact CONTACT NAME AND DETAILS/a/dd
dt class=h1 title=Contact NAME AND 
DETAILSimg src=/images/
contact/thumbs/headshot.jpg width=80 height=100 class=left
alt=Contact Image /CONTACT NAMEbr /spanCONTACT POSITION/span/
dt
dd class=p+44 (0)20 7### br /a
href=mailto:cona...@email.com; target=_blank alt=Contact CONTACT
NAME AND DETAILS title=Contact CONTACT NAME AND DETAILS/a/dd
dt class=h1 title=Contact NAME AND 
DETAILSimg src=/images/
contact/thumbs/headshot.jpg width=80 height=100 class=left
alt=Contact Image /CONTACT NAMEbr /spanCONTACT POSITION/span/
dt
dd class=p+44 (0)20 7### br /a
href=mailto:cona...@email.com; target=_blank alt=Contact CONTACT
NAME AND DETAILS title=Contact CONTACT NAME AND DETAILS/a/dd
/dl
/li
li
dl
dt class=h1 title=Contact NAME AND 
DETAILSimg src=/images/
contact/thumbs/headshot.jpg width=80 height=100 class=left
alt=Contact Image /CONTACT NAMEbr /spanCONTACT POSITION/span/
dt
dd class=p+44 (0)20 7### br /a
href=mailto:cona...@email.com; target=_blank alt=Contact CONTACT
NAME AND DETAILS title=Contact CONTACT NAME AND DETAILS/a/dd
dt class=h1 title=Contact NAME AND 
DETAILSimg src=/images/
contact/thumbs/headshot.jpg width=80 height=100 class=left
alt=Contact Image /CONTACT NAMEbr /spanCONTACT POSITION/span/
dt
dd class=p+44 (0)20 7### br /a
href=mailto:cona...@email.com; target=_blank alt=Contact CONTACT
NAME AND DETAILS title=Contact CONTACT NAME AND DETAILS/a/dd
dt class=h1 title=Contact NAME AND 
DETAILSimg src=/images/
contact/thumbs/headshot.jpg width=80 height=100 class=left
alt=Contact Image /CONTACT NAMEbr /spanCONTACT POSITION/span/
dt
dd class=p+44 (0)20 7### br /a
href=mailto:cona...@email.com; target=_blank alt=Contact CONTACT
NAME AND DETAILS title=Contact CONTACT NAME AND DETAILS/a/dd
/dl
/li
/ul
/div


Now in my CSS I style this as:

#carousel { overflow: hidden; visibility: visible; width: 600px;
height: 325px; position: relative; z-index: 2; width: 2000px; left:
-5000px;  }
#carousel ul { margin: 0; padding: 0; list-style-type: none; }
#carousel li { width: 300px; }
#carousel dl { width: 300px; font-size: 11px;}

#carousel dt { height: 50px; }
#carousel dd { height: 40px; }

#carousel dt img { margin: 0 10px; }

#carousel .h1 { font-size: 20px; line-height: 0.8em; font-weight:
normal; }
#carousel .h1 span { font-size: 14px; }

#carousel .p { margin: 0 0 20px; }


Now, here's the kicker, and finally my question:


[jQuery] Re: Current item child index ?

2009-03-05 Thread Adam Jessop

Give the li's an ID and just use that for the step number

e.g:

li id=step-1Step one/li
li id=step-2Step two/li


Then:
script
$(#stepsList li).click(function() {
  // load stepContent  === not a problem
  
   id = $(this).attr('id');
   $(#stepFooter).html(Viewing + id.replace(-, ) + of  
+$(#stepsList li).length);

})
/script

Un tested but you get the idea...



-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Liam Byrne
Sent: 05 March 2009 12:25
To: jquery-en@googlegroups.com
Subject: [jQuery] Current item child index ?


Hi folks

Just wondering if there's a quick/shorthand way of doing this:

I'm doing a navigation system where I want clickable items but I want to

put the current item number in a footer, e.g.

Any ideas of a quick way (without using each) to get CURRENTSTEPNUMBER

? Basically the reverse of nth-child ?

CODE OUTLINE (IF IT HELPS) :

script
$(#stepsList li).click(function() {
  // load stepContent  === not a problem

   $(#stepFooter).html(Viewing step +CURRENTSTEPNUMBER+ of  
+$(#stepsList li).length);

})
/script


h1STEPS TO BE COMPLETED/h1
ul id=stepsList
listep one/li
listep two/li
/listep threeli
/ul

div id=stepContent

div id=stepFooter
/div
/div

***
 
IMPORTANT INFORMATION  CONFIDENTIALITY NOTICE 
The information in this e-mail is confidential and may be legally privileged. 
It is intended solely for the named recipient.  Access to this Email by anyone 
else is unauthorised. 
 If you are not the intended recipient or the employee or agent responsible for 
delivering the message to the recipient named, 
please note that any use, disclosure, copying, distribution of this e-mail or 
any action taken or omitted to be taken in reliance on it is 
prohibited.  If you are not the intended recipient, please inform us by 
returning a copy of the e-mail with the subject 
line marked wrong address and then deleting the e-mail, and any attachments 
and any copies of it.  Any questions should be directed 
to  postmas...@sivltd.com. 

Sheffield International Venues Limited uses regularly updated anti-virus 
software in an attempt to reduce the possibility 
of infection. However we do not guarantee that any attachments to this e-mail 
are virus free. 

***
 



[jQuery] Slider - value = function

2009-03-05 Thread Elledinho

Hi peoples.

I just wanted to ask... is is a bug that I cant use a function as
value of a Slider (UI) ?

fx:
$(#soundControl #setVolume).slider({
range: min,
min: -3,
max: 103,
value: ytplayer.getVolume(),
});

This wont even show the slider because of the value of value
(ytplayer.getVolume())

What can I to make this work?


[jQuery] Re: Current item child index ?

2009-03-05 Thread MorningZ

There is also the .index functionality

http://docs.jquery.com/Core/index



On Mar 5, 7:31 am, Adam Jessop a.jes...@sivltd.com wrote:
 Give the li's an ID and just use that for the step number

 e.g:

 li id=step-1Step one/li
 li id=step-2Step two/li

 Then:
 script
 $(#stepsList li).click(function() {
   // load stepContent  === not a problem

    id = $(this).attr('id');
    $(#stepFooter).html(Viewing + id.replace(-, ) + of  
 +$(#stepsList li).length);

 })

 /script

 Un tested but you get the idea...

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

 Behalf Of Liam Byrne
 Sent: 05 March 2009 12:25
 To: jquery-en@googlegroups.com
 Subject: [jQuery] Current item child index ?

 Hi folks

 Just wondering if there's a quick/shorthand way of doing this:

 I'm doing a navigation system where I want clickable items but I want to

 put the current item number in a footer, e.g.

 Any ideas of a quick way (without using each) to get CURRENTSTEPNUMBER

 ? Basically the reverse of nth-child ?

 CODE OUTLINE (IF IT HELPS) :

 script
 $(#stepsList li).click(function() {
   // load stepContent  === not a problem

    $(#stepFooter).html(Viewing step +CURRENTSTEPNUMBER+ of  
 +$(#stepsList li).length);

 })
 /script

 h1STEPS TO BE COMPLETED/h1
 ul id=stepsList
 listep one/li
 listep two/li
 /listep threeli
 /ul

 div id=stepContent

 div id=stepFooter
 /div
 /div

 ***
 IMPORTANT INFORMATION  CONFIDENTIALITY NOTICE
 The information in this e-mail is confidential and may be legally privileged.
 It is intended solely for the named recipient.  Access to this Email by 
 anyone else is unauthorised.
  If you are not the intended recipient or the employee or agent responsible 
 for delivering the message to the recipient named,
 please note that any use, disclosure, copying, distribution of this e-mail or 
 any action taken or omitted to be taken in reliance on it is
 prohibited.  If you are not the intended recipient, please inform us by 
 returning a copy of the e-mail with the subject
 line marked wrong address and then deleting the e-mail, and any attachments 
 and any copies of it.  Any questions should be directed
 to  postmas...@sivltd.com.

 Sheffield International Venues Limited uses regularly updated anti-virus 
 software in an attempt to reduce the possibility
 of infection. However we do not guarantee that any attachments to this e-mail 
 are virus free.

 ***


[jQuery] Re: draggable events not working with 1.3.2 version

2009-03-05 Thread valugi

thanks a lot. I see now the note in the UI download page.(Latest
stable (1.5.3: jQuery 1.2.6)). Silly me.


On Mar 5, 1:32 pm, Richard D. Worth rdwo...@gmail.com wrote:
 jQuery UI 1.5.3 is only compatible with jQuery 1.2.6. To use jQuery UI with
 the latest version of jQuery (1.3+) you'll need the latest preview release:
 1.6rc6.

 - Richard

 On Wed, Mar 4, 2009 at 7:02 AM, valugi val...@gmail.com wrote:

  This code works with 1.2.6 version but not on 1.3.2. The UI library is
  the same on both tries. No errors are reported in the firebug console.

  Anybody got any idea?

  script src=js/jquery-1.2.6.min.js type=text/javascript /script
  script src=js/jquery-ui-personalized-1.5.3.js type=text/
  javascript /script

  script type=text/javascript
         $(document).ready( function(){
                 $(#test).draggable(
                         {
                                 start: function( ev, ui){
                                         $(#response).html(start);
                                 },
                                 stop: function( ev, ui){
                                         $(#response).html(stop);
                                 }
                         }
                 );
         });

  /script


[jQuery] sorting w/ a hyperlink

2009-03-05 Thread philliptackett

Hi,

I have a page where I've implemented the jquery function. Please
check
out here:


http://www.grad.uiuc.edu/eep/srop/faculty/faculty_search_results.cfm?...


My question, is how to make the 'Full Name' column sort by the Full
Name value instead of the value of the URL hyperlink which is what I
believe it's doing now. Here's the code I use to call the function:


script type=text/javascript
$(function() {
$(#myTable).tablesorter({sortList:[[0,0],[1,0],
[2,0]], widgets:
['zebra']});
});
/script


Thanks,
Phil Tackett


[jQuery] Re: Dynamic mailto: link.

2009-03-05 Thread Sir Rawlins

Hey Ryan!

Thanks for your advice, I appreciate it.

I've got this now:

input type=checkbox name=CMStudent_IDs value=s...@email.com //
td
a class=blue_button id=mailspanEmail Selected Students/
span/a

$(input[name='CMStudent_IDs']).click(function(){
var mylink = [];


$(input[name='CMStudent_IDs':checked]).each(function(i){
 mylink.push($(this).val());
});

$(a#mail).setAttr(href, mailto:; + 
mylink.join
(,));
});

However it doesn't seem to work for me, I check a couple of the
checkboxes but the link is never given an href so clicking it does
nothing. Can you spot anything out of sorts with the code?

Many thanks mate,

Rob

On Mar 5, 1:34 pm, ryan.j ryan.joyce...@googlemail.com wrote:
 and you'd probably want to add :checked onto the end of the selector
 too. ;)


[jQuery] Re: Beginner a little stuck

2009-03-05 Thread Richard Wheatley


Liam - i have pushed the return false down one set of brackets which has 
fixed one prob...however still not quite there... reading docs on 
parents function and its clear as mud to me right now..


Liam Potter wrote:


you need to first of all, write a valid form.

form
input type=hidden value=1 /
input type=submit class=submit /
/form

then your script needs to be

script language=javascript
$(document).ready(function() {
   $('.submit').click(function() {
$(this).parents('form').each(function(){
   var msg = $('.qty').val();

   $.post(?= site_url('cart/add_cart') ?, {qty: msg}, function
() {
   $('#sidebar').load('http://localhost/update_records.php');
   });
 return false;
});
   });

});
/script


ashbyrich wrote:

I have multiple forms of the nature

[code]
form
input hidden value =1
input submit class=submit
/form
form
input hidden class=qty value =2
input submit class=submit
/form

[/code]

I have the script as follows

[code]

script language=javascript
$(document).ready(function() {
$('.submit').click(function() {

var msg = $('.qty').val();

$.post(?= site_url('cart/add_cart') ?, {qty: msg}, function
() {
$('#sidebar').load('http://localhost/update_records.php');
});
  return false;
});

});
/script

[/code]

Problem is that i whichever submit button i press it only grabs value
1.  This is completely logical, I just don't know how to modify the
script to get the right form...
Apologies for dumb question..I will read the docs/do tuts soon..
  




[jQuery] Re: Javascript search library

2009-03-05 Thread Nicolas R

Khai, perhaps this may be useful to you:
http://code.google.com/p/jdatastore/

If you find it excessive, perhaps just the filter method is what
you're after:
http://code.google.com/p/jdatastore/source/browse/trunk/store.js#375

On Mar 5, 4:00 am, Khai khaitd...@gmail.com wrote:
 I have a collection of DIVs (or a JSON array).  Is there a javascript
 library that can search through a JSON array and return a collection
 of matched elements, and support advanced search with boolean
 operator?

 Thanks
 Khai


[jQuery] Re: Beginner a little stuck

2009-03-05 Thread Liam Potter


the main part is the $(this)
that basically lets jquery know you mean specifically the button you 
pressed rather then all buttons with the class .submit


Richard Wheatley wrote:


Liam - i have pushed the return false down one set of brackets which 
has fixed one prob...however still not quite there... reading docs on 
parents function and its clear as mud to me right now..


Liam Potter wrote:


you need to first of all, write a valid form.

form
input type=hidden value=1 /
input type=submit class=submit /
/form

then your script needs to be

script language=javascript
$(document).ready(function() {
   $('.submit').click(function() {
$(this).parents('form').each(function(){
   var msg = $('.qty').val();

   $.post(?= site_url('cart/add_cart') ?, {qty: msg}, function
() {
   $('#sidebar').load('http://localhost/update_records.php');
   });
 return false;
});
   });

});
/script


ashbyrich wrote:

I have multiple forms of the nature

[code]
form
input hidden value =1
input submit class=submit
/form
form
input hidden class=qty value =2
input submit class=submit
/form

[/code]

I have the script as follows

[code]

script language=javascript
$(document).ready(function() {
$('.submit').click(function() {

var msg = $('.qty').val();

$.post(?= site_url('cart/add_cart') ?, {qty: msg}, function
() {
$('#sidebar').load('http://localhost/update_records.php');
});
  return false;
});

});
/script

[/code]

Problem is that i whichever submit button i press it only grabs value
1.  This is completely logical, I just don't know how to modify the
script to get the right form...
Apologies for dumb question..I will read the docs/do tuts soon..
  




[jQuery] Re: Beginner a little stuck

2009-03-05 Thread Liam Potter


You may find it easier to use the form plugin though.
http://malsup.com/jquery/form/

Richard Wheatley wrote:


Liam - i have pushed the return false down one set of brackets which 
has fixed one prob...however still not quite there... reading docs on 
parents function and its clear as mud to me right now..


Liam Potter wrote:


you need to first of all, write a valid form.

form
input type=hidden value=1 /
input type=submit class=submit /
/form

then your script needs to be

script language=javascript
$(document).ready(function() {
   $('.submit').click(function() {
$(this).parents('form').each(function(){
   var msg = $('.qty').val();

   $.post(?= site_url('cart/add_cart') ?, {qty: msg}, function
() {
   $('#sidebar').load('http://localhost/update_records.php');
   });
 return false;
});
   });

});
/script


ashbyrich wrote:

I have multiple forms of the nature

[code]
form
input hidden value =1
input submit class=submit
/form
form
input hidden class=qty value =2
input submit class=submit
/form

[/code]

I have the script as follows

[code]

script language=javascript
$(document).ready(function() {
$('.submit').click(function() {

var msg = $('.qty').val();

$.post(?= site_url('cart/add_cart') ?, {qty: msg}, function
() {
$('#sidebar').load('http://localhost/update_records.php');
});
  return false;
});

});
/script

[/code]

Problem is that i whichever submit button i press it only grabs value
1.  This is completely logical, I just don't know how to modify the
script to get the right form...
Apologies for dumb question..I will read the docs/do tuts soon..
  




[jQuery] Re: JQGrid Grid as subgrid not calling server-side program

2009-03-05 Thread Chuk

I'm thinking that the problem might be in what external scripts I'm
linking to.  When I'm utilizing grid as subgrid, should I include
anything other than JQGrid/js/grid.subgrid.js?


[jQuery] Re: JQGrid Grid as subgrid not calling server-side program

2009-03-05 Thread Chuk

I'm thinking that the problem might be in what external scripts I'm
linking to.  When I'm utilizing grid as subgrid, should I include
anything other than JQGrid/js/grid.subgrid.js?


[jQuery] Re: LocalScroll with anchor in URL not working

2009-03-05 Thread clorentzen

Ariel --

Thanks again for responding. I've tried a few more things, but the
links from another page targeting my scrolling page still seem to work
unreliably. I'm in FF3 mainly, but can see the issue in Safari 3 and
IE6 and 7 as well.

Sometimes the links to site two and site three on this page work
exactly as intended (scrolling over to the appropriate place), and
other times they merely load the page basically at 0,0.

http://www.cementresources.com/paneltest/hub.html

The problem with links off my hub.html page doesn't occur every time,
though... Which has me even more confused, since sometimes it seems to
work, but if I immediately go back in the browser and try the link
on hub.html again, it might not work the second or third time.

And if I refresh the scrolling page once loaded (which has a hash in
the URL noting the selected anchor), the same problem occurs:
sometimes the page reloads scrolled over to the correct spot, other
times it just seems to reset the window to 0.0.

Let me know if you have any ideas. Appreciate the help. Thanks.

--Carl.


On Mar 4, 5:39 pm, Ariel Flesler afles...@gmail.com wrote:
 It seems to be working well for me, on FF2.
 Using the back button won't animatedly scroll, the plugin isn't
 monitoring those changes.



 On Wed, Mar 4, 2009 at 7:28 PM, clorentzen carl.lorent...@gmail.com wrote:

  Ariel --

  Thanks for your reply. If I go to my test page from one of the full
  URLs with an anchor, and then refresh the page, I still have the
  problem -- namely, it resets to the beginning of the page and doesn't
  properly scroll to the anchor location in the URL. Also, when I click
  my site two link, the subsequent properly scrolls all the way from
  the left to the anchor location, but the site three link seems to
  scroll over only from 100 or so pixels from the anchor location. Any
  ideas why these things might be happening? Thanks again.

  I've updated my sample/test page with the new code you provided.

 http://www.cementresources.com/paneltest/hub.html

  Best,

  --Carl.

  On Mar 4, 5:04 pm, Ariel Flesler afles...@gmail.com wrote:
  I think that happens because you first need to reset the scroll to
  (0,0).
  The browser also scrolls natively.

  I'm planning to add this within $.localScroll.hash, as well as taking
  advantage of sync animations, added since 1.3.
  But for now... :)

  $(document).ready(function(){
     window.scrollTo(0,0);
     $.localScroll.hash({
        axis:'x',
        duration:1500
     });
     $('#container').localScroll({
       axis:'x',
       hash:true,
       duration: 1000
    });

  });

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

  On Mar 4, 3:47 pm, clorentzen carl.lorent...@gmail.com wrote:

   Sorry, I hit post button too quickly there...

   You can see an example linking to a test page here:

  http://www.cementresources.com/paneltest/hub.html

   I've seen the issue in FF3, Safari 3, and in IE 6 and 7.

   Not sure what I'm doing incorrectly. Any help appreciated. Thank you!

   On Mar 4, 1:43 pm, clorentzen carl.lorent...@gmail.com wrote:

Hi --

I'm using theLocalScrollplugin, and having trouble getting it to
work when passing the anchor through as part of the URL. Instead of
scrolling to the appropriate anchor id, the window just moves a few
pixels and stops.

CallingLocalScrollon links within the page works fine, but not when
the link is coming from another page or typed directly in the browser
address bar.

My code for initializingLocalScrollis:

$(document).ready(function(){
    $.localScroll.hash({
        axis:'x',
        duration:1500
    });
    $('#container').localScroll({
        axis:'x',
        hash:true,
        duration: 1000
    });

});

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


[jQuery] Re: Dynamic mailto: link.

2009-03-05 Thread MorningZ

Here's a quick example i whipped up (and works)

http://paste.pocoo.org/show/106586/

To note about your code, setAttr isn't a jQuery call, it's .attr



On Mar 5, 10:04 am, Sir Rawlins robert.rawl...@thinkbluemedia.co.uk
wrote:
 Hey Ryan!

 Thanks for your advice, I appreciate it.

 I've got this now:

 input type=checkbox name=CMStudent_IDs value=s...@email.com //
 td
         a class=blue_button id=mailspanEmail Selected Students/
 span/a

             $(input[name='CMStudent_IDs']).click(function(){
                                 var mylink = [];

                                 
 $(input[name='CMStudent_IDs':checked]).each(function(i){
                                      mylink.push($(this).val());
                                 });

                                 $(a#mail).setAttr(href, mailto:; + 
 mylink.join
 (,));
             });

 However it doesn't seem to work for me, I check a couple of the
 checkboxes but the link is never given an href so clicking it does
 nothing. Can you spot anything out of sorts with the code?

 Many thanks mate,

 Rob

 On Mar 5, 1:34 pm, ryan.j ryan.joyce...@googlemail.com wrote:

  and you'd probably want to add :checked onto the end of the selector
  too. ;)


[jQuery] Re: LocalScroll with anchor in URL not working

2009-03-05 Thread Ariel Flesler

Uhm... I really dunno. As I told you, the plugin won't react to clicks
on the Back button.
I intend to take another look at this asap.

Try putting the window.scrollTo line outside the document.ready.

On Thu, Mar 5, 2009 at 1:28 PM, clorentzen carl.lorent...@gmail.com wrote:

 Ariel --

 Thanks again for responding. I've tried a few more things, but the
 links from another page targeting my scrolling page still seem to work
 unreliably. I'm in FF3 mainly, but can see the issue in Safari 3 and
 IE6 and 7 as well.

 Sometimes the links to site two and site three on this page work
 exactly as intended (scrolling over to the appropriate place), and
 other times they merely load the page basically at 0,0.

 http://www.cementresources.com/paneltest/hub.html

 The problem with links off my hub.html page doesn't occur every time,
 though... Which has me even more confused, since sometimes it seems to
 work, but if I immediately go back in the browser and try the link
 on hub.html again, it might not work the second or third time.

 And if I refresh the scrolling page once loaded (which has a hash in
 the URL noting the selected anchor), the same problem occurs:
 sometimes the page reloads scrolled over to the correct spot, other
 times it just seems to reset the window to 0.0.

 Let me know if you have any ideas. Appreciate the help. Thanks.

 --Carl.


 On Mar 4, 5:39 pm, Ariel Flesler afles...@gmail.com wrote:
 It seems to be working well for me, on FF2.
 Using the back button won't animatedly scroll, the plugin isn't
 monitoring those changes.



 On Wed, Mar 4, 2009 at 7:28 PM, clorentzen carl.lorent...@gmail.com wrote:

  Ariel --

  Thanks for your reply. If I go to my test page from one of the full
  URLs with an anchor, and then refresh the page, I still have the
  problem -- namely, it resets to the beginning of the page and doesn't
  properly scroll to the anchor location in the URL. Also, when I click
  my site two link, the subsequent properly scrolls all the way from
  the left to the anchor location, but the site three link seems to
  scroll over only from 100 or so pixels from the anchor location. Any
  ideas why these things might be happening? Thanks again.

  I've updated my sample/test page with the new code you provided.

 http://www.cementresources.com/paneltest/hub.html

  Best,

  --Carl.

  On Mar 4, 5:04 pm, Ariel Flesler afles...@gmail.com wrote:
  I think that happens because you first need to reset the scroll to
  (0,0).
  The browser also scrolls natively.

  I'm planning to add this within $.localScroll.hash, as well as taking
  advantage of sync animations, added since 1.3.
  But for now... :)

  $(document).ready(function(){
     window.scrollTo(0,0);
     $.localScroll.hash({
        axis:'x',
        duration:1500
     });
     $('#container').localScroll({
       axis:'x',
       hash:true,
       duration: 1000
    });

  });

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

  On Mar 4, 3:47 pm, clorentzen carl.lorent...@gmail.com wrote:

   Sorry, I hit post button too quickly there...

   You can see an example linking to a test page here:

  http://www.cementresources.com/paneltest/hub.html

   I've seen the issue in FF3, Safari 3, and in IE 6 and 7.

   Not sure what I'm doing incorrectly. Any help appreciated. Thank you!

   On Mar 4, 1:43 pm, clorentzen carl.lorent...@gmail.com wrote:

Hi --

I'm using theLocalScrollplugin, and having trouble getting it to
work when passing the anchor through as part of the URL. Instead of
scrolling to the appropriate anchor id, the window just moves a few
pixels and stops.

CallingLocalScrollon links within the page works fine, but not when
the link is coming from another page or typed directly in the browser
address bar.

My code for initializingLocalScrollis:

$(document).ready(function(){
    $.localScroll.hash({
        axis:'x',
        duration:1500
    });
    $('#container').localScroll({
        axis:'x',
        hash:true,
        duration: 1000
    });

});

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




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


[jQuery] Re: Objects Methods as event handlers.

2009-03-05 Thread Michael

That unfortunately is not the attitude of John Resiq - the creator.
While trying to find a class implementation for jQuery I ran across
his Classy Query April Fool's joke from last year.  My mind is set - I
will not be using this library unless forced because I do not want to
use the code of anyone so conceited and arrogant.  I don't know which
is more outrageous - that he demeans all developers who choose to use
a classical inheritance scheme or that he actually spent the time to
write and test mock code as part of the 'joke'.  Joke might be his
intent, but I found the whole thing far from funny.


[jQuery] Trying to add/remove a class when....

2009-03-05 Thread webspee...@gmail.com

Hey all.

I'm trying to add/remove a class and am having trouble. When I add the
new class, the color takes hold, but not the changing of the
background image.

The original CSS is defined as input[type=button]{background-
image:}

How do I remove a class that is defined like the one above? I tried
removeClass(input), but that didn't work.



[jQuery] Re: Dynamic mailto: link.

2009-03-05 Thread Sir Rawlins

MorningZ,

That works a real treat! Thank you very much indeed!!!

One thing further I'd like to pick your brains on. I have a 'select
all' script which works like this:

$(.select_all_cm).click(function() {
var checked_status = this.checked;
$(input[name=CMStudent_IDs]).each(function()
{
this.checked = checked_status;
});
 });

However, using this doesn't trigger the change() event on the
checkboxes, is there another event we can bind to that function
that'll be triggers by the select_all as well?

Thanks mate,

Rob

On Mar 5, 3:32 pm, MorningZ morni...@gmail.com wrote:
 Here's a quick example i whipped up (and works)

 http://paste.pocoo.org/show/106586/

 To note about your code, setAttr isn't a jQuery call, it's .attr

 On Mar 5, 10:04 am, Sir Rawlins robert.rawl...@thinkbluemedia.co.uk
 wrote:

  Hey Ryan!

  Thanks for your advice, I appreciate it.

  I've got this now:

  input type=checkbox name=CMStudent_IDs value=s...@email.com //
  td
          a class=blue_button id=mailspanEmail Selected Students/
  span/a

              $(input[name='CMStudent_IDs']).click(function(){
                                  var mylink = [];

                                  
  $(input[name='CMStudent_IDs':checked]).each(function(i){
                                       mylink.push($(this).val());
                                  });

                                  $(a#mail).setAttr(href, mailto:; + 
  mylink.join
  (,));
              });

  However it doesn't seem to work for me, I check a couple of the
  checkboxes but the link is never given an href so clicking it does
  nothing. Can you spot anything out of sorts with the code?

  Many thanks mate,

  Rob

  On Mar 5, 1:34 pm, ryan.j ryan.joyce...@googlemail.com wrote:

   and you'd probably want to add :checked onto the end of the selector
   too. ;)


[jQuery] Re: Simple one: difference between varXy.find(':text') and $(varXy).find(':text')

2009-03-05 Thread ricardobeat

It's mostly done to improve performance. If you save the jQuery object
in a var you only need to find the element once (depending on the
selector it's an expensive operation), and then operate on that single
object. I (and other people) like to put a '$' in front of the var
name when it contains a jQ object, to make it clear:

var $mySet = $('.mystuff'); //jQ object
$mySet.click(...).append(...)

var myElement = $('#someelement')[0]; //HTML element
$(myElement).doSomething();

by doing $($mySet) you're unnecessarily creating a new object from the
one you have already stored. It's not really much overhead, but bloats
code.

ggerri: this.something() where 'something' is a jQuery method is
usually found in plug-ins:

jQuery.fn.doSomething = function(){
 // in here, 'this' refers to the current jQuery object/set
 //so you can use methods on it, like each
 this.each(function(){
// here, 'this' is the current element in the loop, not a jq
object
//so you need to wrap it in jQ before using it
$(this).append(...)
 });
};

cheers,
- ricardo

On Mar 5, 9:58 am, Rick Faircloth r...@whitestonemedia.com wrote:
 Hi, Rayn :handshake: :o)

 I think, for shorthand notation (some say for readability, but I think 
 otherwise),
 some set var's (variables) to represent pieces of code, for instance:

 var mySet = '$(mySet)'

 and then use it as:

 mySet.find(':text')...

 Written in longhand, it would be:

 $('mySet').find(':text')...

 When trying to read someone else's code, where this shorthand is use 
 extensively,
 I just find it hard to decipher, since I have to trace all the var's down to 
 find
 out what they stand for...

 Someone please correct me if I'm wrong...

 Rick

 -Original Message-
 From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On 
 Behalf Of ggerri
 Sent: Thursday, March 05, 2009 7:31 AM
 To: jquery-en@googlegroups.com
 Subject: [jQuery] Re: Simple one: difference between varXy.find(':text') and 
 $(varXy).find(':text')

 Thanks Ryan :handshake:

 so  mySet.find(':text').each(...) would be right and
 $(mySet).find(':text').each(...) not? :confused:

 In examples I often see (within an each function): $(this).something but also 
 this.something

 Still dont get the difference of use :,(

 G

 ryan.joyce...@googlemail.com wrote:

  mySet is an object or variable, $(mySet) will try to get an element
  using the contents of mySet as the selector.

  On Mar 5, 10:04 am, ggerri gerald.ressm...@ewz.ch wrote:
  Hi there

  thats an easy one for you ;-)

  if i do:

  var mySet = $('trtd:nth-child(2n)');

  how do I use mySet? What's the difference between

  mySet.find(':text')

  and

  $(mySet).find(':text')

  Thanks :-))
  GGerri

  --
  View this message in
  context:http://www.nabble.com/Simple-one%3A-difference-between-varXy.find%28%...
  Sent from the jQuery General Discussion mailing list archive at
  Nabble.com.

 --
 View this message in 
 context:http://www.nabble.com/Simple-one%3A-difference-between-varXy.find%28%...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: Need to insert an element in DIV at position X Y

2009-03-05 Thread ricardobeat

Insert anywhere and use position:absolute.

On Mar 5, 8:03 am, choesang tchoes...@gmail.com wrote:
 Hi!

 I am trying to create a webpage where users can insert a pin (div) in
 between the text using context menu.
 My problem is that i do not know how to insert at the exact position.
 Using Dom's I can arrive only to the nearest DIV but a DIV contains a
 lot of text and the PIN has to be position close to the text.

 I can obtain the position of the mouse click using pageX and pageY but
 dont know how to insert an element at that position. I tried
 insertAfter, prepend, append but not getting the desired result.

 Any idea how to solve this problem.

 regards,
 choesang tenzin


[jQuery] Re: Trying to add/remove a class when....

2009-03-05 Thread MorningZ

Got more HTML and CSS to show?  it's hard to help your problem with
the little code you posted


On Mar 5, 10:52 am, webspee...@gmail.com webspee...@gmail.com
wrote:
 Hey all.

 I'm trying to add/remove a class and am having trouble. When I add the
 new class, the color takes hold, but not the changing of the
 background image.

 The original CSS is defined as input[type=button]{background-
 image:}

 How do I remove a class that is defined like the one above? I tried
 removeClass(input), but that didn't work.


[jQuery] Re: .clone a form

2009-03-05 Thread bstoppel

Without the .html() part you get an object. With .text() you get what
appears to be HTML entities and text.


On Mar 5, 6:10 am, Rick Faircloth r...@whitestonemedia.com wrote:
 Not sure, but it might be that the .html() part is telling
 the clone function to just clone the html *within* .hook:first.

 What happens if you leave off the .html() part?

 Rick

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

 Behalf Of bstoppel
 Sent: Wednesday, March 04, 2009 11:50 PM
 To: jQuery (English)
 Subject: [jQuery] .clone a form

 Hi All.

 I am having an issue with cloning a form. When I clone an existing form,
 only the input tags are cloned. Here is an example

 -- HTML

 form class=hook action=do/something method=post
 enctype=multipart/form-data
 input type=text name=variable
 input type=submit
 /form

 div id=clonehere/div

 -- JQuery

 $('#clonehere').append($('.hook:first').clone(true).html());

 -- Result

 #clonehere will only get this part of the form input type=text
 name=variable input type=submit

 What am I doing wrong?


[jQuery] Re: Simple one: difference between varXy.find(':text') and $(varXy).find(':text')

2009-03-05 Thread Rick Faircloth

Thanks for the further input, Ricardo...

Is there any way you can put a percentage of processing and/or time saved
by using var with elements?  Especially if there is only one or two
references on a page?

Rick

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of ricardobeat
Sent: Thursday, March 05, 2009 11:00 AM
To: jQuery (English)
Subject: [jQuery] Re: Simple one: difference between varXy.find(':text') and
$(varXy).find(':text')


It's mostly done to improve performance. If you save the jQuery object in a
var you only need to find the element once (depending on the selector it's
an expensive operation), and then operate on that single object. I (and
other people) like to put a '$' in front of the var name when it contains a
jQ object, to make it clear:

var $mySet = $('.mystuff'); //jQ object
$mySet.click(...).append(...)

var myElement = $('#someelement')[0]; //HTML element
$(myElement).doSomething();

by doing $($mySet) you're unnecessarily creating a new object from the one
you have already stored. It's not really much overhead, but bloats code.

ggerri: this.something() where 'something' is a jQuery method is usually
found in plug-ins:

jQuery.fn.doSomething = function(){
 // in here, 'this' refers to the current jQuery object/set
 //so you can use methods on it, like each
 this.each(function(){
// here, 'this' is the current element in the loop, not a jq object
//so you need to wrap it in jQ before using it
$(this).append(...)
 });
};

cheers,
- ricardo

On Mar 5, 9:58 am, Rick Faircloth r...@whitestonemedia.com wrote:
 Hi, Rayn :handshake: :o)

 I think, for shorthand notation (some say for readability, but I think 
 otherwise), some set var's (variables) to represent pieces of code, for
instance:

 var mySet = '$(mySet)'

 and then use it as:

 mySet.find(':text')...

 Written in longhand, it would be:

 $('mySet').find(':text')...

 When trying to read someone else's code, where this shorthand is use 
 extensively, I just find it hard to decipher, since I have to trace 
 all the var's down to find out what they stand for...

 Someone please correct me if I'm wrong...

 Rick

 -Original Message-
 From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] 
 On Behalf Of ggerri
 Sent: Thursday, March 05, 2009 7:31 AM
 To: jquery-en@googlegroups.com
 Subject: [jQuery] Re: Simple one: difference between 
 varXy.find(':text') and $(varXy).find(':text')

 Thanks Ryan :handshake:

 so  mySet.find(':text').each(...) would be right and
 $(mySet).find(':text').each(...) not? :confused:

 In examples I often see (within an each function): $(this).something 
 but also this.something

 Still dont get the difference of use :,(

 G

 ryan.joyce...@googlemail.com wrote:

  mySet is an object or variable, $(mySet) will try to get an element 
  using the contents of mySet as the selector.

  On Mar 5, 10:04 am, ggerri gerald.ressm...@ewz.ch wrote:
  Hi there

  thats an easy one for you ;-)

  if i do:

  var mySet = $('trtd:nth-child(2n)');

  how do I use mySet? What's the difference between

  mySet.find(':text')

  and

  $(mySet).find(':text')

  Thanks :-))
  GGerri

  --
  View this message in
 
context:http://www.nabble.com/Simple-one%3A-difference-between-varXy.find%28
%...
  Sent from the jQuery General Discussion mailing list archive at 
  Nabble.com.

 --
 View this message in
context:http://www.nabble.com/Simple-one%3A-difference-between-varXy.find%28
%...
 Sent from the jQuery General Discussion mailing list archive at
Nabble.com.



[jQuery] Re: Beginner a little stuck

2009-03-05 Thread Richard Wheatley


Thanks Liam

Liam Potter wrote:


You may find it easier to use the form plugin though.
http://malsup.com/jquery/form/

Richard Wheatley wrote:


Liam - i have pushed the return false down one set of brackets which 
has fixed one prob...however still not quite there... reading docs on 
parents function and its clear as mud to me right now..


Liam Potter wrote:


you need to first of all, write a valid form.

form
input type=hidden value=1 /
input type=submit class=submit /
/form

then your script needs to be

script language=javascript
$(document).ready(function() {
   $('.submit').click(function() {
$(this).parents('form').each(function(){
   var msg = $('.qty').val();

   $.post(?= site_url('cart/add_cart') ?, {qty: msg}, function
() {
   $('#sidebar').load('http://localhost/update_records.php');
   });
 return false;
});
   });

});
/script


ashbyrich wrote:

I have multiple forms of the nature

[code]
form
input hidden value =1
input submit class=submit
/form
form
input hidden class=qty value =2
input submit class=submit
/form

[/code]

I have the script as follows

[code]

script language=javascript
$(document).ready(function() {
$('.submit').click(function() {

var msg = $('.qty').val();

$.post(?= site_url('cart/add_cart') ?, {qty: msg}, 
function

() {
$('#sidebar').load('http://localhost/update_records.php');
});
  return false;
});

});
/script

[/code]

Problem is that i whichever submit button i press it only grabs value
1.  This is completely logical, I just don't know how to modify the
script to get the right form...
Apologies for dumb question..I will read the docs/do tuts soon..
  






[jQuery] Re: Current item child index ?

2009-03-05 Thread mkmanning

As MorningZ said, use .index(). When you have a collection of elements
in a jQuery object, use .index() and pass the element you wan the
index of to the function.

var stepslist = $(#stepsList li);
stepslist.click(function() {
// load stepContent  === not a problem
$(#stepFooter).html(Viewing step +(stepslist.index(this)+1)+ of
+stepslist.length);
})



On Mar 5, 6:13 am, MorningZ morni...@gmail.com wrote:
 There is also the .index functionality

 http://docs.jquery.com/Core/index

 On Mar 5, 7:31 am, Adam Jessop a.jes...@sivltd.com wrote:

  Give the li's an ID and just use that for the step number

  e.g:

  li id=step-1Step one/li
  li id=step-2Step two/li

  Then:
  script
  $(#stepsList li).click(function() {
    // load stepContent  === not a problem

     id = $(this).attr('id');
     $(#stepFooter).html(Viewing + id.replace(-, ) + of  
  +$(#stepsList li).length);

  })

  /script

  Un tested but you get the idea...

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

  Behalf Of Liam Byrne
  Sent: 05 March 2009 12:25
  To: jquery-en@googlegroups.com
  Subject: [jQuery] Current item child index ?

  Hi folks

  Just wondering if there's a quick/shorthand way of doing this:

  I'm doing a navigation system where I want clickable items but I want to

  put the current item number in a footer, e.g.

  Any ideas of a quick way (without using each) to get CURRENTSTEPNUMBER

  ? Basically the reverse of nth-child ?

  CODE OUTLINE (IF IT HELPS) :

  script
  $(#stepsList li).click(function() {
    // load stepContent  === not a problem

     $(#stepFooter).html(Viewing step +CURRENTSTEPNUMBER+ of  
  +$(#stepsList li).length);

  })
  /script

  h1STEPS TO BE COMPLETED/h1
  ul id=stepsList
  listep one/li
  listep two/li
  /listep threeli
  /ul

  div id=stepContent

  div id=stepFooter
  /div
  /div

  *** 
  
  IMPORTANT INFORMATION  CONFIDENTIALITY NOTICE
  The information in this e-mail is confidential and may be legally 
  privileged.
  It is intended solely for the named recipient.  Access to this Email by 
  anyone else is unauthorised.
   If you are not the intended recipient or the employee or agent responsible 
  for delivering the message to the recipient named,
  please note that any use, disclosure, copying, distribution of this e-mail 
  or any action taken or omitted to be taken in reliance on it is
  prohibited.  If you are not the intended recipient, please inform us by 
  returning a copy of the e-mail with the subject
  line marked wrong address and then deleting the e-mail, and any 
  attachments and any copies of it.  Any questions should be directed
  to  postmas...@sivltd.com.

  Sheffield International Venues Limited uses regularly updated anti-virus 
  software in an attempt to reduce the possibility
  of infection. However we do not guarantee that any attachments to this 
  e-mail are virus free.

  *** 
  


[jQuery] Re: .clone a form

2009-03-05 Thread Rick Faircloth

Possible work-a-around...

Enclose your form in a div, say div id='form-div'form.../div,
and clone the div...?

Rick

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of bstoppel
Sent: Thursday, March 05, 2009 11:07 AM
To: jQuery (English)
Subject: [jQuery] Re: .clone a form


Without the .html() part you get an object. With .text() you get what
appears to be HTML entities and text.


On Mar 5, 6:10 am, Rick Faircloth r...@whitestonemedia.com wrote:
 Not sure, but it might be that the .html() part is telling the clone 
 function to just clone the html *within* .hook:first.

 What happens if you leave off the .html() part?

 Rick

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

 Behalf Of bstoppel
 Sent: Wednesday, March 04, 2009 11:50 PM
 To: jQuery (English)
 Subject: [jQuery] .clone a form

 Hi All.

 I am having an issue with cloning a form. When I clone an existing 
 form, only the input tags are cloned. Here is an example

 -- HTML

 form class=hook action=do/something method=post
 enctype=multipart/form-data
 input type=text name=variable
 input type=submit
 /form

 div id=clonehere/div

 -- JQuery

 $('#clonehere').append($('.hook:first').clone(true).html());

 -- Result

 #clonehere will only get this part of the form input type=text
 name=variable input type=submit

 What am I doing wrong?



[jQuery] Re: .clone a form

2009-03-05 Thread mkmanning

Your code works fine without the .html(). If you're trying to log what
you get, then it will say 'object', which is to be expected.

On Mar 5, 8:18 am, Rick Faircloth r...@whitestonemedia.com wrote:
 Possible work-a-around...

 Enclose your form in a div, say div id='form-div'form.../div,
 and clone the div...?

 Rick

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

 Behalf Of bstoppel
 Sent: Thursday, March 05, 2009 11:07 AM
 To: jQuery (English)
 Subject: [jQuery] Re: .clone a form

 Without the .html() part you get an object. With .text() you get what
 appears to be HTML entities and text.

 On Mar 5, 6:10 am, Rick Faircloth r...@whitestonemedia.com wrote:
  Not sure, but it might be that the .html() part is telling the clone
  function to just clone the html *within* .hook:first.

  What happens if you leave off the .html() part?

  Rick

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

  Behalf Of bstoppel
  Sent: Wednesday, March 04, 2009 11:50 PM
  To: jQuery (English)
  Subject: [jQuery] .clone a form

  Hi All.

  I am having an issue with cloning a form. When I clone an existing
  form, only the input tags are cloned. Here is an example

  -- HTML

  form class=hook action=do/something method=post
  enctype=multipart/form-data
  input type=text name=variable
  input type=submit
  /form

  div id=clonehere/div

  -- JQuery

  $('#clonehere').append($('.hook:first').clone(true).html());

  -- Result

  #clonehere will only get this part of the form input type=text
  name=variable input type=submit

  What am I doing wrong?


[jQuery] Re: Cross domain call using JQuery

2009-03-05 Thread mkmanning

Are you wrapping the return value server-side in the callback
function?

On Mar 5, 12:10 am, baby babybaby...@gmail.com wrote:
 Hi,

 Thanks for your suggestion. I have gone though this flicker example
 and it is perfectly. flicker example is also working fine when i
 integrate this code in my application however, when i try to call my
 struts application url, it is not working.

 do i need to do any configuration for this?

 Once again Thanks for you quick response.

 On Mar 4, 9:42 pm, mkmanning michaell...@gmail.com wrote:

  You don't have to go any further than the 
  docs:http://docs.jquery.com/Ajax/jQuery.getJSON#urldatacallback
  Run the flickr example and you'll see how JSONP works. In a nutshell,
  to get around crossdomain security issues, the getJSON call creates a
  script tag whose URL is the getJSON url, and the content of that
  script tag from the remote server is the callback function wrapping
  the JSON data.

  You can also use getScript to achieve the same end:

  Here's the flickr script with a callback function called 'foo' (look
  at in a browser, and then change the callback param to see how it
  wraps the payload in a function of that name):

 http://api.flickr.com/services/feeds/photos_public.gne?tags=cattagmo...

  As long as there's a function called 'foo', loading that script will
  call it:
  function foo(data){
      $.each(data.items, function(i,item){
              $(img/).attr(src, item.media.m).appendTo(#images);
              if ( i == 3 ) return false;
            });

  }

  On Mar 4, 6:23 am, MorningZ morni...@gmail.com wrote:

  http://www.ibm.com/developerworks/library/wa-aj-jsonp1/

   On Mar 4, 5:53 am, baby babybaby...@gmail.com wrote:

Hi,

We are developing an application where it needs to make a call to
other web site. I am getting security exception when i tried to call
it using JSON.

Could you please guide us?

Thanks.


[jQuery] Re: Javascript search library

2009-03-05 Thread ricardobeat

Maybe you can use jQuery's filter method:

$(JSONObject).filter(function(){
 return this.cactus = 'green'  !this.water;
});

On Mar 4, 11:00 pm, Khai khaitd...@gmail.com wrote:
 I have a collection of DIVs (or a JSON array).  Is there a javascript
 library that can search through a JSON array and return a collection
 of matched elements, and support advanced search with boolean
 operator?

 Thanks
 Khai


[jQuery] Re: Dynamic mailto: link.

2009-03-05 Thread MorningZ

Here's some revised code with a Check All option

http://paste.pocoo.org/show/106596/



On Mar 5, 11:00 am, Sir Rawlins robert.rawl...@thinkbluemedia.co.uk
wrote:
 MorningZ,

 That works a real treat! Thank you very much indeed!!!

 One thing further I'd like to pick your brains on. I have a 'select
 all' script which works like this:

         $(.select_all_cm).click(function() {
                 var checked_status = this.checked;
                 $(input[name=CMStudent_IDs]).each(function()
                 {
                     this.checked = checked_status;
                 });
          });

 However, using this doesn't trigger the change() event on the
 checkboxes, is there another event we can bind to that function
 that'll be triggers by the select_all as well?

 Thanks mate,

 Rob

 On Mar 5, 3:32 pm, MorningZ morni...@gmail.com wrote:

  Here's a quick example i whipped up (and works)

 http://paste.pocoo.org/show/106586/

  To note about your code, setAttr isn't a jQuery call, it's .attr

  On Mar 5, 10:04 am, Sir Rawlins robert.rawl...@thinkbluemedia.co.uk
  wrote:

   Hey Ryan!

   Thanks for your advice, I appreciate it.

   I've got this now:

   input type=checkbox name=CMStudent_IDs value=s...@email.com //
   td
           a class=blue_button id=mailspanEmail Selected Students/
   span/a

               $(input[name='CMStudent_IDs']).click(function(){
                                   var mylink = [];

                                   
   $(input[name='CMStudent_IDs':checked]).each(function(i){
                                        mylink.push($(this).val());
                                   });

                                   $(a#mail).setAttr(href, mailto:; + 
   mylink.join
   (,));
               });

   However it doesn't seem to work for me, I check a couple of the
   checkboxes but the link is never given an href so clicking it does
   nothing. Can you spot anything out of sorts with the code?

   Many thanks mate,

   Rob

   On Mar 5, 1:34 pm, ryan.j ryan.joyce...@googlemail.com wrote:

and you'd probably want to add :checked onto the end of the selector
too. ;)


[jQuery] Re: Simple one: difference between varXy.find(':text') and $(varXy).find(':text')

2009-03-05 Thread ricardobeat

For one or two references it will probably be irrelevant, but for
cases where you're looping over with each() it can make a meaningful
difference. A selector like $('div:not(#topo) div.home
div .subdestaque') takes between 5-20ms depending on the browser, by
saving the object in a variable you cut the whole of that time for
each use - a local variable lookup is, for performance matters,
instantaneous.

cheers,
- ricardo

On Mar 5, 1:07 pm, Rick Faircloth r...@whitestonemedia.com wrote:
 Thanks for the further input, Ricardo...

 Is there any way you can put a percentage of processing and/or time saved
 by using var with elements?  Especially if there is only one or two
 references on a page?

 Rick

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

 Behalf Of ricardobeat
 Sent: Thursday, March 05, 2009 11:00 AM
 To: jQuery (English)
 Subject: [jQuery] Re: Simple one: difference between varXy.find(':text') and
 $(varXy).find(':text')

 It's mostly done to improve performance. If you save the jQuery object in a
 var you only need to find the element once (depending on the selector it's
 an expensive operation), and then operate on that single object. I (and
 other people) like to put a '$' in front of the var name when it contains a
 jQ object, to make it clear:

 var $mySet = $('.mystuff'); //jQ object
 $mySet.click(...).append(...)

 var myElement = $('#someelement')[0]; //HTML element
 $(myElement).doSomething();

 by doing $($mySet) you're unnecessarily creating a new object from the one
 you have already stored. It's not really much overhead, but bloats code.

 ggerri: this.something() where 'something' is a jQuery method is usually
 found in plug-ins:

 jQuery.fn.doSomething = function(){
      // in here, 'this' refers to the current jQuery object/set
      //so you can use methods on it, like each
      this.each(function(){
         // here, 'this' is the current element in the loop, not a jq object
         //so you need to wrap it in jQ before using it
         $(this).append(...)
      });
 };

 cheers,
 - ricardo

 On Mar 5, 9:58 am, Rick Faircloth r...@whitestonemedia.com wrote:
  Hi, Rayn :handshake: :o)

  I think, for shorthand notation (some say for readability, but I think
  otherwise), some set var's (variables) to represent pieces of code, for
 instance:

  var mySet = '$(mySet)'

  and then use it as:

  mySet.find(':text')...

  Written in longhand, it would be:

  $('mySet').find(':text')...

  When trying to read someone else's code, where this shorthand is use
  extensively, I just find it hard to decipher, since I have to trace
  all the var's down to find out what they stand for...

  Someone please correct me if I'm wrong...

  Rick

  -Original Message-
  From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com]
  On Behalf Of ggerri
  Sent: Thursday, March 05, 2009 7:31 AM
  To: jquery-en@googlegroups.com
  Subject: [jQuery] Re: Simple one: difference between
  varXy.find(':text') and $(varXy).find(':text')

  Thanks Ryan :handshake:

  so  mySet.find(':text').each(...) would be right and
  $(mySet).find(':text').each(...) not? :confused:

  In examples I often see (within an each function): $(this).something
  but also this.something

  Still dont get the difference of use :,(

  G

  ryan.joyce...@googlemail.com wrote:

   mySet is an object or variable, $(mySet) will try to get an element
   using the contents of mySet as the selector.

   On Mar 5, 10:04 am, ggerri gerald.ressm...@ewz.ch wrote:
   Hi there

   thats an easy one for you ;-)

   if i do:

   var mySet = $('trtd:nth-child(2n)');

   how do I use mySet? What's the difference between

   mySet.find(':text')

   and

   $(mySet).find(':text')

   Thanks :-))
   GGerri

   --
   View this message in

 context:http://www.nabble.com/Simple-one%3A-difference-between-varXy.find%28
 %...
   Sent from the jQuery General Discussion mailing list archive at
   Nabble.com.

  --
  View this message in
 context:http://www.nabble.com/Simple-one%3A-difference-between-varXy.find%28
 %...
  Sent from the jQuery General Discussion mailing list archive at
 Nabble.com.


[jQuery] Re: Dynamic mailto: link.

2009-03-05 Thread Sir Rawlins

Good man!

Thank you a great deal!

Rob

On Mar 5, 4:33 pm, MorningZ morni...@gmail.com wrote:
 Here's some revised code with a Check All option

 http://paste.pocoo.org/show/106596/

 On Mar 5, 11:00 am, Sir Rawlins robert.rawl...@thinkbluemedia.co.uk
 wrote:

  MorningZ,

  That works a real treat! Thank you very much indeed!!!

  One thing further I'd like to pick your brains on. I have a 'select
  all' script which works like this:

          $(.select_all_cm).click(function() {
                  var checked_status = this.checked;
                  $(input[name=CMStudent_IDs]).each(function()
                  {
                      this.checked = checked_status;
                  });
           });

  However, using this doesn't trigger the change() event on the
  checkboxes, is there another event we can bind to that function
  that'll be triggers by the select_all as well?

  Thanks mate,

  Rob

  On Mar 5, 3:32 pm, MorningZ morni...@gmail.com wrote:

   Here's a quick example i whipped up (and works)

  http://paste.pocoo.org/show/106586/

   To note about your code, setAttr isn't a jQuery call, it's .attr

   On Mar 5, 10:04 am, Sir Rawlins robert.rawl...@thinkbluemedia.co.uk
   wrote:

Hey Ryan!

Thanks for your advice, I appreciate it.

I've got this now:

input type=checkbox name=CMStudent_IDs value=s...@email.com //
td
        a class=blue_button id=mailspanEmail Selected Students/
span/a

            $(input[name='CMStudent_IDs']).click(function(){
                                var mylink = [];

                                
$(input[name='CMStudent_IDs':checked]).each(function(i){
                                     mylink.push($(this).val());
                                });

                                $(a#mail).setAttr(href, mailto:; + 
mylink.join
(,));
            });

However it doesn't seem to work for me, I check a couple of the
checkboxes but the link is never given an href so clicking it does
nothing. Can you spot anything out of sorts with the code?

Many thanks mate,

Rob

On Mar 5, 1:34 pm, ryan.j ryan.joyce...@googlemail.com wrote:

 and you'd probably want to add :checked onto the end of the selector
 too. ;)


[jQuery] Re: Need to insert an element in DIV at position X Y

2009-03-05 Thread brian

On Thu, Mar 5, 2009 at 11:01 AM, ricardobeat ricardob...@gmail.com wrote:

 Insert anywhere and use position:absolute.

Would the text re-flow around the div, though? I'd imagine it wouldn't.

If not, I suppose you could get the insertion point within the div's
text, using textrange, then replace it with a copy that includes the
new div at that position. Possible?


[jQuery] Re: Need to insert an element in DIV at position X Y

2009-03-05 Thread choesang

Thanks alot it works!

$(#Content).rightClick( function(e) {
var x = e.pageX;
var y = e.pageY;
$(div class='pin' style='top:  + y + px; left:  + x  + 
px';/
div).insertAfter(this);
 });


[jQuery] Re: Need to insert an element in DIV at position X Y

2009-03-05 Thread choesang

Thanks alot it works!

$(#Content).rightClick( function(e) {
var x = e.pageX;
var y = e.pageY;
$(div class='pin' style='top:  + y + px; left:  + x  + 
px';/
div).insertAfter(this);
 });


[jQuery] Re: How to trigger click event in jquery

2009-03-05 Thread Yun W

I have the same issue with the click on jQuery.

When using $('#elmId').trigger('click'), it doesn't work on Google
Chrome/Safari, but it does work on IE7/IE6.  No error is thrown.
What's the problem?

Thanks.

On Mar 5, 3:56 am, Andy789 e...@abcstudio.com.au wrote:
 Hi All,

 I am struggling with something very simple.

 1. onclick event for li element is binded with mootools

 2. I can easilytriggeronclick via function with mootools like

 $('lst4').fireEvent('click'); ///works fine

 2. I cannottriggeronclick via jquery. I am trying

 function test(){
 //$('lst4').fireEvent('click'); ///works OK, calling mootools
 $j('#lst4').trigger('click');  // does not work, returns no errors

 }

 I am using both mootools ans jquery. $j relates to jquery (var $j =
 jQuery.noConflict();)

 How can Itriggeronclick for that element programmatically with
 jquery?


[jQuery] Re: Need to insert an element in DIV at position X Y

2009-03-05 Thread choesang

.pin{
background:url('pin_org.png') no-repeat; height:24px; width:
24px;position:absolute;
}


[jQuery] Re: Need to insert an element in DIV at position X Y

2009-03-05 Thread choesang

.pin{
background:url('pin_org.png') no-repeat; height:24px; width:
24px;position:absolute;
}


[jQuery] Re: Anchors Images Tutorial

2009-03-05 Thread brian

On Thu, Mar 5, 2009 at 7:49 AM, HM-User m.lawrencehu...@gmail.com wrote:

 I have had a look at this tutorial by Malsup and simply, you can add
 an a link to the image slides.
 However, for me like the tutorial with:

 function onAfter() {
    $('#output').html(Current anchor:  + this.href);

 I have for myself:

 before: onBefore,
 pager: '#featurenav'
 });
 function onBefore() {
 jQuery('#headline').html(this.alt);
 }
 });

 The image slides are held within a div and it is simply: a
 href=img src= alt=something //a.

 But adding the a link to the img src tag does not make the alt text
 appear but the image does link. How can I get the a link to the image
 AND the alt text to appear as well?

I don't know what tutorial you're referring to but it looks to me like
you should have something like:

$(this).attr('alt')

However, does this refer to the img or the link? In the onAfter
function it appears to be the link. Try:

$(this).find('img').attr('alt')

and, for onAfter():

$(this).attr('href')


[jQuery] Re: Simple one: difference between varXy.find(':text') and $(varXy).find(':text')

2009-03-05 Thread wick

Rick, as far as I can tell there is something wrong with two of the
code examples you provided.

var mySet = '$(mySet)';   ...this sets the mySet variable to a string
that *looks* like a jQuery selector, but your quotes make it into a
useless string.
$('mySet').find(':text')......this selector looks for a mySet
HTML object (which does not exist), again, because of the way you have
the quotes. It doesn't use the mySet variable reference at all.

To answer GGerri's question..

var mySet = $('trtd:nth-child(2n)');  ...assigns a jQuery object to
the mySet variable.
mySet.find(':text')   ...takes your jQuery object  applies find() to
it.
$(mySet).find(':text')   ...takes your jQuery object, runs it through
the jQuery selector engine again,  applies find().

Both ways work okay, but the 2nd way isn't the best because running a
jQuery object through the selector engine again serves no purpose that
I'm aware of. Normally you'd use the 2nd example only if mySet was a
DOM object reference, not a jQuery object reference.

Regarding GGerri's question about the this variable - in jQuery,
this refers to a DOM object so you always need to wrap it with the
jQuery $(...) selector if you're going to use jQuery methods on it.

A useful variable naming convention I've seen is to prefix any jQuery
object variables with a dollar sign. It's an easy reminder that the
variable is already a jQuery object. In other words:

var $mySet = $('div h1 a');  $mySet becomes a jQuery object
$mySet.show(300,function() {
  $(this).fadeIn(); ...this is a DOM object, so you need to wrap it
with the jQuery selector
});

Hope that helps!

-Wick
http://www.CarComplaints.com


On Mar 5, 7:58 am, Rick Faircloth r...@whitestonemedia.com wrote:
 Hi, Rayn :handshake: :o)

 I think, for shorthand notation (some say for readability, but I think 
 otherwise),
 some set var's (variables) to represent pieces of code, for instance:

 var mySet = '$(mySet)'

 and then use it as:

 mySet.find(':text')...

 Written in longhand, it would be:

 $('mySet').find(':text')...

 When trying to read someone else's code, where this shorthand is use 
 extensively,
 I just find it hard to decipher, since I have to trace all the var's down to 
 find
 out what they stand for...

 Someone please correct me if I'm wrong...

 Rick

 -Original Message-
 From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On 
 Behalf Of ggerri
 Sent: Thursday, March 05, 2009 7:31 AM
 To: jquery-en@googlegroups.com
 Subject: [jQuery] Re: Simple one: difference between varXy.find(':text') and 
 $(varXy).find(':text')

 Thanks Ryan :handshake:

 so  mySet.find(':text').each(...) would be right and
 $(mySet).find(':text').each(...) not? :confused:

 In examples I often see (within an each function): $(this).something but also 
 this.something

 Still dont get the difference of use :,(

 G

 ryan.joyce...@googlemail.com wrote:

  mySet is an object or variable, $(mySet) will try to get an element
  using the contents of mySet as the selector.

  On Mar 5, 10:04 am, ggerri gerald.ressm...@ewz.ch wrote:
  Hi there

  thats an easy one for you ;-)

  if i do:

  var mySet = $('trtd:nth-child(2n)');

  how do I use mySet? What's the difference between

  mySet.find(':text')

  and

  $(mySet).find(':text')

  Thanks :-))
  GGerri

  --
  View this message in
  context:http://www.nabble.com/Simple-one%3A-difference-between-varXy.find%28%...
  Sent from the jQuery General Discussion mailing list archive at
  Nabble.com.

 --
 View this message in 
 context:http://www.nabble.com/Simple-one%3A-difference-between-varXy.find%28%...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: Simple one: difference between varXy.find(':text') and $(varXy).find(':text')

2009-03-05 Thread Rick Faircloth

Thanks, Ricardo...good to know.

Rick

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of ricardobeat
Sent: Thursday, March 05, 2009 11:38 AM
To: jQuery (English)
Subject: [jQuery] Re: Simple one: difference between varXy.find(':text') and
$(varXy).find(':text')


For one or two references it will probably be irrelevant, but for cases
where you're looping over with each() it can make a meaningful difference. A
selector like $('div:not(#topo) div.home div .subdestaque') takes between
5-20ms depending on the browser, by saving the object in a variable you cut
the whole of that time for each use - a local variable lookup is, for
performance matters, instantaneous.

cheers,
- ricardo

On Mar 5, 1:07 pm, Rick Faircloth r...@whitestonemedia.com wrote:
 Thanks for the further input, Ricardo...

 Is there any way you can put a percentage of processing and/or time 
 saved by using var with elements?  Especially if there is only one or 
 two references on a page?

 Rick

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

 Behalf Of ricardobeat
 Sent: Thursday, March 05, 2009 11:00 AM
 To: jQuery (English)
 Subject: [jQuery] Re: Simple one: difference between 
 varXy.find(':text') and
 $(varXy).find(':text')

 It's mostly done to improve performance. If you save the jQuery object 
 in a var you only need to find the element once (depending on the 
 selector it's an expensive operation), and then operate on that single 
 object. I (and other people) like to put a '$' in front of the var 
 name when it contains a jQ object, to make it clear:

 var $mySet = $('.mystuff'); //jQ object
 $mySet.click(...).append(...)

 var myElement = $('#someelement')[0]; //HTML element 
 $(myElement).doSomething();

 by doing $($mySet) you're unnecessarily creating a new object from the 
 one you have already stored. It's not really much overhead, but bloats
code.

 ggerri: this.something() where 'something' is a jQuery method is 
 usually found in plug-ins:

 jQuery.fn.doSomething = function(){
      // in here, 'this' refers to the current jQuery object/set
      //so you can use methods on it, like each
      this.each(function(){
         // here, 'this' is the current element in the loop, not a jq 
 object
         //so you need to wrap it in jQ before using it
         $(this).append(...)
      });
 };

 cheers,
 - ricardo

 On Mar 5, 9:58 am, Rick Faircloth r...@whitestonemedia.com wrote:
  Hi, Rayn :handshake: :o)

  I think, for shorthand notation (some say for readability, but I 
  think otherwise), some set var's (variables) to represent pieces of 
  code, for
 instance:

  var mySet = '$(mySet)'

  and then use it as:

  mySet.find(':text')...

  Written in longhand, it would be:

  $('mySet').find(':text')...

  When trying to read someone else's code, where this shorthand is use 
  extensively, I just find it hard to decipher, since I have to trace 
  all the var's down to find out what they stand for...

  Someone please correct me if I'm wrong...

  Rick

  -Original Message-
  From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com]
  On Behalf Of ggerri
  Sent: Thursday, March 05, 2009 7:31 AM
  To: jquery-en@googlegroups.com
  Subject: [jQuery] Re: Simple one: difference between
  varXy.find(':text') and $(varXy).find(':text')

  Thanks Ryan :handshake:

  so  mySet.find(':text').each(...) would be right and
  $(mySet).find(':text').each(...) not? :confused:

  In examples I often see (within an each function): $(this).something 
  but also this.something

  Still dont get the difference of use :,(

  G

  ryan.joyce...@googlemail.com wrote:

   mySet is an object or variable, $(mySet) will try to get an 
   element using the contents of mySet as the selector.

   On Mar 5, 10:04 am, ggerri gerald.ressm...@ewz.ch wrote:
   Hi there

   thats an easy one for you ;-)

   if i do:

   var mySet = $('trtd:nth-child(2n)');

   how do I use mySet? What's the difference between

   mySet.find(':text')

   and

   $(mySet).find(':text')

   Thanks :-))
   GGerri

   --
   View this message in

 context:http://www.nabble.com/Simple-one%3A-difference-between-varXy.f
 ind%28
 %...
   Sent from the jQuery General Discussion mailing list archive at 
   Nabble.com.

  --
  View this message in
 context:http://www.nabble.com/Simple-one%3A-difference-between-varXy.f
 ind%28
 %...
  Sent from the jQuery General Discussion mailing list archive at
 Nabble.com.



[jQuery] Re: Simple one: difference between varXy.find(':text') and $(varXy).find(':text')

2009-03-05 Thread Rick Faircloth

Oh, you're absolutely right, wick... I was just careless in my coding.
Thanks for pointing that out and correcting the example...for my sake
and, especially for GGerri's!

Rick

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of wick
Sent: Thursday, March 05, 2009 11:58 AM
To: jQuery (English)
Subject: [jQuery] Re: Simple one: difference between varXy.find(':text') and
$(varXy).find(':text')


Rick, as far as I can tell there is something wrong with two of the code
examples you provided.

var mySet = '$(mySet)';   ...this sets the mySet variable to a string
that *looks* like a jQuery selector, but your quotes make it into a useless
string.
$('mySet').find(':text')......this selector looks for a mySet
HTML object (which does not exist), again, because of the way you have the
quotes. It doesn't use the mySet variable reference at all.

To answer GGerri's question..

var mySet = $('trtd:nth-child(2n)');  ...assigns a jQuery object to the
mySet variable.
mySet.find(':text')   ...takes your jQuery object  applies find() to
it.
$(mySet).find(':text')   ...takes your jQuery object, runs it through
the jQuery selector engine again,  applies find().

Both ways work okay, but the 2nd way isn't the best because running a jQuery
object through the selector engine again serves no purpose that I'm aware
of. Normally you'd use the 2nd example only if mySet was a DOM object
reference, not a jQuery object reference.

Regarding GGerri's question about the this variable - in jQuery, this
refers to a DOM object so you always need to wrap it with the jQuery $(...)
selector if you're going to use jQuery methods on it.

A useful variable naming convention I've seen is to prefix any jQuery object
variables with a dollar sign. It's an easy reminder that the variable is
already a jQuery object. In other words:

var $mySet = $('div h1 a');  $mySet becomes a jQuery object
$mySet.show(300,function() {
  $(this).fadeIn(); ...this is a DOM object, so you need to wrap it with
the jQuery selector });

Hope that helps!

-Wick
http://www.CarComplaints.com


On Mar 5, 7:58 am, Rick Faircloth r...@whitestonemedia.com wrote:
 Hi, Rayn :handshake: :o)

 I think, for shorthand notation (some say for readability, but I think 
 otherwise), some set var's (variables) to represent pieces of code, for
instance:

 var mySet = '$(mySet)'

 and then use it as:

 mySet.find(':text')...

 Written in longhand, it would be:

 $('mySet').find(':text')...

 When trying to read someone else's code, where this shorthand is use 
 extensively, I just find it hard to decipher, since I have to trace 
 all the var's down to find out what they stand for...

 Someone please correct me if I'm wrong...

 Rick

 -Original Message-
 From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] 
 On Behalf Of ggerri
 Sent: Thursday, March 05, 2009 7:31 AM
 To: jquery-en@googlegroups.com
 Subject: [jQuery] Re: Simple one: difference between 
 varXy.find(':text') and $(varXy).find(':text')

 Thanks Ryan :handshake:

 so  mySet.find(':text').each(...) would be right and
 $(mySet).find(':text').each(...) not? :confused:

 In examples I often see (within an each function): $(this).something 
 but also this.something

 Still dont get the difference of use :,(

 G

 ryan.joyce...@googlemail.com wrote:

  mySet is an object or variable, $(mySet) will try to get an element 
  using the contents of mySet as the selector.

  On Mar 5, 10:04 am, ggerri gerald.ressm...@ewz.ch wrote:
  Hi there

  thats an easy one for you ;-)

  if i do:

  var mySet = $('trtd:nth-child(2n)');

  how do I use mySet? What's the difference between

  mySet.find(':text')

  and

  $(mySet).find(':text')

  Thanks :-))
  GGerri

  --
  View this message in
 
context:http://www.nabble.com/Simple-one%3A-difference-between-varXy.find%28
%...
  Sent from the jQuery General Discussion mailing list archive at 
  Nabble.com.

 --
 View this message in
context:http://www.nabble.com/Simple-one%3A-difference-between-varXy.find%28
%...
 Sent from the jQuery General Discussion mailing list archive at
Nabble.com.



[jQuery] Re: .clone a form

2009-03-05 Thread bstoppel

The code works, but not as I need it to. If I remove the .html() and
append the clone to another element, I get an object, not the form. I
need the form. As Rick and another person the I spoke with mentioned,
a work around is to wrap the form with a div and select the div. That
way when I .clone() the div and get the .html(), the innerHTML
contains the form tag. I am not a huge fan of adding cruft to my HTML,
but it is time to accept the solution at hand and move on. Even if it
is not perfect.

Thanks everyone.

On Mar 5, 10:23 am, mkmanning michaell...@gmail.com wrote:
 Your code works fine without the .html(). If you're trying to log what
 you get, then it will say 'object', which is to be expected.

 On Mar 5, 8:18 am, Rick Faircloth r...@whitestonemedia.com wrote:

  Possible work-a-around...

  Enclose your form in a div, say div id='form-div'form.../div,
  and clone the div...?

  Rick

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

  Behalf Of bstoppel
  Sent: Thursday, March 05, 2009 11:07 AM
  To: jQuery (English)
  Subject: [jQuery] Re: .clone a form

  Without the .html() part you get an object. With .text() you get what
  appears to be HTML entities and text.

  On Mar 5, 6:10 am, Rick Faircloth r...@whitestonemedia.com wrote:
   Not sure, but it might be that the .html() part is telling the clone
   function to just clone the html *within* .hook:first.

   What happens if you leave off the .html() part?

   Rick

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

   Behalf Of bstoppel
   Sent: Wednesday, March 04, 2009 11:50 PM
   To: jQuery (English)
   Subject: [jQuery] .clone a form

   Hi All.

   I am having an issue with cloning a form. When I clone an existing
   form, only the input tags are cloned. Here is an example

   -- HTML

   form class=hook action=do/something method=post
   enctype=multipart/form-data
   input type=text name=variable
   input type=submit
   /form

   div id=clonehere/div

   -- JQuery

   $('#clonehere').append($('.hook:first').clone(true).html());

   -- Result

   #clonehere will only get this part of the form input type=text
   name=variable input type=submit

   What am I doing wrong?


[jQuery] Re: Animate using relative %

2009-03-05 Thread brian

On Thu, Mar 5, 2009 at 8:22 AM, Adam Jessop a...@infused-gaming.net wrote:
 Sure,

 The site in question is at: http://be.0wned.co.uk

Do you really expect anyone to click that link with JS enabled? ;-)

I think the way I'd approach this would be to first get the CSS set up
so that, with the images already in place when the page loads, they
assume their proper positions regardless of window size. Then, I'd
replace each of the images with a single pixel img. When the page
loaded, I'd get the positions of each of the 1 pixel imgs on the
screen and set the animation params for the respective images which a
re off-screen.


[jQuery] Re: Simple one: difference between varXy.find(':text') and $(varXy).find(':text')

2009-03-05 Thread wick


Cool. By the way, regarding your question about determining the
javascript processing time, something like this is helpful:

http://jdev.blogsome.com/2006/08/18/compact-script-to-calculate-script-execution-time/


On Mar 5, 12:02 pm, Rick Faircloth r...@whitestonemedia.com wrote:
 Oh, you're absolutely right, wick... I was just careless in my coding.
 Thanks for pointing that out and correcting the example...for my sake
 and, especially for GGerri's!

 Rick

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

 Behalf Of wick
 Sent: Thursday, March 05, 2009 11:58 AM
 To: jQuery (English)
 Subject: [jQuery] Re: Simple one: difference between varXy.find(':text') and
 $(varXy).find(':text')

 Rick, as far as I can tell there is something wrong with two of the code
 examples you provided.

 var mySet = '$(mySet)';   ...this sets the mySet variable to a string
 that *looks* like a jQuery selector, but your quotes make it into a useless
 string.
 $('mySet').find(':text')...    ...this selector looks for a mySet
 HTML object (which does not exist), again, because of the way you have the
 quotes. It doesn't use the mySet variable reference at all.

 To answer GGerri's question..

 var mySet = $('trtd:nth-child(2n)');  ...assigns a jQuery object to the
 mySet variable.
 mySet.find(':text')   ...takes your jQuery object  applies find() to
 it.
 $(mySet).find(':text')   ...takes your jQuery object, runs it through
 the jQuery selector engine again,  applies find().

 Both ways work okay, but the 2nd way isn't the best because running a jQuery
 object through the selector engine again serves no purpose that I'm aware
 of. Normally you'd use the 2nd example only if mySet was a DOM object
 reference, not a jQuery object reference.

 Regarding GGerri's question about the this variable - in jQuery, this
 refers to a DOM object so you always need to wrap it with the jQuery $(...)
 selector if you're going to use jQuery methods on it.

 A useful variable naming convention I've seen is to prefix any jQuery object
 variables with a dollar sign. It's an easy reminder that the variable is
 already a jQuery object. In other words:

 var $mySet = $('div h1 a');  $mySet becomes a jQuery object
 $mySet.show(300,function() {
   $(this).fadeIn(); ...this is a DOM object, so you need to wrap it with
 the jQuery selector });

 Hope that helps!

 -Wickhttp://www.CarComplaints.com

 On Mar 5, 7:58 am, Rick Faircloth r...@whitestonemedia.com wrote:
  Hi, Rayn :handshake: :o)

  I think, for shorthand notation (some say for readability, but I think
  otherwise), some set var's (variables) to represent pieces of code, for
 instance:

  var mySet = '$(mySet)'

  and then use it as:

  mySet.find(':text')...

  Written in longhand, it would be:

  $('mySet').find(':text')...

  When trying to read someone else's code, where this shorthand is use
  extensively, I just find it hard to decipher, since I have to trace
  all the var's down to find out what they stand for...

  Someone please correct me if I'm wrong...

  Rick

  -Original Message-
  From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com]
  On Behalf Of ggerri
  Sent: Thursday, March 05, 2009 7:31 AM
  To: jquery-en@googlegroups.com
  Subject: [jQuery] Re: Simple one: difference between
  varXy.find(':text') and $(varXy).find(':text')

  Thanks Ryan :handshake:

  so  mySet.find(':text').each(...) would be right and
  $(mySet).find(':text').each(...) not? :confused:

  In examples I often see (within an each function): $(this).something
  but also this.something

  Still dont get the difference of use :,(

  G

  ryan.joyce...@googlemail.com wrote:

   mySet is an object or variable, $(mySet) will try to get an element
   using the contents of mySet as the selector.

   On Mar 5, 10:04 am, ggerri gerald.ressm...@ewz.ch wrote:
   Hi there

   thats an easy one for you ;-)

   if i do:

   var mySet = $('trtd:nth-child(2n)');

   how do I use mySet? What's the difference between

   mySet.find(':text')

   and

   $(mySet).find(':text')

   Thanks :-))
   GGerri

   --
   View this message in

 context:http://www.nabble.com/Simple-one%3A-difference-between-varXy.find%28
 %...
   Sent from the jQuery General Discussion mailing list archive at
   Nabble.com.

  --
  View this message in
 context:http://www.nabble.com/Simple-one%3A-difference-between-varXy.find%28
 %...
  Sent from the jQuery General Discussion mailing list archive at
 Nabble.com.


[jQuery] Re: Error: $(#suggest1).autocomplete is not a function

2009-03-05 Thread efet

I did not include head/head part in my previous message. The
following code is included in the head section:

script type=text/javascript src=jquery.js/script
script type='text/javascript' src='jquery.bgiframe.min.js'/script
script type='text/javascript' src='jquery.ajaxQueue.js'/script

script type='text/javascript' src='thickbox-compressed.js'/script
script type='text/javascript' src='jquery.autocomplete.js'/script
script type='text/javascript' src='localdata.js'/script
link rel=stylesheet type=text/css href=main.css /


On Mar 5, 8:05 am, MorningZ morni...@gmail.com wrote:
 It doesn't work because you don't have the autocomplete js file
 referenced/loaded

 On Mar 5, 1:19 am, efet efetun...@gmail.com wrote:

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

    var data = [ {QUERY: $(#QUERY).val(), url:'test.asp?
  Process=CheckCustomer'} ];
    $(#suggest1).autocomplete(data);

  });

  /script
                  div class=required
                      label for=Test...Test.../label
                      input type=text id=suggest1 /
                  /div

  Data needs to be taken as:
  test.asp?Process=CheckCustomerQUERY=a

  Not very familiary with jquery yet. Can anyone tell me why I get the
  following error.

  Error: $(#suggest1).autocomplete is not a function
  Source 
  File:http://www.refinethetaste.com/html/cp/default.asp?Section=ordersProc...
  Line: 162


[jQuery] Re: ajax data

2009-03-05 Thread hosemaria

Got solution
have to be something like this:

{'data':items,'item[1]':'one','item[2]':'two'};

Greetings


On 2 Mar, 20:04, hosemaria hosema...@gmail.com wrote:
  Try:

  {
    item1:one,
    item2:,
    item3: {item31:sdf, item32:sdfs}
  }

 Doesn't work. Result is the same.
    [item3] = [object Object]


[jQuery] Re: .clone a form

2009-03-05 Thread mkmanning

Are you by any chance appending it with some additional text?
For example, something like this:

$('#clonehere').append($('.hook:first').clone(true) + br /);

If you do that then you will get [object Object]

The code works fine as it is, as long as you use it correctly; here's
a page using your markup and your code:

http://actingthemaggot.com/test/clone_test.html

No workaround is needed.

On Mar 5, 9:12 am, bstoppel brett.telosstud...@gmail.com wrote:
 The code works, but not as I need it to. If I remove the .html() and
 append the clone to another element, I get an object, not the form. I
 need the form. As Rick and another person the I spoke with mentioned,
 a work around is to wrap the form with a div and select the div. That
 way when I .clone() the div and get the .html(), the innerHTML
 contains the form tag. I am not a huge fan of adding cruft to my HTML,
 but it is time to accept the solution at hand and move on. Even if it
 is not perfect.

 Thanks everyone.

 On Mar 5, 10:23 am, mkmanning michaell...@gmail.com wrote:

  Your code works fine without the .html(). If you're trying to log what
  you get, then it will say 'object', which is to be expected.

  On Mar 5, 8:18 am, Rick Faircloth r...@whitestonemedia.com wrote:

   Possible work-a-around...

   Enclose your form in a div, say div id='form-div'form.../div,
   and clone the div...?

   Rick

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

   Behalf Of bstoppel
   Sent: Thursday, March 05, 2009 11:07 AM
   To: jQuery (English)
   Subject: [jQuery] Re: .clone a form

   Without the .html() part you get an object. With .text() you get what
   appears to be HTML entities and text.

   On Mar 5, 6:10 am, Rick Faircloth r...@whitestonemedia.com wrote:
Not sure, but it might be that the .html() part is telling the clone
function to just clone the html *within* .hook:first.

What happens if you leave off the .html() part?

Rick

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

Behalf Of bstoppel
Sent: Wednesday, March 04, 2009 11:50 PM
To: jQuery (English)
Subject: [jQuery] .clone a form

Hi All.

I am having an issue with cloning a form. When I clone an existing
form, only the input tags are cloned. Here is an example

-- HTML

form class=hook action=do/something method=post
enctype=multipart/form-data
input type=text name=variable
input type=submit
/form

div id=clonehere/div

-- JQuery

$('#clonehere').append($('.hook:first').clone(true).html());

-- Result

#clonehere will only get this part of the form input type=text
name=variable input type=submit

What am I doing wrong?


[jQuery] Re: Trying to add/remove a class when....

2009-03-05 Thread Charlie Tomlinson





input isn't a css "class",, it's a tag with css attributes

have you tried ("input").css ()?


webspee...@gmail.com wrote:

  Hey all.

I'm trying to add/remove a class and am having trouble. When I add the
new class, the color takes hold, but not the changing of the
background image.

The original CSS is defined as input[type="button"]{background-
image:}

How do I remove a class that is defined like the one above? I tried
removeClass("input"), but that didn't work.


  






[jQuery] show and hide jcarousel lite plug in

2009-03-05 Thread surreal5335

I have a set up I am creating where when the user clicks on an image
in one carousel it will display another carousel that contains
pictures in it to view in a larger window. I have been able to get the
carousel on both to work, but I am having trouble getting the second
to show and hide and pick from a certain set of pictures when a
picture in the first carousel is clicked.

I have tried using a javascript switch statment (which works fine in
other wbesites that dont use jquery) and also the code below to
achieve the effect. Neither have worked thus far.


var currentDiv = 1;
function showMe(n) {
$(#ex_+currentDiv).hide();
$(#ex_+n).style.display = block;
currentDiv = n;
}



for the html code to handle the click event, I used:



div class=gallery id=gallery 
  ul
 lia href=#img src=/photo_site/thumbs/6.png alt=1
height=160 width=160 id=6 onclick=showMe(1)/a/li
 lia href=#img src=/photo_site/thumbs/holga.png
alt=3 height=160 width=160 id=6 onclick=showMe(5)/a/li
 lia href=#img src=/photo_site/thumbs/land.png
alt=3 height=160 width=160 id=land onclick=showMe(6)/a/
li
 /ul
/div



For the sub carousels I used this code:



div class=pictures id=pictures
 ul id=misc id=ex_1 style=display:none;
 liimg src=/photo_site/thumbs/pictures/misc/tm1.png
alt=1 height=160 width=160/li
 liimg src=/photo_site/thumbs/pictures/misc/tm3.png
alt=2 height=160 width=160/li
 liimg src=/photo_site/thumbs/pictures/misc/tm4.png
alt=3 height=160 width=160/li
 liimg src=/photo_site/thumbs/misc.png alt=4
height=160 width=160/li
 /ul
 ul id=luminous id=ex_5 style=display:none;
 liimg src=/photo_site/thumbs/pictures/luminous/th1.png
alt=1 height=160 width=160/li
 liimg src=/photo_site/thumbs/pictures/luminous/th3.png
alt=2 height=160 width=160/li
 liimg src=/photo_site/thumbs/pictures/luminous/th4.png
alt=3 height=160 width=160/li
 liimg src=/photo_site/thumbs/pictures/luminous/th5.png
alt=4 height=160 width=160/li
 liimg src=/photo_site/thumbs/pictures/luminous/th6.png
alt=5 height=160 width=160/li
 liimg src=/photo_site/thumbs/holga.png alt=6
height=160 width=160/li
 /ul
/div


Obviously there is more, but its all the same pattern.

I also understand that jcarousel lite doesnt react well to css's
display: none; and that I should use javascript's .hide (); instead. I
wasnt really sure how to employ this code into the html though.

I appreciate any help in the matter


[jQuery] Re: Animate using relative %

2009-03-05 Thread Adam Jessop
* 
* 
*   

Well contrary to the domain name, it is a real site with  no threat, disable 
your JS first if you like!

 

I have the CSS values for how I want the end result to be  already, but I don’t 
want them visible when the page loads, defies the whole  point of the effect.   
 

 

After that I'm afraid I don’t really see how that achieves  what I want.

 

-Original Message-

From: jquery-en@googlegroups.com  [mailto:jquery...@googlegroups.com] On Behalf 
Of brian

Sent: 05 March 2009 17:23

To: jquery-en@googlegroups.com

Subject: [jQuery] Re: Animate using relative %

 

 

On Thu, Mar 5, 2009 at 8:22 AM, Adam Jessop a...@infused-gaming.net wrote:

 Sure,

 

 The site in question is at: http://be.0wned.co.uk

 

Do you really expect anyone to click that link with JS  enabled? ;-)

 

I think the way I'd approach this would be to first get  the CSS set up so 
that, with the images already in place when the page loads,  they assume their 
proper positions regardless of window size. Then, I'd replace  each of the 
images with a single pixel img. When the page loaded, I'd get the  positions of 
each of the 1 pixel imgs on the screen and set the animation  params for the 
respective images which a re off-screen.

[jQuery] Re: Get contents of first child tr, td with class

2009-03-05 Thread webspee...@gmail.com

How would you get the second, third and so on?

On Feb 12, 2:21 pm, James james.gp@gmail.com wrote:
 $(#recent_activity tbodytrtd.date:first).text();

 On Feb 12, 9:13 am, Mark Steudel msteu...@gmail.com wrote:

  I have a table like so:

  table id=recent_activity
  thead
  tr
  tht1/th
  tht2/th
  /tr
  /thead
  tbody
  tr
  tdvalue/td
  td class=date2008-09-01/td --- want this content
  /tr
  tr
  tdvalue/td
  td class=date2008-09-01/td
  /tr
  /tbody
  /table

  And I want to try and get the first td with class date, I've tried the
  following and I get close, but I think I'm just missing something
  easy:

  $('#recent_activity tbody:first-child.activity_date').val(); --
  returns undefined

  or

  $('#recent_activity tbody:first-child.activity_date').html(); --
  returns null

  Thoughts? Better way?

  Thanks


[jQuery] Re: Modify hash in Tabs plugin

2009-03-05 Thread Klaus Hartl

If I remember correctly - haven't had a look at Tabs 2 for quite some
time - if you set the title attribute on an anchor, the hash is
derived from that.

a title=Inicio href=html/inicio.html.../a

= #Inicio

White space will be converted to an underscore...


--Klaus



On 5 Mrz., 09:00, fonoteca nas...@gmail.com wrote:
 I'm learning about JQuery and I'm absolute begginer.
 I've looking for help about one issue that imagine is easy but I can't
 find the answer till now.
 I supose Klaus Hartl has the solution for this: How I modify the hash
 of the tabs plugin?

 I'm using the version 2 with the remote option:true.

 By default appears numbers when I need show the title. With the remote
 option and I don't know how make to appear the title of the link in
 the hash instead the number.

 At last, but no at least: of course sorry about my english. It's not
 my native languaje.

 I'm making tests and this is my code:

 html
     head
         meta http-equiv=Content-Type content=text/html;
 charset=utf-8
         meta http-equiv=Content-Style-Type content=text/css
         meta http-equiv=Content-Script-Type content=text/
 javascript

         titleMy web/title

         script src=js/jquery-1.2.6.js type=text/javascript/
 script
         script src=js/jquery.history_remote.js type=text/
 javascript/script
         script src=js/jquery.tabs.js type=text/javascript/
 script
         script type=text/javascript
             $(document).ready(function() {
                 $('#menu').tabs({ remote: true, fxFade: { height:
 'show', opacity: 'show' }, fxSpeed: '4000'});
             });
         /script

 script type=text/javascript
   $(document).ready(function($) {
    $(#fulla).fadeIn('slow');
   });
 /script

         link rel=stylesheet href=css/fonoteca.css type=text/css
 media=print, projection, screen
         !-- Additional IE/Win specific style sheet (Conditional
 Comments) --
         !--[if lte IE 7]
         link rel=stylesheet href=css/fonoteca-ie.css type=text/
 css media=projection, screen
         ![endif]--

     /head
     body
      !-- Inicio fulla --
      div id=fulla class=fulla style=display:none
       !-- Inicio container --
       div id=container class=container
        !-- Inicio header --
        div id=header class=header
         Title
       /div
        !-- Fin header --

        !-- Inicio menu --
         div id=menu class=menu
             ul id=tabs class=tabs
                 lia href=html/inicio.html
 title=IniciospanInicio/span/a/li
                 lia href=html/voces.html
 title=VocesspanVoces de la Historia/span/a/li
                 lia href=html/anuncios.html
 title=AnunciosspanAnuncios/span/a/li
                 lia href=html/gazapos.html title=Gazapos y
 aneacute;cdotasspanGazapos/span/a/li
                 lia href=html/sintonias.html
 title=Sintoniacute;asspanSintoniacute;as/span/a/li
                 lia href=html/emisoras.html
 title=EmisorasspanEmisoras/span/a/li
             /ul
         /div
         !-- Fin menu --
         /div
         !-- Fin contingut --
       /div
       !-- Fin container --

       !-- Inicio side --
       div id=side class=side
         Lateral
       /div
       !-- Fin side --
       !-- Inicio pie --
       div id=pie class=pie_bis
         Pie de la pagina
       /div
       !-- Fin pie --
      /div
      !-- Fin fulla --
     /body
 /html


[jQuery] Re: .clone a form

2009-03-05 Thread bstoppel

You're totally right. In my real code I am appending text as well as
the cloned form.


[jQuery] Accordion Content height

2009-03-05 Thread Dan Vega

It seems each of the blocks are the same height as the largest. Is
there a way to tell them only to be as tall as their content?


[jQuery] Re: 2 tables with same td width

2009-03-05 Thread Alain Roger
On Wed, Mar 4, 2009 at 11:12 PM, donb falconwatc...@comcast.net wrote:


 Is thre some reason you can't do it with simple CSS directives?
 Define a Class for each td as appropriate and use the same class in
 the td of both tables. No jQuery or javascript needed at all.


yes, because i have a different CSS code for headers and standard cells :-(


[jQuery] Re: 2 tables with same td width

2009-03-05 Thread Alain Roger
On Wed, Mar 4, 2009 at 10:39 PM, MorningZ morni...@gmail.com wrote:


 I took a shot in the dark on what your HTML is like

 here's a working example

 http://paste.pocoo.org/show/106506/

 Note: the width's of cells are not know until the page is fully
 loaded... hence the initial call to the function is inside $
 (window).load


ok, so here is a screenshot of my basic html code under firebug.
as you can see there is nothing special.

Alain
attachment: column-width.gif

[jQuery] Re: Animate using relative %

2009-03-05 Thread brian

On Thu, Mar 5, 2009 at 1:12 PM, Adam Jessop a...@infused-gaming.net wrote:
 Well contrary to the domain name, it is a real site with no threat, disable
 your JS first if you like!

I was joking.

 I have the CSS values for how I want the end result to be already, but I
 don’t want them visible when the page loads, defies the whole point of the
 effect.

I meant that you should leave them visible only for as long as it
takes to set up your CSS to have them positioned where you want them.
I'm guessing this is a fluid design, so that the image locations would
adjust according to screen size changes.. If the CSS isn't correctly
done the next step would be pointless.

Once the images are how you want them to ultimately be, regardless of
screen size changes, replace them with single-pixel images (ie,
invisible) at the top-left corner position of your actual images.

 After that I'm afraid I don’t really see how that achieves what I want.

When the page loads, have your script find the positions--using
pixels--of each of the placeholder images. Feed those coordinates to
your animate function.

You could probably achieve the same thing without the placeholders by
doing a bit of math based on the screen size and the CSS percentages
but this other way seems to me to be simplest.


[jQuery] Re: Accordion Content height

2009-03-05 Thread Jörn Zaefferer

Yes, set autoHeight: false.

Jörn

On Thu, Mar 5, 2009 at 7:35 PM, Dan Vega danv...@gmail.com wrote:

 It seems each of the blocks are the same height as the largest. Is
 there a way to tell them only to be as tall as their content?


  1   2   >