[jQuery] autocomplete: positioning of the select box

2008-11-24 Thread Fatih

I am using the autocomplete plugin. Everything works fine, besides one
little problem.

How can I control the positioning of the select-box that contains the
autocomplete suggestions? I want to lower the select box a little bit,
and also want to move it a little bit to the left. This is because I
am using an image input field, and the borders of the input field in
the image are a little bit wider than the regular input field borders.

Any help is much appreciated.


[jQuery] Re: Back Button

2008-11-24 Thread Brian Cherne
Take a look at the history plug-in page code again:
http://www.mikage.to/jquery/jquery_history.html

A really important concept to understand is that the history plug-in (any
history plug-in) is listening / watching for the URL to change. Any change
you want it to make going Back you will need to let it make going
Forward (and on click) as well. You basically relinquish control to the
history plug-in (actually to the pageload function if you're following the
example URL to the letter). It works like this:

- user clicks link with an #home href
- url changes to page.html#home
- history plug-in notices url change, calls pageload function
- pageload function does something based on home

- user clicks link with an #products href
- url changes to page.html#products
- history plug-in notices url change, calls pageload function
- pageload function does something based on products

- user clicks browser's Back button
- url changes to page.html#home
- history plug-in notices url change, calls pageload function
- pageload function does something based on home

- user clicks browser's Forward button
- url changes to page.html#products
- history plug-in notices url change, calls pageload function
- pageload function does something based on products

I hope this makes sense. You will need to:

1) remove the inline onclick for each of your links. That overrides the
history plug-in and you won't be able to work around it (cleanly).

2) make the href hash values different for each of your links.

So, instead of:
a href=# onclick=showHome()Home/a

You'll need something more like:
a href=#homeHome/a
a href=#productsProducts/a

I hope this helps.

Brian.


On Sun, Nov 23, 2008 at 10:51 PM, OhNoMrBill [EMAIL PROTECTED] wrote:


 Anyone have an ideal on this?

 On Nov 22, 8:15 pm, OhNoMrBill [EMAIL PROTECTED] wrote:
  I am in a real bind on this issue. Is anyone able to answer? Help
  would be greatly appreciated if you can!!
 
  On Nov 22, 10:50 am, OhNoMrBill [EMAIL PROTECTED] wrote:
 
 
 
   Here is the scenario I am trying to deal with currently:
 
   I have a link that looks like:
 
   a href=# onClick=$.Content_Home();Some Link/a
 
   All the url links in this site look like this...onclick overrides.
 
   What I need to do is ensure that when a user clicks back, the actual
   prior jQuery function is called, and not the entire page.
 
   I tried the history plugin, and can not seem to get it to pick this
   kind of thing up. Anyone with direct experience on this kind of thing,
   please chime in with some suggestions.- Hide quoted text -
 
  - Show quoted text -



[jQuery] Re: file uploads and progress monitoring

2008-11-24 Thread netvibe

I've used swfupload. It's cross browser, multiple files, etc..

http://netvibe.nl/imagemanager/







On Nov 24, 4:21 am, cambazz [EMAIL PROTECTED] wrote:
 Hello,

 I am looking for a cross browser solution to file upload with commons
 file upload. With the commons file upload, one may also make a
 progress meter.

 I have used forms plugin and got a hold of xhr object. I can cancel
 the download at anytime.

 How can I monitor the result of the ajax post while the post is being
 made? by specifing a target: '#progressDir' I can get the result after
 the post is done, but I have found no other solutions.

 Best Regards,
 -C.B.


[jQuery] How to find the first parent?

2008-11-24 Thread Debby

How to find very first parent of perticular element?


[jQuery] Re: jCarousel problem in Chrome

2008-11-24 Thread [EMAIL PROTECTED]

Update: Found the problem, it was a CSS issue, the carousel container
not being floated correctly.

Ade.

On Nov 24, 1:50 am, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 Hi,

 Does this work with Google Chrome? All looks fine on page load.
 However, the thumbnails overshoot (can't think of a better way of
 describing it) when using the next button. In other words, when
 scrolling, the thumbnails are not contained within the carousel. I
 guess this is a CSS issue (script works fine for me in FF and IE), but
 wondered if anyone had come up for a fix with this.

 Thanks.

 Ade.


[jQuery] Re: How to find the first parent?

2008-11-24 Thread Shawn Grover


$(#myElement).parent();

Shawn

Debby wrote:

How to find very first parent of perticular element?


[jQuery] Re: animate problem with IE7

2008-11-24 Thread ^AndreA^

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

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

often... ;-)

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

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

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

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

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

  }

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

  The value of end is 50, unit is %.

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

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

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

  JK

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

  Hi Jeffrey, thanks.

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

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

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

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

  Thanks,
  Andrea

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

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

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

   While going to the right, everything went as usual.

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

   All good.

   Then I refreshed and tried going to the left.

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

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

   Divs 4 and 5 got WEIRD settings.

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

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

   Cheers,
   JK

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

   Hi all,

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

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

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

   I explain briefly how the script works.

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

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

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

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

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

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

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

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

   any idea?!?

   I'm sure the problem is in 

[jQuery] Re: Back Button

2008-11-24 Thread OhNoMrBill

That makes sense; but then how do I bind the functions to the links?

The functions represent a large block of black-boxed code that is an
AJAX handler that pushes content into destination divs.


On Nov 24, 2:52 am, Brian Cherne [EMAIL PROTECTED] wrote:
 Take a look at the history plug-in page code again:
 http://www.mikage.to/jquery/jquery_history.html

 A really important concept to understand is that the history plug-in (any
 history plug-in) is listening / watching for the URL to change. Any change
 you want it to make going Back you will need to let it make going
 Forward (and on click) as well. You basically relinquish control to the
 history plug-in (actually to the pageload function if you're following the
 example URL to the letter). It works like this:

 - user clicks link with an #home href
 - url changes to page.html#home
 - history plug-in notices url change, calls pageload function
 - pageload function does something based on home

 - user clicks link with an #products href
 - url changes to page.html#products
 - history plug-in notices url change, calls pageload function
 - pageload function does something based on products

 - user clicks browser's Back button
 - url changes to page.html#home
 - history plug-in notices url change, calls pageload function
 - pageload function does something based on home

 - user clicks browser's Forward button
 - url changes to page.html#products
 - history plug-in notices url change, calls pageload function
 - pageload function does something based on products

 I hope this makes sense. You will need to:

 1) remove the inline onclick for each of your links. That overrides the
 history plug-in and you won't be able to work around it (cleanly).

 2) make the href hash values different for each of your links.

 So, instead of:
 a href=# onclick=showHome()Home/a

 You'll need something more like:
 a href=#homeHome/a
 a href=#productsProducts/a

 I hope this helps.

 Brian.



 On Sun, Nov 23, 2008 at 10:51 PM, OhNoMrBill [EMAIL PROTECTED] wrote:

  Anyone have an ideal on this?

  On Nov 22, 8:15 pm, OhNoMrBill [EMAIL PROTECTED] wrote:
   I am in a real bind on this issue. Is anyone able to answer? Help
   would be greatly appreciated if you can!!

   On Nov 22, 10:50 am, OhNoMrBill [EMAIL PROTECTED] wrote:

Here is the scenario I am trying to deal with currently:

I have a link that looks like:

a href=# onClick=$.Content_Home();Some Link/a

All the url links in this site look like this...onclick overrides.

What I need to do is ensure that when a user clicks back, the actual
prior jQuery function is called, and not the entire page.

I tried the history plugin, and can not seem to get it to pick this
kind of thing up. Anyone with direct experience on this kind of thing,
please chime in with some suggestions.- Hide quoted text -

   - Show quoted text -- Hide quoted text -

 - Show quoted text -


[jQuery] Why doesn't code execute when Drop Down is changed or Button clicked.

2008-11-24 Thread bkbonner


I've been trying  to figure out why when I click the button nothing
happens...Can someone shed me some light on this example?

html

head

script src=jquery-1.2.6.min.js/script 
script 
function init(){
alert('one');
alert('two');
};

$(init);

$(#lstRace).change(
   alert('three');
);

$(#clickMe).click(
   alert('four');
);

/script
/head
body
Hello

select id=lstRace name=lstRace 

option value=1Test/option
option value=2/Test3/option
option value=3/Other, please specify/option
/select


input type=test id=raceOtherDiv name=other /
input type=button id=clickMe click me /input
/body
/html
-- 
View this message in context: 
http://www.nabble.com/Why-doesn%27t-code-execute-when-Drop-Down-is-changed-or-Button-clicked.-tp20654372s27240p20654372.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: autocomplete: positioning of the select box

2008-11-24 Thread Seaneh Boy



 Any help is much appreciated.


[jQuery] get top most parent

2008-11-24 Thread chitgoks

hi, i am stumped so i am posting it here. no luck searching google for
many hours

this is my html code

div id=firstpane class=menu_list !--Code for menu starts here--

p id=header1 class=menu_headHeader-1/p
div class=menu_body
a href=#Link-1/a
a href=#Link-2/a
a href=#Link-3/a
/div

p id=header2 class=menu_headHeader-2/p
div id=header2_menubody class=menu_body

div id=pane class=menu_list
p id=submenu class=menu_headSub-Menu/p
div class=menu_body
a href=#Sub Link-1/a
a href=#Sub Link-2/a
a href=#Sub Link-3/a
/div
/div

a href=#Link-1/a
a href=#Link-2/a
a href=#Link-3/a
/div

p id=header3 class=menu_headHeader-3/p
div class=menu_body
a href=#Link-1/a
a href=#Link-2/a
a href=#Link-3/a
   /div
/div  !--Code for menu ends here--

if i have access to the object id header2 how can i get access to
id=submenu ?
i tried header2obj.children('.menu_head') but it doesnt work. thanks


[jQuery] fading rollovers causing problems in IE6 and IE7

2008-11-24 Thread zenicanin

I've used the code provided by,
http://jqueryfordesigners.com/image-cross-fade-transition/

Here's the site in question,
http://www.hbportfolio.net/clients/thestlnightlife/

Any idea why sometimes it would show both images underneath each other
in IE6? It shows last image twice in IE6. And I think it shows double
images for all in IE7. It's really weird...

Any ideas?

Thanks in advance! :)


[jQuery] How return value in jQuery ajax

2008-11-24 Thread sam

