Re: [jQuery] simple question regarding trigger jquery events with non-jquery code

2009-11-08 Thread jQueryNoobzor

Thank you but the problem is that it's not an event detectable by jquery as
far as I know. It's an event that I have a script for and it triggers when
the mouse moves towards a tab or the close window, but NOT when it moves to
the left, right or bottom of the browser's viewable area.

So I just need to 'execute' a jquery event ( the .click) from a non-jquery
piece of code.

Sorry for making it sound complicated :(



Bjarki-2 wrote:
 
 I'm not sure if I under stand you. Are you trying to trigger the click
 event inside another event ?
 if so then you do it like this
 
 $('selector').blur(function(){
 $('#clickme').click();
 });
 blur is just an example here you can use what ever event you like for
 this.
 list of events http://docs.jquery.com/Events
 
 with regards
 Bjarki Heiðar
 
 On Nov 6, 9:42 pm, jQueryNoobzor warko...@gmail.com wrote:
 Thank you so much for your response Michel. Being the complete noob that
 I am
 though I can't seem to implement it as desired.

 The code works fine when I put it in my document ready function like;

 $(document).ready(function(){
         $(.iframe).colorbox({innerWidth:810px, innerHeight:580px,
 iframe:true}, function(){WindowShown=1;});
         $('#clickme').click();

 });

 Ofcourse this way it loads as soon as the page loads (or before it
 finishes
 loading even).

 But how do I 'trigger' the click only upon a certain event? Let's say
 when
 my other javascript calls LastChance(); ?

 E.g.

 $(document).ready(function(){
         $(.iframe).colorbox({innerWidth:810px, innerHeight:580px,
 iframe:true}, function(){WindowShown=1;});

 });

 function LastChance() { // execute the event!
         $('#clickme').click();

 }

 And then when my other piece of javascript triggers LastChance function
 it
 does the .click() stuff.

 Do you get what I'm saying? Sorry for the noob question, I'm sure the
 answer
 is really simple.

 Is there a jquery for dummies book? :D

 Michel Belleville wrote:

  Use jQuery in the first place :

  document.getElementById() doesn't wrap what it finds in the jQuery
 result
  array so there's no jQuery .click() method for your result.

  So use jQuery selectors like this :
  $('#clickme').click();

 --
 View this message in
 context:http://old.nabble.com/simple-question-regarding-trigger-jquery-events...
 Sent from the jQuery General Discussion mailing list archive at
 Nabble.com.
 
 

-- 
View this message in context: 
http://old.nabble.com/simple-question-regarding-trigger-jquery-events-with-non-jquery-code-tp26230150s27240p26251933.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



Re[jQuery] garding Tablesorter

2009-11-08 Thread Henry Loke

Regarding Tablesorter [http://tablesorter.com/]

My table contain the column called No. ( Number ).

No., Name, Age,

When I sorted by Name, The arrangement of No. sorted.

Is there has a way, to dead fixed on No. column ( Column No. not sorted
example it will showed 1., 2., 3. ...etc)  but able to sort Name and Age
according?

Thanks

-fsloke

-- 
View this message in context: 
http://old.nabble.com/Regarding-Tablesorter-tp26252007s27240p26252007.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



Re: [jQuery] Iterating over a list

2009-11-08 Thread Sam Doyle

$(this).fadeOu(duration, function() {


Typo

Sent from my iPhone

On 8 Nov 2009, at 07:27, Michel Belleville  
michel.bellevi...@gmail.com wrote:



$(this).fadeOu(duration, function() {


[jQuery] Function to bind itself to some element

2009-11-08 Thread deyo.vuk

I'm probably missing something major in how this should work, but I'm stuck
so here's the question:

JQuery code in file dataTableHandler.js:

jquery.dataTableHandler = function(param1, param2, param3) {

$.ajax({
method: post,
data: ({newparam1: param1, newparam2: param3}),
urL: ../somepath,
success: function(returnedData) {
$(someDiv1).html(returnedData);
},
complete: function(xhr, status) {
$.(someDiv2).bind(click, function(e) { 
dataTableHandler(param1, param2+1, param3) !-- here is
the problem
});
}
});

}  
 
After successfully invoking the function from the jsp/html page I get an
exception (visible in the Firebug) that says dataTableHandler is not
defined. I tried a lot of stuff to solve this, among others replacing
$.ajax() with $.get(), but the exception is always on the marked line.

What am I missing? How can I make a function bind itself (recursive!?) to
some html element?
-- 
View this message in context: 
http://old.nabble.com/Function-to-bind-itself-to-some-element-tp26252246s27240p26252246.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Superfish Examples

2009-11-08 Thread Bruce A
This post is intended for the author of Superfish (Joel Birch)...

As a relative novice to css xhtml, I endeavor to research and then use
best practice code wherever I can.
It helps me to not get into any bad habits and to see how things
'should be done'.
Necessarily this implies I may not be the author of the code. This has
led me to want to use Superfish, as it seems to have a venerable
heritage (through suckerfish) and great standards compliance.

However, as a beginner I would like to point out that it would be
extremely helpful to have access to examples of the code in action.
While you have your own much appreciated examples, I would love to see
various Superfish implementations 'in the wild'.

Would it be possible to have a section on your website where examples
of superfish sites could be posted?

Thanks for writing such great code!


[jQuery] Re: Superfish CSS questio

2009-11-08 Thread gfranklin
Luciano,

http://apc.mcswebhost.com/about-us/history
Your About button is assigned the class .active.

It looks to me like .active has assigned #ccc background color. Just
change .active to be something else.

History button also has .active assigned to it, and .first-child as
well, so look for those definition in the CSS. However, since you're
on the History page, the id value #current takes precendence -- the
blue background (except for when you mouse over it, which
involves :hover). #current takes precedence because it is defined
later in the css file. [If #current wasn't defined later than .active
in the CSS, The history button would look like the About button.]

-Greg

p.s. I've pasted your CSS definitions below.

.sf-menu .active {

background: #ccc;

}

.sf-menu #current {

background: #202f6a;

}





On Nov 7, 4:41 pm, luciano991 mountain...@gmail.com wrote:
 Hello,

 Thanks for your response to my inquiry. I did have a bit of sloppy
 code there, and I believe I have fixed that now.

 I just have one problem remaining. When I click on the About Us link
 it goes to an article called History. That all looks great. But if I
 choose History from the drop down menu, it still goes to the History
 article which is correct in the way I have arranged things. However,
 when you go to the History article from the Drop Down menu, the link
 for About Us is grey instead of the blue color I chose for the current
 link. Can that be corrected?

 Thanks,

 luciano

 On Nov 7, 5:00 am, gfranklin gfrank...@gmail.com wrote:

  You need to change this chunk of your CSS code:

  ===
  .sf-menu li:hover, .sf-menu li.sfHover,

  .sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active {

          background:             ##ad0303;

          outline:                0;
          color: #fc3131;
  ===

  The background has two pound signs (#), it should be only 1. And
  background color should be blue, not red. And the color should be
  white, not blue. You may need to break out all those definitions in
  the list into separate definitions if differing behavior is desired.

  On Nov 6, 6:07 pm, luciano991 mountain...@gmail.com wrote:

   Hello,

   This is my first post. I want to compliment the author on this great
   extension. I had trouble with it at first because I used to be a
   Windows guy and now I'm a Mac guy and I'm still getting used to things
   that are so simple and obvious I can't see the forest for the trees. I
   get it now and wow

   I implemented the module here:http://apc.mcswebhost.com

   If you hover on the About Us link and click  History and go to that
   page everything is cool except now the About US link has a grey
   background and the drop down link for History has the blue current
   background I set for the top level. I can fix one but not all these
   problems by editing the style .sf-menu a.sf-with-ul  but I would like
   to find the ancestors to edit to fix the problem. I want all link
   backgrounds for all levels to be #ad0303 with #fff for the font color,
   the current link should be the blue background with white print, the
   hover font colors should all be the same.

   Thanks,

   luciano


[jQuery] Modal dialog?

2009-11-08 Thread Mech7
I have a problem where i might have more then one modal dialog in the
same page.. I want to use a class for this, and select it on the
position in the DOM...

But after I open it one time JQuery UI seems to move the dialog
windows to the bottom... so I cannot search for it in the same
location again to reopen it. Is there anyway to avoid this?


[jQuery] jQuery animation performance issue

2009-11-08 Thread ziggymello
Hi,

I have created a site which uses jQuery animation: 
http://www.adamswa.com/staging/align/

The problem is that it works fine locally but performs poorly on a
server. The background grey circles and the main images should move
across the page nicely to their final position. The background grey
circles also should be loading at the same time as everything else.
The nav and the address and social icons work fine...and they are at
the top of the html structure, then everything below it seems to stop
animating. Does anyone have any ideas? This is my first experience
using this kind of animation.

cheers


[jQuery] Tooltip Script for self-hosted Flash Video?

2009-11-08 Thread Nick Hope
I have started making some stock footage galleries (e.g.
http://www.bubblevision.com/underwater-footage/cowries/ ) but would
like to make a stock footage gallery with larger video previews that
popup on mouseover, just like here:

http://www.istockphoto.com/file_search.php?action=filetext=%22shark%22d5be6482a6a854e0baddf2260a9c3927_1=shark

This page also does it well:

http://www.videocopilot.net/tutorials/

My videos are self-hosted and served in the Longtail FLV Player, not
on YouTube etc..

Can anyone recommend a tooltip script to do this?

Thanks!


Re: [jQuery] Function to bind itself to some element

2009-11-08 Thread Qamal Kosim-Satyaputra
did you try - jquery.dataTableHandler(param1, param2+1, param3)
instead of - dataTableHandler(param1, param2+1, param3)
???

you can try initializing the variable firsthand...

jquery.dataTableHandler = function() {};

or something... then assign the function, but i doubt thats necessary

On Sun, Nov 8, 2009 at 9:09 PM, deyo.vuk napushano...@yahoo.com wrote:


 I'm probably missing something major in how this should work, but I'm stuck
 so here's the question:

 JQuery code in file dataTableHandler.js:

 jquery.dataTableHandler = function(param1, param2, param3) {

 $.ajax({
method: post,
data: ({newparam1: param1, newparam2: param3}),
urL: ../somepath,
success: function(returnedData) {
$(someDiv1).html(returnedData);
},
complete: function(xhr, status) {
$.(someDiv2).bind(click, function(e) {
dataTableHandler(param1, param2+1, param3) !-- here is
 the problem
});
}
 });

 }

 After successfully invoking the function from the jsp/html page I get an
 exception (visible in the Firebug) that says dataTableHandler is not
 defined. I tried a lot of stuff to solve this, among others replacing
 $.ajax() with $.get(), but the exception is always on the marked line.

 What am I missing? How can I make a function bind itself (recursive!?) to
 some html element?
 --
 View this message in context:
 http://old.nabble.com/Function-to-bind-itself-to-some-element-tp26252246s27240p26252246.html
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.




[jQuery] How to remove the ascii down arrow for a menu that has children

2009-11-08 Thread Jeremy
Hi,

I am using SuperFish 1.4.8.

Each menu item that has children has a ↓ symbol added to the menu
name.  This is separate to the graphical arrow that is added when
autoArrows:  true.

How do I remove this?

Many thanks
Jeremy


Re: Re[jQuery] garding Tablesorter

2009-11-08 Thread MorningZ
This may not be the most elegant of ways, but it works  :-)

http://jsbin.com/ajome/edit


On Nov 8, 4:27 am, Henry Loke fsl...@yahoo.com wrote:
 Regarding Tablesorter [http://tablesorter.com/]

 My table contain the column called No. ( Number ).

 No., Name, Age,

 When I sorted by Name, The arrangement of No. sorted.

 Is there has a way, to dead fixed on No. column ( Column No. not sorted
 example it will showed 1., 2., 3. ...etc)  but able to sort Name and Age
 according?

 Thanks

 -fsloke

 --
 View this message in 
 context:http://old.nabble.com/Regarding-Tablesorter-tp26252007s27240p26252007...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Autocomplete - Is there a way?

2009-11-08 Thread cdukes77
I'm using Autocomplete in a search field to reference and load a
record from a database ... it's working perfectly, thank-you for
making this UI concept so easy to accomplish ...

Is there a way to have a special item return in the autocomplete
list regardless of what the user types ... In other words something
like ...

Imagine a Movie database -- with a UI that allows you to type the
movie name in an autocomplete enabled text area ... as you type the
name ... possible matches are displayed and available for selection
(so far, exactly as you would expect autocomplete to work)  ... but as
you type, and the list continuously narrows, the user finds that the
movie is not in the list ...

What I'm trying to figure out how to do - is to have an Add New
option in the Autocomplete list that shows (at the top or bottom of
the autocomplete list) as a selectable option, regardless of what the
user is searching for.

I can obviously have an Add New option when the user types an
a ... what I would like is for the Add New selectable option to
show up in all circumstances.

Thanks again,
Chip


[jQuery] Re: Jquery UI Accordion Navigation

2009-11-08 Thread mehstg1319
Cheers Richard. Have moved my post over to the Jquery-UI group. Have
made a little progress, but still no cigar. Cheers for the help.

P

On Nov 7, 12:22 pm, Richard D. Worth rdwo...@gmail.com wrote:
 And sorry I didn't realize we're on the wrong list. If you need any more
 help, please start a new thread on the jQuery UI list:

 http://groups.google.com/group/jquery-ui

 Thanks.

 - Richard

 On Sat, Nov 7, 2009 at 7:21 AM, Richard D. Worth rdwo...@gmail.com wrote:

  It looks like you'll have to supply your own navigationFilter function:

 http://docs.jquery.com/UI/Accordion#option-navigationFilter

  The default is

  navigationFilter: function() {
    return this.href.toLowerCase() == location.href.toLowerCase();
  }

  which is trying to match the whole url, not the end, and not just the hash

  - Richard

  On Sat, Nov 7, 2009 at 3:49 AM, mehstg1319 meh...@gmail.com wrote:

  Right, All out of ideas now. :-(

  Have changed the 1,2,3 etc to valid tokens and changed the NAME to ID.
  But still no luck.

  I sense I must be very close, but cannot work out why it does not
  work.

  Paul

  On Nov 6, 5:15 pm, Richard D. Worth rdwo...@gmail.com wrote:
   h3a name=1 class=menuLink href=#1 tabindex=-1Home/a/h3
   ...
   h3a name=2 class=menuLink href=#2 tabindex=-1About/a/h3
   ...
   h3a name=3 class=menuLink href=#3
  tabindex=-1Portfolio/a/h3

   - Richard

   On Fri, Nov 6, 2009 at 11:55 AM, mehstg1319 meh...@gmail.com wrote:
I don't see any ID's or Names that don't start with a letter in my
code. :-s

P

On Nov 6, 4:50 pm, Richard D. Worth rdwo...@gmail.com wrote:
 ID and NAME tokens must begin with a letter ([A-Za-z])

 On Fri, Nov 6, 2009 at 11:39 AM, mehstg1319 meh...@gmail.com
  wrote:
  Richard,

  I have tried using ID's. Seems to make no difference, the
  navigation
  will still not work :-( I believe I may have the anchors slightly
  wrong, but cannot work out what is wrong with them.

  With regards to your second point about using a valid ID? I do not
  understand, I don't see anything wrong with the names i have used?

  P

  On Nov 6, 1:43 pm, Richard D. Worth rdwo...@gmail.com wrote:
   Two suggestions:

   1. use id instead of name

   2. use a valid id. See

  http://www.w3.org/TR/html4/types.html#h-6.2
   
   ID and NAME tokens must begin with a letter ([A-Za-z]) and may
  be
  followed
   by any number of letters, digits ([0-9]), hyphens (-),
  underscores
  (_),
   colons (:), and periods (.).
   

   - Richard

   On Fri, Nov 6, 2009 at 3:00 AM, mehstg1319 meh...@gmail.com
  wrote:
Thanks very much

That has fixed that bug, silly mistake to make!!

The navigation still does not work however :-(  i.e. if I go
  to
   http://www.paulbraham.com/test_site/index.html#2itshouldopenon
the
second panel and if I go to
   http://www.paulbraham.com/test_site/index.html#3
it should open on the third.

Any ideas what I have done wrong here?

Paul

On Nov 6, 1:42 am, jquery.redsqu...@googlemail.com
jquery.redsqu...@googlemail.com wrote:
 Your click function fail is due to the fact you hook the
  event up
 outside of a doc ready block. You can either change it to
  use
.live
  or
 move it after the accordion initialise call.

 On Nov 5, 2:48 pm, mehstg1319 meh...@gmail.com wrote:

  Hi guys

  I am working on the following sitehttp://
 www.paulbraham.com/test_site/
  and am having a few troubles with my JQuery Accordion.

  Basically, I have turned on Navigation, and inserted three
anchors,
  #1, #2 and #3 for the three sections that exist. Now in
  theory,
i
  could go to index.html#2 and it would load with section 2
  open.
  This
  is not happening, and I cannot work out what is wrong with
  my
code.

  Also, I have used the following code to update the hash on
  the
  address
  bar when a section is selected. This is so it is possible
  to
  bookmark
  the website with a certain section open. This is also not
working.

  $(.menuLink).click(function(event){
                    window.location.hash=this.hash;
           });

  If it helps, I found this tutorial, that shows it working
  perfectly, I
  just can't work out what is so different about mine!!

 http://www.michaeljacobdavis.com/tutorials/statesavingaccordion/state.
..

  Thanks in advance

  Paul


[jQuery] Re: jQuery $.get callback function not being called

2009-11-08 Thread ArnieML
Hi Michel,

I added the following statement after json encoding:

echo $tweets;

to the PHP, but the callback function still isn't getting called.

Any other ideas?

Thanks for the help.

On Nov 7, 11:20 pm, Michel Belleville michel.bellevi...@gmail.com
wrote:
 It's been a long time since my last PHP days but shouldn't you echo or print
 something to get it sent ? It seems you'd get an empty response here (unless
 json_encode already outputs the answer to the response). And as you expect
 at least a bit of json to run through and output parts of, your callback may
 be called but not do anything about the empty response.

 Hope it helps.

 Michel Belleville

 2009/11/8 ArnieML arnie.lapi...@gmail.com

  Hello, I hope someone can help. I'm issuing the following ajax jquery
  call:

         $.get(/ajaxtest.php, { ajax: true, east: northEast.lng(), west:
  southWest.lng(), north: northEast.lat(), south: southWest.lat(), mood:
  amood },
         function (data) {
                 for(var i=0; idata.length; i++){
                 alert(now processing tweets);
                 display_tmmmarker(map, data[i], i);
                 }
                 $(#gettingtweets).remove();

         }, 'json');

  The PHP page looks like this:

  if ( $_REQUEST['ajax'] == 'true' ) {
         $east   = $_REQUEST['east'];
         $south  = $_REQUEST['south'];
         $west   = $_REQUEST['west'];
         $north  = $_REQUEST['north'];
         $mood   = $_REQUEST['mood'];

         $tweets = get_tmmtweets($east, $south, $west, $north, $mood);

         json_encode($tweets);
         }
  exit;

  I have verified that the $tweets array has been JSON-encoded using
  array_values. But the callback function isn't being invoked. I put in
  an alert statement in the callback to verify if the function has been
  called, but I'm not getting the alert message. Is the $tweets array
  not being passed on for some reason?

  Can someone help out? Thanks very much!


[jQuery] Re: How to remove the ascii down arrow for a menu that has children

2009-11-08 Thread Jeremy
Is ok - I noticed my stupid mistake - it's a html entiry included with
the text in the html!

sorry!

On Nov 8, 2:53 pm, Jeremy jscol...@gmail.com wrote:
 Hi,

 I am using SuperFish 1.4.8.

 Each menu item that has children has a ↓ symbol added to the menu
 name.  This is separate to the graphical arrow that is added when
 autoArrows:  true.

 How do I remove this?

 Many thanks
 Jeremy


[jQuery] How to add a background graphic to the top-level menu item?

2009-11-08 Thread Jeremy
Love the menus.

I would like to re-style the top-level menu items to use a background
graphic.  I need to provide 2 elements - each one specifying a
different 'background-position'.  Eg

a href=#a class=jc-tab-right
em class=jc-tab-left
spanHome/span
/em
/a

Any ideas?

Thanks
Jeremy


[jQuery] Re: Plugin Authoring Code Example Incorrect

2009-11-08 Thread Shane Riley
I ended up using this syntax instead:
return this.each(function(){});

On Nov 7, 11:43 am, Morten Maxild mmax...@gmail.com wrote:
 'return true' is wrong, you need to return the 'wrapped set' to support 
 chaining. The $().each method does return the 'wrapped set' and you can take 
 advantage of this.

 HTH
 Morten



 -Original Message-
 From: Shane Riley [mailto:shanerileydoti...@gmail.com]
 Sent: Saturday, November 07, 2009 1:19 PM
 To: jQuery (English)
 Subject: [jQuery] Plugin Authoring Code Example Incorrect

 I created a jQuery plugin for the sake of learning the process and got
 it working no problem. In the plugin authoring docs it says that if
 you return true inside the each method, you can continue using jQuery
 chaining. However the code example above has the return this statement
 at the end of the plugin function rather than the each method. While
 quickly reading through this article after creating my plugin to
 ensure I was following best practices, I placed the return true in the
 same spot and my Javascript ceased to run. I tried logging in and
 editing the documentation, however it's locked. Just wanted to let
 everyone know of the mistake in the hopes someone on here has the
 ability to fix it.


Re: [jQuery] How to determine number of elements after dom manipulation ?

2009-11-08 Thread Richard Bakker

Does anyone perhaps know ?


On 7 nov 2009, at 09:18, Richard Bakker wrote:


I am generating elements (img's) based on data from an xml file.
Once that is done, I want to determine the number of icons that were
generated.

i do a: alert($('img').size())
result: 0, which isn't the case

how can i determine them after they have generated ?
**
function dataloader(location,service,div){
  $.ajax({
  type: GET,
  url: includes/data.xml,
  dataType: xml,
  success: function(xml) {

  $(xml).find('group').each(function(){
  if($(this).attr(name) == service){
  $(this).find(Service).each(function(){
  var type = $(this).find(Type).text()
  var host = $(this).find(Host).text()
  var name = $(this).find(Name).text()
  var site = $(this).find(Site).text()

  if(type == Host  site == location){
  $('img src=images/ 
server.jpg title='+ host +' /').appendTo

('#'+div);
  }
  })
  }
  });
  }
  });

}




Re: [jQuery] Re: Plugin Authoring Code Example Incorrect

2009-11-08 Thread Morten Maxild
Exactly...looks correct:-)

-Original Message-
From: Shane Riley [mailto:shanerileydoti...@gmail.com]
Sent: Sunday, November 08, 2009 6:44 PM
To: jQuery (English)
Subject: [jQuery] Re: Plugin Authoring Code Example Incorrect

I ended up using this syntax instead:
return this.each(function(){});

On Nov 7, 11:43 am, Morten Maxild mmax...@gmail.com wrote:
 'return true' is wrong, you need to return the 'wrapped set' to support
chaining. The $().each method does return the 'wrapped set' and you can
take advantage of this.

 HTH
 Morten



 -Original Message-
 From: Shane Riley [mailto:shanerileydoti...@gmail.com]
 Sent: Saturday, November 07, 2009 1:19 PM
 To: jQuery (English)
 Subject: [jQuery] Plugin Authoring Code Example Incorrect

 I created a jQuery plugin for the sake of learning the process and got
 it working no problem. In the plugin authoring docs it says that if
 you return true inside the each method, you can continue using jQuery
 chaining. However the code example above has the return this statement
 at the end of the plugin function rather than the each method. While
 quickly reading through this article after creating my plugin to
 ensure I was following best practices, I placed the return true in the
 same spot and my Javascript ceased to run. I tried logging in and
 editing the documentation, however it's locked. Just wanted to let
 everyone know of the mistake in the hopes someone on here has the
 ability to fix it.



Re: [jQuery] Re: Plugin Authoring Code Example Incorrect

2009-11-08 Thread Karl Swedberg

In the meantime, I changed the wording on that page.

Both of the following will work:
1)
return this.each(function() { /* do something */ });
2)
this.each(function() { /* do something */ });
return this;

--Karl

On Nov 8, 2009, at 12:56 PM, Morten Maxild wrote:


Exactly...looks correct:-)


-Original Message-
From: Shane Riley [mailto:shanerileydoti...@gmail.com]
Sent: Sunday, November 08, 2009 6:44 PM
To: jQuery (English)
Subject: [jQuery] Re: Plugin Authoring Code Example Incorrect

I ended up using this syntax instead:
return this.each(function(){});

On Nov 7, 11:43 am, Morten Maxild mmax...@gmail.com wrote:
'return true' is wrong, you need to return the 'wrapped set' to  
support
chaining. The $().each method does return the 'wrapped set' and you  
can

take advantage of this.


HTH
Morten




-Original Message-
From: Shane Riley [mailto:shanerileydoti...@gmail.com]
Sent: Saturday, November 07, 2009 1:19 PM
To: jQuery (English)
Subject: [jQuery] Plugin Authoring Code Example Incorrect


I created a jQuery plugin for the sake of learning the process  
and got

it working no problem. In the plugin authoring docs it says that if
you return true inside the each method, you can continue using  
jQuery
chaining. However the code example above has the return this  
statement
at the end of the plugin function rather than the each method.  
While

quickly reading through this article after creating my plugin to
ensure I was following best practices, I placed the return true  
in the

same spot and my Javascript ceased to run. I tried logging in and
editing the documentation, however it's locked. Just wanted to let
everyone know of the mistake in the hopes someone on here has the
ability to fix it.






Re: [jQuery] How to determine number of elements after dom manipulation ?

2009-11-08 Thread Karl Swedberg

You'll have to do it within the success callback:

function dataloader(location,service,div){
  $.ajax({
type: GET,
url: includes/data.xml,
dataType: xml,
success: function(xml) {

  $(xml).find('group').each(function(){
if($(this).attr(name) == service) {
  $(this).find(Service).each(function(){
var type = $(this).find(Type).text()
var host = $(this).find(Host).text()
var name = $(this).find(Name).text()
var site = $(this).find(Site).text()

if(type == Host  site == location){
  $('img src=images/server.jpg title='+ host +' / 
').appendTo('#'+div);

}
  });
}
  });
  alert($('#' + div).find('img').length); // -- should give you  
correct number here

}
  });
}

--Karl

On Nov 8, 2009, at 12:45 PM, Richard Bakker wrote:


Does anyone perhaps know ?


On 7 nov 2009, at 09:18, Richard Bakker wrote:


I am generating elements (img's) based on data from an xml file.
Once that is done, I want to determine the number of icons that were
generated.

i do a: alert($('img').size())
result: 0, which isn't the case

how can i determine them after they have generated ?
**
function dataloader(location,service,div){
 $.ajax({
 type: GET,
 url: includes/data.xml,
 dataType: xml,
 success: function(xml) {

 $(xml).find('group').each(function(){
 if($(this).attr(name) == service){
 $(this).find(Service).each(function(){
 var type = $(this).find(Type).text()
 var host = $(this).find(Host).text()
 var name = $(this).find(Name).text()
 var site = $(this).find(Site).text()

 if(type == Host  site == location){
 $('img src=images/ 
server.jpg title='+ host +' /').appendTo

('#'+div);
 }
 })
 }
 });
 }
 });

}






Re: [jQuery] Re: Plugin Authoring Code Example Incorrect

2009-11-08 Thread Shane Riley
Thanks Karl. Turns out both worked for me, but I had placed the return  
just outside the plugin function instead of within it.



On Nov 8, 2009, at 1:13 PM, Karl Swedberg wrote:


In the meantime, I changed the wording on that page.

Both of the following will work:
1)
return this.each(function() { /* do something */ });
2)
this.each(function() { /* do something */ });
return this;

--Karl

On Nov 8, 2009, at 12:56 PM, Morten Maxild wrote:


Exactly...looks correct:-)


-Original Message-
From: Shane Riley [mailto:shanerileydoti...@gmail.com]
Sent: Sunday, November 08, 2009 6:44 PM
To: jQuery (English)
Subject: [jQuery] Re: Plugin Authoring Code Example Incorrect

I ended up using this syntax instead:
return this.each(function(){});

On Nov 7, 11:43 am, Morten Maxild mmax...@gmail.com wrote:
'return true' is wrong, you need to return the 'wrapped set' to  
support
chaining. The $().each method does return the 'wrapped set' and  
you can

take advantage of this.


HTH
Morten




-Original Message-
From: Shane Riley [mailto:shanerileydoti...@gmail.com]
Sent: Saturday, November 07, 2009 1:19 PM
To: jQuery (English)
Subject: [jQuery] Plugin Authoring Code Example Incorrect


I created a jQuery plugin for the sake of learning the process  
and got
it working no problem. In the plugin authoring docs it says that  
if
you return true inside the each method, you can continue using  
jQuery
chaining. However the code example above has the return this  
statement
at the end of the plugin function rather than the each method.  
While

quickly reading through this article after creating my plugin to
ensure I was following best practices, I placed the return true  
in the

same spot and my Javascript ceased to run. I tried logging in and
editing the documentation, however it's locked. Just wanted to let
everyone know of the mistake in the hopes someone on here has the
ability to fix it.








[jQuery] Re: Superfish CSS questio

2009-11-08 Thread Phil
Haven't looked closely at the css but just wanted to point out one
thing.  The order in which items appear in the style sheet is only one
piece of the puzzle as to what is applied.  Specificity is the
larger.  You can actually assign a numerical value to a selector to
decide if it is more specific than another and hence will have its
rule applied.  For example take these three selections applied to this
code.

a href class=anyclass id=anyid ...

#anyid {background: orange;}
a {background: yellow;}
a.anyclass {background: red;}

all of these css rules select the same a element and even though the
red background appears last in the list the one that will be applied
is the orange.

Heres how it works.

An ID is given a rating or specific value of 100
A class 10
an element 1

you can add up the numbers in any css rule to see which is more
specific and will be applied.  in our preceding example

orange = 100
yellow = 1
red = 11

Hope that helps somewhat.  And by the way if two have the same value
the last one to appear in the stylesheet will be the rule that
applies.

Phil

On Nov 8, 2:39 am, gfranklin gfrank...@gmail.com wrote:
 Luciano,

 http://apc.mcswebhost.com/about-us/history
 Your About button is assigned the class .active.

 It looks to me like .active has assigned #ccc background color. Just
 change .active to be something else.

 History button also has .active assigned to it, and .first-child as
 well, so look for those definition in the CSS. However, since you're
 on the History page, the id value #current takes precendence -- the
 blue background (except for when you mouse over it, which
 involves :hover). #current takes precedence because it is defined
 later in the css file. [If #current wasn't defined later than .active
 in the CSS, The history button would look like the About button.]

 -Greg

 p.s. I've pasted your CSS definitions below.

 .sf-menu .active {

         background: #ccc;

 }

 .sf-menu #current {

         background: #202f6a;

 }

 On Nov 7, 4:41 pm, luciano991 mountain...@gmail.com wrote: Hello,

  Thanks for your response to my inquiry. I did have a bit of sloppy
  code there, and I believe I have fixed that now.

  I just have one problem remaining. When I click on the About Us link
  it goes to an article called History. That all looks great. But if I
  choose History from the drop down menu, it still goes to the History
  article which is correct in the way I have arranged things. However,
  when you go to the History article from the Drop Down menu, the link
  for About Us is grey instead of the blue color I chose for the current
  link. Can that be corrected?

  Thanks,

  luciano

  On Nov 7, 5:00 am, gfranklin gfrank...@gmail.com wrote:

   You need to change this chunk of your CSS code:

   ===
   .sf-menu li:hover, .sf-menu li.sfHover,

   .sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active {

           background:             ##ad0303;

           outline:                0;
           color: #fc3131;
   ===

   The background has two pound signs (#), it should be only 1. And
   background color should be blue, not red. And the color should be
   white, not blue. You may need to break out all those definitions in
   the list into separate definitions if differing behavior is desired.

   On Nov 6, 6:07 pm, luciano991 mountain...@gmail.com wrote:

Hello,

This is my first post. I want to compliment the author on this great
extension. I had trouble with it at first because I used to be a
Windows guy and now I'm a Mac guy and I'm still getting used to things
that are so simple and obvious I can't see the forest for the trees. I
get it now and wow

I implemented the module here:http://apc.mcswebhost.com

If you hover on the About Us link and click  History and go to that
page everything is cool except now the About US link has a grey
background and the drop down link for History has the blue current
background I set for the top level. I can fix one but not all these
problems by editing the style .sf-menu a.sf-with-ul  but I would like
to find the ancestors to edit to fix the problem. I want all link
backgrounds for all levels to be #ad0303 with #fff for the font color,
the current link should be the blue background with white print, the
hover font colors should all be the same.

Thanks,

luciano


[jQuery] Characters in a string

2009-11-08 Thread Dave Maharaj :: WidePixels.com
I have a string where i need to get the last specific number of characters
but cant seem to find an answer when you don't know the length of the
strings since its dynamic.
 
var str=/folder/subfolder/setfolder/6ab0e34e915;
 
where i need the last 11 digits (6ab0e34e915). The folder names change so
that number is never know to subtrct back from leaving me with 11
 
Any help would be great.
 
Thanks
 
Dave


Re: [jQuery] Characters in a string

2009-11-08 Thread Charlie Griefer
On Sun, Nov 8, 2009 at 10:53 AM, Dave Maharaj :: WidePixels.com 
d...@widepixels.com wrote:

  I have a string where i need to get the last specific number of
 characters but cant seem to find an answer when you don't know the length of
 the strings since its dynamic.

 var str=/folder/subfolder/setfolder/6ab0e34e915;

 where i need the last 11 digits (6ab0e34e915). The folder names change so
 that number is never know to subtrct back from leaving me with 11


straight JS.

var str = /folder/subfolder/setfolder/6ab0e34e915;
var arr = str.split('/');  // converts your string to an array, delimited by
the '/' character

var myNumber = arr[arr.length-1];

-- 
Charlie Griefer
http://charlie.griefer.com/

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.


Re: [jQuery] How to determine number of elements after dom manipulation ?

2009-11-08 Thread Qamal Kosim-Satyaputra
where did you exactly call 'alert($('img').size())'? inside the callback
function? remember ajax is asynchronous, if you're calling it after calling
dataloader() the ajax mat not return yet and your images aren't yet in the
DOM.

On Mon, Nov 9, 2009 at 4:45 AM, Richard Bakker richardbak...@me.com wrote:

 Does anyone perhaps know ?


 On 7 nov 2009, at 09:18, Richard Bakker wrote:

  I am generating elements (img's) based on data from an xml file.
 Once that is done, I want to determine the number of icons that were
 generated.

 i do a: alert($('img').size())
 result: 0, which isn't the case

 how can i determine them after they have generated ?
 **
 function dataloader(location,service,div){
  $.ajax({
  type: GET,
  url: includes/data.xml,
  dataType: xml,
  success: function(xml) {

  $(xml).find('group').each(function(){
  if($(this).attr(name) == service){
  $(this).find(Service).each(function(){
  var type = $(this).find(Type).text()
  var host = $(this).find(Host).text()
  var name = $(this).find(Name).text()
  var site = $(this).find(Site).text()

  if(type == Host  site == location){
  $('img src=images/server.jpg
 title='+ host +' /').appendTo
 ('#'+div);
  }
  })
  }
  });
  }
  });

 }





Re: [jQuery] Re: jQuery $.get callback function not being called

2009-11-08 Thread Michel Belleville
Well the doc suggests
http://php.net/manual/fr/function.json-encode.phpthat json_encode
doesn't change the variable passed as a parameter but
returns the encoded string so you've got to do something like this :
echo json_encode($tweets);

To get a jason encoded serialisation of your data output in the response and
not :
json_encode($tweets);
echo $tweets;

Which would only output $tweets not encoded.

Though if it doesn't work like I tell you, you'd better worry about
something else and I don't know exactly what at this point.

Michel Belleville


2009/11/8 ArnieML arnie.lapi...@gmail.com

 Hi Michel,

 I added the following statement after json encoding:

 echo $tweets;

 to the PHP, but the callback function still isn't getting called.

 Any other ideas?

 Thanks for the help.

 On Nov 7, 11:20 pm, Michel Belleville michel.bellevi...@gmail.com
 wrote:
  It's been a long time since my last PHP days but shouldn't you echo or
 print
  something to get it sent ? It seems you'd get an empty response here
 (unless
  json_encode already outputs the answer to the response). And as you
 expect
  at least a bit of json to run through and output parts of, your callback
 may
  be called but not do anything about the empty response.
 
  Hope it helps.
 
  Michel Belleville
 
  2009/11/8 ArnieML arnie.lapi...@gmail.com
 
   Hello, I hope someone can help. I'm issuing the following ajax jquery
   call:
 
  $.get(/ajaxtest.php, { ajax: true, east: northEast.lng(),
 west:
   southWest.lng(), north: northEast.lat(), south: southWest.lat(), mood:
   amood },
  function (data) {
  for(var i=0; idata.length; i++){
  alert(now processing tweets);
  display_tmmmarker(map, data[i], i);
  }
  $(#gettingtweets).remove();
 
  }, 'json');
 
   The PHP page looks like this:
 
   if ( $_REQUEST['ajax'] == 'true' ) {
  $east   = $_REQUEST['east'];
  $south  = $_REQUEST['south'];
  $west   = $_REQUEST['west'];
  $north  = $_REQUEST['north'];
  $mood   = $_REQUEST['mood'];
 
  $tweets = get_tmmtweets($east, $south, $west, $north, $mood);
 
  json_encode($tweets);
  }
   exit;
 
   I have verified that the $tweets array has been JSON-encoded using
   array_values. But the callback function isn't being invoked. I put in
   an alert statement in the callback to verify if the function has been
   called, but I'm not getting the alert message. Is the $tweets array
   not being passed on for some reason?
 
   Can someone help out? Thanks very much!



Re: [jQuery] Iterating over a list

2009-11-08 Thread Michel Belleville
Typo indeed ^^°

Though the principle is sound.

Michel Belleville


2009/11/8 Sam Doyle sammeh@gmail.com

 $(this).fadeOu(duration, function() {


 Typo

 Sent from my iPhone

 On 8 Nov 2009, at 07:27, Michel Belleville michel.bellevi...@gmail.com
 wrote:

 $(this).fadeOu(duration, function() {




Re: [jQuery] simple question regarding trigger jquery events with non-jquery code

2009-11-08 Thread Michel Belleville
I'm not sure I get what you need but if you need to use jQuery from another
script you can as long as you're placing that other script after you've
loaded jQuery. Then again, of course, this other script should give you an
opportunity to run the callback somewhere. As long as jQuery() is declared
in the same context there should be no problem.

Michel Belleville


2009/11/8 jQueryNoobzor warko...@gmail.com


 Thank you but the problem is that it's not an event detectable by jquery as
 far as I know. It's an event that I have a script for and it triggers when
 the mouse moves towards a tab or the close window, but NOT when it moves to
 the left, right or bottom of the browser's viewable area.

 So I just need to 'execute' a jquery event ( the .click) from a non-jquery
 piece of code.

 Sorry for making it sound complicated :(



 Bjarki-2 wrote:
 
  I'm not sure if I under stand you. Are you trying to trigger the click
  event inside another event ?
  if so then you do it like this
 
  $('selector').blur(function(){
  $('#clickme').click();
  });
  blur is just an example here you can use what ever event you like for
  this.
  list of events http://docs.jquery.com/Events
 
  with regards
  Bjarki Heiðar
 
  On Nov 6, 9:42 pm, jQueryNoobzor warko...@gmail.com wrote:
  Thank you so much for your response Michel. Being the complete noob that
  I am
  though I can't seem to implement it as desired.
 
  The code works fine when I put it in my document ready function like;
 
  $(document).ready(function(){
  $(.iframe).colorbox({innerWidth:810px, innerHeight:580px,
  iframe:true}, function(){WindowShown=1;});
  $('#clickme').click();
 
  });
 
  Ofcourse this way it loads as soon as the page loads (or before it
  finishes
  loading even).
 
  But how do I 'trigger' the click only upon a certain event? Let's say
  when
  my other javascript calls LastChance(); ?
 
  E.g.
 
  $(document).ready(function(){
  $(.iframe).colorbox({innerWidth:810px, innerHeight:580px,
  iframe:true}, function(){WindowShown=1;});
 
  });
 
  function LastChance() { // execute the event!
  $('#clickme').click();
 
  }
 
  And then when my other piece of javascript triggers LastChance function
  it
  does the .click() stuff.
 
  Do you get what I'm saying? Sorry for the noob question, I'm sure the
  answer
  is really simple.
 
  Is there a jquery for dummies book? :D
 
  Michel Belleville wrote:
 
   Use jQuery in the first place :
 
   document.getElementById() doesn't wrap what it finds in the jQuery
  result
   array so there's no jQuery .click() method for your result.
 
   So use jQuery selectors like this :
   $('#clickme').click();
 
  --
  View this message in
  context:
 http://old.nabble.com/simple-question-regarding-trigger-jquery-events...
  Sent from the jQuery General Discussion mailing list archive at
  Nabble.com.
 
 

 --
 View this message in context:
 http://old.nabble.com/simple-question-regarding-trigger-jquery-events-with-non-jquery-code-tp26230150s27240p26251933.html
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.




RE: [jQuery] Characters in a string

2009-11-08 Thread Dave Maharaj :: WidePixels.com
Thanks.
 
that's just what I needed.
 
Dave

  _  

From: Charlie Griefer [mailto:charlie.grie...@gmail.com] 
Sent: November-08-09 3:32 PM
To: jquery-en@googlegroups.com
Subject: Re: [jQuery] Characters in a string


On Sun, Nov 8, 2009 at 10:53 AM, Dave Maharaj :: WidePixels.com
d...@widepixels.com wrote:


I have a string where i need to get the last specific number of characters
but cant seem to find an answer when you don't know the length of the
strings since its dynamic.
 
var str=/folder/subfolder/setfolder/6ab0e34e915;
 
where i need the last 11 digits (6ab0e34e915). The folder names change so
that number is never know to subtrct back from leaving me with 11


straight JS.

var str = /folder/subfolder/setfolder/6ab0e34e915;
var arr = str.split('/');  // converts your string to an array, delimited by
the '/' character

var myNumber = arr[arr.length-1]; 


-- 
Charlie Griefer
http://charlie.griefer.com/

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.



Re: [jQuery] Function to bind itself to some element

2009-11-08 Thread deyo.vuk

Yes, I have tried (and now again) and I still keep getting the same message.
Can the problem be something about order inside .js file? That the function
is not properly declared?
The first message I have posted contains full content of my .js file.


Qamal Kosim-Satyaputra wrote:
 
 did you try - jquery.dataTableHandler(param1, param2+1, param3)
 instead of - dataTableHandler(param1, param2+1, param3)
 ???
 
 you can try initializing the variable firsthand...
 
 jquery.dataTableHandler = function() {};
 
 or something... then assign the function, but i doubt thats necessary
 
 

-- 
View this message in context: 
http://old.nabble.com/Function-to-bind-itself-to-some-element-tp26252246s27240p26257523.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Autocomplete - Is there a way?

2009-11-08 Thread MorningZ
 What I'm trying to figure out how to do - is to have an Add New
 option in the Autocomplete list that shows (at the top or bottom of
 the autocomplete list) as a selectable option, regardless of what the
 user is searching for.

Well, if you have the plugin working, then you obviously have the
server side coding complete.. you'd simply add this Add New to the
end of these results on the server



On Nov 8, 11:19 am, cdukes77 cduke...@bellsouth.net wrote:
 I'm using Autocomplete in a search field to reference and load a
 record from a database ... it's working perfectly, thank-you for
 making this UI concept so easy to accomplish ...

 Is there a way to have a special item return in the autocomplete
 list regardless of what the user types ... In other words something
 like ...

 Imagine a Movie database -- with a UI that allows you to type the
 movie name in an autocomplete enabled text area ... as you type the
 name ... possible matches are displayed and available for selection
 (so far, exactly as you would expect autocomplete to work)  ... but as
 you type, and the list continuously narrows, the user finds that the
 movie is not in the list ...

 What I'm trying to figure out how to do - is to have an Add New
 option in the Autocomplete list that shows (at the top or bottom of
 the autocomplete list) as a selectable option, regardless of what the
 user is searching for.

 I can obviously have an Add New option when the user types an
 a ... what I would like is for the Add New selectable option to
 show up in all circumstances.

 Thanks again,
 Chip


[jQuery] Re: Input for special numbers

2009-11-08 Thread kicaj
I know this plugin, but I want without plugin, simple function (maybe
without jquery?)

On 7 Lis, 18:12, brian zijn.digi...@gmail.com wrote:
 Have a look at the Masked Input Plugin:

 http://digitalbush.com/projects/masked-input-plugin/

 On Sat, Nov 7, 2009 at 5:31 AM,kicajki...@kdev.pl wrote:
  How build input form where we can put only 9 digits, and after first 3
  digits join '-', and after next two digits again join '-'?
  Like this: 342-23-4323

  Only numbers, but '-' will be added automatic!
  Without plugin, only very simple solution:)

  Thanks!

  Sorry, for my english:/


[jQuery] Problems with Jquery 1.3 and Google web optimizer?

2009-11-08 Thread the_woodsman
Hi,

When migrating to JQ 1.3.2, we seem to have found an issue with our
Google Web Optimizer (GWO) experiments.

there seems to be a race hazard of some kind before GWO redirects to
an alternate page version.

The error is along the lines of document.body does not exist... when
we roll back to JQ 1.2 the error dissapears.

Has anyone else experienced these issues?

Thanks in advance,

Elwood


Re: [jQuery] Function to bind itself to some element

2009-11-08 Thread deyo.vuk

I have found the solution (and it is somewhat based on Qamal's suggestion for
assigning. thanks Qamal!)

Solution is to declare variable for new function, nested inside main one
and to bind that one as event handler. Also to add call to that nested
function when main one is called.

jQuery.dataTableHandler = function(param1, param2, param3) {

var dataTableHandlerFunction = function(param1, param2, param3) {
$.ajax({
method: post,
data: ({newparam1: param1, newparam2: param3}),
urL: ../somepath,
success: function(returnedData) {
$(someDiv1).html(returnedData);
},
complete: function(xhr, status) {
$.(someDiv2).bind(click, function(e) {
dataTableHandlerFunction(param1, param2+1, param3) ;   
!-- here is the problem
});
}
});
}

//main executes
dataTableHandlerFunction(param1, param2, param3);
}   
-- 
View this message in context: 
http://old.nabble.com/Function-to-bind-itself-to-some-element-tp26252246s27240p26258399.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Append Help

2009-11-08 Thread Dave Maharaj :: WidePixels.com
I have a div that I want to add new content to after the div closes
 
div id=originaloriginal content here /div
 
div id=something_new new content here /div
 
So the new content I am adding gets inserted after the original div.
 
I tried:
 
$(response).fadeIn('slow').appendTo('#original');
$(response).fadeIn('slow').append('#original');
$(response).fadeIn('slow').prependTo('#original');
$(response).fadeIn('slow').after('#original');
 
But its always ending up inside 
 div id=originaloriginal content here 
div id=something_newnew content here/div
/div

What am I doing wrong here?

Thanks
 
Dave



[jQuery] Re: Autocomplete - Is there a way?

2009-11-08 Thread cdukes77
Exactly ... the questions is how ... here;s the autocomplete script
I'm using - I cannot see any way to add a list item that is outside of
the loop AND part of the return ...

$(document).ready(function() {
$(#searchName).autocomplete(data, {
matchContains: true,
formatItem: function(item) {
return item.text;
}
}).result(function(event, item) {
location.href = item.url;
});
});

On Nov 8, 3:54 pm, MorningZ morni...@gmail.com wrote:
  What I'm trying to figure out how to do - is to have an Add New
  option in theAutocompletelist that shows (at the top or bottom of
  theautocompletelist) as a selectable option, regardless of what the
  user is searching for.

 Well, if you have the plugin working, then you obviously have the
 server side coding complete.. you'd simply add this Add New to the
 end of these results on the server

 On Nov 8, 11:19 am, cdukes77 cduke...@bellsouth.net wrote:



  I'm usingAutocompletein a search field to reference and load a
  record from a database ... it's working perfectly, thank-you for
  making this UI concept so easy to accomplish ...

  Is there a way to have a special item return in theautocomplete
  list regardless of what the user types ... In other words something
  like ...

  Imagine a Movie database -- with a UI that allows you to type the
  movie name in anautocompleteenabled text area ... as you type the
  name ... possible matches are displayed and available for selection
  (so far, exactly as you would expectautocompleteto work)  ... but as
  you type, and the list continuously narrows, the user finds that the
  movie is not in the list ...

  What I'm trying to figure out how to do - is to have an Add New
  option in theAutocompletelist that shows (at the top or bottom of
  theautocompletelist) as a selectable option, regardless of what the
  user is searching for.

  I can obviously have an Add New option when the user types an
  a ... what I would like is for the Add New selectable option to
  show up in all circumstances.

  Thanks again,
  Chip- Hide quoted text -

 - Show quoted text -


[jQuery] Re: Autocomplete - Is there a way?

2009-11-08 Thread MorningZ
Ah, local data on the page...

no idea, sorry


On Nov 8, 5:10 pm, cdukes77 cduke...@bellsouth.net wrote:
 Exactly ... the questions is how ... here;s the autocomplete script
 I'm using - I cannot see any way to add a list item that is outside of
 the loop AND part of the return ...

         $(document).ready(function() {
             $(#searchName).autocomplete(data, {
                 matchContains: true,
                 formatItem: function(item) {
                     return item.text;
                 }
             }).result(function(event, item) {
                 location.href = item.url;
             });
         });

 On Nov 8, 3:54 pm, MorningZ morni...@gmail.com wrote:

   What I'm trying to figure out how to do - is to have an Add New
   option in theAutocompletelist that shows (at the top or bottom of
   theautocompletelist) as a selectable option, regardless of what the
   user is searching for.

  Well, if you have the plugin working, then you obviously have the
  server side coding complete.. you'd simply add this Add New to the
  end of these results on the server

  On Nov 8, 11:19 am, cdukes77 cduke...@bellsouth.net wrote:

   I'm usingAutocompletein a search field to reference and load a
   record from a database ... it's working perfectly, thank-you for
   making this UI concept so easy to accomplish ...

   Is there a way to have a special item return in theautocomplete
   list regardless of what the user types ... In other words something
   like ...

   Imagine a Movie database -- with a UI that allows you to type the
   movie name in anautocompleteenabled text area ... as you type the
   name ... possible matches are displayed and available for selection
   (so far, exactly as you would expectautocompleteto work)  ... but as
   you type, and the list continuously narrows, the user finds that the
   movie is not in the list ...

   What I'm trying to figure out how to do - is to have an Add New
   option in theAutocompletelist that shows (at the top or bottom of
   theautocompletelist) as a selectable option, regardless of what the
   user is searching for.

   I can obviously have an Add New option when the user types an
   a ... what I would like is for the Add New selectable option to
   show up in all circumstances.

   Thanks again,
   Chip- Hide quoted text -

  - Show quoted text -


[jQuery] css based on url wildcard

2009-11-08 Thread Wacko Jacko
Hi All,

Just wondering if there is a way with jQuery of adding css to an id
based on a url wildcard? Eg, if the current url contains
'BlogRetrieve.aspx' add .class to this #id.

Thanks in advance for your help.

Jackson


Re: [jQuery] Superfish Examples

2009-11-08 Thread Charlie




easy to find lots of examplessearch this group,
you'll find many a site using superfish that have links posted in
threads 

Bruce A wrote:

  This post is intended for the author of Superfish (Joel Birch)...

As a relative novice to css xhtml, I endeavor to research and then use
best practice code wherever I can.
It helps me to not get into any bad habits and to see how things
'should be done'.
Necessarily this implies I may not be the author of the code. This has
led me to want to use Superfish, as it seems to have a venerable
heritage (through suckerfish) and great standards compliance.

However, as a beginner I would like to point out that it would be
extremely helpful to have access to examples of the code in action.
While you have your own much appreciated examples, I would love to see
various Superfish implementations 'in the wild'.

Would it be possible to have a section on your website where examples
of superfish sites could be posted?

Thanks for writing such great code!

  






[jQuery] Firefox/Webkit differences from position()

2009-11-08 Thread jr195
Hi everyone,

I'm pretty new to jQuery.

The navigation numbers at the top of this page are highlighted when
clicked:

http://carillontech.org/vademecum/

The problem is that the blue highlighting box is positioned 7px higher
in the Webkit browsers.  Short of writing different instructions in
the JS for each browser, is there anything I'm doing wrong that is
responsible for this? I'm guessing that the different browsers read
different coordinates from position().  Using spans instead of
divs for the navigation numbers and carets gives a different result,
also inconsistent between browsers.

I haven't even looked at it in IE yet, and am a little terrified to.

Thanks!!



[jQuery] Beginners question: how to set width on an element

2009-11-08 Thread john6630
I want to read the body width when a page loads and set an element's
width to the same width. The reason I want to do this is that the page
is generated programmatically. Alternatively I can have the program
set the width value to a constant but in any case, I believe I need to
do this when the page is loaded versus a CSS file that is not created
by the form generator.

Here is what I have tried:

style type=text/css
body
{
margin: 0 auto;
width: 430px;
}
/style

script type=text/javascript src=~/JavaScript/
jquery-1.3.2.min.js/script
script type=text/javascript
  $(document).ready(function(){
  $(ul.AspNet-Menu).width() = $(body).width();
  });
/script

Note: my program that creates the page sets the body width. So I could
replace the code with
  $(ul.AspNet-Menu).width() = 430px;

TIA,
John


Re: [jQuery] Superfish: CSS to change the color of text on hover

2009-11-08 Thread Charlie




can add 
.sf-menu li.sfHover  a   to list below,   isn't supported in IE6

Marion wrote:

  Hello,

I have a superfish menu where I'd like to have the color of the text
change on hover (rather than the background color). I'd like the color
to change and stay changed when I hover over the menu item and its
submenus.

The bit of CSS that makes this work for changing the background color
is this:
.sf-menu li:hover, .sf-menu li.sfHover,
.sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active {
	background:		#CFDEFF;
	outline:		0;
}

but setting the color here only changes the color of the single item
hovered over - so the submenu item, but not the parent menu item when
I hover over a submenu.

Not really a jQuery problem I know, but I'm hoping someone here can
help.

Marion

  






[jQuery] Re: Beginners question: how to set width on an element

2009-11-08 Thread MorningZ
http://docs.jquery.com/CSS/width

$(ul.AspNet-Menu).width($(body).width());



On Nov 8, 7:18 pm, john6630 john6...@hotmail.com wrote:
 I want to read the body width when a page loads and set an element's
 width to the same width. The reason I want to do this is that the page
 is generated programmatically. Alternatively I can have the program
 set the width value to a constant but in any case, I believe I need to
 do this when the page is loaded versus a CSS file that is not created
 by the form generator.

 Here is what I have tried:

         style type=text/css
                 body
                         {
                                 margin: 0 auto;
                                 width: 430px;
                         }
         /style

     script type=text/javascript src=~/JavaScript/
 jquery-1.3.2.min.js/script
     script type=text/javascript
       $(document).ready(function(){
       $(ul.AspNet-Menu).width() = $(body).width();
       });
     /script

 Note: my program that creates the page sets the body width. So I could
 replace the code with
       $(ul.AspNet-Menu).width() = 430px;

 TIA,
 John


[jQuery] Instantiating a chart in a dynamically-added div

2009-11-08 Thread GT
Hi there,

I've got a page that has navigation tabs, with each tab linked to a
specific div (divs made visible by the click of the tab).

The divs themselves are populated by load statements - a PHP file is
fed an input code, and returns an HTML stream which then gets plonked
in the div. Each time the code input changes, each div's PHP scripts
is run in turn and all 5 divs are repopulated with content pertaining
to the new input code.

One of the divs has a child div that contains a SWF; at present the
entire structure works exactly as I want, but the SWF is slow and fat
(as SWFs are). I want to replace the SWF with a jqplot element.

The problem is that there is no 'click' event (or other event) that
can be used to trigger a 'live' instantiation of jqplot on this
(dynamically-populated) child div. Once the PHP script has run, it's
just 'there'. My attempts to get the jqplot element to insert itself
have been pathetic, to say the least.

So the following code is in my footer (after the script tag for
jquery): as you can see, all I am trying to do at this stage is target
the #chart1 and #chart2 divs (both which are added within the content
populated into #summDiv when  /includes/StockFullSum.php is run).

If I put a breakpoint within doTheChart(), the breakpoint triggers (so
the function is being activated) but nothing happens to either #chart
div. Furthermore, the breakpoint occurs before #summDiv is populated
(evidenced by the fact that loading.gif is still displaying).

There is something I'm missing - it's clear that doTheChart has to be
delayed until AFTER #summDiv's content is fully loaded: how can that
be achieved? More to the point, why don't I get an error telling me
that I'm trying to do stuff to an elements that doesn't exist (yet)?

Cheerio


GT

problem script appears below

script  type=text/javascript
$(document).ready(function() {
$(ul.tabs).tabs(div.panes  div);
var asxcode= '?php echo $ASXCode; ?';
if(asxcode!=='')
{
dotheFirst(asxcode);
}
});

$(#hitThat).click(function() {
   var thisCode=$(#getCode).val();
   dotheFirst(thisCode);
});

function dotheFirst(z) {
  $(#summDiv).html('centerimg style=margin-top:70px; src=?
php echo $siteURL; ?/WIP/loading.gif //center');
  $(#summDiv).load(?php echo $siteURL; ?/includes/
StockFullSum.php, {ASXCode:z});
  doTheChart();
  doTheRest(z);

}


function doTheRest(t){
   $(#fundDiv).load(?php echo $siteURL; ?/includes/
StockFundSum.php, {ASXCode:t});
   $(#techDiv).load(?php echo $siteURL; ?/includes/
StockTechSum.php, {ASXCode:t});
   $(#sensDiv).load(?php echo $siteURL; ?/includes/
StockSensSum.php, {ASXCode:t});
   $(#optDiv).load(?php echo $siteURL; ?/includes/
StockOptSum.php, {ASXCode:t});
   $(#newsDiv).load(?php echo $siteURL; ?/includes/
StockNewsSum.php, {ASXCode:t});
}

function doTheChart(){
  $(#chart2).hide();  ;
  $(#chart1).show()
  .css(background-color,blue);
};

/script



[jQuery] Re: jQuery $.get callback function not being called

2009-11-08 Thread ArnieML
I tried echo json_encode($tweets);
and still no callback function. The XMLhttp response header looks like
this:

DateMon, 09 Nov 2009 00:57:25 GMT
Content-Typetext/html
Connection  close
Server  Apache
X-Powered-ByPHP/5.2.1
Expires Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control   no-store, no-cache, must-revalidate, post-check=0, pre-
check=0
Pragma  no-cache
Content-Length  20283

Is the Cache-Control setting of no-store, no-cache a possible problem?

Regards,

Arnie

On Nov 8, 11:14 am, Michel Belleville michel.bellevi...@gmail.com
wrote:
 Well the doc suggests
 http://php.net/manual/fr/function.json-encode.phpthat json_encode
 doesn't change the variable passed as a parameter but
 returns the encoded string so you've got to do something like this :
 echo json_encode($tweets);

 To get a jason encoded serialisation of your data output in the response and
 not :
 json_encode($tweets);
 echo $tweets;

 Which would only output $tweets not encoded.

 Though if it doesn't work like I tell you, you'd better worry about
 something else and I don't know exactly what at this point.

 Michel Belleville

 2009/11/8 ArnieML arnie.lapi...@gmail.com

  Hi Michel,

  I added the following statement after json encoding:

  echo $tweets;

  to the PHP, but the callback function still isn't getting called.

  Any other ideas?

  Thanks for the help.

  On Nov 7, 11:20 pm, Michel Belleville michel.bellevi...@gmail.com
  wrote:
   It's been a long time since my last PHP days but shouldn't you echo or
  print
   something to get it sent ? It seems you'd get an empty response here
  (unless
   json_encode already outputs the answer to the response). And as you
  expect
   at least a bit of json to run through and output parts of, your callback
  may
   be called but not do anything about the empty response.

   Hope it helps.

   Michel Belleville

   2009/11/8 ArnieML arnie.lapi...@gmail.com

Hello, I hope someone can help. I'm issuing the following ajax jquery
call:

       $.get(/ajaxtest.php, { ajax: true, east: northEast.lng(),
  west:
southWest.lng(), north: northEast.lat(), south: southWest.lat(), mood:
amood },
       function (data) {
               for(var i=0; idata.length; i++){
               alert(now processing tweets);
               display_tmmmarker(map, data[i], i);
               }
               $(#gettingtweets).remove();

       }, 'json');

The PHP page looks like this:

if ( $_REQUEST['ajax'] == 'true' ) {
       $east   = $_REQUEST['east'];
       $south  = $_REQUEST['south'];
       $west   = $_REQUEST['west'];
       $north  = $_REQUEST['north'];
       $mood   = $_REQUEST['mood'];

       $tweets = get_tmmtweets($east, $south, $west, $north, $mood);

       json_encode($tweets);
       }
exit;

I have verified that the $tweets array has been JSON-encoded using
array_values. But the callback function isn't being invoked. I put in
an alert statement in the callback to verify if the function has been
called, but I'm not getting the alert message. Is the $tweets array
not being passed on for some reason?

Can someone help out? Thanks very much!


[jQuery] Re: Google closure tools and library

2009-11-08 Thread Diego Desani
Tks! =)

On 7 nov, 16:47, Jake B jakeboon...@gmail.com wrote:
 If you look at the online version of the compiler, you'll see that
 jQuery, jQuery UI, and other popular libraries are options in the Add
 a URL dropdown menu:

 http://closure-compiler.appspot.com/home

 I assume that means that Google anticipates Closure being used in
 conjunction with those existing libraries.

 On Nov 6, 1:55 pm, claya clakac...@gmail.com wrote: Any thoughts on the 
 Google closures tools release announcement.

 http://googlecode.blogspot.com/2009/11/introducing-closure-tools.html

  Will jQuery work with it? is it better?


[jQuery] Re: Iterating over a list

2009-11-08 Thread gthorne
I'm not sure I follow what the principle is?


On Nov 8, 1:16 pm, Michel Belleville michel.bellevi...@gmail.com
wrote:
 Typo indeed ^^°

 Though the principle is sound.

 Michel Belleville

 2009/11/8 Sam Doyle sammeh@gmail.com

  $(this).fadeOu(duration, function() {

  Typo

  Sent from my iPhone

  On 8 Nov 2009, at 07:27, Michel Belleville michel.bellevi...@gmail.com
  wrote:

  $(this).fadeOu(duration, function() {


[jQuery] Superfish 1.4.8

2009-11-08 Thread thicket
Hi -
am new to javascript and web stuff.

Am using Superfish for some menus - think it's great and has saved a
lot of time however there is one feature that has been bugging me.

For many of my selectable/clickable menu items I'm using ajax to add
content to the page. When a menu item is clicked the menu remains
visible until the mouse is moved off the element (on a blur event)
plus any 'delay' that has been configured in.

To my mind once a menu item has been 'clicked' - the choice has been
made and I want the sub-menu to disappear straight away. If the option
is not selected then the way it currently operates is fine.

So to achieve this I have added a new 'method' to fn.superfish -
changes below. It seems to have the desired affect but as I'm a newbie
and do not fully understand the original code I am not sure if this is
a good way to go about it or not. If true OOP I'ld have created a
subclass and added the method there thus leaving the 'base' class
alone - perhaps there is a way to 'extend' superfish without modifying
the original code?

;(function($){
$.fn.superfish = function(op){

},
//  'method' to hide a submenu once it has been clicked
clicked = function(){
var $$ = $(this), numKids = 
$(this).children().length;
rem = numKids % 2;// only hide 
if menu item has no
sub-menus
if ( numKids  1  rem == 1 ) {
$$.hideSuperfishUl(); }
},
// end of clicked 'method'
out = function(){
...

$a.each(function(i){
var $li = $a.eq(i).parents('li');

$a.eq(i).click(function(){clicked.call($li);}).focus(function()
{over.call($li);}).blur(function(){out.call($li);});
});
.


Re: [jQuery] Re: For a week i request this question here, but no request.

2009-11-08 Thread Charlie




consider using an accordion. jQuery UI accordion has navigation
option that will open to correct panel. If you want menu to stay open,
superfish is not really suited for that IMO
http://jqueryui.com/demos/accordion/

Brad Hile wrote:

  I'm definately no expert but when you hover over a superfish main
element
it changes the active li class to  'sfHover' and the ul within it to
ul style="display: block; visibility: visible;"

Not tested but perhaps you could use something like (this is to
activate the 2nd menu item)
$('.sf-menu li:nth-child(2)').addClass("sfHover")
$('.sf-menu li:nth-child(2) ul').css({'visibility': 'visible'});




On Nov 5, 6:39pm, jens i...@wizardmedien.de wrote:
  
  
For a week i request this question here, but no request.

How to open the activ ul from the start at a sitehttp://groups.google.com/group/jquery-en/browse_thread/thread/e752f5d...

  
  
  






Re: [jQuery] select range of days in calendar (self-created)

2009-11-08 Thread Charlie




http://jqueryui.com/demos/selectable/

simusch wrote:

  hi

i have a small problem with jquery.

under
http://inview.ch/files/calendar.php
i created a small calendar, which is thought for booking a holidays-
house.

i'd like to do 2 things:

- click on a day changes it to yellow (works fine with toggleClass)
- clicking on a day and then moving the mouse (with mousebutton
clicked) to another day should mark ALL DAYS WITHIN THIS RANGE as
yellow

does someone have an idea, how to realize this?

thanks for your help

simon (german)

  






[jQuery] jQuery only works in offline files?!

2009-11-08 Thread wesley.bunton

Okay, so I have this super strange problem.  I recently finished converting
my web page from a multiple page site to a one file, jquery slide menu page. 
I finally got it working quite well on my offline files.

So eager to finally be done with it I uploaded my entire directory in a zip
file (including the subfolders of scripts and whatnot which were necessary
for the rendering of my site).  Then when I load my page online it shows
everything displayed (jquery hide and slide functions not working) and my
css styles don't seem to be picking up as well.  So I'm totally confused as
to what is not working inbetween my offline files which work beautifully and
my online files?!

I checked the settings through my hostings settings panel, they have
advanced server side settings for php, ruby, etc - but nothing that would
seem to concern this in any way.

I suppose since the css isn't working as well, this isn't necessarily a
jquery specific problem, but I know you guys know this stuff too! Any
helpful advice is appreciated greatly.

Thanks everyone.
-- 
View this message in context: 
http://old.nabble.com/jQuery-only-works-in-offline-files-%21-tp26261050s27240p26261050.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



Re: [jQuery] jQuery only works in offline files?!

2009-11-08 Thread Matt Quackenbush
I'm going to say that there is about a 99.99% chance that the paths to
your CSS and jQuery files are incorrect.


[jQuery] Ajax and removeClass

2009-11-08 Thread cavanshir
Hello,

I have page with buttons and links. I wrote a jQuery code that adds
new css classes to images under clicked links. Also I have an Ajax
request, which replaces buttons with identical ones, but with
different content. After ajax executes, the jQuery code does not add
new classes to images under links, although links and images  have the
same attributes.

Any ideas how to fix this issue.

Thanks.
Cavanshir.


[jQuery] JCarousel is broken in internet explorer

2009-11-08 Thread guyzalon
Hi,
I'm running Drupal 6 with JCarousel and view carousel, its works
perfectly in Firefox, but its broken in internet explorer.
The problem can be seen in my production site: http://www.kidsgame.co.il
(after scrolling down)
I can't find what the problem is, though I checked in many
directions...
Thanks,
Guy.


[jQuery] Serverside button click not working with clientside click

2009-11-08 Thread Priya
runjQueryCode($('.dim').css('height', $(document).height());$
('.btnb').click(function(){$('.dim').fadeIn();return false;});$
(window).bind('resize', function(){$('.dim').css('height', $
(window).height());});)


Re: [jQuery] Re: Google closure tools and library

2009-11-08 Thread waseem sabjee
in closure I selected Jquery from the URL and tried this specific code.

$(function() { alert(true); });

they were no errors.
but 3 warnings.
I also noticed it takes considerably longer to compile JavaScript as it
compiles the whole Jquery library along with your script.
Shouldn't it compile your script only since jquery.min is a compiled file ?

*Number of warnings: 3*
JSC_USELESS_CODE: Suspicious code. This code lacks side-effects. Is there a
bug? at line 988 character 3 in
jquery.jsview-source:http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js
if ( name == selected  elem.parentNode )
^
JSC_USELESS_CODE: Suspicious code. This code lacks side-effects. Is there a
bug? at line 989 character 4 in
jquery.jsview-source:http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js
elem.parentNode.selectedIndex;
^
JSC_USELESS_CODE: Suspicious code. This code lacks side-effects. Is there a
bug? at line 1866 character 3 in
jquery.jsview-source:http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js
elem.parentNode.selectedIndex;
^
On Mon, Nov 9, 2009 at 3:23 AM, Diego Desani ddes...@gmail.com wrote:

 Tks! =)

 On 7 nov, 16:47, Jake B jakeboon...@gmail.com wrote:
  If you look at the online version of the compiler, you'll see that
  jQuery, jQuery UI, and other popular libraries are options in the Add
  a URL dropdown menu:
 
  http://closure-compiler.appspot.com/home
 
  I assume that means that Google anticipates Closure being used in
  conjunction with those existing libraries.
 
  On Nov 6, 1:55 pm, claya clakac...@gmail.com wrote: Any thoughts on
 the Google closures tools release announcement.
 
  http://googlecode.blogspot.com/2009/11/introducing-closure-tools.html
 
   Will jQuery work with it? is it better?



[jQuery] serverside button click event not firing with jquery clientside button click

2009-11-08 Thread Priya
Hi,
The jquery used here is to meake the screen blur when popup
loads..Blur effect is working.But the serverside code of butn1 not
firing.

The code are
Page_Load()
runjQueryCode($('.dim').css('height', $(document).height());$
('.btnb').click(function(){$('.dim').fadeIn();return false;});$
(window).bind('resize', function(){$('.dim').css('height', $
(window).height());});)
end sub

  Sub runjQueryCode(ByVal jsCodetoRun As String)
 ScriptManager.RegisterClientScriptBlock(Me.Page, Page.GetType,
Guid.NewGuid().ToString(), getjQueryCode(jsCodetoRun), True)
End Sub
 Function getjQueryCode(ByVal jsCodetoRun As String) As String
Dim sb As New StringBuilder()
sb.AppendLine($(document).ready(function() {)
sb.AppendLine(jsCodetoRun)
sb.AppendLine( });)
Return sb.ToString
End Function

  Protected Sub butn1_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles butn1.Click
lbltest.Text = Button in the page Clicked
 End Sub

.aspx
asp:Button runat=server ID=butn1 Text=show CssClass=btnb/
 div id=dim class=dim
asp:Panel ID=PnldelSCDoc runat=server
CssClass=popupcurve Visible=true
div class=popupcurve_inside
table style=width: 100%;
tr
td align=center
asp:Button ID=btnok Width=75px
runat=server Text=OK /
/td
/tr
/table
/div
/asp:Panel
/div

Please help me


[jQuery] Re: Passing typeof function

2009-11-08 Thread aze
Thanks again but it still to hard for me to run the script if i have
several ajax calls, does the obj object (in your code) refreshes when
I do ajax calls and there are button of same type in it?

What I want actually
I have content loaded thru ajax and inside it have buttons and i want
to simplify the button's theme, caption and at the same time passing
function to the click event. I change my code for better understanding

A) in loaded content
a href=# class=btnA/a
a href=# class=btnB/a


then after page load, script will execute as follow

B) in document.ready() of the loaded content
$(.btnA).btnInit(Button A, function () {
alert('This is button A');
   // do some other action_1 when clicked
});
$(.btnB).btnInit(Button B, function () {
alert ('This is button B');
// do some action_2 when clicked
});


different button has different action
then , I have this plugin in a different file

C) included in mainpage
(function($){
$.fn.btnInit = function() {
  function prepare(obj, caption, action) {
obj
.html(caption)
.addClass(fg-button ui-state-default ui-corner-all)
.click(function(){
  // run the function passed by the script in B)
  //
};


return this.each(function(caption, action){
obj = $(this);
prepare(obj, caption, action);
});



};
})(jQuery);

Sorry for this hassle.


Re: [jQuery] css based on url wildcard

2009-11-08 Thread Michel Belleville
Straight js : window.location.url contains current url.
jQuery : $('#id_of_element').addClass('class') selects and element with the
id 'id_of_element' and adds the class 'class'.
I'll let you add the if and write the regexp (straight JS).

Michel Belleville


2009/11/9 Wacko Jacko jackson.be...@gmail.com

 Hi All,

 Just wondering if there is a way with jQuery of adding css to an id
 based on a url wildcard? Eg, if the current url contains
 'BlogRetrieve.aspx' add .class to this #id.

 Thanks in advance for your help.

 Jackson



Re: [jQuery] Re: Iterating over a list

2009-11-08 Thread Michel Belleville
To use callbacks that are triggered actually when the animation finishes
instead of calling the animations all at once and seeing only the very last
because they all start approximately at the same time.

Michel Belleville


2009/11/9 gthorne gtho...@gmail.com

 I'm not sure I follow what the principle is?


 On Nov 8, 1:16 pm, Michel Belleville michel.bellevi...@gmail.com
 wrote:
  Typo indeed ^^°
 
  Though the principle is sound.
 
  Michel Belleville
 
  2009/11/8 Sam Doyle sammeh@gmail.com
 
   $(this).fadeOu(duration, function() {
 
   Typo
 
   Sent from my iPhone
 
   On 8 Nov 2009, at 07:27, Michel Belleville 
 michel.bellevi...@gmail.com
   wrote:
 
   $(this).fadeOu(duration, function() {



Re: [jQuery] Re: jQuery $.get callback function not being called

2009-11-08 Thread Michel Belleville
Well no, no-store, no-cache, must-revalidate is exactly what you need here.
If you had cache your problem could have been that the cache was keeping a
former result from when you didn't output the result. You should check
wether you get something in the reply, and if not ask yourself why your PHP
script doesn't output anything (my best guess at this point would be that
get_tmmtweets($east, $south, $west, $north, $mood); returns nothing that
json_encode() likes, if anything), though I don't know get_tmmtweets and I
guess I can't help you much here.

Michel Belleville


2009/11/9 ArnieML arnie.lapi...@gmail.com

 I tried echo json_encode($tweets);
 and still no callback function. The XMLhttp response header looks like
 this:

 DateMon, 09 Nov 2009 00:57:25 GMT
 Content-Typetext/html
 Connection  close
 Server  Apache
 X-Powered-ByPHP/5.2.1
 Expires Thu, 19 Nov 1981 08:52:00 GMT
 Cache-Control   no-store, no-cache, must-revalidate, post-check=0, pre-
 check=0
 Pragma  no-cache
 Content-Length  20283

 Is the Cache-Control setting of no-store, no-cache a possible problem?

 Regards,

 Arnie

 On Nov 8, 11:14 am, Michel Belleville michel.bellevi...@gmail.com
 wrote:
  Well the doc suggests
  http://php.net/manual/fr/function.json-encode.phpthat json_encode
  doesn't change the variable passed as a parameter but
  returns the encoded string so you've got to do something like this :
  echo json_encode($tweets);
 
  To get a jason encoded serialisation of your data output in the response
 and
  not :
  json_encode($tweets);
  echo $tweets;
 
  Which would only output $tweets not encoded.
 
  Though if it doesn't work like I tell you, you'd better worry about
  something else and I don't know exactly what at this point.
 
  Michel Belleville
 
  2009/11/8 ArnieML arnie.lapi...@gmail.com
 
   Hi Michel,
 
   I added the following statement after json encoding:
 
   echo $tweets;
 
   to the PHP, but the callback function still isn't getting called.
 
   Any other ideas?
 
   Thanks for the help.
 
   On Nov 7, 11:20 pm, Michel Belleville michel.bellevi...@gmail.com
   wrote:
It's been a long time since my last PHP days but shouldn't you echo
 or
   print
something to get it sent ? It seems you'd get an empty response here
   (unless
json_encode already outputs the answer to the response). And as you
   expect
at least a bit of json to run through and output parts of, your
 callback
   may
be called but not do anything about the empty response.
 
Hope it helps.
 
Michel Belleville
 
2009/11/8 ArnieML arnie.lapi...@gmail.com
 
 Hello, I hope someone can help. I'm issuing the following ajax
 jquery
 call:
 
$.get(/ajaxtest.php, { ajax: true, east:
 northEast.lng(),
   west:
 southWest.lng(), north: northEast.lat(), south: southWest.lat(),
 mood:
 amood },
function (data) {
for(var i=0; idata.length; i++){
alert(now processing tweets);
display_tmmmarker(map, data[i], i);
}
$(#gettingtweets).remove();
 
}, 'json');
 
 The PHP page looks like this:
 
 if ( $_REQUEST['ajax'] == 'true' ) {
$east   = $_REQUEST['east'];
$south  = $_REQUEST['south'];
$west   = $_REQUEST['west'];
$north  = $_REQUEST['north'];
$mood   = $_REQUEST['mood'];
 
$tweets = get_tmmtweets($east, $south, $west, $north,
 $mood);
 
json_encode($tweets);
}
 exit;
 
 I have verified that the $tweets array has been JSON-encoded using
 array_values. But the callback function isn't being invoked. I put
 in
 an alert statement in the callback to verify if the function has
 been
 called, but I'm not getting the alert message. Is the $tweets array
 not being passed on for some reason?
 
 Can someone help out? Thanks very much!