i have function
jQuery.ajax({
 type: GET,
  url: url,
 data: queryString + 'btnSubmit=1',
  success: function(msg)
{
  if(msg=0){

if(msg)
{
 $(#errorid).val();

}
else
{
$(#email).val();
document.getElementById(email).focus();
}
  }
  }
  });
how to get msg in othe javascript function

function()
{
}
how can i use out of one function in other javascript function OR how
can i Stop one function from the other function


[jQuery] Re: How to find the first parent?

2008-11-24 Thread chitgoks
elementobj.parents()[0]
or elementobj.parent()

On Mon, Nov 24, 2008 at 6:51 PM, Debby [EMAIL PROTECTED] wrote:


 How to find very first parent of perticular element?




-- 
Website/Java Games: http://www.chitgoks.com
Java Casino Games: http://chitgoks.tripod.com
Photo Gallery: http://gallery.chitgoks.com
My Blogs:
http://tech.chitgoks.com
http://wuhtevah.chitgoks.com
http://disneyusa.blogspot.com


[jQuery] Re: get top most parent

2008-11-24 Thread Liam Potter


header2obj.children().children().children(#submenu);



chitgoks wrote:

hi, i am stumped so i am posting it here. no luck searching google for
many hours

this is my html code

div id=firstpane class=menu_list !--Code for menu starts here--
  
		p id=header1 class=menu_headHeader-1/p

div class=menu_body
a href=#Link-1/a
a href=#Link-2/a
a href=#Link-3/a
/div

p id=header2 class=menu_headHeader-2/p
div id=header2_menubody class=menu_body

div id=pane class=menu_list
p id=submenu class=menu_headSub-Menu/p
div class=menu_body
a href=#Sub Link-1/a
a href=#Sub Link-2/a
a href=#Sub Link-3/a
/div
/div

a href=#Link-1/a
a href=#Link-2/a
a href=#Link-3/a
/div

p id=header3 class=menu_headHeader-3/p
div class=menu_body
a href=#Link-1/a
a href=#Link-2/a
a href=#Link-3/a
   /div
/div  !--Code for menu ends here--

if i have access to the object id header2 how can i get access to
id=submenu ?
i tried header2obj.children('.menu_head') but it doesnt work. thanks
  




[jQuery] Re: Why doesn't code execute when Drop Down is changed or Button clicked.

2008-11-24 Thread Liam Potter


try

$(#clickMe).click(function () {
  alert('four');
});



bkbonner wrote:

I've been trying  to figure out why when I click the button nothing
happens...Can someone shed me some light on this example?

html

head

script src=jquery-1.2.6.min.js/script   
script 
function init(){
alert('one');
alert('two');
};

$(init);

$(#lstRace).change(
   alert('three');
);

$(#clickMe).click(
   alert('four');
);

/script
/head
body
Hello

select id=lstRace name=lstRace 

option value=1Test/option
option value=2/Test3/option
option value=3/Other, please specify/option
/select


input type=test id=raceOtherDiv name=other /
input type=button id=clickMe click me /input
/body
/html
  




[jQuery] weird 404 records in website statistics on jquery js file

2008-11-24 Thread Kevin Kietel

Hi,

when I look at my website statistics (awstats), somehow I keep finding
these 404 records that point to:

/jquery-1.2.3.pack.js/eval/3DYR8yd%2Bmb25QTy058Fe3Q%3D%3D

or

/jquery-1.2.3.pack.js/
+sfgRmluamFuX1R5cGU9amF2YV9zY3JpcHQmRmluamFuX0xhbmc9dGV4dC9qYXZhc2NyaXB0+

Does anyone have an idea what this means?


[jQuery] Re: get top most parent

2008-11-24 Thread Shawn Grover


$(#header2).children(p.submenu);

or
$(#header2).find(.submenu);

or make use of context:

$(.submenu, #header2);

- read that as all items with class of .submenu under the #header2 
object.  The #header2 part can be a selector, DOM element, or jQuery 
object.


HTH

Shawn

Liam Potter wrote:


header2obj.children().children().children(#submenu);



chitgoks wrote:

hi, i am stumped so i am posting it here. no luck searching google for
many hours

this is my html code

div id=firstpane class=menu_list !--Code for menu starts here--
  p id=header1 class=menu_headHeader-1/p
div class=menu_body
a href=#Link-1/a
a href=#Link-2/a
a href=#Link-3/a
/div

p id=header2 class=menu_headHeader-2/p
div id=header2_menubody class=menu_body

div id=pane class=menu_list
p id=submenu class=menu_headSub-Menu/p
div class=menu_body
a href=#Sub Link-1/a
a href=#Sub Link-2/a
a href=#Sub Link-3/a
/div
/div

a href=#Link-1/a
a href=#Link-2/a
a href=#Link-3/a
/div

p id=header3 class=menu_headHeader-3/p
div class=menu_body
a href=#Link-1/a
a href=#Link-2/a
a href=#Link-3/a
   /div
/div  !--Code for menu ends here--

if i have access to the object id header2 how can i get access to
id=submenu ?
i tried header2obj.children('.menu_head') but it doesnt work. thanks
  




[jQuery] Re: Load JQuery only once

2008-11-24 Thread Raphael Jolivet

Hello, thanks to all of you.
Your 3 solutions are interesting.

I'll use the wordpress specific solution, but I remind the others for
future work.

I'm glad to see that the JQuery community is helpful and reactive.

Regards,

Raphael


[jQuery] Re: window close

2008-11-24 Thread Isaak Malik
Try:

$(this).parents('.popup_window_wrapper').hide();

On Mon, Nov 24, 2008 at 6:08 AM, Debby [EMAIL PROTECTED] wrote:


 Hi all,

 On click of hyperlink, i am cerating one popup which is under one div
 having class but no id.
 On click of  close window hyperlink in the popup i want to hide this
 popup.
 But not able to hide this.
 I tried this, but not working
 $(this).parent('.popup_window_wrapper').css({'display':'none'});

 popup_window_wrapper: Is the class of popup div.

 Please help me.




-- 
Isaak Malik
Web Developer


[jQuery] Re: Back Button

2008-11-24 Thread aymen bentaleb

i've tried this plugin and i got a problem on running with IE7.
i've posted this as a request beacause i'find the same problem as another user
here is my post http://plugins.jquery.com/node/2472
Can anyone helps thanks

2008/11/24, OhNoMrBill [EMAIL PROTECTED]:

 That makes sense; but then how do I bind the functions to the links?

 The functions represent a large block of black-boxed code that is an
 AJAX handler that pushes content into destination divs.


 On Nov 24, 2:52 am, Brian Cherne [EMAIL PROTECTED] wrote:
 Take a look at the history plug-in page code again:
 http://www.mikage.to/jquery/jquery_history.html

 A really important concept to understand is that the history plug-in (any
 history plug-in) is listening / watching for the URL to change. Any change
 you want it to make going Back you will need to let it make going
 Forward (and on click) as well. You basically relinquish control to the
 history plug-in (actually to the pageload function if you're following
 the
 example URL to the letter). It works like this:

 - user clicks link with an #home href
 - url changes to page.html#home
 - history plug-in notices url change, calls pageload function
 - pageload function does something based on home

 - user clicks link with an #products href
 - url changes to page.html#products
 - history plug-in notices url change, calls pageload function
 - pageload function does something based on products

 - user clicks browser's Back button
 - url changes to page.html#home
 - history plug-in notices url change, calls pageload function
 - pageload function does something based on home

 - user clicks browser's Forward button
 - url changes to page.html#products
 - history plug-in notices url change, calls pageload function
 - pageload function does something based on products

 I hope this makes sense. You will need to:

 1) remove the inline onclick for each of your links. That overrides the
 history plug-in and you won't be able to work around it (cleanly).

 2) make the href hash values different for each of your links.

 So, instead of:
 a href=# onclick=showHome()Home/a

 You'll need something more like:
 a href=#homeHome/a
 a href=#productsProducts/a

 I hope this helps.

 Brian.



 On Sun, Nov 23, 2008 at 10:51 PM, OhNoMrBill [EMAIL PROTECTED] wrote:

  Anyone have an ideal on this?

  On Nov 22, 8:15 pm, OhNoMrBill [EMAIL PROTECTED] wrote:
   I am in a real bind on this issue. Is anyone able to answer? Help
   would be greatly appreciated if you can!!

   On Nov 22, 10:50 am, OhNoMrBill [EMAIL PROTECTED] wrote:

Here is the scenario I am trying to deal with currently:

I have a link that looks like:

a href=# onClick=$.Content_Home();Some Link/a

All the url links in this site look like this...onclick overrides.

What I need to do is ensure that when a user clicks back, the actual
prior jQuery function is called, and not the entire page.

I tried the history plugin, and can not seem to get it to pick this
kind of thing up. Anyone with direct experience on this kind of
thing,
please chime in with some suggestions.- Hide quoted text -

   - Show quoted text -- Hide quoted text -

 - Show quoted text -


[jQuery] Re: how do you get a div from an ajax form return?

2008-11-24 Thread davidgregan

Here is the call to the jquery ajax forms plugin:

$(#addForm).ajaxForm({ target: '.flexigrid'},
function() {
$(#CIPdocs).flexReload();
}
);

The target is the div that I am trying to upgrade. Basically, I am
using the form to add a record and then after that I want to refresh a
div. In the code behind, I just return the view after I add the record
so it makes sense that the entire page is stuck in the target div. I'm
just wondering if there is a way to refresh the div with just the
refreshed view's contents of the div. Maybe something like this?

$(#addForm).ajaxForm(
function(data) {
$(#flexigrid).html(data.find
(#flexigrid).html));
$(#CIPdocs).flexReload();
}
);

or is there a better or more conventional way?

On Nov 22, 6:04 pm, coughlinsmyalias [EMAIL PROTECTED] wrote:
 Hey,

 Can you send me your code to look at. Are you trying to update a DIV
 or use it as a succss show?

 On Nov 22, 6:08 pm, davidgregan [EMAIL PROTECTED] wrote:

  I'm using the jquery forms plugin for an ajax request and update. I
  set the target option to the desired div that I want to update. The
  problem that I'm running into is that it will update the div with the
  contents of the entire page rather than the just the contents of that
  div. I'd like to do this without creating another view for just the
  div alone. What is the proper way to do this? Return the calls results
  to a variable and then parse the variable for the desired div? Is
  there another way? Thanks in advanced.


[jQuery] Re: asdf

2008-11-24 Thread Liam Potter


and a good asdf to you to sir.

Weston Weems wrote:
asdf 


[jQuery] asdf

2008-11-24 Thread Weston Weems
asdf


[jQuery] Re: populate selectbox with json feed...partially working, need help to finish.

2008-11-24 Thread ricardobeat

Seems to me you're missing a double dot:

{title: Roman History, ID,13}

should be

{title: Roman History, ID: 13}

Also what's the point in using option groups without a label?
Something like this should do:

JS:
var $history = $('#history  optgroup');

$.each(json.channel.subtopics, function(i,item) {
$history.append(new Option(this.title, this.id));
});

HTML:
select id=history
  optgroup label=History
  /optgroup
/select

On Nov 24, 2:09 am, claudes [EMAIL PROTECTED] wrote:
 i have this json feed:
 {
     channel: {
         title: History,
         id: 12,
         subtopics: [
                         {title: Roman History, ID,13},
                         {title: Greek History, ID, 1},
                         {title: French History, ID, 1}
         ] // subtopics
     }

 }

 and i want to populate a select box to result as follows:

 optionHistory
 optgroup
 option value=IDRoman History/option
 ...
 /optgroup
 /option

 this is the code i have so far:

 $.getJSON(jrss.js, function(json) {
                 var html = 'select id=select-program';
                         response = {
                  values: [],
                  count: 0
              };
                 $.each(json.channel.subtopics,function(i,item) {
                         html += 'optionhistory/option'; // not sure where 
 this goes
                         response.values[i] = item.title;
                         html += 'optgroup';
                         html += 'option'+item.title;+'/option';
                         html += '/optgroup';
                 });

                         html += '/select';

                         $('body').append(html);
                 });

 });

 var jJSON = {
     getValues: function(obj,num) {
         return jJSON[obj][values];
     }

 }

 I can currently get the code to populate the optgroup correctly. I still
 cannot get it to assign id as the value. and i cannot dynamically assign the
 optionhistory/history dynamically...it returns undefined.

 can anyone help me with these two issues? thanks
 --
 View this message in 
 context:http://www.nabble.com/populate-selectbox-with-json-feed...partially-w...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: how to capture error 500/404 ?

2008-11-24 Thread ricardobeat

The XHR object and the error are passed as arguments to the ajaxError
callback:

$.ajaxError(function(event, XHRObject, options, errorThrown){
console.log( XHRObject.responseText, errorThrown );
});

see http://docs.jquery.com/Ajax/ajaxError#callback

On Nov 24, 4:09 am, Adwin  Wijaya [EMAIL PROTECTED] wrote:
 how about using ajaxError events ? but I dont know how to capture the
 response text if 404 / 500 errors occured.
 can i use that instead of $.ajax ...  ?

 thanks !

 On Nov 24, 12:18 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote:

  The best way would be to use the $.ajax call directly (both the post and the
  get function call $.ajax internally).

  $.ajax({
     type:'GET',
     url:'somepath.php',
     dataType:'json',
     success:do_something,
     error:do_something_else

  });

  function do_something(results) {
    ///

  }

  function do_something_else() {
    ///

  }

  JK

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

  Behalf Of Adwin Wijaya
  Sent: Sunday, November 23, 2008 8:58 PM
  To: jQuery (English)
  Subject: [jQuery] how to capture error 500/404 ?

  Hi,

  how to capture error that produced by server (err 505 or 404) inside
  $.post() and $.get() ?

  thanks !!!


[jQuery] Re: Why doesn't code execute when Drop Down is changed or Button clicked.

2008-11-24 Thread ricardobeat

Also you need to add the handlers after DOM has loaded, or run the
script at the end of the document body:

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

$('#lstRace').change(function(){
  alert('yay');
});

   // everything that deals with elements in here

});
/script

Sounds like you're starting in Javascript via jQuery, that's not the
wisest choice. Try learning the basics of Javascript before tackling
jQuery, that will make things a lot easier for you.

cheers,
- ricardo
On Nov 24, 11:16 am, Liam Potter [EMAIL PROTECTED] wrote:
 try

 $(#clickMe).click(function () {
            alert('four');
         });

 bkbonner wrote:
  I've been trying  to figure out why when I click the button nothing
  happens...Can someone shed me some light on this example?

  html

  head

  script src=jquery-1.2.6.min.js/script          
  script 
     function init(){
         alert('one');
         alert('two');
          };

          $(init);

          $(#lstRace).change(
             alert('three');
     );

          $(#clickMe).click(
             alert('four');
     );

  /script
  /head
  body
  Hello

  select id=lstRace name=lstRace 

  option value=1Test/option
  option value=2/Test3/option
  option value=3/Other, please specify/option
  /select

  input type=test id=raceOtherDiv name=other /
  input type=button id=clickMe click me /input
  /body
  /html


[jQuery] Re: file uploads and progress monitoring

2008-11-24 Thread cambazz

I am stubbornly refusing a flash based solution. I am sure there is a
way.

On Nov 24, 12:01 pm, netvibe [EMAIL PROTECTED] wrote:
 I've used swfupload. It's cross browser, multiple files, etc..

 http://netvibe.nl/imagemanager/

 On Nov 24, 4:21 am,cambazz[EMAIL PROTECTED] wrote:

  Hello,

  I am looking for a cross browser solution to file upload with commons
  file upload. With the commons file upload, one may also make a
  progress meter.

  I have used forms plugin and got a hold of xhr object. I can cancel
  the download at anytime.

  How can I monitor the result of the ajax post while the post is being
  made? by specifing a target: '#progressDir' I can get the result after
  the post is done, but I have found no other solutions.

  Best Regards,
  -C.B.


[jQuery] Re: clueTip send header with Ajax request

2008-11-24 Thread n8cshaw

I got rid of the syntax error, but it appears that clueTip is not
inserting the header on the request.

function initToolTips() {
jQuery('a.eventTitle').cluetip({
width: 350,
local: false,
hideLocal: true,
cursor: 'pointer',
cluetipClass: 'jtip',
arrows: true,
dropShadow: false,
hoverIntent: false,
sticky: true,
mouseOutClose: false,
closePosition: 'title',
closeText: 'img src=$content.getURI(images/
icon_close_black.gif) alt=close /',
clickThrough: true,
hoverIntent: {
sensitivity: 3,
interval: 200,
timeout: 100
},
ajaxCache: false,
ajaxSettings: {
dataType: 'xml',
//global: true
beforeSend: function(xhr) {
xhr.setRequestHeader(${apiAuthHeader_name}, $
{apiAuthHeader_value});
}
}
}



On Nov 21, 9:10 am, n8cshaw [EMAIL PROTECTED] wrote:
 Hi all. I am implementing clueTip and have it working just fine using
 an Ajax call. However, when all is said and done, the Ajax call will
 be hitting a web service that requires a custom authentication header.
 I have set up my jQuery global ajax options to send the header on all
 requests.

 jQuery.ajaxSetup({
beforeSend: function(xhr)
 { xhr.setRequestHeader(customAuthHeader,
 customAuthHeaderValue);}
 });

 However, it does not appear that clueTip recognizes these global
 options (ideally, it probably should). So, I have to send the header
 on the request manually. I have tried to do this via the ajaxSettings,
 but I am getting syntax errors and the clueTip docs don't mention
 anything about usingbeforeSend, so I am not even sure if it is
 possible.

 ajaxSettings: {
 dataType: 'xml',
beforeSend: function(xhr) {
 xhr.setRequestHeader(customAuthHeader,
 customAuthHeaderValue)
 }
 },

 Has anyone done this or can anyone provide some advice on how to do
 this?


[jQuery] Re: $('#id').width()

2008-11-24 Thread Lee McMullen
Hi,

I've just run another couple of tests and have discovered the following:

When the form opens and defaults to the tab where the input is located,
$('#field_id').width() returns the correct width (i.e. 175 in this case).

However when the form opens and defaults to a different tab,
$('#field_id').width() is returning 0.

I've also tried applying the width of the field using it's id but this had
no effect i.e. the same problem was occurring.

So, has anyone else come across this issue of .width() returning 0?

Thanks,
Lee

On Fri, Nov 21, 2008 at 1:09 PM, Isaiah Fischer [EMAIL PROTECTED]wrote:

 But now that I think about it... The image wouldn't appear if the element
 hadn't been loaded either... So my previous suggestions probably won't fix
 the problem... :/ I'll take another look this afternoon and see if I can
 find out whats going wrong...


 On Fri, Nov 21, 2008 at 2:10 AM, Lee McMullen [EMAIL PROTECTED]wrote:

 Thanks, I'll try your suggestions and let you know.

 Just out of curiosity, why would binding the field setup to the window
 load have an effect? I thought that was the whole point of using
 $(function(){}), so you didn't have to wait for the window to load?


 On 21 Nov 2008, at 04:01, Isaiah Fischer [EMAIL PROTECTED]
 wrote:

 Then I have two possible solutions to what I think the problem may be...

 One, have the field_setup() function bound to the window load as such:

 $(window).bind(load,function(){field_setup()});

 or define the width in the css of that field by its ID

 If that doesn't work then I'll need to find a different problem to solve
 :P

 On Thu, Nov 20, 2008 at 4:23 PM, Lee Mc  [EMAIL PROTECTED]
 [EMAIL PROTECTED] wrote:


 The width is defined by a class the field has rather than it's ID.




 On Nov 20, 8:06 pm, CodingCyb.org [EMAIL PROTECTED] wrote:
  And in the css the width is defined for #test_field or w/e its
  named? Or is it defined by a class that it has?
 
  On Nov 20, 9:37 am, Lee Mc [EMAIL PROTECTED] wrote:
 
   The width of the field gets set by a stylesheet which is pulled
   through.
 
   On Nov 20, 3:22 pm, CodingCyb.org [EMAIL PROTECTED] wrote:
 
Is the original width of the text field set in css? Or is it just
 the
width it gets when page loads?
 
On Nov 20, 9:09 am, Lee Mc [EMAIL PROTECTED] wrote:
 
 Yes that's exactly right.
 
 Any ideas would be greatly appreciated!
 
 On Nov 20, 1:18 pm, CodingCyb.org [EMAIL PROTECTED]
 wrote:
 
  I'm still trying to picture the site in my mind. So it has
 three tabs
  that you can switch between, but the default can be different?
 And
  when the default isn't the first one, the image appears in tab
 one,
  but stays underneath the input box because the width isn't
 updated?
 
  On Nov 20, 12:11 am, Lee Mc [EMAIL PROTECTED] wrote:
 
   The example HTML only has a single text input, it's this
 input I'm
   having issues with. Apologies, the example HTML gave the
 field a
   different ID than the JS contained. Im copying the code from
 an in
   process project so it's stripped down for readability.
 
   Therefore the different ID in my HTML is just a typo.
 
   Cheers, Lee.
 
   On Nov 20, 4:14 am, CodingCyb.org [EMAIL PROTECTED]
 wrote:
 
Sorry it took so long for a reply...
 
Where in the html is #test_field ? That's what the
 field_img goes
after, but I'm not sure where that is...
 
On Nov 19, 9:39 am, Lee Mc [EMAIL PROTECTED] wrote:
 
 Hi, yes I think you've misunderstood my problem.
 
 In a nutshell, there is an input type=text on tab 1.
 On load of
 the form, I'm trying to make this input less wide and
 place an image
 next to it.  When tab 1 is the default tab, it works
 fine.  When any
 other tab is the default, it inserts the image but
 doesn't update the
 width of the field.
 
 This is an example of my markup:
 
 div class=tab_container
 
 !--insert tabs--
 ul class=tabs
 lia href=my_form#tab_1 class=tab
 title=content_1Tab 1/a/
 li
 lia href=my_form#tab_2 class=tab
 title=content_2Tab 2/a/
 li
 lia href=my_form#tab_3 class=tab
 title=content_3Tab 3/a/
 li
 /ul
 
 !--insert tab 1--
 div id=content_1 class=tab_content
 a name=tab_1/a
 label for=field_idMy Test Field:/labelinput
 type=text
 id=field_id value=
 /div!--close content_1--
 
 !--insert tab 2--
 div id=content_2 class=tab_content
 a name=tab_2/a
 !--tab 2 content--
 /div!--close content 2--
 
 !--insert tab 3--
 div id=content_3 class=tab_content
 a name=tab_3/a
 !--tab 3 content--
 /div!--close content 3--
 
 /div!--close tab container--
 
 Any thoughts would be much appreciated.
 
 Cheers,
 Lee
 
 On Nov 18, 3:47 pm, CodingCyborg [EMAIL 

[jQuery] Re: CSRF best practice

2008-11-24 Thread Bil Corry

Paul Hammant wrote on 11/23/2008 7:28 AM: 
 The article talks of prepending with {d: and suffixing with } if the
 root node is an array.  Is that the best strategy ?

The best strategy is to generate a unique token (nonce) when you create a 
session for the user and store that value in their session, then with every 
request that you want to protect, include the nonce with the request.  So it'd 
look like:

$.get(path/to/my/service?nonce=s8NPYG1Nhsy3GI0yFKju ...)

Then on the server, confirm the nonce passed in matches the nonce stored in the 
session before you return any data.  Since an attacker won't know the nonce 
value, it defeats the CSRF attempt.


- Bil



[jQuery] Re: Repositioning a Google Gadget

2008-11-24 Thread DaveG

This seems to have something to do with moving a SCRIPT tag around in
the DOM. The gadget creates a script and a style tag. If I *remove*
the script tag from the DOM, and then reposition the wrapper to
another location in the DOM, all works well. If I try to *move* the
script tag to another DOM element then the original problem occurs. So
*moving* a script tag around the DOM seems to be the cause --
regardless of when the move occurs (even post-load).

I've added this scenario to the demo.

Has anyone seen this before?

 ~ ~ Dave

On Nov 23, 5:26 pm, DaveG [EMAIL PROTECTED] wrote:
 Hi,

 I don't believe this is strictly a jq issue, but I'm hoping someone
 can help.

 I'm using the Fish Gadget (http://abowman.com/google-modules/fish/)
 within a wiki based CMS, and need to reposition the gadget from one
 HTML element to another.

 If I directly reposition the gadget using what appears to be the
 gadgets base class ig-reset, then everything works. If I try to
 reposition using a surrounding wrapper, then the iframe used by the
 gadget seems to take over.

 Unfortunately I need the flexibility of repositioning using the
 surrounding wrapper. I've tried setting various position, float, and
 display attributes of the wrapper to no avail. I put a test up 
 here:http://solidgone.com/jquery/google-gadget.html

 Anyone have any insights?

  ~ ~ Dave


[jQuery] Selecting options programatically with change event fired

2008-11-24 Thread Mabsky

I'm making first steps using QUnit for unit testing javascript.
I have a logic that based on selected option from selectbox does
something. I would like to test that logic but I'm unable to select
options programatically in my tests so that change event of the
selectbox is fired.

Please help.


[jQuery] Re: Trouble in Table sorter

2008-11-24 Thread Carpii



On Nov 22, 10:24 am, hyon [EMAIL PROTECTED] wrote:
 Hi,

 When desc sorting, it generated 1.5, 0, and No data~~, but when asc
 order, it generated 0, No Data~~, 1.5.

It sounds like it is evaluating all types as numerics, and so No
Data is being interpreted as 0
Im not familiar with tablesorter, but Im guessing it has a comparison
function which compares two values.
You could probably add a little code to make sure they are numerics
before comparing them, or maybe interpret any non-numerics as -1
instead of 0?


[jQuery] table striping performance with livequery

2008-11-24 Thread Carpii

Hi all, ive just started using jQuery, and also the livequery plugin

I set up jQuery to automatically stripe a table, and also do a
mouseover to highlight the current row.
This works nicely, but I wanted to use it inside of a tabset which
loads its pages dynamically

To do this I started using livequery to bind the events after the tab
is loaded.

Ive noticed the performance of the row mouseover row highlight is now
pretty poor, and wondered if Im doing something wrong?

Pretty trivial code

$(document).ready(function()
{
  $(.stripeMe tr)
.livequery('mouseover', function() {
$(this).addClass(over);
})
.livequery('mouseout', function() {
$(this).removeClass(over);
});
}

Is there a reason this technique would degrade performance ?

Thanks


[jQuery] How to detect a autocomplete on a input field?

2008-11-24 Thread temega

I'm creating a login box that has a Username and Password field. Their
label is displayed inside the input field them self, so you see
Username and Password in the field when the page is loaded and
when you focus the field this label is hidden. It's actually a
background image that a hide and show on focus and on blur.

Now my problem detecting auto completions by browsers. The change
event doesn't get called when a field is auto completed so I have no
idea how to detect this...

Any ideas?


[jQuery] Re: file uploads and progress monitoring

2008-11-24 Thread Mike Hughes

Ben Nadel did it with CF8 and uplaoded multiple files,I have not had a
need to try this but other stuff from Ben is has been great.

http://www.bennadel.com/blog/1244-ColdFusion-jQuery-And-AJAX-File-Upload-Demo.htm

Hope this help


Mike Hughes  [EMAIL PROTECTED]




On Mon, Nov 24, 2008 at 9:34 AM, cambazz [EMAIL PROTECTED] wrote:

 I am stubbornly refusing a flash based solution. I am sure there is a
 way.

 On Nov 24, 12:01 pm, netvibe [EMAIL PROTECTED] wrote:
 I've used swfupload. It's cross browser, multiple files, etc..

 http://netvibe.nl/imagemanager/

 On Nov 24, 4:21 am,cambazz[EMAIL PROTECTED] wrote:

  Hello,

  I am looking for a cross browser solution to file upload with commons
  file upload. With the commons file upload, one may also make a
  progress meter.

  I have used forms plugin and got a hold of xhr object. I can cancel
  the download at anytime.

  How can I monitor the result of the ajax post while the post is being
  made? by specifing a target: '#progressDir' I can get the result after
  the post is done, but I have found no other solutions.

  Best Regards,
  -C.B.


[jQuery] jQuery UI Tabset with ajax reloads tab content

2008-11-24 Thread Carpii

Im using a jQuery UI tabset, with each tab contents loaded dynamically

div id=example
ul class=ui-tabs-nav
li class=ui-tabs-selecteda
href=accounts.phpspanAccounts/span/a/li
lia 
href=transactions.phpspanTransactions/span/a/li
/ul
/div

This works ok, but the tab content is loaded each time the tab is
clicked.
I think Id like the tab to be loaded if its not already in the DOM,
but after that I want it to just flick back to the already loaded
tab.

Is there a way to do this generically which doesnt involve handling
each tab on an id by id basis?

Thanks


[jQuery] Re: jeditable - Tabbing between jeditable elements

2008-11-24 Thread [EMAIL PROTECTED]

 Maybe onblur = submit is what you are after?

This is what I am looking for. Submitting on the condition that the
user tabbed out of the current jeditable input field.

Man you thought of everything when you wrote this...

I'll post my resulting code as soon as I get a chance to write and
test it.

-jl


On Nov 21, 12:03 am, Mika Tuupola [EMAIL PROTECTED] wrote:
 On Nov 21, 2008, at 7:10 AM, [EMAIL PROTECTED] wrote:

  At present, a tab keyPress results in discarding the edits. I have not
  been able to get the callback to fire to submit the edit then change
  focus to the target element if I tab out of the element. I would like
  the tab key to result in the submit event which would trigger the
  callback function. Is there anything I could do short of modifying the
  plugin?

    * @param String  options[onblur]    'cancel', 'submit', 'ignore' or  
 function ??

 cancel means discard edits when input goes out of focus.
 ignore means nothing happens.
 submit means the same as clicking submit.

 or you can write whatever function() { /* something *} if you have  
 some unorthodox need :)

 Maybe onblur = submit is what you are after?

 --
 Mika Tuupolahttp://www.appelsiini.net/


[jQuery] next() in a function

2008-11-24 Thread Vinoj

I'm having some trouble with next() and after reading through the
posts I don't think it's similar to what has already been posted.

The ideal behavior that I'd like is for the p (which is hidden at
first) to be shown when the anchor tag above it is clicked. There is
some extra behavior also through toggle, which adds a class on the
first click, and removes on second click.

Any help would be appreciated-- here's my script:

script type=text/javascript
$(document).ready(function() {
$(a.closed).toggle(
function() {
$(this).addClass(open);
$(this).removeClass(closed);
$(this).next(p.none).toggle(slow);
},
function() {
$(this).addClass(closed);
$(this).removeClass(open);
$(this).next(p.none).toggle(slow);
}
);
});
/script

and my HTML

!-- Start Initial Hidden Fields --
div class=detail-content
h3a href=# 
class=closedSolution description/a/h3
p class=noneLorem ipsum 
dolor sit amet, consectetuer
adipiscing elit. Morbi ante. Duis vitae elit. Etiam bibendum tempor
odio. Suspendisse enim arcu, sagittis eget, sollicitudin vel, dapibus
eu, magna. Aenean ullamcorper pede semper lacus. Donec./p
/div!-- end content piece --


[jQuery] Re: Design question

2008-11-24 Thread Nicolas R

instead of using an array you could use a key/value object.
then you can do something like

var o = {}
o[row_position] = [row_data]

then when you remove a row you do

delete o[row_position]

you could get the row's position from the dragdrop callback I assume,
but even if thats not the case its pretty straight forward using
jquery i guess.

On Nov 24, 5:40 pm, daveyoi [EMAIL PROTECTED] wrote:
 Hello Everyone,

 I am new to jquery and am using it in a project to develop a PHP based
 Mysql report generator. My question is not 100% jquery but more on
 application design?

 I have a bunch of list items that I can drag and drop (thanks to
 jquery) on to a workspace - on dropping I create a TH/TH elelment
 with the value of the list item and an image which has a .click()
 attached with a call back to a remove(). - This all works as expected
 and really demonstrates how after just a couple of hours how powerfull
 jquery is.

 The hard part that I just cant get my head round is I need the value
 and position of each item dropped onto the page stored somehow. I have
 been using a bog standard js array and just pushing the new value into
 the array on the drop callback but if I remove one of the TH/TH
 then my array keys become out of sync.

 Any suggestions on how best to approach this - I am primarily a PHP
 developer and have been thinking of using Ajax to store the data in a
 temp table but this seems a little longwinded.. js gurus your ideas?

 Thanks - and hope I can repay the favour some time.

 Dave


[jQuery] Problem using jqUnit

2008-11-24 Thread insitu

Hi to all,
I am trying to develop some code using jqUnit to test-drive things,
and I am running on a strange problem: jqUnit.triggerEvent does not
work as expected, it does not fire a click() handler that is installed
outside of the test's code block. Full code, HTML + 2 JS files,

help and comments greatly appreciated,

Insitu

html
  head
titleConstruction d'un diaporama/title
meta http-equiv=Content-Type content=text/html; charset=utf-8/

link rel=Stylesheet media=screen href=testsuite.css/
script type=text/javascript src=jquery.js/script
script type=text/javascript src=jqUnit.js/script
script type=text/javascript src=slide.js/script
script type=text/javascript src=slideTest.js/script
script type=text/javascript
  jQuery(document).ready(function() {
 alert(run tests);
  jqUnit.runTest();
   });
/script
  /head

  body
  h1Diaporama/h1
hr
  div id=body
h1 id=headerTest de construction de diaporama/h1

h2 id=userAgent/h2

!-- Test HTML --
div id=main style=
  div id=slideshow
div id=titreLe titre/div
div id=content/div
pre id=pre class=javascript/pre
form id=form
  div class=buttons
input type=submit value=Run class=run id=run/
input type=button id=prev value=laquo; Prev/
input type=button id=next value=Next raquo;/
  /div
  div id=container
textarea id=code wrap=off/textarea
ol id=results/ol
  /div
/form
  /div
/div
ol id=tests/ol
  /div
  /body
/html


The failing tests:
(function temp($){
 $(document).ready(
 function() {
 alert(init tests);
 with (jqUnit) {
 module('Tests diaporama');
 test('click on slideshow displays TOC as a list',
 function()  {
 triggerEvent( $(#slideshow).get(0), click );
 equals($('#slideshow #titre').text(),Table of Content, 
title
is 'TOC');
 equals($('#slideshow #content ol').children().size(), 5, 
TOC
is displayed in a list);
 equals($('#slideshow #content ol').attr('class'), toc, 
TOC
has style 'toc');
 equals($('#slideshow #content ol li').slice(2,3).text(), 
titre
3, TOC contains some titles);
 });
 }
 }
 );
})(jQuery);

The code:
(function initUI($) {
$(document).ready(function() {
 alert(init UI);
  $('#slideshow').click(
  function () {
  $('#content',this)
  .html(ol class=\toc\ +
lia title/li +
lia title/li +
lititre 3/li +
lia title/li +
lia title/li +
/ol);
  $('#titre',this).text('Table of Content');
  });
  }
);
})(jQuery);



[jQuery] Click off a div and have it disappear

2008-11-24 Thread shogunmike

Hi guys,

Since this is my first post I thought I'd introduce myself - I'm Mike,
working on a web startup in London. We're using jQuery (because it's
awesome!) for all of our JS needs.

However, I'm having a bit of a problem with creating a clickable menu.
In
particular, I'm trying to open a menu pane by clicking on a graphic (a
button). After the button graphic is clicked, it is replaced and then
an
additional div is added below which contains a ul element, with the
child li
elements. I want the menu to stay open indefinitely until somebody
clicks
anywhere on the screen except the menu, at which point the menu div
hides
and the picture will revert to it's original form.

I originally tried using $('*') select syntax and the mouseoff event,
but it
never seemed to work (it wouldn't allow me to click on the li elements
WITHIN the menu). If you want an example of what I'm trying to do (and
you have a Friendfeed account), then their more menu for each bit of
activity has exactly this behaviour. I haven't been able to find any
other examples that are similar - sorry!

If anybody is still a bit confused about what I'm trying to achieve,
then I'll gladly elaborate.

Thanks in advance for any help you can provide,

Mike.


[jQuery] Re: next() in a function

2008-11-24 Thread Leonardo K
The a element is inside a h3. Doen'st existe any next element inside.

U should do this:

$(this).parent().next(p.none).toggle(slow)

p.none is the next element after h3 which is the parent of a

On Mon, Nov 24, 2008 at 15:14, Vinoj [EMAIL PROTECTED] wrote:


 I'm having some trouble with next() and after reading through the
 posts I don't think it's similar to what has already been posted.

 The ideal behavior that I'd like is for the p (which is hidden at
 first) to be shown when the anchor tag above it is clicked. There is
 some extra behavior also through toggle, which adds a class on the
 first click, and removes on second click.

 Any help would be appreciated-- here's my script:

 script type=text/javascript
$(document).ready(function() {
$(a.closed).toggle(
function() {
$(this).addClass(open);
$(this).removeClass(closed);
$(this).next(p.none).toggle(slow);
},
function() {
$(this).addClass(closed);
$(this).removeClass(open);
$(this).next(p.none).toggle(slow);
}
);
});
 /script

 and my HTML

 !-- Start Initial Hidden Fields --
div class=detail-content
h3a href=#
 class=closedSolution description/a/h3
p class=noneLorem ipsum
 dolor sit amet, consectetuer
 adipiscing elit. Morbi ante. Duis vitae elit. Etiam bibendum tempor
 odio. Suspendisse enim arcu, sagittis eget, sollicitudin vel, dapibus
 eu, magna. Aenean ullamcorper pede semper lacus. Donec./p
/div!-- end content piece --



[jQuery] jquery tablesorter and exclude a href from sort

2008-11-24 Thread tjones

Hello,
I have just started to use the jquery tablesorter and really like it.
Since I'm really new to jquery can someone tell me if there is a
parser or something that will allow me to sort a column which has a
href... in it.

Thanks,
tom

Example...
tda href=index.cfm?groupinfo=#name#img src=images/info.png
height=16 width=16 align=texttop/a#name#/td


[jQuery] Re: Click off a div and have it disappear

2008-11-24 Thread Liam Potter


if you just want it to be similar to a mouseoff then bind a mouseleave 
function to the li rather then using mouseoff.


shogunmike wrote:

Hi guys,

Since this is my first post I thought I'd introduce myself - I'm Mike,
working on a web startup in London. We're using jQuery (because it's
awesome!) for all of our JS needs.

However, I'm having a bit of a problem with creating a clickable menu.
In
particular, I'm trying to open a menu pane by clicking on a graphic (a
button). After the button graphic is clicked, it is replaced and then
an
additional div is added below which contains a ul element, with the
child li
elements. I want the menu to stay open indefinitely until somebody
clicks
anywhere on the screen except the menu, at which point the menu div
hides
and the picture will revert to it's original form.

I originally tried using $('*') select syntax and the mouseoff event,
but it
never seemed to work (it wouldn't allow me to click on the li elements
WITHIN the menu). If you want an example of what I'm trying to do (and
you have a Friendfeed account), then their more menu for each bit of
activity has exactly this behaviour. I haven't been able to find any
other examples that are similar - sorry!

If anybody is still a bit confused about what I'm trying to achieve,
then I'll gladly elaborate.

Thanks in advance for any help you can provide,

Mike.
  




[jQuery] Design question

2008-11-24 Thread daveyoi

Hello Everyone,

I am new to jquery and am using it in a project to develop a PHP based
Mysql report generator. My question is not 100% jquery but more on
application design?

I have a bunch of list items that I can drag and drop (thanks to
jquery) on to a workspace - on dropping I create a TH/TH elelment
with the value of the list item and an image which has a .click()
attached with a call back to a remove(). - This all works as expected
and really demonstrates how after just a couple of hours how powerfull
jquery is.

The hard part that I just cant get my head round is I need the value
and position of each item dropped onto the page stored somehow. I have
been using a bog standard js array and just pushing the new value into
the array on the drop callback but if I remove one of the TH/TH
then my array keys become out of sync.

Any suggestions on how best to approach this - I am primarily a PHP
developer and have been thinking of using Ajax to store the data in a
temp table but this seems a little longwinded.. js gurus your ideas?

Thanks - and hope I can repay the favour some time.

Dave


[jQuery] Re: Design question

2008-11-24 Thread Michael Geary

Is row_position a row number in the table? Those numbers would change when
you delete a row. Or is it a value that you increment every time you add a
row (independent of the position in the table)? That would work - but you
wouldn't have a way to loop through this object sequentially.

Dave, I think we need to know more about what you're doing with that data to
suggest a solution. But here's another idea: If the problem is your array
getting out of sync when you delete a row, simply use [].splice() to delete
the corresponding array element, e.g. if you are deleting row 'n', use
array.splice(n,1) to delete the element.

You can also use .splice() to insert elements in an array, or delete and
insert elements at the same time. It's a very handy function.

-Mike

 From: Nicolas R
 
 instead of using an array you could use a key/value object.
 then you can do something like
 
 var o = {}
 o[row_position] = [row_data]
 
 then when you remove a row you do
 
 delete o[row_position]
 
 you could get the row's position from the dragdrop callback 
 I assume, but even if thats not the case its pretty straight 
 forward using jquery i guess.
 
 On Nov 24, 5:40 pm, daveyoi [EMAIL PROTECTED] wrote:
  Hello Everyone,
 
  I am new to jquery and am using it in a project to develop 
 a PHP based 
  Mysql report generator. My question is not 100% jquery but more on 
  application design?
 
  I have a bunch of list items that I can drag and drop (thanks to
  jquery) on to a workspace - on dropping I create a 
 TH/TH elelment 
  with the value of the list item and an image which has a .click() 
  attached with a call back to a remove(). - This all works 
 as expected 
  and really demonstrates how after just a couple of hours 
 how powerfull 
  jquery is.
 
  The hard part that I just cant get my head round is I need 
 the value 
  and position of each item dropped onto the page stored 
 somehow. I have 
  been using a bog standard js array and just pushing the new 
 value into 
  the array on the drop callback but if I remove one of the TH/TH 
  then my array keys become out of sync.
 
  Any suggestions on how best to approach this - I am primarily a PHP 
  developer and have been thinking of using Ajax to store the 
 data in a 
  temp table but this seems a little longwinded.. js gurus your ideas?
 
  Thanks - and hope I can repay the favour some time.
 
  Dave
 



[jQuery] Re: table striping performance with livequery

2008-11-24 Thread Brandon Aaron
When dealing with tables, event delegation is almost always the best way to
handle it. You might want to give jQuery.listen plugin a try.
http://plugins.jquery.com/project/Listen
--
Brandon Aaron

On Mon, Nov 24, 2008 at 8:36 AM, Carpii [EMAIL PROTECTED] wrote:


 Hi all, ive just started using jQuery, and also the livequery plugin

 I set up jQuery to automatically stripe a table, and also do a
 mouseover to highlight the current row.
 This works nicely, but I wanted to use it inside of a tabset which
 loads its pages dynamically

 To do this I started using livequery to bind the events after the tab
 is loaded.

 Ive noticed the performance of the row mouseover row highlight is now
 pretty poor, and wondered if Im doing something wrong?

 Pretty trivial code

 $(document).ready(function()
 {
  $(.stripeMe tr)
.livequery('mouseover', function() {
$(this).addClass(over);
})
.livequery('mouseout', function() {
$(this).removeClass(over);
});
 }

 Is there a reason this technique would degrade performance ?

 Thanks



[jQuery] Re: Back Button

2008-11-24 Thread Brian Cherne
My previous Google search looks to have pulled the wrong history plug-in.
Try this one from Klaus Hartl. He writes good code and it looks more recent.
http://stilbuero.de/jquery/history/

Brian.


On Mon, Nov 24, 2008 at 6:44 AM, aymen bentaleb [EMAIL PROTECTED]wrote:


 i've tried this plugin and i got a problem on running with IE7.
 i've posted this as a request beacause i'find the same problem as another
 user
 here is my post http://plugins.jquery.com/node/2472
 Can anyone helps thanks

 2008/11/24, OhNoMrBill [EMAIL PROTECTED]:
 
  That makes sense; but then how do I bind the functions to the links?
 
  The functions represent a large block of black-boxed code that is an
  AJAX handler that pushes content into destination divs.
 
 
  On Nov 24, 2:52 am, Brian Cherne [EMAIL PROTECTED] wrote:
  Take a look at the history plug-in page code again:
  http://www.mikage.to/jquery/jquery_history.html
 
  A really important concept to understand is that the history plug-in
 (any
  history plug-in) is listening / watching for the URL to change. Any
 change
  you want it to make going Back you will need to let it make going
  Forward (and on click) as well. You basically relinquish control to
 the
  history plug-in (actually to the pageload function if you're following
  the
  example URL to the letter). It works like this:
 
  - user clicks link with an #home href
  - url changes to page.html#home
  - history plug-in notices url change, calls pageload function
  - pageload function does something based on home
 
  - user clicks link with an #products href
  - url changes to page.html#products
  - history plug-in notices url change, calls pageload function
  - pageload function does something based on products
 
  - user clicks browser's Back button
  - url changes to page.html#home
  - history plug-in notices url change, calls pageload function
  - pageload function does something based on home
 
  - user clicks browser's Forward button
  - url changes to page.html#products
  - history plug-in notices url change, calls pageload function
  - pageload function does something based on products
 
  I hope this makes sense. You will need to:
 
  1) remove the inline onclick for each of your links. That overrides the
  history plug-in and you won't be able to work around it (cleanly).
 
  2) make the href hash values different for each of your links.
 
  So, instead of:
  a href=# onclick=showHome()Home/a
 
  You'll need something more like:
  a href=#homeHome/a
  a href=#productsProducts/a
 
  I hope this helps.
 
  Brian.
 
 
 
  On Sun, Nov 23, 2008 at 10:51 PM, OhNoMrBill [EMAIL PROTECTED]
 wrote:
 
   Anyone have an ideal on this?
 
   On Nov 22, 8:15 pm, OhNoMrBill [EMAIL PROTECTED] wrote:
I am in a real bind on this issue. Is anyone able to answer? Help
would be greatly appreciated if you can!!
 
On Nov 22, 10:50 am, OhNoMrBill [EMAIL PROTECTED] wrote:
 
 Here is the scenario I am trying to deal with currently:
 
 I have a link that looks like:
 
 a href=# onClick=$.Content_Home();Some Link/a
 
 All the url links in this site look like this...onclick overrides.
 
 What I need to do is ensure that when a user clicks back, the
 actual
 prior jQuery function is called, and not the entire page.
 
 I tried the history plugin, and can not seem to get it to pick
 this
 kind of thing up. Anyone with direct experience on this kind of
 thing,
 please chime in with some suggestions.- Hide quoted text -
 
- Show quoted text -- Hide quoted text -
 
  - Show quoted text -



[jQuery] Re: Click off a div and have it disappear

2008-11-24 Thread shogunmike

Thanks for the swift reply Liam!

If I select all of the li's, then bind a mouseleave function to each
of them, is it possible to combine this with a mousedown event to
close the menu once it's clicked outside of the div containing the ul/
li's?

Regards,

Mike.

On Nov 24, 5:33 pm, Liam Potter [EMAIL PROTECTED] wrote:
 if you just want it to be similar to a mouseoff then bind a mouseleave
 function to the li rather then using mouseoff.

 shogunmike wrote:
  Hi guys,

  Since this is my first post I thought I'd introduce myself - I'm Mike,
  working on a web startup in London. We're using jQuery (because it's
  awesome!) for all of our JS needs.

  However, I'm having a bit of a problem with creating a clickable menu.
  In
  particular, I'm trying to open a menu pane by clicking on a graphic (a
  button). After the button graphic is clicked, it is replaced and then
  an
  additional div is added below which contains a ul element, with the
  child li
  elements. I want the menu to stay open indefinitely until somebody
  clicks
  anywhere on the screen except the menu, at which point the menu div
  hides
  and the picture will revert to it's original form.

  I originally tried using $('*') select syntax and the mouseoff event,
  but it
  never seemed to work (it wouldn't allow me to click on the li elements
  WITHIN the menu). If you want an example of what I'm trying to do (and
  you have a Friendfeed account), then their more menu for each bit of
  activity has exactly this behaviour. I haven't been able to find any
  other examples that are similar - sorry!

  If anybody is still a bit confused about what I'm trying to achieve,
  then I'll gladly elaborate.

  Thanks in advance for any help you can provide,

  Mike.


[jQuery] Re: .click vs. .bind

2008-11-24 Thread coughlinsmyalias

Thank you guys for your help!

On Nov 23, 8:01 pm, George [EMAIL PROTECTED] wrote:
 Just a note: The bind notation allows you to specify additional data
 for your even handler function.
 I am actually used to always use a .bind

 George.

 On Nov 23, 7:47 pm, Michael Geary [EMAIL PROTECTED] wrote:

  There is no difference at all.

  $(...).click( fn )

  is merely a shorthand for:

  $(...).bind( 'click', fn );

  You can see this in the code that creates .click() and the other shortcut
  methods:

  jQuery.each( (blur,focus,load,resize,scroll,unload,click,dblclick, +
      mousedown,mouseup,mousemove,mouseover,mouseout,change,select, +
      submit,keydown,keypress,keyup,error).split(,), function(i, name){

      // Handle event binding
      jQuery.fn[name] = function(fn){
          return fn ? this.bind(name, fn) : this.trigger(name);
      };

  });

  -Mike

   From: coughlinsmyalias

   What is the main difference between using .bind() and
   .click(), when I was reading up, it was mentioning it removes
   event bubbling?- Hide quoted text -

  - Show quoted text -


[jQuery] Re: animate problem with IE7

2008-11-24 Thread Jeffrey Kretz

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

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

JK

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


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

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

often... ;-)

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

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

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

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

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

  }

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

  The value of end is 50, unit is %.

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

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

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

  JK

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

  Hi Jeffrey, thanks.

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

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

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

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

  Thanks,
  Andrea

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

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

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

   While going to the right, everything went as usual.

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

   All good.

   Then I refreshed and tried going to the left.

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

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

   Divs 4 and 5 got WEIRD settings.

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

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

   Cheers,
   JK

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

   Hi all,

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

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

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

   I explain briefly how the script works.

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

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

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

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

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

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

[jQuery] problem with document ready function

2008-11-24 Thread firstarsbrnwhite

I have a collapsing expanding menu I want to collapse before the
images load on the page. I was able to do this with the $document
ready command. Only problem is 

In FF3 menu collapses immediately...once all images are loaded the
menu expands again ... :(
In IE6 works
In IE7 menu never collapses

Using onpageload produces varied results as well loading the script
after all the slow images...and sometimes in IE7 the menu doesn't
collapse.

here is the page

http://www.ryanvosburg.com/portfolio/blackcreek/indexdom.html

here is the code

var toggleMenu = {


init : function(sContainerClass, sHiddenClass) {
var arrMenus = this.getElementsByClassName(document, 'ul',
sContainerClass);
var arrSubMenus, oSubMenu, oLink;
for (var i = 0; i  arrMenus.length; i++) {
arrSubMenus = arrMenus[i].getElementsByTagName('ul');
for (var j = 0; j  arrSubMenus.length; j++) {
oSubMenu = arrSubMenus[j];
oLink = 
oSubMenu.parentNode.getElementsByTagName('a')[0];
oLink.onclick = function(){toggleMenu.toggle
(this.parentNode.getElementsByTagName('ul')[0], sHiddenClass); return
false;}
this.toggle(oSubMenu, sHiddenClass);
}
}
},
toggle : function(el, sHiddenClass) {
var oRegExp = new RegExp((^|\\s) + sHiddenClass + (\\s|$));
el.className = (oRegExp.test(el.className)) ? 
el.className.replace
(oRegExp, '') : el.className + ' ' + sHiddenClass; // Add or remove
the class name that hides the element
},
addEvent : function(obj, type, fn) {
if (obj.addEventListener)
obj.addEventListener(type, fn, false);
else if (obj.attachEvent) {
obj[e+type+fn] = fn;
obj[type+fn] = function() 
{obj[e+type+fn](window.event);}
obj.attachEvent(on+type, obj[type+fn]);
}
},
getElementsByClassName : function(oElm, strTagName, strClassName){
var arrElements = (strTagName == *  document.all)?
document.all : oElm.getElementsByTagName(strTagName);
var arrReturnElements = new Array();
strClassName = strClassName.replace(/\-/g, \\-);
var oRegExp = new RegExp((^|\\s) + strClassName + (\\s|$));
var oElement;
for(var i=0; iarrElements.length; i++){
oElement = arrElements[i];
if(oRegExp.test(oElement.className)){
arrReturnElements.push(oElement);
}
}
return (arrReturnElements)
}
};

$(document).ready(function () {
toggleMenu.addEvent(window, 'load', function(){toggleMenu.init
('menu','hidden');});

if (document.addEventListener)
  document.addEventListener(DOMContentLoaded, toggleMenu.init
('menu','hidden'), false)

});


[jQuery] Is my style of writing jQuery plugin correct?

2008-11-24 Thread howa

Codes...


jQuery.test = function(val) {

jQuery.test.foo = function() {
   alert( foo + jQuery.test.bar()  );
};

jQuery.test.bar = function() {
   return bar +val;
};

jQuery(document).ready(function() {

jQuery.test.foo();

});
};

// To use

script

jQuery.test(Tom);

/script


Is  my style of writing jQuery plugin correct?

Thanks for comments...



[jQuery] Re: jquery tablesorter and exclude a href from sort

2008-11-24 Thread aquaone
You will likely need to define your own textExtraction function.
http://tablesorter.com/docs/example-option-text-extraction.html

stephen


On Mon, Nov 24, 2008 at 09:21, tjones [EMAIL PROTECTED] wrote:


 Hello,
 I have just started to use the jquery tablesorter and really like it.
 Since I'm really new to jquery can someone tell me if there is a
 parser or something that will allow me to sort a column which has a
 href... in it.

 Thanks,
 tom

 Example...
 tda href=index.cfm?groupinfo=#name#img src=images/info.png
 height=16 width=16 align=texttop/a#name#/td



[jQuery] Re: problem with document ready function

2008-11-24 Thread firstarsbrnwhite

I removed

toggleMenu.addEvent(window, 'load', function(){toggleMenu.init
('menu','hidden');});

and now works as I want it to in FF3


[jQuery] Re: How to bind validation to new loaded form?

2008-11-24 Thread [EMAIL PROTECTED]

hanks for the reply.
I got this anwer on a previous question. (very helpfull, cause a few
days ago i did not know binding  even existed)
So i understand that i have to bind my new form to my validation
script.
But i cant get it working this time.

I have tried to validate just one input for an easier example.
This is wat i made of it:

 $('#nieuwespeler').click(function(){
//alert(Nieuwe speler! howra); Got this alert
var toLoad = 'forms/registratie.php';
  $('#content').hide('slow',loadContent); // fast, slow, normal or
milliseconden??
  $('#load').remove();
  $('#content').append('span id=loadLOADING.../span');
  $('#load').fadeIn('slow');
  function loadContent() {
   $('#content').load(toLoad,'',showNewContent())
  }
  function showNewContent() {
   $('#content').show('slow',hideLoader)
  }

  function hideLoader() {
   $('#load').fadeOut('slow');
  }

$(#signupForm).validate({
 rules:{
  firstname: required,
  username:
{
   required: true,
   minlength: 2}
 }
});



return false;
   });


I have added above code in my document ready part.
The signup form does appear, ut when i submit this form, without
filling in anything, it submits without validation.

My question is: What is wrong with the last part, where i try to bind
the validation to my form?
Validation does work, when including this form directly in the page,
but not when loading afterwards..
Apperently i am binding the wrong way, but just cant see what is wrong
with it.
Please??


[jQuery] [validate] Sending Two Inputs Together to Remote Validation?

2008-11-24 Thread megageorge

Is it possible to send two of the inputs in a form together to a
remote validation php script?

For example, I would like to check whether a person called 'Bob' has
the email address '[EMAIL PROTECTED]'. The php script would need pieces
of information from both the name input and the email address input.

How could I do this?

Thanks in advance,
George


[jQuery] Re: Is my style of writing jQuery plugin correct?

2008-11-24 Thread Eric Martin

The intent of your code is not very clear. The design of your plugin
can vary a great deal depending on its purpose. Typically, however, I
use a format similar to:

// put in a closure and make jQuery available as $
(function ($) {
// define a function that can be called on a jQuery object
$.fn.myFunction = function (args) {
// return the object (to maintain chain)
return this.each(function () {
// do stuff here
});
};

// private functions
function myPrivateFunc() {

}
})(jQuery);

// to call
$(#id).myFunction(your_args_here);

Hope that helps some ;)

On Nov 24, 10:44 am, howa [EMAIL PROTECTED] wrote:
 Codes...

 jQuery.test = function(val) {

     jQuery.test.foo = function() {
        alert( foo + jQuery.test.bar()  );
     };

     jQuery.test.bar = function() {
        return bar +val;
     };

     jQuery(document).ready(function() {

             jQuery.test.foo();

     });

 };

 // To use

 script

 jQuery.test(Tom);

 /script

 Is  my style of writing jQuery plugin correct?

 Thanks for comments...


[jQuery] Re: has anyone come across a plugin like this ?

2008-11-24 Thread heysatan

Rick,

Yeah, this doesn't create the breadcrumb, that's something better
handled on the server.  If we were to create the breadcrumb on the
client side, it would loose all of it's SEO advantages.

It's typical to see breadcrumbs in unordered lists, so I created a
plugin that manipulates those lists and manages them when they get too
long.  I guess you could create a plugin that writes breadcrumbs based
of cookies set when navigating, but this would be just as bad for SEO,
and be wrong if you came there from google.

Many CMS have built in bread crumbs, so hopefully you can use one of
these.

The links are all dummy links, just to show how it works.

Thanks!

Jason





On Nov 21, 9:28 pm, Rick Faircloth [EMAIL PROTECTED] wrote:
 Jason...

 I'm not sure I understand what your plug-in is for.
 When you say it's a breadcrumb plugin, I thought you meant
 it would show a site visitor the trail of pages visited.

 I'm not quite sure I know how to set this up.  I created actual
 pages from your demo...biocompate.html, kits_assays.html, etc.,
 so there would be actual pages to visit, but the order the
 breakcrumbs never changes, but stays in the order of the
 list of pages in breadcrumb0, the id of the div in which I changed the
 links.

 A little help for the clueless?

 Thanks,

 Rick

 heysatan wrote:
  jBreadCrumb RELEASED

  Hi all, I've put the breadcrumb plugin up on jquery's site:

 http://plugins.jquery.com/project/jBreadCrumb

  Here's a link to the working example (also linked to from the jquery
  page)

 http://www.comparenetworks.com/developers/jqueryplugins/jbreadcrumb.html

  Let me know what you think, there are some improvements that can be
  made for sure.  It's decently smart but I think I will improve the
  collapsing algorithm to know what it needs to collapse based on
  individual elements width.

  Oh, and it's compatible with ie 6, ie 7 and all standards compliant
  browsers.

  Thanks,

  Jason

  On Nov 20, 6:14 pm, heysatan [EMAIL PROTECTED] wrote:

  I am just finishing up version 0.1, it will be up tomorrow morning
  (Pacific time).

  On Nov 18, 2:04 pm, yvonney [EMAIL PROTECTED] wrote:

  Oh YES!!! that WOULD be fabulous I know how busy life gets of
  course... Jason! when you have time we'd all love to play with a
  plugin version I bet!

  best wishes

  On Nov 11, 2:32 pm, Andy Matthews [EMAIL PROTECTED] wrote:

  I'd be interested in this as a plugin as well.

  On Nov 11, 4:21 pm, heysatan [EMAIL PROTECTED] wrote:

  That's a start.

  On Nov 10, 4:13 pm, Microbe [EMAIL PROTECTED] wrote:

  Demand # 1

  :o)

  On Nov 11, 8:57 am, heysatan [EMAIL PROTECTED] wrote:

  Hi Sean,

  I built this breadcrumb animation.  Due to time limitations at the end
  of the project I wasn't able to make it into a plugin (I built a lot
  of other plugins for this project), but I'd like to when I get a
  chance.

  I really solved a problem for us because our category and page titles
  are so long (scientists are long winded).  Before we would show only a
  couple of steps in the HTML to get around this.  This method was more
  SEO friendly, more usable, and I thought, kind of cool.

  If there is a demand for it I'll work on porting it to a plugin, but
  probably not for the next 2 weeks or so.

  Jason
  Lead UI Developer - CompareNetworks

  On Nov 10, 1:21 am, CliffordSean [EMAIL PROTECTED] wrote:

  see the breadcrumb on here 
  :http://www.biocompare.com/ProductDetails/386912/1/Mutation-Generation...
  has anyone come across a plugin like this ?

  tnx
  sean
  --
  View this message in 
  context:http://www.nabble.com/has-anyone-come-across-a-plugin-like-this---tp2...
  Sent from the jQuery General Discussion mailing list archive at 
  Nabble.com.

  ---
  Text inserted by Panda IS 2009:

   This message has NOT been classified as spam. If it is unsolicited mail 
  (spam), click on the following link to reclassify 
  it:http://localhost:6083/Panda?ID=pav_10186SPAM=truepath=C:\Documents%20and%20Settings\Rick%20Faircloth\Local%20Settings\Application%20Data\Panda%20Security\Panda%20Internet%20Security%202009\AntiSpam
  ---


[jQuery] Converting javascript to a jquery plugin

2008-11-24 Thread halcyonandon

Hi, I was asked to convert some javascript into a jquery plugin.  I've
followed the documentation for authoring a plugin at
http://docs.jquery.com/Plugins/Authoring I've also followed other
instructions found on the web.  Currently I have my code working with
respect to this, but largely the javascript code is still exactly the
same.  I was wondering if there was more I could do with jQuery with
respect to this code.

here it is...

(function($) {
var tabHighlightClass = 'tabon';
var currentTab = 'hotel';
var currentLink;
var tF0 = new Array('dl0r', 'dl0o', 'dl0m');
var tF1 = new Array('al0r', 'al0o', 'al0m');
var tFields = new Array('tF0', 'tF1');
var txtFields = new Array(tF0, tF1);
var sF0 = new Array('numberOfAdults-hotel', 'numberOfAdults-package',
'adr', 'ado', 'adm');
var sF1 = new Array('numberOfChildren-hotel', 'numberOfChildren-
package', 'chr', 'cho', 'chm');
var sF2 = new Array('lir', 'lio', 'lim');
var sF3 = new Array('dt0r', 'dt0o', 'dt0m');
var selFields = new Array(sF0, sF1, sF2, sF3);
var sFields = new Array('sF0', 'sF1', 'sF2', 'sF3');
var fids = new Array('roundtrip', 'oneway', 'multiple');
var actids = new Array('popular', 'enter');
var tmp = '';
$.bots = {

   showTab: function(o) {
if (currentTab) {
if (document.getElementById(currentTab)) {
document.getElementById(currentTab).style.display =
'none';
}
var b = currentLink.firstChild;
var ftype = b.src.substring(b.src.lastIndexOf('.'),
b.src.length);
b.src = b.src.replace('_o' + ftype, ftype);
}
var id = o.href.substring(o.href.lastIndexOf('#') + 1);
currentTab = id;
currentLink = o;
if (document.getElementById(id)) {
document.getElementById(id).style.display = 'block';
}
o.firstChild.src = o.firstChild.src.replace(ftype, '_o' + ftype);
},
  initTabs: function() {
if (document.getElementById  document.createTextNode) {
var n = document.getElementById('tbs');
var as = n.getElementsByTagName(a);
for (var i = 0; i  as.length; i++) {
as[i].onclick = function() {
$.bots.showTab(this);
return false;
};
as[i].onfocus = function() {
this.blur();
};
if (i == 0)
currentLink = as[i];
}
if (document.getElementById(currentTab)) {
document.getElementById(currentTab).style.display =
'block';
}
}
},
tFieldsInit: function() {
var obj;
for (var i = 0; i  txtFields.length; i++) {
for (var j = 0; j  txtFields[i].length; j++) {
obj = document.getElementById(txtFields[i][j]);
if (obj)
obj.onblur = new Function($.bots.syncTxtFields( + 
tFields[i] + ,
this.value));
}
}
for (i = 0; i  selFields.length; i++) {
for (j = 0; j  selFields[i].length; j++) {
obj = document.getElementById(selFields[i][j]);
if (obj)
obj.onchange = new 
Function($.bots.syncSelFields( + sFields[i] +
, this.selectedIndex));
}
}
},
syncTxtFields: function(arr, value) {
for (var i = 0; i  arr.length; i++) {
document.getElementById(arr[i]).value = value;
}
},
syncSelFields: function(arr, index) {
for (var i = 0; i  arr.length; i++) {
document.getElementById(arr[i]).options[index].selected =
true;
}
},
setOpt: function(s) {
s.form.locationID.value = s.options[s.selectedIndex].value;
if (tmp  s.options[s.selectedIndex].value == '')
s.form.locationID.value = tmp;
},
initFlightForms: function () {
var radios = document.forms['flightSearchType'].elements['flights
[flightSearchType]'];
for (var i = 0; i  fids.length; i++) {
var fmName = 'flightSearchForm' + fids[i].ucFirst();
var fm = document.forms[fmName];
radios[i].onclick = new Function('$.bots.toggleFSF(' + fids
[i] + ')');
fm.onsubmit = function() {
for (i = 0; i  radios.length; i++) {
if (radios[i].checked)
ckd = radios[i].value;
}
this.elements['flights[flightSearchType]'].value = ckd;
};
}
radios[0].checked = true;
},
initActivityForms: function () {
var radios = document.forms['ActivitiesTab'].elements['activities
[ActivitiesTab]'];
for (var i = 0; i  actids.length; i++) {
var fmName = 'ticketSearchForm' + actids[i].ucFirst();
var fm = document.forms[fmName];
radios[i].onclick = new Function('$.bots.toggleASF(' + actids
[i] + ')');
fm.onsubmit = function() {
for (i = 0; i  radios.length; i++) {
if (radios[i].checked)
ckd = radios[i].value;
}

[jQuery] Capturing Tab and enter key at document level using JQuery

2008-11-24 Thread [EMAIL PROTECTED]

Hi,
Could anyone of you suggest the best way to capture tab and enter key
at document level using JQuery?

Thanks in advance for your help


[jQuery] How can i do Image rollover with simple gamma change?

2008-11-24 Thread expat101

I would like to have an image rollover with just basic gamma change to
highlight an image...can this be done with basic jquery?


[jQuery] Instantiating multiple plugin instances on the same page

2008-11-24 Thread howardk

Is there a way of instantiating multiple instances of a plugin on the
same page?

What I have essentially is an animated effects plugin, and I want to
be able to invoke separate instantiations of it, doing something like
the following:

script
$( '#effect_1' ).animEffect( { name: 'jumper', color: 'ff', fps:
30 } );
$( '#effect_2' ).animEffect( { name: 'round-the-moon', color:
'00', fps: 40 } );
/script

div id='effect_1'/div
div id='effect_2'/div

I'm still fairly new to javascript. As far as I can tell though, it
looks like it can't be done, since as far as I can see, each plugin
invocation is really calling the same function object over and over
again (thereby overwriting whatever instance or local variables might
have been set in a prior invocation).

Is this correct? Is there a way of doing this, or am I out of luck?
Howard


[jQuery] Re: How can i do Image rollover with simple gamma change?

2008-11-24 Thread Andy Matthews

Yes...

You can use the animate method to fade in/out any element by applying
opacity.


andy

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of expat101
Sent: Monday, November 24, 2008 3:04 PM
To: jQuery (English)
Subject: [jQuery] How can i do Image rollover with simple gamma change?


I would like to have an image rollover with just basic gamma change to
highlight an image...can this be done with basic jquery?




[jQuery] Callback on $.Post not firing

2008-11-24 Thread Rage9

This is driving me loopy.  Simple post, trying to get a result back
from the server.  Heck even copied it from the documentation and the
callback just will not fire, but the post works fine:

var answer = confirm(Delete Selected?);
if (answer){
$.post(test.php, { name: test }, function(data){
alert(popped off!);
 alert(data.name); // John
 console.log(data.time); //  2pm
}, json);
}

PHP:

?php

echo json_encode(array(name=John,time=2pm));

?

I also tried with XML with no luck either.  Firebug doesn't seem to
show a response, but I know the post variables are passed just fine,
because I wrote a logger [not included] to tell me what the variables
where being passed.  No dice on the return info.  Tried this with both
firefox and opera and in neither the call-backe worked.

Ideas?


[jQuery] Re: has anyone come across a plugin like this ?

2008-11-24 Thread Rick Faircloth


Thanks for the feedback, Jason!

rick

heysatan wrote:

Rick,

Yeah, this doesn't create the breadcrumb, that's something better
handled on the server.  If we were to create the breadcrumb on the
client side, it would loose all of it's SEO advantages.

It's typical to see breadcrumbs in unordered lists, so I created a
plugin that manipulates those lists and manages them when they get too
long.  I guess you could create a plugin that writes breadcrumbs based
of cookies set when navigating, but this would be just as bad for SEO,
and be wrong if you came there from google.

Many CMS have built in bread crumbs, so hopefully you can use one of
these.

The links are all dummy links, just to show how it works.

Thanks!

Jason





On Nov 21, 9:28 pm, Rick Faircloth [EMAIL PROTECTED] wrote:
  

Jason...

I'm not sure I understand what your plug-in is for.
When you say it's a breadcrumb plugin, I thought you meant
it would show a site visitor the trail of pages visited.

I'm not quite sure I know how to set this up.  I created actual
pages from your demo...biocompate.html, kits_assays.html, etc.,
so there would be actual pages to visit, but the order the
breakcrumbs never changes, but stays in the order of the
list of pages in breadcrumb0, the id of the div in which I changed the
links.

A little help for the clueless?

Thanks,

Rick

heysatan wrote:


jBreadCrumb RELEASED
  
Hi all, I've put the breadcrumb plugin up on jquery's site:
  
http://plugins.jquery.com/project/jBreadCrumb
  
Here's a link to the working example (also linked to from the jquery

page)
  
http://www.comparenetworks.com/developers/jqueryplugins/jbreadcrumb.html
  
Let me know what you think, there are some improvements that can be

made for sure.  It's decently smart but I think I will improve the
collapsing algorithm to know what it needs to collapse based on
individual elements width.
  
Oh, and it's compatible with ie 6, ie 7 and all standards compliant

browsers.
  
Thanks,
  
Jason
  
On Nov 20, 6:14 pm, heysatan [EMAIL PROTECTED] wrote:
  

I am just finishing up version 0.1, it will be up tomorrow morning
(Pacific time).

On Nov 18, 2:04 pm, yvonney [EMAIL PROTECTED] wrote:


Oh YES!!! that WOULD be fabulous I know how busy life gets of
course... Jason! when you have time we'd all love to play with a
plugin version I bet!
  
best wishes
  
On Nov 11, 2:32 pm, Andy Matthews [EMAIL PROTECTED] wrote:
  

I'd be interested in this as a plugin as well.

On Nov 11, 4:21 pm, heysatan [EMAIL PROTECTED] wrote:


That's a start.
  
On Nov 10, 4:13 pm, Microbe [EMAIL PROTECTED] wrote:
  

Demand # 1

:o)

On Nov 11, 8:57 am, heysatan [EMAIL PROTECTED] wrote:


Hi Sean,
  
I built this breadcrumb animation.  Due to time limitations at the end

of the project I wasn't able to make it into a plugin (I built a lot
of other plugins for this project), but I'd like to when I get a
chance.
  
I really solved a problem for us because our category and page titles

are so long (scientists are long winded).  Before we would show only a
couple of steps in the HTML to get around this.  This method was more
SEO friendly, more usable, and I thought, kind of cool.
  
If there is a demand for it I'll work on porting it to a plugin, but

probably not for the next 2 weeks or so.
  
Jason

Lead UI Developer - CompareNetworks
  
On Nov 10, 1:21 am, CliffordSean [EMAIL PROTECTED] wrote:
  

see the breadcrumb on here 
:http://www.biocompare.com/ProductDetails/386912/1/Mutation-Generation...
has anyone come across a plugin like this ?

tnx

sean
--
View this message in 
context:http://www.nabble.com/has-anyone-come-across-a-plugin-like-this---tp2...
Sent from the jQuery General Discussion mailing list archive at Nabble.com.


---
Text inserted by Panda IS 2009:
  
 This message has NOT been classified as spam. If it is unsolicited mail (spam), click on the following link to reclassify it:http://localhost:6083/Panda?ID=pav_10186SPAM=truepath=C:\Documents%20and%20Settings\Rick%20Faircloth\Local%20Settings\Application%20Data\Panda%20Security\Panda%20Internet%20Security%202009\AntiSpam

---
  



---
Text inserted by Panda IS 2009:

 This message has NOT been classified as spam. If it is unsolicited mail (spam), click 
on the following link to reclassify it: 

[jQuery] Re: has anyone come across a plugin like this ?

2008-11-24 Thread heysatan

Rick,

Yeah, this doesn't create the breadcrumb, that's something better
handled on the server.  If we were to create the breadcrumb on the
client side, it would loose all of it's SEO advantages.

It's typical to see breadcrumbs in unordered lists, so I created a
plugin that manipulates those lists and manages them when they get too
long.  I guess you could create a plugin that writes breadcrumbs based
of cookies set when navigating, but this would be just as bad for SEO,
and be wrong if you came there from google.

Many CMS have built in bread crumbs, so hopefully you can use one of
these.

The links are all dummy links, just to show how it works.

Thanks!

Jason





On Nov 21, 9:28 pm, Rick Faircloth [EMAIL PROTECTED] wrote:
 Jason...

 I'm not sure I understand what your plug-in is for.
 When you say it's a breadcrumb plugin, I thought you meant
 it would show a site visitor the trail of pages visited.

 I'm not quite sure I know how to set this up.  I created actual
 pages from your demo...biocompate.html, kits_assays.html, etc.,
 so there would be actual pages to visit, but the order the
 breakcrumbs never changes, but stays in the order of the
 list of pages in breadcrumb0, the id of the div in which I changed the
 links.

 A little help for the clueless?

 Thanks,

 Rick

 heysatan wrote:
  jBreadCrumb RELEASED

  Hi all, I've put the breadcrumb plugin up on jquery's site:

 http://plugins.jquery.com/project/jBreadCrumb

  Here's a link to the working example (also linked to from the jquery
  page)

 http://www.comparenetworks.com/developers/jqueryplugins/jbreadcrumb.html

  Let me know what you think, there are some improvements that can be
  made for sure.  It's decently smart but I think I will improve the
  collapsing algorithm to know what it needs to collapse based on
  individual elements width.

  Oh, and it's compatible with ie 6, ie 7 and all standards compliant
  browsers.

  Thanks,

  Jason

  On Nov 20, 6:14 pm, heysatan [EMAIL PROTECTED] wrote:

  I am just finishing up version 0.1, it will be up tomorrow morning
  (Pacific time).

  On Nov 18, 2:04 pm, yvonney [EMAIL PROTECTED] wrote:

  Oh YES!!! that WOULD be fabulous I know how busy life gets of
  course... Jason! when you have time we'd all love to play with a
  plugin version I bet!

  best wishes

  On Nov 11, 2:32 pm, Andy Matthews [EMAIL PROTECTED] wrote:

  I'd be interested in this as a plugin as well.

  On Nov 11, 4:21 pm, heysatan [EMAIL PROTECTED] wrote:

  That's a start.

  On Nov 10, 4:13 pm, Microbe [EMAIL PROTECTED] wrote:

  Demand # 1

  :o)

  On Nov 11, 8:57 am, heysatan [EMAIL PROTECTED] wrote:

  Hi Sean,

  I built this breadcrumb animation.  Due to time limitations at the end
  of the project I wasn't able to make it into a plugin (I built a lot
  of other plugins for this project), but I'd like to when I get a
  chance.

  I really solved a problem for us because our category and page titles
  are so long (scientists are long winded).  Before we would show only a
  couple of steps in the HTML to get around this.  This method was more
  SEO friendly, more usable, and I thought, kind of cool.

  If there is a demand for it I'll work on porting it to a plugin, but
  probably not for the next 2 weeks or so.

  Jason
  Lead UI Developer - CompareNetworks

  On Nov 10, 1:21 am, CliffordSean [EMAIL PROTECTED] wrote:

  see the breadcrumb on here 
  :http://www.biocompare.com/ProductDetails/386912/1/Mutation-Generation...
  has anyone come across a plugin like this ?

  tnx
  sean
  --
  View this message in 
  context:http://www.nabble.com/has-anyone-come-across-a-plugin-like-this---tp2...
  Sent from the jQuery General Discussion mailing list archive at 
  Nabble.com.

  ---
  Text inserted by Panda IS 2009:

   This message has NOT been classified as spam. If it is unsolicited mail 
  (spam), click on the following link to reclassify 
  it:http://localhost:6083/Panda?ID=pav_10186SPAM=truepath=C:\Documents%20and%20Settings\Rick%20Faircloth\Local%20Settings\Application%20Data\Panda%20Security\Panda%20Internet%20Security%202009\AntiSpam
  ---


[jQuery] Re: Callback on $.Post not firing

2008-11-24 Thread Andy Matthews

Is it maybe generating an error? Try converting to a .ajax call so that
you've got access to the error method handlers.

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Rage9
Sent: Monday, November 24, 2008 3:43 PM
To: jQuery (English)
Subject: [jQuery] Callback on $.Post not firing


This is driving me loopy.  Simple post, trying to get a result back
from the server.  Heck even copied it from the documentation and the
callback just will not fire, but the post works fine:

var answer = confirm(Delete Selected?);
if (answer){
$.post(test.php, { name: test }, function(data){
alert(popped off!);
 alert(data.name); // John
 console.log(data.time); //  2pm
}, json);
}

PHP:

?php

echo json_encode(array(name=John,time=2pm));

?

I also tried with XML with no luck either.  Firebug doesn't seem to
show a response, but I know the post variables are passed just fine,
because I wrote a logger [not included] to tell me what the variables
where being passed.  No dice on the return info.  Tried this with both
firefox and opera and in neither the call-backe worked.

Ideas?




[jQuery] Re: How can i do Image rollover with simple gamma change?

2008-11-24 Thread Jeffrey Kretz

Opacity would fade in the image as a whole, rather than adjusting its
brightness/contrast (which is more what gamma would adjust).

I don't know how fancy you want to get, but you could absolutely position a
div in front of the image, set for white (or black) and adjust its opacity
from 0 to some small percentage (10%, maybe?) as a highlight.

jQuery.fn.gammaGlow = function(color,opacity){

   return this.each(function(i){

  var img = $(this);
  var css = $.extend({
   display:'none',
   position:'absolute',
   backgroundColor:color,
   opacity:opacity,
   width:img.width(),
   height:img.height()
  },img.position())

  $('div/div')
 .css(css)
 .insertAfter(img)
 .fadeIn()
 .fadeOut(function(){$(this).remove();})
   });

};
-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Andy Matthews
Sent: Monday, November 24, 2008 1:34 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: How can i do Image rollover with simple gamma change?


Yes...

You can use the animate method to fade in/out any element by applying
opacity.


andy

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of expat101
Sent: Monday, November 24, 2008 3:04 PM
To: jQuery (English)
Subject: [jQuery] How can i do Image rollover with simple gamma change?


I would like to have an image rollover with just basic gamma change to
highlight an image...can this be done with basic jquery?





[jQuery] Re: adding different class for only 1 error element?

2008-11-24 Thread Cronet

Thank you for your reply.

Your solution worked fine... I could add a different class to one only
one error.

A further question:

Is it possible to wrap only 2 of the errors with an extra container?

Is this possible with 'errorLabelContainer', or is that globally
set ?!



On 23 Nov., 22:24, Daniel [EMAIL PROTECTED] wrote:
 Hi AxIF,

 you can use the errorPlacement:

 errorPlacement: function(error, element) {
                  if(element.attr(id) == 'cname'){ // match your
 element's id
                    error.addClass(invalid); // add invalid class
                    error.appendTo(element.parent()); // this line will
 change depends on your form layout
                }else{
                   error.appendTo(element.parent()); // this line will
 change depends on your form layout
                }
              }

 Daniel.

 On Nov 24, 12:40 am, Cronet [EMAIL PROTECTED] wrote:

  Hi,

  i would like adding all errors the call .inlineError ... Simply done
  with

          $(#UserAddForm).validate({
                          errorClass: inlineError
                    }
          });

  Is it possible adding to one Element the class .error, all
  others .inlineError ?

  Regards,
  AxlF


[jQuery] Re: Instantiating multiple plugin instances on the same page

2008-11-24 Thread Shawn Grover


Depends how your plugin is set up.

If you didn't implement the chaining techniques, then chances are you 
only have one instance.  But if you did implement chaining, you *should* 
have multiple instances.


Do you have something like this line in your plugin?

return $(this).each( function () {
  // plugin code goes here
});

If you can post your code, we can help more.  OR, you can go to the 
#jquery channel on IRC and use a pastie (www.pastie.org) to get some 
more interactive help...


Hope that helps some.

Shawn

howardk wrote:

Is there a way of instantiating multiple instances of a plugin on the
same page?

What I have essentially is an animated effects plugin, and I want to
be able to invoke separate instantiations of it, doing something like
the following:

script
$( '#effect_1' ).animEffect( { name: 'jumper', color: 'ff', fps:
30 } );
$( '#effect_2' ).animEffect( { name: 'round-the-moon', color:
'00', fps: 40 } );
/script

div id='effect_1'/div
div id='effect_2'/div

I'm still fairly new to javascript. As far as I can tell though, it
looks like it can't be done, since as far as I can see, each plugin
invocation is really calling the same function object over and over
again (thereby overwriting whatever instance or local variables might
have been set in a prior invocation).

Is this correct? Is there a way of doing this, or am I out of luck?
Howard


[jQuery] Re: Callback on $.Post not firing

2008-11-24 Thread Rage9

Ok did that but still not getting anything from the errors:

$.ajax({
type: POST,
url: test.php,
data: {name: test},
dataType: json,
error: function (XMLHttpRequest, textStatus, 
errorThrown) {
alert(XMLHttpRequest:  + 
XMLHttpRequest);
alert(textStatus:  + textStatus);
alert(errorThrown:  + errorThrown);
},
success: function(msg){
alert( Data Saved:  + msg );
}
 });

XMLHttpRequest: XMLHttpRequest object; textStatus: error; and
errorThrown: undefined
Am I going about this the wrong way?

On Nov 24, 3:47 pm, Andy Matthews [EMAIL PROTECTED] wrote:
 Is it maybe generating an error? Try converting to a .ajax call so that
 you've got access to the error method handlers.

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

 Behalf Of Rage9
 Sent: Monday, November 24, 2008 3:43 PM
 To: jQuery (English)
 Subject: [jQuery] Callback on $.Post not firing

 This is driving me loopy.  Simple post, trying to get a result back
 from the server.  Heck even copied it from the documentation and the
 callback just will not fire, but the post works fine:

 var answer = confirm(Delete Selected?);
                 if (answer){
                         $.post(test.php, { name: test }, function(data){
                         alert(popped off!);
                          alert(data.name); // John
                          console.log(data.time); //  2pm
                         }, json);
                 }

 PHP:

 ?php

 echo json_encode(array(name=John,time=2pm));

 ?

 I also tried with XML with no luck either.  Firebug doesn't seem to
 show a response, but I know the post variables are passed just fine,
 because I wrote a logger [not included] to tell me what the variables
 where being passed.  No dice on the return info.  Tried this with both
 firefox and opera and in neither the call-backe worked.

 Ideas?


[jQuery] Re: animate problem with IE7

2008-11-24 Thread ^AndreA^

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

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

Nobody has replied so far...

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

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

Andrea

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

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

 JK

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

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

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

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

 often... ;-)

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

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

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

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

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

   }

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

   The value of end is 50, unit is %.

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

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

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

   JK

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

   Hi Jeffrey, thanks.

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

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

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

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

   Thanks,
   Andrea

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

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

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

While going to the right, everything went as usual.

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

All good.

Then I refreshed and tried going to the left.

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

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

Divs 4 and 5 got WEIRD settings.

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

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

Cheers,
JK

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

Hi all,

I'm working on a

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

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

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

I explain briefly how the script works.

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

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

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

[jQuery] Re: Instantiating multiple plugin instances on the same page

2008-11-24 Thread Michael Geary

You may be worried about a problem that doesn't exist. Every time you call a
function, JavaScript creates a new, unique set of local variables for that
invocation of the function. It doesn't reuse the same function invocation
and its local variables over and over again.

Now, you *could* write code that would get you in trouble here. For example,
you could use global variables instead of local variables in your function,
and those would get overwritten as you might expect.

But normal JavaScript behavior does exactly what you want here. This is true
for plugin methods just like any other functions.

As Shawn suggested, if you have trouble with a specific bit of code, post a
link to it and someone can take a look at it.

-Mike

 From: howardk
 
 Is there a way of instantiating multiple instances of a 
 plugin on the same page?
 
 What I have essentially is an animated effects plugin, and I 
 want to be able to invoke separate instantiations of it, 
 doing something like the following:
 
 script
   $( '#effect_1' ).animEffect( { name: 'jumper', color: 
 'ff', fps:
 30 } );
   $( '#effect_2' ).animEffect( { name: 'round-the-moon', color:
 '00', fps: 40 } );
 /script
 
 div id='effect_1'/div
 div id='effect_2'/div
 
 I'm still fairly new to javascript. As far as I can tell 
 though, it looks like it can't be done, since as far as I can 
 see, each plugin invocation is really calling the same 
 function object over and over again (thereby overwriting 
 whatever instance or local variables might have been set in a 
 prior invocation).
 
 Is this correct? Is there a way of doing this, or am I out of luck?
 Howard
 



[jQuery] Best way yo get the type of matched elements

2008-11-24 Thread DejanNenov

Hello,

I have a simple problem - what is the best syntax / way to get the DOM
type of a matched element? I am unable to find this in the docs...

Example:

div class=aaaSome Text/div
span class=aaaSpan Text/div
form
   input type=button class=aaa /
/form

How can I get the types of matched elements - $(this).val().type -
below - reports undefined - but I would like to get div, span,
button, etc:

$(.aaa).each(function() {
alert($(this).val().type);
});

Thanks in advance for your help.


[jQuery] Re: How can i do Image rollover with simple gamma change?

2008-11-24 Thread expat101

hi, thanks for all the replies

how can i achieve something like here
http://www.linn-bad.no/

the 9 thumbs rollover with increased gamma

cheers


On Nov 25, 8:58 am, Jeffrey Kretz [EMAIL PROTECTED] wrote:
 Opacity would fade in the image as a whole, rather than adjusting its
 brightness/contrast (which is more what gamma would adjust).

 I don't know how fancy you want to get, but you could absolutely position a
 div in front of the image, set for white (or black) and adjust its opacity
 from 0 to some small percentage (10%, maybe?) as a highlight.

 jQuery.fn.gammaGlow = function(color,opacity){

    return this.each(function(i){

       var img = $(this);
       var css = $.extend({
            display:'none',
            position:'absolute',
            backgroundColor:color,
            opacity:opacity,
            width:img.width(),
            height:img.height()
       },img.position())

       $('div/div')
          .css(css)
          .insertAfter(img)
          .fadeIn()
          .fadeOut(function(){$(this).remove();})
    });

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

 Behalf Of Andy Matthews
 Sent: Monday, November 24, 2008 1:34 PM
 To: jquery-en@googlegroups.com
 Subject: [jQuery] Re: How can i do Image rollover with simple gamma change?

 Yes...

 You can use the animate method to fade in/out any element by applying
 opacity.

 andy

 -Original Message-
 From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of expat101
 Sent: Monday, November 24, 2008 3:04 PM
 To: jQuery (English)
 Subject: [jQuery] How can i do Image rollover with simple gamma change?

 I would like to have an image rollover with just basic gamma change to
 highlight an image...can this be done with basic jquery?


[jQuery] Re: How can i do Image rollover with simple gamma change?

2008-11-24 Thread Charlie Griefer
http://www.linn-bad.no/design/plain/js/linn-bad.js

On Mon, Nov 24, 2008 at 4:03 PM, expat101 [EMAIL PROTECTED] wrote:


 hi, thanks for all the replies

 how can i achieve something like here
 http://www.linn-bad.no/

 the 9 thumbs rollover with increased gamma

 cheers


 On Nov 25, 8:58 am, Jeffrey Kretz [EMAIL PROTECTED] wrote:
  Opacity would fade in the image as a whole, rather than adjusting its
  brightness/contrast (which is more what gamma would adjust).
 
  I don't know how fancy you want to get, but you could absolutely position
 a
  div in front of the image, set for white (or black) and adjust its
 opacity
  from 0 to some small percentage (10%, maybe?) as a highlight.
 
  jQuery.fn.gammaGlow = function(color,opacity){
 
 return this.each(function(i){
 
var img = $(this);
var css = $.extend({
 display:'none',
 position:'absolute',
 backgroundColor:color,
 opacity:opacity,
 width:img.width(),
 height:img.height()
},img.position())
 
$('div/div')
   .css(css)
   .insertAfter(img)
   .fadeIn()
   .fadeOut(function(){$(this).remove();})
 });
 
  };
  -Original Message-
  From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
 
  Behalf Of Andy Matthews
  Sent: Monday, November 24, 2008 1:34 PM
  To: jquery-en@googlegroups.com
  Subject: [jQuery] Re: How can i do Image rollover with simple gamma
 change?
 
  Yes...
 
  You can use the animate method to fade in/out any element by applying
  opacity.
 
  andy
 
  -Original Message-
  From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
  Behalf Of expat101
  Sent: Monday, November 24, 2008 3:04 PM
  To: jQuery (English)
  Subject: [jQuery] How can i do Image rollover with simple gamma change?
 
  I would like to have an image rollover with just basic gamma change to
  highlight an image...can this be done with basic jquery?




-- 
I have failed as much as I have succeeded. But I love my life. I love my
wife. And I wish you my kind of success.


[jQuery] What I am I doing wrong? This should be quick.

2008-11-24 Thread theCrandallSter

// when the mouse is hovering over the category link
 $(#menu li a[id]).hover(function(){

// hide the default image and description
$(.js_off).fadeOut(fast);

 // display the slide show section whose class matches the category
link's id
var cat=$(this).attr('id');
$(div.slideshow.+ cat +.ns).fadeIn(fast);

 // when the mouse leaves that category link
 },function(){

 //hide the class
$(.slideshow).fadeOut(fast);

// display the default image
$(.js_off).fadeIn(fast);
 });


The JS Debugger does not return any errors and everything works,
except the cycle plugin, which returns no error. I am expecting the
corresponding slide show to appear, but no luck.


[jQuery] clicking at bottom of long list moves entire page up.

2008-11-24 Thread tmat

Greetings!
I'm developing a list of events, and when someone clicks on the name
of an event, I want the details to  be grabbed from a php page, and
shown underneath.

The HTML is this:
div class='eventName' eid='[the id for the event]' [name of the
event] /div
div class='eventDesc' eid='[event id]'/div

My jQuery is like this:
$(.eventName).click(function() {
var eventID = $(this).attr(eid);
$.get(eventinfo.php,{eid:eventID }, function(data) {
$(.eventDesc[eid='+eventID+']).html(data);

$(.eventDesc[eid='+eventID+']).slideToggle(500) ;
});
})

It does what I want it to do... but when you click on one of the
bottom events in the list, the page automatically scrolls up to about
the middle of the page -- and you have scroll back down to the bottom
to see the info.  It would be rather annoying if this were live.

Anyone have any ideas how to fix this?  Or any tips?  Thanks very
much, in advance.
-Terry


[jQuery] Re: Instantiating multiple plugin instances on the same page

2008-11-24 Thread howardk

Michael and Sean,
Thanks to both of you. I think I'll take you up on your offer of
posting some (simplified) code. Sometime tomorrow if I can find the
time for it ...
Thanks again,
Howard

On Nov 24, 3:49 pm, Michael Geary [EMAIL PROTECTED] wrote:
 You may be worried about a problem that doesn't exist. Every time you call a
 function, JavaScript creates a new, unique set of local variables for that
 invocation of the function. It doesn't reuse the same function invocation
 and its local variables over and over again.

 Now, you *could* write code that would get you in trouble here. For example,
 you could use global variables instead of local variables in your function,
 and those would get overwritten as you might expect.

 But normal JavaScript behavior does exactly what you want here. This is true
 for plugin methods just like any other functions.

 As Shawn suggested, if you have trouble with a specific bit of code, post a
 link to it and someone can take a look at it.

 -Mike

  From: howardk

  Is there a way of instantiating multiple instances of a
  plugin on the same page?

  What I have essentially is an animated effects plugin, and I
  want to be able to invoke separate instantiations of it,
  doing something like the following:

  script
     $( '#effect_1' ).animEffect( { name: 'jumper', color:
  'ff', fps:
  30 } );
     $( '#effect_2' ).animEffect( { name: 'round-the-moon', color:
  '00', fps: 40 } );
  /script

  div id='effect_1'/div
  div id='effect_2'/div

  I'm still fairly new to javascript. As far as I can tell
  though, it looks like it can't be done, since as far as I can
  see, each plugin invocation is really calling the same
  function object over and over again (thereby overwriting
  whatever instance or local variables might have been set in a
  prior invocation).

  Is this correct? Is there a way of doing this, or am I out of luck?
  Howard


[jQuery] Re: problem with document ready function

2008-11-24 Thread ricardobeat

You don't need any of that stuff if you have jQuery:

1. it handles events for you
2. it selects element with CSS3 selectors
3. built-in function for hide/show and effects

This (not tested) should do the same as your code:

$(document).ready(function(){
var subs = $('#container  ul ul');
subs.hide(); //hide all submenus
$('#container  ul  li a').click(function(){ //add an event
listener
  subs.hide(); //hide all submenus
  this.next('ul').show(); //show the ul next to this a
});
});

On Nov 24, 5:00 pm, firstarsbrnwhite [EMAIL PROTECTED] wrote:
 I removed

 toggleMenu.addEvent(window, 'load', function(){toggleMenu.init
 ('menu','hidden');});

 and now works as I want it to in FF3


[jQuery] Re: What I am I doing wrong? This should be quick.

2008-11-24 Thread MorningZ

I don't know the answer to your question, but i will provide you some
advice that you'll get better/faster help if you make your subject
lines more in line with what you are having an issue with

for instance, your problem is related to the cycle plugin, if you put
cycle somewhere in the subject instead of what i am doing wrong,
which could be anything, you would have/will have gotten help right
from the guy who wrote it (Mike Alsup)...  but as is, chances are he
won't get in here to answer your question because he won't know any
better




On Nov 24, 5:59 pm, theCrandallSter [EMAIL PROTECTED] wrote:
 // when the mouse is hovering over the category link
          $(#menu li a[id]).hover(function(){

 // hide the default image and description
                 $(.js_off).fadeOut(fast);

  // display the slide show section whose class matches the category
 link's id
                 var cat=$(this).attr('id');
                 $(div.slideshow.+ cat +.ns).fadeIn(fast);

  // when the mouse leaves that category link
          },function(){

  //hide the class
                 $(.slideshow).fadeOut(fast);

 // display the default image
                 $(.js_off).fadeIn(fast);
  });

 The JS Debugger does not return any errors and everything works,
 except the cycle plugin, which returns no error. I am expecting the
 corresponding slide show to appear, but no luck.


[jQuery] Replacing document.getElementById()

2008-11-24 Thread halcyonandon

Hi,

I'm trying change all instances of document.getElementById() with
the jQuery's DOM traversal syntax, however it breaks it everytime.

A simple example is this function:

rm: function(){
var m = document.getElementById('discountMonth');
if(m)
m.selectedIndex = 0;
}

If I change document.getElementById('discountMonth'); to $
('#discountMonth');  or any variation of that it breaks.(I tried
single and double quotes as well as attempting to get the element by
class and so forth with no luck).

The HTML looks like this select onchange=$.bots.rd();return false;
id=discountMonth name=deals[discountMonth]
class=input_deals_dropdownoption value=//select.

The more troublesome issue is with a function like this

rd: function (){
var ds = new Array('checkInDate-Deal', 'checkOutDate-Deal');
$(ds).each(function(i){
el = document.getElementById(ds[i]);
if(el)
el.value = 'mm/dd/';
});
}, ...

With the HTML looking like input type=text onblur=$.bots.rm
();return false; id=checkOutDate-Deal value=mm/dd/
name=checkOutDate class=input_deals/

Any help understanding jQuery's DOM traversal especially with regard
to array iterations would be much appreciated, thanks.



[jQuery] Re: Best way yo get the type of matched elements

2008-11-24 Thread DumpsterDoggy

Here you go!

$(.aaa).each(function() {
alert(this.tagName);
});

FYI: Firebug is awesome! ;)

On Nov 24, 5:56 pm, DejanNenov [EMAIL PROTECTED] wrote:
 Hello,

 I have a simple problem - what is the best syntax / way to get the DOM
 type of a matched element? I am unable to find this in the docs...

 Example:

 div class=aaaSome Text/div
 span class=aaaSpan Text/div
 form
    input type=button class=aaa /
 /form

 How can I get the types of matched elements - $(this).val().type -
 below - reports undefined - but I would like to get div, span,
 button, etc:

 $(.aaa).each(function() {
         alert($(this).val().type);

 });

 Thanks in advance for your help.


[jQuery] get all children and subchildren

2008-11-24 Thread chitgoks

how would you write the code to get all children and sub-children that
are of class menu_head and menu_body?
example this would be my html

p id=header2 class=menu_headHeader-2/p
div id=header2_menubody class=menu_body

div id=pane class=menu_list
p id=submenu class=menu_headSub-Menu/p
div id=submenu_menubody class=menu_body
a id=submenu_sublink1 href=#Sub 
Link-1/a
a id=submenu_sublink2 href=#Sub 
Link-2/a
a id=submenu_sublink3 href=#Sub 
Link-3/a
/div
/div

a id=header2_link1 href=#Link-1/a
a id=header2_link2 href=#Link-2/a
a id=header2_link3 href=#Link-3/a
/div

this was what i tried
 $('#header2').children('.menu_head') and $('header2').children
('.menu_body') but they dont work

if i use $('$header2').children() it will only give me the div with id
pane

anyone got ideas? thanks


[jQuery] Re: get top most parent

2008-11-24 Thread chitgoks

i managed to get the top most parent regardless which menu item is
clicked using this code

$('#ID_HERE').parents('div.menu_body').prev($('#ID_HERE').parents
('div.menu_body').size()-1)


[jQuery] Pulling images dynamically from a folder.

2008-11-24 Thread fr0st003


Here is the page I am working on, I am relatively new to jquery and
javascript in general.

http://johntbrown.com/sandbox/lopano/work.html

What I would like to do is to pull images dynamically from a folder to
generate the back ground for the page. Then for the forward/backward buttons
I would like to be able to scan through the folder, also I would like to
have some sort of tool tip showing a preview of the next image when you put
your cursor over the forward/backward buttons.



-- 
View this message in context: 
http://www.nabble.com/Pulling-images-dynamically-from-a-folder.-tp20672755s27240p20672755.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] UI tabs with embedded layered images?

2008-11-24 Thread jlwx


Hi all,
I've created a tabbed interface using the jQuery UI Tabs plug-in.  Very easy
and cool.

Now I'm trying to do this in *each* tab:

1) Create a set of checkboxes that, when each is checked, will superimpose
transparent images (different z-indexes) on top of each other.  Multiple
checkboxes need to be active at the same time.  Changing tabs changes the
different images.
2) Possibly create a zoom-in/zoom-out/pan feature on top of each image.
3) This whole interface must be self-contained and be able to be dynamically
placed on a page, since the text and images before the tabbed interface will
change.  No absolute positioning of the images.

Problems:
I can't seem to get the checkboxes positioned where I want inside each tab,
and when I assign them to different images, while I can click them on and
off, they aren't on top of each other, so not layered.

What I'm essentially trying to do:
Create a google-maps like interface for *images*, rather than, for, uh,
maps.  I would think this all would be possible with jQuery (especially
since my interface should be way simpler, no navigation, etc.)  

Anyone know of any plugins that already do this, or if I'll even be able to
do this in concept with jQuery?  Advice on where to start?

Thanks for any ideas or pointers in the right direction.

Jason
-- 
View this message in context: 
http://www.nabble.com/UI-tabs-with-embedded-layered-images--tp20671524s27240p20671524.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] validate - error in IE6

2008-11-24 Thread jquery_newbie

I am trying to run my page with the Validator code but on loading it
in IE6 I get the Expected ; error followed by Object doesn't
support this property or method errors. It has absolutely no problems
in Firefox3. Strangely enough when I comment out the META http-
equiv=Content-Type content=text/html; charset=UTF-8 line the
Expected ; error disappears although the validation still does not
work. Here's my page:

-
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
html
head
META http-equiv=Content-Type content=text/html; charset=UTF-8
titletest/title
script type=text/javascript src=jquery.js/script
script type=text/javascript src=jquery.validate.pack.js/script
script id=demo type=text/javascript
$(function() {

!-- form validation --
$('#frmFilterEvents').validate({
rules: {
txtStartDate: {
//sutterdate: true,
required: 
#txtEndDate:filled
},
txtEndDate: {
//sutterdate: true,
required: 
#txtStartDate:filled
},
txtZip: {
minlength: 5,
maxlength: 5
}
},
messages: {
txtStartDate: mm/dd/ 
required,
txtEndDate: mm/dd/ 
required,
txtZip: Zip is 5 digits
},
errorPlacement: function(error, 
element) {
if ( element.is(:radio) )
error.appendTo( 
element.parent().next().next() );
else if ( 
element.is(:checkbox) )
error.appendTo ( 
element.next() );
else
error.appendTo( 
element.parent() );
}
});

$('button[name=submitFilter]').click(function() 
{
return $('#frmFilterEvents').valid();
});
})
/script
/head
body style=margin:0;background-color:#FF; class=mls_member
tpl-3col


div class=mls_sidebar id=mls_left
  div class=mls_navSub mls mls_colLf
dl
  dtFilter Events/dt
  dd
form action=  id=frmFilterEvents method=post

  fieldset
  legendDates/legend
  ol class=mls_dates
li
  label for=txtStartDateFrom/label
  span class=ui-datepicker-wrap
  input class=mls_text datePick type=text
name=txtStartDate id=txtStartDate value=
  /span /li
li
  label for=txtEndDateTo/label
  span class=ui-datepicker-wrap
  input class=mls_text datePick type=text
name=txtEndDate id=txtEndDate value=
  /span /li
  /ol
  /fieldset
  fieldset class=mls_last
  legendLocation/legend
  ol
li
  label for=selMilesWithin/label
  select name=selMiles id=selMiles
option value=1010 Miles/option
option value=2020 Miles/option
option value=5050 Miles/option
  /select
/li
li
  label for=txtZipof Zip Code/label
  input class=mls_textSmall type=text
name=txtZip id=txtZip value=
/li
  /ol
  /fieldset
  div class=mls_buttons
button name=submitFilter class=
type=submitSearch/button
  /div
/form
  /dd
/dl
  /div
/div

/body
/html

[jQuery] Re: get all children and subchildren

2008-11-24 Thread chitgoks

by the way, the sample html above is only 1 sub level. i am going to
place in a lot of sub-sub menus so my issue is how to traverse to all
children way down the tree that have the p tag and class menu_head


[jQuery] Re: Replacing document.getElementById()

2008-11-24 Thread Karl Rudd

The $('#id'), or jQuery('#id'), function returns a special jQuery
collection (which acts much like an array in some ways). It does not
return an actual DOM node.

jQuery is a library that helps you select things (via CSS selectors)
and do stuff (usually all at once) to those things.

To check if there was any DOM node selected use:

  var o = $('#myid');
  if (o.length != 0) {
// do something
  }

To get the first DOM node out of a jQuery collection use:

  var theNode = $('#myid')[0];

To select multiple objects pass in a string of selectors (just like in CSS):

  var myNodes = $('#checkInDate-Deal, #checkOutDate-Deal');

To change an attribute of the selected nodes you can either use the
attr() method:

  myNodes.attr('value', 'mm/dd/');

Or in this case, there is a shortcut method:

  myNodes.val('mm/dd/');

Something to watch out for is that the each() method (when called on
a jQuery collection object) actually returns the raw DOM nodes,
one at a time. ie:

  myNodes.each(function() {
// this == a raw DOM node
  });

Karl Rudd

On Tue, Nov 25, 2008 at 12:13 PM, halcyonandon [EMAIL PROTECTED] wrote:

 Hi,

 I'm trying change all instances of document.getElementById() with
 the jQuery's DOM traversal syntax, however it breaks it everytime.

 A simple example is this function:

rm: function(){
var m = document.getElementById('discountMonth');
if(m)
m.selectedIndex = 0;
}

 If I change document.getElementById('discountMonth'); to $
 ('#discountMonth');  or any variation of that it breaks.(I tried
 single and double quotes as well as attempting to get the element by
 class and so forth with no luck).

 The HTML looks like this select onchange=$.bots.rd();return false;
 id=discountMonth name=deals[discountMonth]
 class=input_deals_dropdownoption value=//select.

 The more troublesome issue is with a function like this

rd: function (){
var ds = new Array('checkInDate-Deal', 'checkOutDate-Deal');
$(ds).each(function(i){
el = document.getElementById(ds[i]);
if(el)
el.value = 'mm/dd/';
});
}, ...

 With the HTML looking like input type=text onblur=$.bots.rm
 ();return false; id=checkOutDate-Deal value=mm/dd/
 name=checkOutDate class=input_deals/

 Any help understanding jQuery's DOM traversal especially with regard
 to array iterations would be much appreciated, thanks.




[jQuery] Re: validate - error in IE6

2008-11-24 Thread DumpsterDoggy
Your META tag isn't closed properly so this is probably your starting
point for investigation. Make sure your page validates before you
start to dig into the JavaScript.

On Nov 24, 7:21 pm, jquery_newbie [EMAIL PROTECTED] wrote:
 I am trying to run my page with the Validator code but on loading it
 in IE6 I get the Expected ; error followed by Object doesn't
 support this property or method errors. It has absolutely no problems
 in Firefox3. Strangely enough when I comment out the META http-
 equiv=Content-Type content=text/html; charset=UTF-8 line the
 Expected ; error disappears although the validation still does not
 work. Here's my page:

 -
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 html
 head
 META http-equiv=Content-Type content=text/html; charset=UTF-8
 titletest/title
 script type=text/javascript src=jquery.js/script
 script type=text/javascript src=jquery.validate.pack.js/script
 script id=demo type=text/javascript
                         $(function() {

                                 !-- form validation --
                                 $('#frmFilterEvents').validate({
                                         rules: {
                                                 txtStartDate: {
                                                         //sutterdate: true,
                                                         required: 
 #txtEndDate:filled
                                                 },
                                                 txtEndDate: {
                                                         //sutterdate: true,
                                                         required: 
 #txtStartDate:filled
                                                 },
                                                 txtZip: {
                                                         minlength: 5,
                                                         maxlength: 5
                                                 }
                                         },
                                         messages: {
                                                 txtStartDate: mm/dd/ 
 required,
                                                 txtEndDate: mm/dd/ 
 required,
                                                 txtZip: Zip is 5 digits
                                         },
                                         errorPlacement: function(error, 
 element) {
                                                 if ( element.is(:radio) )
                                                         error.appendTo( 
 element.parent().next().next() );
                                                 else if ( 
 element.is(:checkbox) )
                                                         error.appendTo ( 
 element.next() );
                                                 else
                                                         error.appendTo( 
 element.parent() );
                                         }
                                 });

                                 
 $('button[name=submitFilter]').click(function() {
                                 return $('#frmFilterEvents').valid();
                         });
                         })
 /script
 /head
 body style=margin:0;background-color:#FF; class=mls_member
 tpl-3col

         div class=mls_sidebar id=mls_left
           div class=mls_navSub mls mls_colLf
             dl
               dtFilter Events/dt
               dd
                 form action=  id=frmFilterEvents method=post

                   fieldset
                   legendDates/legend
                   ol class=mls_dates
                     li
                       label for=txtStartDateFrom/label
                       span class=ui-datepicker-wrap
                       input class=mls_text datePick type=text
 name=txtStartDate id=txtStartDate value=
                       /span /li
                     li
                       label for=txtEndDateTo/label
                       span class=ui-datepicker-wrap
                       input class=mls_text datePick type=text
 name=txtEndDate id=txtEndDate value=
                       /span /li
                   /ol
                   /fieldset
                   fieldset class=mls_last
                   legendLocation/legend
                   ol
                     li
                       label for=selMilesWithin/label
                       select name=selMiles id=selMiles
                         option value=1010 Miles/option
                         option value=2020 Miles/option
                         option value=5050 Miles/option
                       /select
                     /li
                     li
                       label for=txtZipof Zip Code/label
                       input class=mls_textSmall type=text
 name=txtZip 

[jQuery] Re: validate - error in IE6

2008-11-24 Thread DumpsterDoggy
I didn't notice at first, but also, your input tags aren't closed
properly either:

Should be:
input class=mls_textSmall type=text
name=txtZip id=txtZip value= /

On Nov 24, 8:19 pm, DumpsterDoggy [EMAIL PROTECTED] wrote:
 Your META tag isn't closed properly so this is probably your starting
 point for investigation. Make sure your page validates before you
 start to dig into the JavaScript.

 On Nov 24, 7:21 pm, jquery_newbie [EMAIL PROTECTED] wrote:

  I am trying to run my page with the Validator code but on loading it
  in IE6 I get the Expected ; error followed by Object doesn't
  support this property or method errors. It has absolutely no problems
  in Firefox3. Strangely enough when I comment out the META http-
  equiv=Content-Type content=text/html; charset=UTF-8 line the
  Expected ; error disappears although the validation still does not
  work. Here's my page:

  -
  !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN 
  http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
  html
  head
  META http-equiv=Content-Type content=text/html; charset=UTF-8
  titletest/title
  script type=text/javascript src=jquery.js/script
  script type=text/javascript src=jquery.validate.pack.js/script
  script id=demo type=text/javascript
                          $(function() {

                                  !-- form validation --
                                  $('#frmFilterEvents').validate({
                                          rules: {
                                                  txtStartDate: {
                                                          //sutterdate: true,
                                                          required: 
  #txtEndDate:filled
                                                  },
                                                  txtEndDate: {
                                                          //sutterdate: true,
                                                          required: 
  #txtStartDate:filled
                                                  },
                                                  txtZip: {
                                                          minlength: 5,
                                                          maxlength: 5
                                                  }
                                          },
                                          messages: {
                                                  txtStartDate: mm/dd/ 
  required,
                                                  txtEndDate: mm/dd/ 
  required,
                                                  txtZip: Zip is 5 digits
                                          },
                                          errorPlacement: function(error, 
  element) {
                                                  if ( element.is(:radio) )
                                                          error.appendTo( 
  element.parent().next().next() );
                                                  else if ( 
  element.is(:checkbox) )
                                                          error.appendTo ( 
  element.next() );
                                                  else
                                                          error.appendTo( 
  element.parent() );
                                          }
                                  });

                                  
  $('button[name=submitFilter]').click(function() {
                                  return $('#frmFilterEvents').valid();
                          });
                          })
  /script
  /head
  body style=margin:0;background-color:#FF; class=mls_member
  tpl-3col

          div class=mls_sidebar id=mls_left
            div class=mls_navSub mls mls_colLf
              dl
                dtFilter Events/dt
                dd
                  form action=  id=frmFilterEvents method=post

                    fieldset
                    legendDates/legend
                    ol class=mls_dates
                      li
                        label for=txtStartDateFrom/label
                        span class=ui-datepicker-wrap
                        input class=mls_text datePick type=text
  name=txtStartDate id=txtStartDate value=
                        /span /li
                      li
                        label for=txtEndDateTo/label
                        span class=ui-datepicker-wrap
                        input class=mls_text datePick type=text
  name=txtEndDate id=txtEndDate value=
                        /span /li
                    /ol
                    /fieldset
                    fieldset class=mls_last
                    legendLocation/legend
                    ol
                      li
                        label for=selMilesWithin/label
                        select name=selMiles id=selMiles
                          option value=1010 Miles/option
     

[jQuery] Re: Appending text works; appending element doesn't

2008-11-24 Thread Rodent of Unusual Size

I still can't find anything wrong, and someone on the #jquery channel
confirmed it.

So does _anyone_ have any idea what's going on here?

Thanks..


[jQuery] Re: get all children and subchildren

2008-11-24 Thread Hector Virgen
jQuery#children() only returns the immediate children of the element. If you
want to dig deeper, you should use jQuery#find()

$('#header2').find('.menu_head'); // returns all divs with the class
menu_head within the div with id header2.


-Hector


On Mon, Nov 24, 2008 at 5:57 PM, chitgoks [EMAIL PROTECTED] wrote:


 by the way, the sample html above is only 1 sub level. i am going to
 place in a lot of sub-sub menus so my issue is how to traverse to all
 children way down the tree that have the p tag and class menu_head


[jQuery] ANN: Books-a-million.com using jQuery

2008-11-24 Thread Andy Matthews

I used to work for the web company who developed the original BAM
site, and now a friend of mine is project manager for them. They just
released a new version of their website and it uses jQuery:

http://www.booksamillion.com/

From the source, it looks like they're really only making use of an
accordion plugin, but hey...another notch in the belt of jQuery.


[jQuery] Re: What I am I doing wrong? This should be quick.

2008-11-24 Thread Eric

Hi.

A test page would be really helpful so we can see the HTML and also
the rest of the Javascript.  If you can't post a test page, use www.jsbin.com
instead.

That will help us a lot.

Thanks,
-E


On Nov 24, 5:59 pm, theCrandallSter [EMAIL PROTECTED] wrote:
 // when the mouse is hovering over the category link
          $(#menu li a[id]).hover(function(){

 // hide the default image and description
                 $(.js_off).fadeOut(fast);

  // display the slide show section whose class matches the category
 link's id
                 var cat=$(this).attr('id');
                 $(div.slideshow.+ cat +.ns).fadeIn(fast);

  // when the mouse leaves that category link
          },function(){

  //hide the class
                 $(.slideshow).fadeOut(fast);

 // display the default image
                 $(.js_off).fadeIn(fast);
  });

 The JS Debugger does not return any errors and everything works,
 except the cycle plugin, which returns no error. I am expecting the
 corresponding slide show to appear, but no luck.


[jQuery] Re: window close

2008-11-24 Thread Namrata Vagyani
This is also not working :(

On Mon, Nov 24, 2008 at 7:51 PM, Isaak Malik [EMAIL PROTECTED] wrote:

 Try:

 $(this).parents('.popup_window_wrapper').hide();


 On Mon, Nov 24, 2008 at 6:08 AM, Debby [EMAIL PROTECTED] wrote:


 Hi all,

 On click of hyperlink, i am cerating one popup which is under one div
 having class but no id.
 On click of  close window hyperlink in the popup i want to hide this
 popup.
 But not able to hide this.
 I tried this, but not working
 $(this).parent('.popup_window_wrapper').css({'display':'none'});

 popup_window_wrapper: Is the class of popup div.

 Please help me.




 --
 Isaak Malik
 Web Developer



  1   2   >