[jQuery] Re: jQuery text toggle effect

2009-06-22 Thread mojoeJohn

k well i found a great solution that i rigged to fit my own
situation ... i worked w/ the code a bit and changed it up some from
what i originally posted.

here's the link to the article i found 
http://www.sitepoint.com/forums/showthread.php?t=554851

the jquery:

$('.showhide').click(function() {
$('.clients').slideToggle(400);
$(this).text($(this).text() == 'Show box' ? 'Hide box' : 'Show
box');
return false;
});


html:

div class=showhideShow box/div
ul class=clients
liimg src=images/1.jpg alt=photo1//li
liimg src=images/2.jpg alt=photo2//li
liimg src=images/3.jpg alt=photo3//li
liimg src=images/4.jpg alt=photo4//li
liimg src=images/5.jpg alt=photo5//li
noscriptThis is the description for the logo/noscript
!--close clients--
/ul


this time showhide doesn't wrap around clients



could someone explain what this line does:

$(this).text($(this).text() == 'Show box' ? 'Hide box' : 'Show
box');

i don't like to have solutions unless i can understand the answer.
it'll help me learn better.



On Jun 19, 3:55 pm, Matt Kruse m...@thekrusefamily.com wrote:
 On Jun 19, 9:02 am, mojoeJohn mojoej...@gmail.com wrote:

  obviously, i want thetexttotogglethe words show and hide in
  accordance to the slidetoggle.

 I keep this in my toolbox:

 //Toggletextwithin an element using regular expressions.
 // Useful for changing show to hide and back when toggling element
 displays, for example
 jQuery.fn.toggleText = function(a,b) {
         return this.html(this.html().replace(new RegExp((+a+|+b
 +)),function(x){return(x==a)?b:a;}));

 }

 Example:

 $('#mydiv').toggleText('show','hide');

 You can pass in regextext, and it cantoggletextwithin a string
 like:

 Click here to show all items

 and it will justtogglethe word show to hide.

 Hope it's useful.

 Matt Kruse


[jQuery] Re: POST method not working for AJAX Tabs

2009-06-22 Thread Klaus Hartl

$('#tabs').tabs({
spinner: 'Loading...',
ajaxOptions: {
dataType:'text'
}
});

http://docs.jquery.com/UI/Tabs#options


--Klaus


On 21 Jun., 22:18, Hardip hardi.per...@gmail.com wrote:
 a small correction.

 the method is working.

 what wasn't working is the dataType.

 if i set it to json, globally, then Tabs tries to fetch json, not text
 (general HTML).

 how can i make an exception to Tabs.

 [code]
 $.ajaxSetup({
                 type:'post',
                 dataType:'json',
                 cache:false,
                 url:'ajax.php',
                 timeout: 30 * 1000
         })
         $('#tabs').tabs({
                 spinner: 'Loading...',
                 cache: false,
                 dataType:'text'
         });
 [/code]

 aint working...

 On Jun 21, 11:00 pm, Hardip hardi.per...@gmail.com wrote:

  When i override the ajax method with $.ajaxSetup and set the
  type:'post', then consecutive calls to fetch data from the server, by
  Ajax Tabs (http://stilbuero.de/jquery/tabs/), the tab stays
  Loading... forever.

  Firebug shows that a POST request was made and it completed
  successfuly, however, the Tab stays Loading... forever.

  If i set it back to type:'get', the Tabs work fine.

  is it a bug, restriction?

  if it's a restriction, then why?

  workarounds?




[jQuery] when is what ready?

2009-06-22 Thread Peter Marino
Hi jQuery,
I assumed when I used the

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

that the page was finished loading? but what I see is that the popup alert
comes before my images on my page
are finished loading? is this correct?

I need to do something to my page when everything is done loading.. how does
one do that?

Peter

-- 
Power Tumbling - http://www.powertumbling.dk
OSG-Help - http://osghelp.com


[jQuery] Re: when is what ready?

2009-06-22 Thread Prashant Khanal
i guess you should use $(document).ready(function(){.});
but keep in mind this fires after DOM is loaded and before page contents are
loaded.
http://www.learningjquery.com/2006/09/introducing-document-ready

On Mon, Jun 22, 2009 at 1:06 PM, Peter Marino marino.pe...@gmail.comwrote:

 Hi jQuery,
 I assumed when I used the

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

 that the page was finished loading? but what I see is that the popup alert
 comes before my images on my page
 are finished loading? is this correct?

 I need to do something to my page when everything is done loading.. how
 does one do that?

 Peter

 --
 Power Tumbling - http://www.powertumbling.dk
 OSG-Help - http://osghelp.com



[jQuery] Re: Form Validation Plugin: customize input validation

2009-06-22 Thread Jörn Zaefferer

You can write a custom method:
http://docs.jquery.com/Plugins/Validation/Validator/addMethod

Jörn

On Mon, Jun 22, 2009 at 7:21 AM, Loony2nzloony...@gmail.com wrote:

 This is in regards to Jörn Zaefferer's plug in.

 How do you customize input validation so that I can remove foul
 language?

 So that first name or last name doesn't have f*ck you or something
 like that.

 is this possible?

 Thanks!



[jQuery] Re: new plugin: miniZoomPan

2009-06-22 Thread GianCarlo Mingati

Hello everyone.
I'm glad you liked it.

;-))
GC

On Jun 19, 6:19 pm, jake dimano jakedim...@gmail.com wrote:
 I must say...very very nice.
 jake

 On Fri, Jun 19, 2009 at 6:16 AM, GianCarlo

 Mingatigiancarlo.ming...@gmail.com wrote:

  Hello everyone,
  during the initial phase in the development of amuch more complex
  zommpan widget, i ended up with this tiny (yet another) zoompan
  plugin. Since it's small and with just few functionalities i'd call it
  miniZoomPan.

 http://www.gcmingati.net/wordpress/wp-content/lab/jquery/minizoompan/

  Basically it just loads a new (bigger) image when you hover the
  container DIV.
  You need to pass the width and height of the two images (the small and
  the large one) and also the images must have a special char at the
  end:
  mycat_s.jpg
  mycat_l.jpg

  Hope you find it useful  ;-)
 http://www.gcmingati.net/wordpress/wp-content/lab/jquery/minizoompan/

  Kindly report any bug.
  Cheers
  GC


[jQuery] Re: slideToggle doesn't work in IE

2009-06-22 Thread Thavipa

Hmm, thx for your reply.. but, it doesn't work..:(


On 20 jun, 18:09, Charlie charlie...@gmail.com wrote:
 IE doesn't seem to recognize option click
 try this in both FF and IE
 $(select *).click(function () {
   alert(this.tagName);
     });
 In FF will get alert returning Option, in IE doesn't fire
 try this:
 $(#kies_land).change(function () {
         if ($(this).val()==nederland) {
   $(.uitschuifgedeelte_land).slideToggle(slow);
       }
     });
 Thavipa wrote:Hi all, For my work i need to make a form. At some points you 
 have to choose an option from a dropdown select box. After you have chosen 
 one of those some other field appear under the dropdown thing. I use the 
 slideToggle event for this effect. In firefox its all working fine, but in ie 
 6.0 and 7.0 it doesnt work. What do need: A dropdown menu with a few options 
 in it. You can choose one of those and after you select it a few other 
 options apear under the dropdown menu. Code: (this is the dropdown menu..) 
 table width=445 border=0 cellpadding=0 tr td 
 width=200Land*/td td width=245 select name=kies_land 
 id=kies_land class=lang option disabled=disabled 
 selected=selectedkies een land/ option option value=nederland 
 class=nederlandNederland/option option 
 value=belgieBelgieuml;/option option 
 value=duitslandDuitsland/option /select /td /tr /table For this 
 example im using tables. I'm sorry...;) (i have a display:none; in my css for 
 this part..) div class=uitschuifgedeelte_land tr td 
 width=200Provincie*/td td width=245 select name=kies_provincie 
 id=kies_provincie class=lang option 
 value=flevolandFlevoland/option option 
 value=gelderlandGelderland/option option 
 value=frieslandFriesland/option /select /td /tr /div This is 
 what needs to appear after you select something. I wrapped it in a div, so 
 its easier for me to call it in the head. This is what i got in my 
 head/head: script src=jquery.js/script script 
 $(document).ready(function(){ $(.nederland).click(function () { 
 $(.uitschuifgedeelte_land).slideToggle(slow); }); }); /script This code 
 works fine in every browser except IE.. what i tried to do: I made a a 
 href= class=somerandomtest/a Just a link on some text.. this did work 
 in IE, but how can i make a make a link of an option from dropdown menu? I 
 hope some of you knows the anser.. i really hope so! I stuck in this for 
 hours...:( Thavipa


[jQuery] Re: when is what ready?

2009-06-22 Thread Liam Potter


$(function() {.}); is shorthand for 
$(document).ready(function(){.});


Use this, it will check if the page content is loaded before firing.

$(window).load(function() {
alert( hello );
});

Prashant Khanal wrote:

i guess you should use $(document).ready(function(){.});
but keep in mind this fires after DOM is loaded and before page 
contents are loaded.

http://www.learningjquery.com/2006/09/introducing-document-ready

On Mon, Jun 22, 2009 at 1:06 PM, Peter Marino marino.pe...@gmail.com 
mailto:marino.pe...@gmail.com wrote:


Hi jQuery,

I assumed when I used the 


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

that the page was finished loading? but what I see is that the
popup alert comes before my images on my page
are finished loading? is this correct?

I need to do something to my page when everything is done
loading.. how does one do that?

Peter

-- 
Power Tumbling - http://www.powertumbling.dk

OSG-Help - http://osghelp.com




[jQuery] Re: when is what ready?

2009-06-22 Thread Prashant Khanal
$(function() {.}); is shorthand for $(document).ready(function(){.

 });


whoa!..i wasn't aware of that..Thanks anyway.


On Mon, Jun 22, 2009 at 3:05 PM, Liam Potter radioactiv...@gmail.comwrote:


 $(function() {.}); is shorthand for
 $(document).ready(function(){.});

 Use this, it will check if the page content is loaded before firing.

 $(window).load(function() {
 alert( hello );
 });

 Prashant Khanal wrote:

 i guess you should use $(document).ready(function(){.});
 but keep in mind this fires after DOM is loaded and before page contents
 are loaded.
 http://www.learningjquery.com/2006/09/introducing-document-ready

 On Mon, Jun 22, 2009 at 1:06 PM, Peter Marino marino.pe...@gmail.commailto:
 marino.pe...@gmail.com wrote:

Hi jQuery,

I assumed when I used the
$(function() {
alert( hello );
});

that the page was finished loading? but what I see is that the
popup alert comes before my images on my page
are finished loading? is this correct?

I need to do something to my page when everything is done
loading.. how does one do that?

Peter

--Power Tumbling - http://www.powertumbling.dk
OSG-Help - http://osghelp.com





[jQuery] Submenu disappears too fast

2009-06-22 Thread evanj

Hello,
I use superfish horizontal nav-bar style. Subcategories appear
horizontally below categories. The problem is that when I take the
mouse from the category name to reach one of their subcats, the
submenu disappears! The subcategories disappear too fast! Is there a
way to fix this? Thank you in adnvance.


[jQuery] PDF + Jquery + thickbox is not suppoting to Mozilla

2009-06-22 Thread jazz

Hi Folks,

I am facing a severe problem in Mozilla,i.e.i cannot open a pdf in a
frame which users Jquery thickbox.


is there any solution?

Regards,
Bharath


[jQuery] Re: jquery accordion inside the jquery tabs

2009-06-22 Thread Henchan

Very similar problems experienced here.
As well as accordion, my JQuery sliders were also failing.
I fixed it by removing some code from my application. I got this code
from D. Crockford.

Object.prototype.beget = function () { // thanks Crockford
function F() {}
F.prototype = this;
return new F();
};

I guess there is some incompatibility between Object.prototype and
JQuery.


[jQuery] Re: PDF + Jquery + thickbox is not suppoting to Mozilla

2009-06-22 Thread Liam Potter


Does this work with any other browser?

jazz wrote:

Hi Folks,

I am facing a severe problem in Mozilla,i.e.i cannot open a pdf in a
frame which users Jquery thickbox.


is there any solution?

Regards,
Bharath
  


[jQuery] Re: jquery cycle - go to image (regardless of position)

2009-06-22 Thread Mike Alsup

 Is there any way to use something like go to and always have it go to
 a particular image regardless of the slide's position in the cycle?  I
 am adding images to the slideshow and every time I add one - the IDs
 change so that go-to #7 is the seventh slide - regardless of what it
 actually is and I would like to target a particular photo - based on
 the photo ID and not the photo position in the cycle.

You can target the slides by index:

http://www.malsup.com/jquery/cycle/goto.html
http://www.malsup.com/jquery/cycle/goto2.html


[jQuery] Re: slideToggle doesn't work in IE

2009-06-22 Thread Charlie





it works fine here http://jsbin.com/ogoni

Thavipa wrote:

  Hmm, thx for your reply.. but, it doesn't work..:(


On 20 jun, 18:09, Charlie charlie...@gmail.com wrote:
  
  
IE doesn't seem to recognize option click
try this in both FF and IE
$("select *").click(function () {
 alert(this.tagName);
 });
In FF will get alert returning "Option", in IE doesn't fire
try this:
$("#kies_land").change(function () {
  if ($(this).val()=="nederland") {
 $(".uitschuifgedeelte_land").slideToggle("slow");
  }
 });
Thavipa wrote:Hi all, For my work i need to make a form. At some points you have to choose an option from a dropdown select box. After you have chosen one of those some other field appear under the dropdown thing. I use the slideToggle event for this effect. In firefox its all working fine, but in ie 6.0 and 7.0 it doesnt work. What do need: A dropdown menu with a few options in it. You can choose one of those and after you select it a few other options apear under the dropdown menu. Code: (this is the dropdown menu..) table width="445" border="0" cellpadding="0" tr td width="200"Land*/td td width="245" select name="kies_land" id="kies_land" class="lang" option disabled="disabled" selected="selected"kies een land/ option option value="nederland" class="nederland"Nederland/option option value="belgie"Belgieuml;/option option value="duitsland"Duitsland/option 
t;/select /td /tr /table For this example im using tables. I'm sorry...;) (i have a display:none; in my css for this part..) div class="uitschuifgedeelte_land" tr td width="200"Provincie*/td td width="245" select name="kies_provincie" id="kies_provincie" class="lang" option value="flevoland"Flevoland/option option value="gelderland"Gelderland/option option value="friesland"Friesland/option /select /td /tr /div This is what needs to appear after you select something. I wrapped it in a div, so its easier for me to call it in the head. This is what i got in my head/head: script src=""/script script $(document).ready(function(){ $(".nederland").click(function () { $(".uitschuifgedeelte_land").slideToggle("slow"); }); }); /script This code works fine in every browser 
except IE.. what i tried to do: I made a a href="" class="somerandom"test/a Just a link on some text.. this did work in IE, but how can i make a make a link of an option from dropdown menu? I hope some of you knows the anser.. i really hope so! I stuck in this for hours...:( Thavipa

  
  
  






[jQuery] Re: PDF + Jquery + thickbox is not suppoting to Mozilla

2009-06-22 Thread Peter Edwards


Hi Bharath,

Your code would never work on my machine (even in IE) as I have set it 
up so PDFs display in a standalone reader (i.e. do NOT use the browser 
plug-in).
Is the problem that the PDF does not download at all in Mozilla under 
some set of circumstances?


Peter

on 22/06/2009 11:10 jazz said::

Hi Folks,

I am facing a severe problem in Mozilla,i.e.i cannot open a pdf in a
frame which users Jquery thickbox.


is there any solution?

Regards,
Bharath

  


[jQuery] Animated Menu Hover doesn't work on Safari and Opera

2009-06-22 Thread Claymenia

Hi all, and thank by advance for your help !

I use the last jquery javascript for working my animated menu with
hover function.

I've this code in my header:

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

$(.menu2 a).append(em/em);

$(.menu2 a).hover(function() {
$(this).find(em).animate({opacity: show, top: -75}, 
slow);
var hoverText = $(this).attr(title);
$(this).find(em).text(hoverText);
}, function() {
$(this).find(em).animate({opacity: hide, top: -85}, 
fast);
});


});
/script

And this code in my body :

ul class=menu2
 li
 a href=index.php?lang=frnav=renttype=nancites
onclick=return hs.htmlExpand(this, { objectType: \'ajax\', width:
970} ) title=Villa Nancitesimg src=./assets/villas/nancites.jpg
width=130 //a
 /li
 li
 a href=index.php?lang=frnav=renttype=dulce
onclick=return hs.htmlExpand(this, { objectType: \'ajax\', width:
970} )  title=Villa Dulceimg src=./assets/villas/dulce.jpg
width=130 //a
 /li
 li
 a href=index.php?lang=frnav=renttype=quebrada
onclick=return hs.htmlExpand(this, { objectType: \'ajax\', width:
970} ) title=Casa Quebradaimg src=./assets/villas/quebrada.jpg
width=130 //a
 /li
 li
 a href=index.php?lang=frnav=renttype=pluma
onclick=return hs.htmlExpand(this, { objectType: \'ajax\', width:
970} ) title=Casa Plumaimg src=./assets/villas/pluma.jpg
width=130 //a
 /li
 li
 a href=index.php?lang=frnav=renttype=coco
onclick=return hs.htmlExpand(this, { objectType: \'ajax\', width:
970} ) title=Cabina Cocoimg src=./assets/villas/coco.jpg
width=130 //a
 /li
 li
 a href=index.php?lang=frnav=renttype=flora
onclick=return hs.htmlExpand(this, { objectType: \'ajax\', width:
970} ) title=Cabina Floraimg src=./assets/villas/flora.jpg
width=130 //a
 /li
  /ul

That works perfectly on FireFox and IE6 (except png :p) but doesn't
work on Opera and Safari...

Anyone have a suggestion ?


[jQuery] jQuery Form Plugin help

2009-06-22 Thread capnhud

I am having a problem using the jquery Form Plugin. I have a form that
is setup to animate the errors when on submits incorrect information
or gives you a succes message when you enter correct information.
Howvever my problem is that the messages do not animate  when being
displayed they just pop into view. How do I make it animate? The page
is question is http://capnhud.host22.com/sampleform2.html


[jQuery] Re: Accessing iframe's content

2009-06-22 Thread Paul Peelen

So i've noticed... good to get it confirmed. The weird thing that I
noticed is that JSON can get the contents of the page, but in JQuery
it tries to read it as an script. I don't know that much about JSON
though..

Thanks for you answer!

Regards,
Paul Peelen

On 2 Juni, 15:46, Liam Byrne l...@onsight.ie wrote:
 If the iframe is from a different domain, then this is not possible.

 Paul Peelen wrote:
  Hi,

  I am trying to access the content of an iframe. I have search google
  and read a couple of other post, but my problem is a little bit more
  complicated.

  I can't use the ...contents().find(whatever) function though the
  result is of content type text/plain. In other words: There is not
  HTML is the result. The result cannot be tampered with either.

  Because contents, html and text are not really helping me I thought to
  use a counter. Whenever the length would be more than 1 I would show
  the result. But that doesn't seem to work either.

  Anybody that has encountered this problem and can help?

  Regards,
  Paul Peelen
  

  No virus found in this incoming message.
  Checked by AVG -www.avg.com
  Version: 8.5.339 / Virus Database: 270.12.49/2149 - Release Date: 06/01/09 
  17:55:00


[jQuery] Re: PDF + Jquery + thickbox is not suppoting to Mozilla

2009-06-22 Thread bharathbhooshan ambati
Yeah you are right...

when i used iframes in IE it worked fine(when i clicked a link the pdf will
be popup)...
where as in mozilla,i am facing the problem of viewing pdfs in both frame as
well as iframe

thanks for spending time on this..please rep asap

Regards,
Bharath

On Mon, Jun 22, 2009 at 5:07 PM, Peter Edwards p...@bjorsq.net wrote:


 Hi Bharath,

 Your code would never work on my machine (even in IE) as I have set it up
 so PDFs display in a standalone reader (i.e. do NOT use the browser
 plug-in).
 Is the problem that the PDF does not download at all in Mozilla under some
 set of circumstances?

 Peter

 on 22/06/2009 11:10 jazz said::

  Hi Folks,

 I am facing a severe problem in Mozilla,i.e.i cannot open a pdf in a
 frame which users Jquery thickbox.


 is there any solution?

 Regards,
 Bharath






-- 
భరత్ భూషణ్ అంబటి


[jQuery] Re: Submenu disappears too fast

2009-06-22 Thread Charlie





try setting delay as in Superfish API
http://users.tpg.com.au/j_birch/plugins/superfish/#options

if that doesn't do anything chances are your script isn't firing . Main
menu won't appear any differently if script isn't firing
non firing script can be for any number of reasons

is this a CMS (Joomla
can you post link or code?

evanj wrote:

  Hello,
I use superfish horizontal nav-bar style. Subcategories appear
horizontally below categories. The problem is that when I take the
mouse from the category name to reach one of their subcats, the
submenu disappears! The subcategories disappear too fast! Is there a
way to fix this? Thank you in adnvance.

  






[jQuery] Re: Undocumented move/copy behavior of append() et al.

2009-06-22 Thread Eyveneena


when i need to clone something and use it in the same document i use this

$(element to clone usually (this)).clone().prependTo(whereever);

hope that helps


Markus Gritsch-2 wrote:
 
 
 Perfect :)
 
 On Sun, Dec 28, 2008 at 11:45 PM, Dave Methvin dave.meth...@gmail.com
 wrote:

 Here's what I came up with, does it make sense?
 --
 Content

 Most jQuery methods that accept content will accept one or more
 arguments of any of the following:

 * A DOM node element;
 * An array of DOM node elements;
 * A jQuery object;
 * A string representing HTML.

 Example:
  $(#div1).append(
 document.createElement(br),
 $(#div2), emafter div2/em
   );

 Auto-Cloning

 Content inserting methods (append, prepend, before, after, and
 replaceWith) behave differently depending on the number of DOM
 elements currently selected by the jQuery object. If there is only one
 element in the jQuery object, the content is inserted to that element;
 content that was in another location in the DOM tree will be moved by
 this operation. This is essentially the same as the W3C DOM
 appendChild method.

 http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#method-appendChild

 When multiple elements are selected by a jQuery object, these methods
 clone the content before inserting it to each element. Since the
 content can only exist in one location in the document tree, cloning
 is required in these cases so that the same content can be used in
 multiple locations.

 This rule also applies to the selector-insertion methods (appendTo,
 prependTo, insertBefore, insertAfter, and replaceAll), but the auto-
 cloning occurs if there is more than one element selected by the
 Selector provided as an argument to the method.

 When a specific behavior is needed regardless of the number of
 elements selected, use the .clone() or .remove() methods in
 conjunction with a selector-insertion method. This example will always
 clone #Thing, append it to each element with class OneOrMore, and
 leave the original #Thing unmolested in the document:

 $(#Thing).clone().appendTo(.OneOrMore);

 This example will always remove #Thing from the document and append it
 to .OneOrMore:

 $(#Thing).remove().appendTo(.OneOrMore);

 
 

-- 
View this message in context: 
http://www.nabble.com/Undocumented-move-copy-behavior-of-append%28%29-et-al.-tp21179461s27240p24146606.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Problems on IE7

2009-06-22 Thread xoail

What tool did you use to see all those errors? I tried firebug and
fiddler but they dont show much. Also, I tried on another PC and I got
the same problem with IE7.

Thanks!

On Jun 20, 6:04 pm, Charlie charlie...@gmail.com wrote:
 i tried this in IE 7 and was able to get to search after closing modal 
 without complete lock up
 page does however have a significant number of validation errors, multiple 
 use of ID's,  broken tags, invalid xhtml tags ,style tags inside body all 
 over the place etc and error console keeps throwing about a hundred warnings 
 every 10-15 seconds
 some or all of these issues may be causing problems, validation might help
 xoail wrote:Anybody? On Jun 19, 3:40 pm, xoailmdsoh...@gmail.comwrote:Hi 
 All, I've been literally pulling my hair out with this issue I have with our 
 corporate website. The problem is with jquery light box (jqmodal) that 
 freezes other controls after use  in IE7. There seem to be no problem with 
 IE6 or FF. If you go to p$j$m.com (remove $ signs), click Glossary (on top 
 left) close it and then try to use search (top right), it freezes and then 
 throws an error. Like I said, this issue only happens in IE7. I have a 
 feeling that something in jqmodal isnt closing and its conflicting with other 
 controls and IE7 is stupid enough to not identify and correct it. I would 
 greatly appreciate any help in this regards. Thanks!


[jQuery] How to abort fadein/out processing?

2009-06-22 Thread adamscybot

Hi,

This is my first time using jquery and Ive designed a small and simple
fadein/out script that acts as a rollover on this navigation bar:

http://relentless-servers.co.uk/Relentless%20Servers%20v3/

Here is the code:

$(document).ready(function() {
$(.navbutton).not(#active).hover(function(){
$(this).siblings(.rollover).fadeIn(300);
},function(){
$(this).siblings(.rollover).fadeOut(300);
});
});

It works great. However, if a user quickly moves their mouse over the
nav buttons and repeats the process, the rollover affect will fadein/
out over and over again until its completed the cycle the amount of
times the user moved the mouse over the button back and forth.

I wish to change this behaviour so that, somehow, the processing is
aborted if it is noticed the mouse is not present after a fadeout is
completed.

I have no idea how to go about this.

Regards,

Adam


[jQuery] Re: How to abort fadein/out processing?

2009-06-22 Thread Liam Potter


add a stop before animations/fadeIns etc

$(document).ready(function() {
$(.navbutton).not(#active).hover(function(){
$(this).stop().siblings(.rollover).fadeIn(300);
},function(){
$(this).stop().siblings(.rollover).fadeOut(300);
});
});


This is end the cycle

adamscybot wrote:

Hi,

This is my first time using jquery and Ive designed a small and simple
fadein/out script that acts as a rollover on this navigation bar:

http://relentless-servers.co.uk/Relentless%20Servers%20v3/

Here is the code:

$(document).ready(function() {
$(.navbutton).not(#active).hover(function(){
$(this).siblings(.rollover).fadeIn(300);
},function(){
$(this).siblings(.rollover).fadeOut(300);
});
});

It works great. However, if a user quickly moves their mouse over the
nav buttons and repeats the process, the rollover affect will fadein/
out over and over again until its completed the cycle the amount of
times the user moved the mouse over the button back and forth.

I wish to change this behaviour so that, somehow, the processing is
aborted if it is noticed the mouse is not present after a fadeout is
completed.

I have no idea how to go about this.

Regards,

Adam
  


[jQuery] Re: am searching popup plugin

2009-06-22 Thread Charlie





your not liking the answer doesn't constitute someone else not
understanding the question.

Here's a jqueryUI dialog that floats with scroll. There is another way
to do this by making it position:fixed but requires some position
calculation within viewport to offset the positon calculations in
dialog.js

would this work for you?

http://jsbin.com/awaki

bharani kumar wrote:
Hi all ,
  
  
  These plugin's are manual popup moving ,
  
  
  But i need ,
  
  
  when the parent scroll bar is is scrolling on that time i want
to down/ up the popup window ,
  
  
  May be u r not understand , please try to understand
myrequirement,
  
  
  Thanks
  
  On Mon, Jun 22, 2009 at 12:01 AM, Charlie charlie...@gmail.com
wrote:
  
not to mention jquery UI
 Dialog

http://jqueryui.com/demos/dialog/

options don't show how to set it fixed for scrolling but that's easily
modified with jquery.css()




brian wrote:

  jquery.popup? There are a couple of different versions of that, I think:

http://labs.wondergroup.com/demos/popup/index.html
http://plugins.jquery.com/project/popup

There's also jqModal:

http://dev.iceburg.net/jquery/jqModal/
http://www.queness.com/post/77/simple-jquery-modal-window-tutorial



On Sun, Jun 21, 2009 at 7:54 AM, bharani
kumarbharanikumariyer...@gmail.com wrote:
  
  
Himembers ,
Past couple of hours am searching the popup plugin ,
Am looking like
When i click the link , i want to open the popup window ,
I want to scroll the parent window ,even after popup window is opned ,
Tell me the plugin name ,

Thanks
B.S.Bharanikumar





  






  
  
  
  
  
-- 
Regards
B.S.Bharanikumar
  http://php-mysql-jquery.blogspot.com/
  






[jQuery] Re: How to abort fadein/out processing?

2009-06-22 Thread adamscybot

I tried this but it had no affect.

I also tried stop() after siblings(.rollover). which appears to work
but permanently breaks the nav bar if you move your mouse over it
quickly.


[jQuery] Re: How to abort fadein/out processing?

2009-06-22 Thread Liam Potter


ok, try this then

$(document).ready(function() {
   $(.navbutton).not(#active).hover(function(){
   $(this).stop().siblings(.rollover).animate({opacity: 1},300);
   },function(){
   $(this).stop().siblings(.rollover).animate({opacity: 0},300);
   });
});

adamscybot wrote:

I tried this but it had no affect.

I also tried stop() after siblings(.rollover). which appears to work
but permanently breaks the nav bar if you move your mouse over it
quickly.
  


[jQuery] Re: How to abort fadein/out processing?

2009-06-22 Thread adamscybot

This doesnt work at all, even without the stop().

Nav bar is unresponsive.


[jQuery] Re: Problems on IE7

2009-06-22 Thread Charlie





validator shows recurring ID's missing script type's, broken tags ,
invalid style placements, invalid xhtml tags etc,

http://validator.w3.org/check?verbose=1uri=http%3A%2F%2Fpjm.com


the errors part can be seen in web dev toolbar in firefox. Mostly they
are warnings and these seem to be quite common. The interesting part to
me was how often they refresh

I profess to not know much about rapidly updating pages like yours.
Validation can cause all sorts of wierd things in DOM manipulation,
likely best place to start

xoail wrote:

  What tool did you use to see all those errors? I tried firebug and
fiddler but they dont show much. Also, I tried on another PC and I got
the same problem with IE7.

Thanks!

On Jun 20, 6:04pm, Charlie charlie...@gmail.com wrote:
  
  
i tried this in IE 7 and was able to get to search after closing modal without complete lock up
page does however have a significant number of validation errors, multiple use of ID's, broken tags, invalid xhtml tags ,style tags inside body all over the place etc and error console keeps throwing about a hundred warnings every 10-15 seconds
some or all of these issues may be causing problems, validation might help
xoail wrote:Anybody? On Jun 19, 3:40pm, xoailmdsoh...@gmail.comwrote:Hi All, I've been literally pulling my hair out with this issue I have with our corporate website. The problem is with jquery light box (jqmodal) that freezes other controls after use in IE7. There seem to be no problem with IE6 or FF. If you go to p$j$m.com (remove $ signs), click Glossary (on top left) close it and then try to use search (top right), it freezes and then throws an error. Like I said, this issue only happens in IE7. I have a feeling that something in jqmodal isnt closing and its conflicting with other controls and IE7 is stupid enough to not identify and correct it. I would greatly appreciate any help in this regards. Thanks!

  
  
  






[jQuery] I am new to this Jquery....i need to display 4 messages(in news sectiiion) one after another in a div tag

2009-06-22 Thread anjith

i need to display 4 messages(in news sectiiion) one after another in a
div tag.as in yahooo.


[jQuery] Re: How to abort fadein/out processing?

2009-06-22 Thread Charlie





take a look at Hover Intent plugin, page explains your problem

http://cherne.net/brian/resources/jquery.hoverIntent.html

adamscybot wrote:

  This doesnt work at all, even without the stop().

Nav bar is unresponsive.

  






[jQuery] Re: How to abort fadein/out processing?

2009-06-22 Thread adamscybot

Very interesting.

Will post back with results.


[jQuery] Re: How to abort fadein/out processing?

2009-06-22 Thread adamscybot

I used the slightly better:

http://blog.threedubmedia.com/2008/08/eventspecialhover.html

Works well.

Thanks,

Adam


[jQuery] Re: I am new to this Jquery....i need to display 4 messages(in news sectiiion) one after another in a div tag

2009-06-22 Thread ryan.j

have a look at .append() and .appendTo() ( 
http://docs.jquery.com/Manipulation/append
and http://docs.jquery.com/Manipulation/appendTo )

append will add some content to the end of an element, append to will
append a specified element to another.

if that's all g(r)eek to you, here is a brief description. if you had
an element with the class 'el' and the content 'test test test' and
ran the following snipped of script against it...

$(.el).append(RYAN LIKES TO APPEND);

...your element.el would now say 'test test testRYAN LIKES TO APPEND'.
the additional text would also be appended to any other elements with
that class in the document. use an id for a unique instance.








On Jun 22, 2:34 pm, anjith anjithkumar.garap...@gmail.com wrote:
 i need to display 4 messages(in news sectiiion) one after another in a
 div tag.as in yahooo.


[jQuery] Re: jQuery returns [object Object] on a blank page -- i am a newbie please help

2009-06-22 Thread Joaquim

can anyone please help?

On Jun 17, 7:15 pm, Joaquim joaquim.joefernan...@gmail.com wrote:
 HI,

 i am trying to build a bookmarklet using jQuery to display a form in
 an overlay. The overlay displays displays correctly if I execute the
 code from a file. But once i move it to the href of a link, it returns
 a blank page with the javascript in the url and [object Object] in the
 body of the page. I am using load() function to load the html and css
 required.
 I am fairly new to jQuery and this is my first app. in jQuery. I dont
 know what i'am doing wrong.
 please help.
 The following is the code.

 body

 a href=javascript:
 var s=document.createElement('script');
 s.setAttribute('src','jquery.js');
 document.getElementsByTagName('head')[0].appendChild(s);
 alert('1');

 var tv = $('head').load('testcss.html');
 var tt = $('body').load('test.html');

 var popupStatus = 0;

 function loadPopup(){

         if(popupStatus==0){
                 $('#backgroundPopup').css({
                         'opacity': '0.7'
                 });
                 $('#backgroundPopup').fadeIn('slow');
                 $('#popup').fadeIn('slow');
                 popupStatus = 1;
         }

 }

 function centerPopup(){

         var windowWidth = document.documentElement.clientWidth;
         var windowHeight = document.documentElement.clientHeight;
         var popupHeight = $('#popup').height();
         var popupWidth = $('#popup').width();

         $('#popup').css({
                 'position': 'absolute',
                 'top': windowHeight/2-popupHeight/2,
                 'left': windowWidth/2-popupWidth/2
         });

         $('#backgroundPopup').css({
                 'height': windowHeight
         });

 }

 function disablePopup(){
         if(popupStatus==1){
                 $('#backgroundPopup').fadeOut('slow');
                 $('#popup').fadeOut('slow');
                 popupStatus = 0;
         }

 }

                 var tabContainers = $('div.tabs  div');
                 tabContainers.hide().filter('form').show();

                 $('div.tabs ul.tabNavigation a').click(function(){
                         tabContainers.hide();
                         tabContainers.filter(this.hash).show();
                         $('div.tabs ul.tabNavigation 
 a').removeClass('selected');
                         $(this.hash).addClass('selected');
                         return false;
                 }).filter(':first').click();

                 $(document).ready(function(){
                 centerPopup();
                 loadPopup();
         });
 
 Bookmarklet me
 /a
 pI am a P tag/p

 /body


[jQuery] Re: I am new to this Jquery....i need to display 4 messages(in news sectiiion) one after another in a div tag

2009-06-22 Thread waseem sabjee
I assume you with this done on an on click event


use the following html to test

div id=object
div
a class=displaymsg href=#Display Message/a
/div
/div


the script for the following html

script type=text/javascript

$(function() {
// wait for DOM to FULLY load

// declare the div with id=object as our refference point
var obj = $(#object);
//get the refference to the element we want to click
var displaymsg = $(a.displaymsg, obj);
// create our messages to test
var toDIsplay = [];
toDisplay.clickCount = 0;
toDisplay.message = new Array();
toDisplay.message[0] = Hi;
toDisplay.message[1] = Hello;
toDisplay.message[2] = bye;

// create the click event of the object
/*
i made this special
i display message relevant to the elements click count
if you want to display all the messages you could use a for loop :)
*/
displaymsg.click(function(e) {
e.preventDefault() // similar to return false
obj.append(toDisplay.message[toDisplay.clickCount]);
toDisplay.clickCount++;
});

});

/script
On Mon, Jun 22, 2009 at 4:07 PM, ryan.j ryan.joyce...@googlemail.comwrote:


 have a look at .append() and .appendTo() (
 http://docs.jquery.com/Manipulation/append
 and http://docs.jquery.com/Manipulation/appendTo )

 append will add some content to the end of an element, append to will
 append a specified element to another.

 if that's all g(r)eek to you, here is a brief description. if you had
 an element with the class 'el' and the content 'test test test' and
 ran the following snipped of script against it...

 $(.el).append(RYAN LIKES TO APPEND);

 ...your element.el would now say 'test test testRYAN LIKES TO APPEND'.
 the additional text would also be appended to any other elements with
 that class in the document. use an id for a unique instance.








 On Jun 22, 2:34 pm, anjith anjithkumar.garap...@gmail.com wrote:
  i need to display 4 messages(in news sectiiion) one after another in a
  div tag.as in yahooo.



[jQuery] SOT: Transparent AIR apps with custom chrome (using jQuery)

2009-06-22 Thread Andy Matthews

I just released another blog post in my jQuery and AIR series.

http://andymatthews.net/read/2009/06/21/jQuery-and-AIR:-Transparent-AIR-appl
ications-with-custom-chrome 



[jQuery] Re: Label disappears on validation

2009-06-22 Thread ypy

Why do the form's labels disappear once a required field is filled ?
I Use the last versions of jquery and validate plugin


On 18 juin, 11:52, ypy pgeorge@gmail.com wrote:
 Hi,

 Let me describe the problem I have to solve :

 When a field is unvalid : its label gets the errorClass class.
 Allright !

 When the field gets valid : the label, instead of only loosing the
 error class, completely disappears (style=display: none;).

 How can I keep my labels displayed when the validation is OK ?

 I described this as a bug  (http://plugins.jquery.com/node/8592), I
 have been answered : Adding the errorClass to the regular element
 doesn't work - the plugin uses the errorClass to find the label to
 show/hide. Use a different class (with the same styles) to fix this.

 I understood I had to specify an errorClass, but it doesn't solve the
 problem.

 Any idea ?

 Ypy

 -
 Here is the source code used :

 jQuery.extend(jQuery.validator.messages, {
   // quand le champ est invalide
     email: Veuillez entrer une adresse email valide.,
   });
 $(document).ready(function() {

 // validate signup form on keyup and submit
 var validator = $(#formulaire).validate({
 rules: {
 Nom: required,
 Email: {
 required: true,
 email: true,

 },
 },

 errorClass: champrequisvide,

 errorContainer: #messageChampsManquants,

 // classe à appliquer pour les champs manquants et leurs labels
 highlight: function(element, errorClass) {
      $(element).addClass(errorClass);
      $(element.form).find(label[for= + element.id + ]).addClass
 (errorClass);
   },

   unhighlight: function(element, errorClass) {
      $(element).removeClass(errorClass);
      $(element.form).find(label[for= + element.id + ]).removeClass
 (errorClass);
   },

 });
 });

 PS : It seems it has been solved there (at least for select fields,
 doesn't work for text 
 inputs):http://groups.google.com/group/jquery-en/browse_thread/thread/d643212792...


[jQuery] Re: am searching popup plugin

2009-06-22 Thread bharani kumar
Hi Thanks , useful one ,

On Mon, Jun 22, 2009 at 6:39 PM, Charlie charlie...@gmail.com wrote:

  your not liking the answer doesn't constitute someone else not
 understanding the question.

 Here's a jqueryUI dialog that floats with scroll. There is another way to
 do this by making it position:fixed but requires some position calculation
 within viewport to offset the positon calculations in dialog.js

 would this work for you?

 http://jsbin.com/awaki


 bharani kumar wrote:

 Hi all ,
  These plugin's are manual popup moving ,

  But i need  ,

  when the parent scroll bar is is scrolling on that time i want to down/
 up the popup window ,

  May be u r not understand , please try to understand my requirement ,

  Thanks

 On Mon, Jun 22, 2009 at 12:01 AM, Charlie charlie...@gmail.com wrote:

 not to mention jquery UIDialog

 http://jqueryui.com/demos/dialog/

 options don't show how to set it fixed for scrolling but that's easily
 modified with  jquery.css()


 brian wrote:

 jquery.popup? There are a couple of different versions of that, I think:
 http://labs.wondergroup.com/demos/popup/index.htmlhttp://plugins.jquery.com/project/popup

 There's also jqModal:
 http://dev.iceburg.net/jquery/jqModal/http://www.queness.com/post/77/simple-jquery-modal-window-tutorial



 On Sun, Jun 21, 2009 at 7:54 AM, bharani
 kumarbharanikumariyer...@gmail.com bharanikumariyer...@gmail.com wrote:


  Hi members ,
 Past couple of hours am searching the popup plugin ,
 Am looking like
 When i click the link , i want to open the popup window ,
 I want to scroll the parent window ,even  after  popup window is opned ,
 Tell me the plugin name ,

 Thanks
 B.S.Bharanikumar










 --
 Regards
 B.S.Bharanikumar
 http://php-mysql-jquery.blogspot.com/





-- 
Regards
B.S.Bharanikumar
http://php-mysql-jquery.blogspot.com/


[jQuery] Re: Label disappears on validation

2009-06-22 Thread Jörn Zaefferer

Because you are adding the error class to your default label, and the
validation plugin uses that to identify the generated error labels.
Use a different class in your highlight/unhighlight options, with the
same styles, and it'll work.

Jörn

On Mon, Jun 22, 2009 at 4:46 PM, ypypgeorge@gmail.com wrote:

 Why do the form's labels disappear once a required field is filled ?
 I Use the last versions of jquery and validate plugin


 On 18 juin, 11:52, ypy pgeorge@gmail.com wrote:
 Hi,

 Let me describe the problem I have to solve :

 When a field is unvalid : its label gets the errorClass class.
 Allright !

 When the field gets valid : the label, instead of only loosing the
 error class, completely disappears (style=display: none;).

 How can I keep my labels displayed when the validation is OK ?

 I described this as a bug  (http://plugins.jquery.com/node/8592), I
 have been answered : Adding the errorClass to the regular element
 doesn't work - the plugin uses the errorClass to find the label to
 show/hide. Use a different class (with the same styles) to fix this.

 I understood I had to specify an errorClass, but it doesn't solve the
 problem.

 Any idea ?

 Ypy

 -
 Here is the source code used :

 jQuery.extend(jQuery.validator.messages, {
   // quand le champ est invalide
     email: Veuillez entrer une adresse email valide.,
   });
 $(document).ready(function() {

 // validate signup form on keyup and submit
 var validator = $(#formulaire).validate({
 rules: {
 Nom: required,
 Email: {
 required: true,
 email: true,

 },
 },

 errorClass: champrequisvide,

 errorContainer: #messageChampsManquants,

 // classe à appliquer pour les champs manquants et leurs labels
 highlight: function(element, errorClass) {
      $(element).addClass(errorClass);
      $(element.form).find(label[for= + element.id + ]).addClass
 (errorClass);
   },

   unhighlight: function(element, errorClass) {
      $(element).removeClass(errorClass);
      $(element.form).find(label[for= + element.id + ]).removeClass
 (errorClass);
   },

 });
 });

 PS : It seems it has been solved there (at least for select fields,
 doesn't work for text 
 inputs):http://groups.google.com/group/jquery-en/browse_thread/thread/d643212792...


[jQuery] jQuery Autocomplete - After service call if result is NULL then layer should be invisible

2009-06-22 Thread Dushyant Patel

Hello,

I am using jQuery Autocomplete Plug-ins(http://bassistance.de/jquery-
plugins/jquery-plugin-autocomplete/).

Let me explain my problem:

If i am looking for shirt and star typing shi and it showing me 10
results for shirt, but now after shi if i type like shixyzyz it
should clear list and hide autocomplete layer.

In my case it is not doing that. Layer stay there with old results.

Pleaes note that i am making service call using JSONP and following is
my code.

$j(.autocomplete).autocomplete('URL/Service.svc/REST/SEARCH/', {
minChars: 3,
matchContains: true,
selectFirst: false,
cacheLength: 0,
width:307,
dataType: jsonp,

any suggestion or hint on this.

Please help me.

Thanks in advance.



[jQuery] Re: jQuery Autocomplete - After service call if result is NULL then layer should be invisible

2009-06-22 Thread Jörn Zaefferer

What happens when your service doesn't return a result? As long as it
returns an empty result (not an error), it should work fine.

Jörn

On Mon, Jun 22, 2009 at 5:01 PM, Dushyant Patelpatel.dushy...@gmail.com wrote:

 Hello,

 I am using jQuery Autocomplete Plug-ins(http://bassistance.de/jquery-
 plugins/jquery-plugin-autocomplete/).

 Let me explain my problem:

 If i am looking for shirt and star typing shi and it showing me 10
 results for shirt, but now after shi if i type like shixyzyz it
 should clear list and hide autocomplete layer.

 In my case it is not doing that. Layer stay there with old results.

 Pleaes note that i am making service call using JSONP and following is
 my code.

 $j(.autocomplete).autocomplete('URL/Service.svc/REST/SEARCH/', {
                minChars: 3,
                matchContains: true,
                selectFirst: false,
                cacheLength: 0,
                width:307,
                dataType: jsonp,

 any suggestion or hint on this.

 Please help me.

 Thanks in advance.




[jQuery] Re: I am new to this Jquery....i need to display 4 messages(in news sectiiion) one after another in a div tag

2009-06-22 Thread Charlie





waseem, why would you make this so complicated for someone just
learning jquery?

OP didn't provide any info on where messages are coming from. Creating
arrays, click counts etc when you don't have enough information to set
anything up is very likely going to confuse someone. A couple of simple
questions would be far more appropriate

Suppose these messages are already in a file and all that is needed is
$("#messageDiv").load("messageFile.html"); How would your solution help
out?

perhaps OP is looking for guidance on how to get these messages to the
page. Writing a bunch of long winded code based completely on
assumptions doesn't help anyone, especially if it doesn't suit the need
of situation. 

Good starting point would be:

What is source of 4 messages? (already in page, external file, database
etc)

if already in page  provide dom manipulation guidance
if in external file  provide .load() guidance
if in db or other source  provide appropriate guidance


waseem sabjee wrote:
I assume you with this done on an on click event
  
  
use the following html to test
  
div id="object"
div
a class="displaymsg" href=""Display Message/a
/div
/div
  
  
the script for the following html
  
script type="text/_javascript_"
  
$(function() {
// wait for DOM to FULLY load
  
// declare the div with id="object" as our refference point
var obj = $("#object");
//get the refference to the element we want to click
var displaymsg = $("a.displaymsg", obj);
// create our messages to test
var toDIsplay = [];
toDisplay.clickCount = 0;
toDisplay.message = new Array();
toDisplay.message[0] = "Hi";
toDisplay.message[1] = "Hello";
toDisplay.message[2] = "bye";
  
// create the click event of the object
/*
i made this special
i display message relevant to the elements click count
if you want to display all the messages you could use a for loop :)
*/
displaymsg.click(function(e) {
e.preventDefault() // similar to return false
obj.append(toDisplay.message[toDisplay.clickCount]);
toDisplay.clickCount++;
});
  
});
  
/script
  On Mon, Jun 22, 2009 at 4:07 PM, ryan.j ryan.joyce.uk@googlemail.com
wrote:
  
have a look at .append() and .appendTo() ( http://docs.jquery.com/Manipulation/append
and http://docs.jquery.com/Manipulation/appendTo
)

append will add some content to the end of an element, append to will
append a specified element to another.

if that's all g(r)eek to you, here is a brief description. if you had
an element with the class 'el' and the content 'test test test' and
ran the following snipped of script against it...

$(".el").append("RYAN LIKES TO APPEND");

...your element.el would now say 'test test testRYAN LIKES TO APPEND'.
the additional text would also be appended to any other elements with
that class in the document. use an id for a unique instance.









On Jun 22, 2:34pm, anjith anjithkumar.garap...@gmail.com
wrote:
 i need to display 4 messages(in news sectiiion) one after another
in a
 div tag.as in yahooo.

  
  
  






[jQuery] Re: Label disappears on validation

2009-06-22 Thread ypy

Thank you for your answer. It works !!

But know I have another problem : a new unwanted label appears...
label class=champrequisvide for=Code_Postal generated=true
style=display: inline;This field is required./label

Can you tell me how to hide that one ?


errorClass: champrequisvide,

errorContainer: #messageChampsManquants, // div qui indique 
que
les champs ne sont pas correctement remplis

// classe à appliquer pour les champs manquants et leurs labels
highlight: function(element, errorClass) {
$(element).addClass(errorClass);
$(element.form).find(label[for= + element.id + ]).addClass
(labelrequisvide);
},

unhighlight: function(element, errorClass) {
$(element).removeClass(errorClass);
$(element.form).find(label[for= + element.id +
]).removeClass(labelrequisvide);
}



On 22 juin, 16:50, Jörn Zaefferer joern.zaeffe...@googlemail.com
wrote:
 Because you are adding the error class to your default label, and the
 validation plugin uses that to identify the generated error labels.
 Use a different class in your highlight/unhighlight options, with the
 same styles, and it'll work.

 Jörn

 On Mon, Jun 22, 2009 at 4:46 PM, ypypgeorge@gmail.com wrote:

  Why do the form's labels disappear once a required field is filled ?
  I Use the last versions of jquery and validate plugin

  On 18 juin, 11:52, ypy pgeorge@gmail.com wrote:
  Hi,

  Let me describe the problem I have to solve :

  When a field is unvalid : its label gets the errorClass class.
  Allright !

  When the field gets valid : the label, instead of only loosing the
  error class, completely disappears (style=display: none;).

  How can I keep my labels displayed when the validation is OK ?

  I described this as a bug  (http://plugins.jquery.com/node/8592), I
  have been answered : Adding the errorClass to the regular element
  doesn't work - the plugin uses the errorClass to find the label to
  show/hide. Use a different class (with the same styles) to fix this.

  I understood I had to specify an errorClass, but it doesn't solve the
  problem.

  Any idea ?

  Ypy

  -
  Here is the source code used :

  jQuery.extend(jQuery.validator.messages, {
    // quand le champ est invalide
      email: Veuillez entrer une adresse email valide.,
    });
  $(document).ready(function() {

  // validate signup form on keyup and submit
  var validator = $(#formulaire).validate({
  rules: {
  Nom: required,
  Email: {
  required: true,
  email: true,

  },
  },

  errorClass: champrequisvide,

  errorContainer: #messageChampsManquants,

  // classe à appliquer pour les champs manquants et leurs labels
  highlight: function(element, errorClass) {
       $(element).addClass(errorClass);
       $(element.form).find(label[for= + element.id + ]).addClass
  (errorClass);
    },

    unhighlight: function(element, errorClass) {
       $(element).removeClass(errorClass);
       $(element.form).find(label[for= + element.id + ]).removeClass
  (errorClass);
    },

  });
  });

  PS : It seems it has been solved there (at least for select fields,
  doesn't work for text 
  inputs):http://groups.google.com/group/jquery-en/browse_thread/thread/d643212792...


[jQuery] Re: Form Validation Plugin: customize input validation

2009-06-22 Thread Loony2nz

OICok.  i'm not really good with regular expressions (hell, i'm
absolutely horrible at it), but I'll give it a shot.

On Jun 22, 1:15 am, Jörn Zaefferer joern.zaeffe...@googlemail.com
wrote:
 You can write a custom 
 method:http://docs.jquery.com/Plugins/Validation/Validator/addMethod

 Jörn

 On Mon, Jun 22, 2009 at 7:21 AM, Loony2nzloony...@gmail.com wrote:

  This is in regards to Jörn Zaefferer's plug in.

  How do you customize input validation so that I can remove foul
  language?

  So that first name or last name doesn't have f*ck you or something
  like that.

  is this possible?

  Thanks!


[jQuery] Re: Problems on IE7

2009-06-22 Thread xoail

Yeah now I see the errors... but what I cant understand is why would
it work when I dont click glossary and directly go to search?

The issue only occurs when glossary is used first and then search but
if I hit search before using glossary, it works fine.

If it had to do with validations, I would assume it wont work at all
irrespective of whether I use glossary or not.. but I could be wrong..
my knowledge of javascript and jquery is very limited so I desperately
need some help...

I am trying to fix some of those errors relating to ID values being
same... if you can think of anything else please do let me know.

Thanks a lot for helping me with this...


On Jun 22, 9:31 am, Charlie charlie...@gmail.com wrote:
 validator shows recurring ID's missing script type's, broken tags , invalid 
 style placements, invalid xhtml tags  
 etc,http://validator.w3.org/check?verbose=1uri=http%3A%2F%2Fpjm.com
 the errors part can be seen in web dev toolbar in firefox. Mostly they are 
 warnings and these seem to be quite common. The interesting part to me was 
 how often they refresh
 I profess to not know much about rapidly updating  pages like yours. 
 Validation can cause all sorts of wierd things in DOM manipulation, likely 
 best place to start
 xoail wrote:What tool did you use to see all those errors? I tried firebug 
 and fiddler but they dont show much. Also, I tried on another PC and I got 
 the same problem with IE7. Thanks! On Jun 20, 6:04 pm, 
 Charliecharlie...@gmail.comwrote:i tried this in IE 7 and was able to get 
 to search after closing modal without complete lock up page does however have 
 a significant number of validation errors, multiple use of ID's,  broken 
 tags, invalid xhtml tags ,style tags inside body all over the place etc and 
 error console keeps throwing about a hundred warnings every 10-15 seconds 
 some or all of these issues may be causing problems, validation might help 
 xoail wrote:Anybody? On Jun 19, 3:40 pm, xoailmdsoh...@gmail.comwrote:Hi 
 All, I've been literally pulling my hair out with this issue I have with our 
 corporate website. The problem is with jquery light box (jqmodal) that 
 freezes other controls after use  in IE7. There seem to be no problem with 
 IE6 or FF. If you go to p$j$m.com (remove $ signs), click Glossary (on top 
 left) close it and then try to use search (top right), it freezes and then 
 throws an error. Like I said, this issue only happens in IE7. I have a 
 feeling that something in jqmodal isnt closing and its conflicting with other 
 controls and IE7 is stupid enough to not identify and correct it. I would 
 greatly appreciate any help in this regards. Thanks!


[jQuery] Re: I am new to this Jquery....i need to display 4 messages(in news sectiiion) one after another in a div tag

2009-06-22 Thread waseem sabjee
I'm just providing alternate ways because i do not have enough information.

On Mon, Jun 22, 2009 at 5:11 PM, Charlie charlie...@gmail.com wrote:

  waseem, why would you make this so complicated for someone just learning
 jquery?

 OP didn't provide any info on where messages are coming from. Creating
 arrays, click counts etc when you don't have enough information to set
 anything up is very likely going to confuse someone. A couple of simple
 questions would  be far more appropriate

 Suppose these messages are already in a file and all that is needed is
 $(#messageDiv).load(messageFile.html); How would your solution help out?

 perhaps OP is looking for guidance on how to get these messages to the
 page. Writing a bunch of long winded code based completely on assumptions
 doesn't help anyone, especially if it doesn't suit the need of situation.

 Good starting point would be:

 What is source of 4 messages? (already in page, external file, database
 etc)

 if already in page  provide dom manipulation guidance
 if in external file  provide .load() guidance
 if in db or other source  provide appropriate guidance



 waseem sabjee wrote:

 I assume you with this done on an on click event


 use the following html to test

 div id=object
 div
 a class=displaymsg href=#Display Message/a
 /div
 /div


 the script for the following html

 script type=text/javascript

 $(function() {
 // wait for DOM to FULLY load

 // declare the div with id=object as our refference point
 var obj = $(#object);
 //get the refference to the element we want to click
 var displaymsg = $(a.displaymsg, obj);
 // create our messages to test
 var toDIsplay = [];
 toDisplay.clickCount = 0;
 toDisplay.message = new Array();
 toDisplay.message[0] = Hi;
 toDisplay.message[1] = Hello;
 toDisplay.message[2] = bye;

 // create the click event of the object
 /*
 i made this special
 i display message relevant to the elements click count
 if you want to display all the messages you could use a for loop :)
 */
 displaymsg.click(function(e) {
 e.preventDefault() // similar to return false
 obj.append(toDisplay.message[toDisplay.clickCount]);
 toDisplay.clickCount++;
 });

 });

 /script
 On Mon, Jun 22, 2009 at 4:07 PM, ryan.j ryan.joyce...@googlemail.comwrote:


 have a look at .append() and .appendTo() (
 http://docs.jquery.com/Manipulation/append
 and http://docs.jquery.com/Manipulation/appendTo )

 append will add some content to the end of an element, append to will
 append a specified element to another.

 if that's all g(r)eek to you, here is a brief description. if you had
 an element with the class 'el' and the content 'test test test' and
 ran the following snipped of script against it...

 $(.el).append(RYAN LIKES TO APPEND);

 ...your element.el would now say 'test test testRYAN LIKES TO APPEND'.
 the additional text would also be appended to any other elements with
 that class in the document. use an id for a unique instance.








 On Jun 22, 2:34 pm, anjith anjithkumar.garap...@gmail.com wrote:
  i need to display 4 messages(in news sectiiion) one after another in a
  div tag.as in yahooo.






[jQuery] Re: Potential blind sql injection vulnerability with Superfish JS?

2009-06-22 Thread gremlin

The other possibility is that it isn't the suckerfish code, but the
actual links you have in your markup that get turned into the menu. If
you are handling query string params in any of those links I would
start looking there.

On Jun 19, 1:45 pm, Olivier Percebois-Garve perceb...@gmail.com
wrote:
 I dont see how superfish relates to sql.
 Aren't they rather referring to the server-side code handling the
 navigation ?

 NationPress wrote:
  The client we're building a site for recently had a server wide scan
  done by SecurityMetrics.com for PCI compliance. This was required by
  their banks commercial credit card service. The report came back with
  a Possible blind sql injection vulnerability warning level 4 out of
  7 for the Superfish menu javascript. Anything 4 and above keeps them
  out of compliance. This file is for the Superfish menu. Is there a
  workaround for this potential issue?


[jQuery] Is this the correct way to get the value of a checked radio input?

2009-06-22 Thread Rick Faircloth
$('inp...@name=deals]:checked').val(),
I'm having some trouble getting the right results and trying to narrow down
the problem...

Thanks,

Rick


Ninety percent of the politicians give the other ten percent a bad
reputation.  Henry Kissinger


[jQuery] Re: Is this the correct way to get the value of a checked radio input?

2009-06-22 Thread waseem sabjee
remove the @ symbol

On Mon, Jun 22, 2009 at 5:40 PM, Rick Faircloth r...@whitestonemedia.comwrote:

 $(
 'inp...@name=deals]:checked').val(),
 I'm having some trouble getting the right results and trying to narrow down
 the problem...
 Thanks,

 Rick


 
 Ninety percent of the politicians give the other ten percent a bad
 reputation.  Henry Kissinger



[jQuery] jquery-ui dialog and ajax issues updating from 1.2.6 to 1.3.2

2009-06-22 Thread Etienne Robillard


Hi,

I'm using jquery-ui 1.6 custom build with jquery 1.2.6 trying to
set up a dialog window. Unfortunately I can't update to 1.3.2 since this
would trigger some unexpected XHR-related bugs like the following:

Exception ``TypeError: M.xhr is not a function'' thrown from function
anonymous(M=Object:{12}) in
http://localhost/media/js/jquery/jquery-1.3.2.min.js

So I'm sticking with the 1.2.6 build, which works fine despite a
minor/not-critical XHR issue:

Exception ``TypeError: s.accepts is undefined'' thrown from function
anonymous(s=Object:{12}) in
http://localhost/media/js/jquery/jquery-1.2.6.pack.js

Notice that this error is reported in FireBug/Venkman, however Firefox
doesn't seem to care and let the XMLHTTPRequest to execute successfully.

The code for the dialog window is given below. I don't seem to
understand why posted data cannot be shown on the dialog box twice.

Moreover, it will display it as I want on the first $.post request but
any additional requests triggered with a click event don't show any
updated data on the dialog box. Venkman reports that the anonymous
callback function manages to obtain the updated data, but still nothing
get shown on the dialog, just an empty div... ;-)

Any help or advices for debugging this issue?

Best regards,
Etienne


This is the script that gets evaluated by jQuery (using $.get(...)). A
json object is returned by the server either containing form validation
errors or a result object that contains simple strings.

script type=text/javascript
$(function(){

$('#'+'formControlBtn').bind('click', function(){
//send the form with a ajax request. on success,
//return a comment preview.
var formData = $('#'+'commentform').serialize();

//one-liner to remove old error messages before posting a new comment
$('p.error').each(function(){$(this).remove()});

$.post('comment', formData, function(json) {
var result = json.errordict || json.comment;

if (result == json.comment) {
// Look for the comment preview..
// Display a pop-up window (dialog) with the comment preview
// in HTML. By clicking on OK or Save the user has no more
// undo chances and the comment will be made.
var commentHTMLDialog = $('div id=commentDialog
class=ui-dialog ui-widget ui-content\/div');

// Set a title
$(commentHTMLDialog).attr('title', 'Preview comment');

// Setup default dialog constructor options
$(commentHTMLDialog).dialog({
autoOpen: true,
bgiframe: false, // must keep this for IE6? default =
'dont care'
width: 500,
modal: true, // prevent reposting while the dialog
is enabled
dialogClass: 'generic',
height: 400,
overlay: {
backgroundColor: '#000',
opacity: 0.5
},
buttons: {
It's all good, add my comment please. : function() {
$(this).dialog('close');
 },
 Cancel: function() {
$(this).dialog('close');
 }
},
open: function() {
// Constructor to define what to do when opening
// the dialog widget
var commentHTMLBody = $(ul
id='commentHTMLBody'/ul);
$(commentHTMLBody).prependTo($(commentHTMLDialog));
for (var x in result) {
// create the template on the fly
$('li'+x+':
'+result[x]+'\/li').appendTo('#'+'commentHTMLBody');
};

} //open
});

$(commentHTMLDialog).dialog('open');
return false;
//$('#'+'commentForm').html('Thanks for your input!');
} else {
// found some validation errors
for (var x in result) {
$('p class=error'+'b'+x+':
\/b'+result[x]+'\/p').appendTo('#'+'commentForm');
};
};
}, json);
return false;
});
});
/script



-- 
Etienne Robillard robillard.etie...@gmail.com
Green Tea Hackers Club http://gthc.org/
Blog: http://gthc.org/blog/
PGP Fingerprint: AED6 B33B B41D 5F4F A92A  2B71 874C FB27 F3A9 BDCC


[jQuery] Click events handling conflict due to prototype?

2009-06-22 Thread Steve the Canuck

Hi,

I have a simple list inside a table

ul class=col_actions
li class=cancel_posting
a href=/frontend_dev.php/organizer/cancel-booking/20
linkindex=18Cancel/a
/li
/ul

I have a ready event handler for click events on the anchor:

$j('.cancel_posting').click( function(e) {
if (!confirm(Are you sure you want to cancel this booking?)) {
e.preventDefault();
}
});

However, this event doesn't seem to fire because the table has some
prototype controls inside it.

If I just copy the list outside the table as a test, it seems like the
event handler works fine.

I am using jquery for all my own code, but some widgets from my PHP
framework (symfony) are built in prototype, so I've been using both to
some extent.

Any ideas about how I can rectify this?

Thanks!
Steve


[jQuery] Re: Array to JSON?

2009-06-22 Thread diogobaeder

Hmmm... why would one use this plugin if we have Douglas Crockford's
json2.org, which is the original JSON library from the same creator of
the concept JSON? And why load more modules into the main jQuery
object, making it heavier, if we don't use DOM element wrappers in the
plugin, only conversions to/from JS objects?

Sorry, I don't mean to be harsh, but it seems to me that this plugin
is a reinvented wheel, and also that it didn't have to be a jQuery
plugin to work. Does it have anything that we can't see in json2.org?

Diogo



On Jun 21, 11:39 pm, kranthi kranthi...@gmail.com wrote:
 are u looking forhttp://www.google.co.in/search?q=jquery+json+plugin?


[jQuery] Re: How to abort fadein/out processing?

2009-06-22 Thread adamscybot

Just a quick update. I found a better solution. This works 100%:

$(document).ready(function() {

$('.navbutton').not(#active).siblings(.rollover).css({ opacity:0,
display:'block' });

$(.navbutton).not(#active).hover(function(){
$(this).siblings(.rollover).stop();
$(this).siblings(.rollover).animate({ opacity:1 },
150);
},function(){
$(this).siblings(.rollover).animate({ opacity:0 },
150);
});

});


[jQuery] Re: Problems on IE7

2009-06-22 Thread Charlie





I'm far from an expert but your glossary is using a script to
manipulate the DOM. If DOM isn't valid, scripts manipulating it are
likely to have problems. A lot of behind the scenes repositioning,
styling etc occur to tags in browser when manipulation scripts run so
it only makes sense that tag problems will cause script problems,
resulting in page problems

best guess is after you use glossary, browser isn't able to reassemble
DOM exactly, or has memory problems or ..your guess is good as mine



xoail wrote:

  Yeah now I see the errors... but what I cant understand is why would
it work when I dont click glossary and directly go to search?

The issue only occurs when glossary is used first and then search but
if I hit search before using glossary, it works fine.

If it had to do with validations, I would assume it wont work at all
irrespective of whether I use glossary or not.. but I could be wrong..
my knowledge of _javascript_ and jquery is very limited so I desperately
need some help...

I am trying to fix some of those errors relating to ID values being
same... if you can think of anything else please do let me know.

Thanks a lot for helping me with this...


On Jun 22, 9:31am, Charlie charlie...@gmail.com wrote:
  
  
validator shows recurring ID's missing script type's, broken tags , invalid style placements, invalid xhtml tags etc,http://validator.w3.org/check?verbose=1uri=http%3A%2F%2Fpjm.com
the errors part can be seen in web dev toolbar in firefox. Mostly they are warnings and these seem to be quite common. The interesting part to me was how often they refresh
I profess to not know much about rapidly updating pages like yours. Validation can cause all sorts of wierd things in DOM manipulation, likely best place to start
xoail wrote:What tool did you use to see all those errors? I tried firebug and fiddler but they dont show much. Also, I tried on another PC and I got the same problem with IE7. Thanks! On Jun 20, 6:04pm, Charliecharlie...@gmail.comwrote:i tried this in IE 7 and was able to get to search after closing modal without complete lock up page does however have a significant number of validation errors, multiple use of ID's, broken tags, invalid xhtml tags ,style tags inside body all over the place etc and error console keeps throwing about a hundred warnings every 10-15 seconds some or all of these issues may be causing problems, validation might help xoail wrote:Anybody? On Jun 19, 3:40pm, xoailmdsoh...@gmail.comwrote:Hi All, I've been literally pulling my hair out with this issue I have with our corporate w
ebsite. The problem is with jquery light box (jqmodal) that freezes other controls after use in IE7. There seem to be no problem with IE6 or FF. If you go to p$j$m.com (remove $ signs), click Glossary (on top left) close it and then try to use search (top right), it freezes and then throws an error. Like I said, this issue only happens in IE7. I have a feeling that something in jqmodal isnt closing and its conflicting with other controls and IE7 is stupid enough to not identify and correct it. I would greatly appreciate any help in this regards. Thanks!

  
  
  






[jQuery] Re: Label disappears on validation

2009-06-22 Thread ypy

Yeah !! Wonderful !
Thank you very much, it works :
label.champrequisvide { display: none !important; }

On 22 juin, 18:05, Jörn Zaefferer joern.zaeffe...@googlemail.com
wrote:
 Try this:

 .champrequisvide { display: none !important; }

 Jörn

 On Mon, Jun 22, 2009 at 5:17 PM, ypypgeorge@gmail.com wrote:
  champrequisvide


[jQuery] Re: Click events handling conflict due to prototype?

2009-06-22 Thread Steve the Canuck

Btw... I do have a workaround - register my click event on something
outside the table, such as the body tag, and then check the original
event target.  I'd prefer to target just the list item and anchor
though if possible.

On Jun 22, 11:14 am, Steve the Canuck steve.san...@gmail.com wrote:
 Hi,

 I have a simple list inside a table

 ul class=col_actions
 li class=cancel_posting
 a href=/frontend_dev.php/organizer/cancel-booking/20
 linkindex=18Cancel/a
 /li
 /ul

 I have a ready event handler for click events on the anchor:

         $j('.cancel_posting').click( function(e) {
                 if (!confirm(Are you sure you want to cancel this 
 booking?)) {
                         e.preventDefault();
                 }
         });

 However, this event doesn't seem to fire because the table has some
 prototype controls inside it.

 If I just copy the list outside the table as a test, it seems like the
 event handler works fine.

 I am using jquery for all my own code, but some widgets from my PHP
 framework (symfony) are built in prototype, so I've been using both to
 some extent.

 Any ideas about how I can rectify this?

 Thanks!
 Steve


[jQuery] Re: Label disappears on validation

2009-06-22 Thread Jörn Zaefferer

Try this:

.champrequisvide { display: none !important; }

Jörn

On Mon, Jun 22, 2009 at 5:17 PM, ypypgeorge@gmail.com wrote:
 champrequisvide


[jQuery] Re: Error : 'document' is undefined

2009-06-22 Thread Charlie






try here: http://jquery.com/

if you plan on using jquery much or any web development install Firefox
and Firebug extension. Far more friendly development browser

if you can't download from above site the following is Google hosted
jquery and is great way to use it, no file paths or downloads to worry
about and there are some other advantages to using this method

script type="text/_javascript_"
src="" class="moz-txt-link-rfc2396E" href="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js">"http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"/script



nanditha k wrote:

  Thanx Kalyan,
  
  But the problem still persists. I am still unable to download
the Jquery from the site.
  
  Have attached the screen shot of theexception generated.Let me
know what am I missing.
  
  Thank you,
  
  

  On Sat, Jun 20, 2009 at 8:06 AM, kalyan
Chatterjee kalyan11021...@gmail.com
wrote:
  
Place your jquery include tag at first then other _javascript_ file
attachment. Hope your problem gone!

On Jun 20, 12:21am, nanditha k nandithak2...@gmail.com
wrote:
 http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.3.2


 On Fri, Jun 19, 2009 at 1:53 PM, amuhlou amysch...@gmail.com
wrote:

  can you post a link to the page where this is happening?

  On Jun 19, 12:47 pm, gits nandithak2...@gmail.com
wrote:
   I am not able to install JQuery , While installing I
have following
   error -
   Error : 'document' is undefined
   Line : 12.

   Could you please gimme a solution?

   Thank you

  
  
  






[jQuery] Re: Is this the correct way to get the value of a checked radio input?

2009-06-22 Thread Rick Faircloth
Excellent...thanks, Waseem...

Rick

On Mon, Jun 22, 2009 at 11:49 AM, waseem sabjee waseemsab...@gmail.comwrote:

 remove the @ symbol


 On Mon, Jun 22, 2009 at 5:40 PM, Rick Faircloth 
 r...@whitestonemedia.comwrote:

 $(
 'inp...@name=deals]:checked').val(),
 I'm having some trouble getting the right results and trying to narrow
 down the problem...
 Thanks,

 Rick


 
 Ninety percent of the politicians give the other ten percent a bad
 reputation.  Henry Kissinger





-- 
--
Ninety percent of the politicians give the other ten percent a bad
reputation.  Henry Kissinger


[jQuery] basic jQuery/JavaScript pattern

2009-06-22 Thread jerome

I keep running across this type of pattern in the jquery source code.

(function(){

...

})();

How is this basic to understanding how jQuery works, and how
JavaScript works?

Thanks in advance.


[jQuery] Re: basic jQuery/JavaScript pattern

2009-06-22 Thread Charlie





since jquery is _javascript_, and probably the best reference on the web
for learning _javascript_ ( and many other languages) is 
w3schools.com try this link:

http://www.w3schools.com/js/js_functions.asp

hard to beat their explanations and "try it yourself" examples


jerome wrote:

  I keep running across this type of pattern in the jquery source code.

(function(){

...

})();

How is this basic to understanding how jQuery works, and how
_javascript_ works?

Thanks in advance.

  






[jQuery] Re: jquery-ui dialog and ajax issues updating from 1.2.6 to 1.3.2

2009-06-22 Thread James

When you update jQuery to 1.3+ from an older version, you also have to
update your UI library to 1.7+ because jQuery 1.3+ is not compatible
with older versions of jQuery UI.

On Jun 22, 5:25 am, Etienne Robillard robillard.etie...@gmail.com
wrote:
 Hi,

 I'm using jquery-ui 1.6 custom build with jquery 1.2.6 trying to
 set up a dialog window. Unfortunately I can't update to 1.3.2 since this
 would trigger some unexpected XHR-related bugs like the following:

 Exception ``TypeError: M.xhr is not a function'' thrown from function
 anonymous(M=Object:{12}) in
 http://localhost/media/js/jquery/jquery-1.3.2.min.js

 So I'm sticking with the 1.2.6 build, which works fine despite a
 minor/not-critical XHR issue:

 Exception ``TypeError: s.accepts is undefined'' thrown from function
 anonymous(s=Object:{12}) in
 http://localhost/media/js/jquery/jquery-1.2.6.pack.js

 Notice that this error is reported in FireBug/Venkman, however Firefox
 doesn't seem to care and let the XMLHTTPRequest to execute successfully.

 The code for the dialog window is given below. I don't seem to
 understand why posted data cannot be shown on the dialog box twice.

 Moreover, it will display it as I want on the first $.post request but
 any additional requests triggered with a click event don't show any
 updated data on the dialog box. Venkman reports that the anonymous
 callback function manages to obtain the updated data, but still nothing
 get shown on the dialog, just an empty div... ;-)

 Any help or advices for debugging this issue?

 Best regards,
 Etienne

 This is the script that gets evaluated by jQuery (using $.get(...)). A
 json object is returned by the server either containing form validation
 errors or a result object that contains simple strings.

 script type=text/javascript
 $(function(){

 $('#'+'formControlBtn').bind('click', function(){
     //send the form with a ajax request. on success,
     //return a comment preview.
     var formData = $('#'+'commentform').serialize();

     //one-liner to remove old error messages before posting a new comment
     $('p.error').each(function(){$(this).remove()});

     $.post('comment', formData, function(json) {
         var result = json.errordict || json.comment;

         if (result == json.comment) {
             // Look for the comment preview..
             // Display a pop-up window (dialog) with the comment preview
             // in HTML. By clicking on OK or Save the user has no more
             // undo chances and the comment will be made.
             var commentHTMLDialog = $('div id=commentDialog
 class=ui-dialog ui-widget ui-content\/div');

             // Set a title
             $(commentHTMLDialog).attr('title', 'Preview comment');

             // Setup default dialog constructor options
             $(commentHTMLDialog).dialog({
                 autoOpen: true,
                 bgiframe: false, // must keep this for IE6? default =
 'dont care'
                 width: 500,
                 modal: true,     // prevent reposting while the dialog
 is enabled
                 dialogClass: 'generic',
                 height: 400,
                 overlay: {
                     backgroundColor: '#000',
                     opacity: 0.5
                 },
                 buttons: {
                     It's all good, add my comment please. : function() {
                             $(this).dialog('close');
                      },
                      Cancel: function() {
                             $(this).dialog('close');
                      }
                 },
                 open: function() {
                     // Constructor to define what to do when opening
                     // the dialog widget
                     var commentHTMLBody = $(ul
 id='commentHTMLBody'/ul);
                     $(commentHTMLBody).prependTo($(commentHTMLDialog));
                     for (var x in result) {
                         // create the template on the fly
                         $('li'+x+':
 '+result[x]+'\/li').appendTo('#'+'commentHTMLBody');
                     };

                 } //open
                 });

                 $(commentHTMLDialog).dialog('open');
                 return false;
                 //$('#'+'commentForm').html('Thanks for your input!');
         } else {
             // found some validation errors
             for (var x in result) {
                 $('p class=error'+'b'+x+':
 \/b'+result[x]+'\/p').appendTo('#'+'commentForm');
             };
         };
     }, json);
     return false;
     });});

 /script

 --
 Etienne Robillard robillard.etie...@gmail.com
 Green Tea Hackers Club http://gthc.org/
 Blog: http://gthc.org/blog/
 PGP Fingerprint: AED6 B33B B41D 5F4F A92A  2B71 874C FB27 F3A9 BDCC


[jQuery] Show/Hide multiple table rows. Pls help

2009-06-22 Thread Kerry

Hi, I have a problem i've been trying to solve for a while. I have a
table that is dynamically generated. I need to be able to hide and
show certain table rows. for e.g.

table
 thead
   tr
   tdheading1/td
   tdheading2/td
   tdheading3/td
/tr
/thead
tbody
   tr
tdDATA1/td
tdDATA1.2/td
tdDATA1.3/td
  /tr
  tr -
tddata1/td   |
tddata1.2/td|dynamically generated by an
array when page loads, tddata1.3/td can be
more table data rows and is to be hidden.
 |To be shown when
DATA1 is clicked
  /tr|
  tr |
tddata1/td   |
tddata1.2/td|
tddata1.3/td|
  /tr  --
  tr
tdDATA2/td
tdDATA2.2/td
tdDATA2.3/td
  /tr
  tr -
tddata2/td   |
tddata2.2/td|dynamically generated by an
array when page loads, tddata2.3/td can be
more table data rows and is to be hidden.
 |To be shown when
DATA2 is clicked
  /tr|
  tr |
tddata2/td   |
tddata2.2/td|
tddata2.3/td|
  /tr  --
 /tbody
/table


I'd like to know how i can show/hide the tr's that are dynamically
generated. i'm also using tablesorter, so i want the rows to be
associsted with their respective DATA, i.e. they are not mixed up.
data1 or data1.2 does not come under DATA2.  I tried every which way
to try the show/hide,  the JQuery Table Display plugin doesnt seem to
do the job.

Pls can someone help!!


[jQuery] Re: Error : 'document' is undefined

2009-06-22 Thread nanditha k
Thank you , Charlie

On Mon, Jun 22, 2009 at 12:56 PM, Charlie charlie...@gmail.com wrote:


 try here: http://jquery.com/

 if you plan on using jquery much or any web development install Firefox and
 Firebug extension. Far more friendly development browser

 if you can't download from above site the following is Google hosted jquery
 and is great way to use it, no file paths or downloads to worry about and
 there are some other advantages to using this method

 script type=text/javascript src=
 http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js;http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js/script





 nanditha k wrote:

 Thanx Kalyan,

 But the problem still persists. I am still unable to download the Jquery
 from the site.

 Have attached the screen shot of the exception generated .Let me know what
 am  I missing.

 Thank you,



 On Sat, Jun 20, 2009 at 8:06 AM, kalyan Chatterjee 
 kalyan11021...@gmail.com wrote:


 Place your jquery include tag at first then other javascript file
 attachment. Hope your problem gone!

 On Jun 20, 12:21 am, nanditha k nandithak2...@gmail.com wrote:
  http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.3.2..
 ..
  
  On Fri, Jun 19, 2009 at 1:53 PM, amuhlou amysch...@gmail.com wrote:
 
   can you post a link to the page where this is happening?
 
   On Jun 19, 12:47 pm, gits nandithak2...@gmail.com wrote:
I am not able to install JQuery , While installing I have following
error -
Error : 'document' is undefined
Line : 12.
 
Could you please gimme a solution?
 
Thank you






[jQuery] Toggle Not Working

2009-06-22 Thread Gercek Karakus

Hi everyone,

I am having problems with Toggle. You can see the jQuery and XHTML
code below. Please let me know if you can see what's going wrong here.

Thanks,



$(document).ready(
function()
{
$('a.toggle').click(function()
{

$(this).parents('div.portlet').children('.portlet_content').toggle
(function(){

$(this).parents('div.portlet').children('.portlet_topper').addClass
('active');
}, function () {
$(this).parents('div.portlet').children
('.portlet_topper').removeClass('active');
});
});
});



div class=portlet
div class=portlet_topper
h31. Most Recent Comments/h3
div class=toggle-containera class=toggle/a/div
/div
div class=portlet_content
pLorem ipsum dolor si ipiscing laoreet nibh. In hac
habitasse platea dictumst. Aliquam erat volutpat. Cum sociis natoque
penatibus et magnis dis parturient montes, nascetur ridiculus mus. In
ut justo. Nulla libero./p
/div
/div


[jQuery] NyroModal stripping out my JS

2009-06-22 Thread Loony2nz

I have NyroModal plugin pulling in a page with javascript on the page.
And NyroModal is stripping out the scripts.   script  header tags
are gone.  inline JS is gone.

What gives? :(

Thanks


[jQuery] .load() function control

2009-06-22 Thread mojoeJohn

I'm loading content with the .load() method. How do i only allow one
click to the link. I don't want future clicks to keep loading the same
content.

$(document).ready(function(){
$(#FAQ).click(function(){
$('div id=faqcontent /').load(content.htm #faqs , function(){
$(this).hide()
.appendTo(#content)
.slideDown(1000); return false
});
});
})


I've got all the content loading correctly, but i don't know where to
go from here to prevent the content from loading several times. Any
ideas?


[jQuery] crazy if... !not working.

2009-06-22 Thread umcosta

Ok, here is what I want to do (extracted from: 
http://docs.jquery.com/Traversing/hasClass):

script src=http://code.jquery.com/jquery-latest.js;/script
script
  $(document).ready(function(){

$(div).click(function(){
  if ( $(this).hasClass(protected) )
$(this).animate({ left: -10 }, 75)
   .animate({ left: 10 }, 75)
   .animate({ left: -10 }, 75)
   .animate({ left: 10 }, 75)
   .animate({ left: 0 }, 75);
});

  });
  /script


And here is my code:

script type=text/javascript src=scripts/jquery.js/script
script type=text/javascript src=scripts/jquery.localscroll.js/
script
script type=text/javascript src=scripts/jquery.scrollto.js/
script
script type=text/javascript src=scripts/jquery.fancybox.js/
script
script type=text/javascript
$(document).ready(function(){

$.localScroll();

$(a).click(function(){
   if ( $(this).hasClass(thumb) )
  $(this).fancybox();
});

});
/script

Any ideas???


[jQuery] Re: jquery-ui dialog and ajax issues updating from 1.2.6 to 1.3.2

2009-06-22 Thread Cesar Sanz

I had the problem too..

You must to update jquery and ui too

- Original Message - 
From: James james.gp@gmail.com
To: jQuery (English) jquery-en@googlegroups.com
Sent: Monday, June 22, 2009 12:18 PM
Subject: [jQuery] Re: jquery-ui dialog and ajax issues updating from 1.2.6 
to 1.3.2



When you update jQuery to 1.3+ from an older version, you also have to
update your UI library to 1.7+ because jQuery 1.3+ is not compatible
with older versions of jQuery UI.

On Jun 22, 5:25 am, Etienne Robillard robillard.etie...@gmail.com
wrote:
 Hi,

 I'm using jquery-ui 1.6 custom build with jquery 1.2.6 trying to
 set up a dialog window. Unfortunately I can't update to 1.3.2 since this
 would trigger some unexpected XHR-related bugs like the following:

 Exception ``TypeError: M.xhr is not a function'' thrown from function
 anonymous(M=Object:{12}) in
 http://localhost/media/js/jquery/jquery-1.3.2.min.js

 So I'm sticking with the 1.2.6 build, which works fine despite a
 minor/not-critical XHR issue:

 Exception ``TypeError: s.accepts is undefined'' thrown from function
 anonymous(s=Object:{12}) in
 http://localhost/media/js/jquery/jquery-1.2.6.pack.js

 Notice that this error is reported in FireBug/Venkman, however Firefox
 doesn't seem to care and let the XMLHTTPRequest to execute successfully.

 The code for the dialog window is given below. I don't seem to
 understand why posted data cannot be shown on the dialog box twice.

 Moreover, it will display it as I want on the first $.post request but
 any additional requests triggered with a click event don't show any
 updated data on the dialog box. Venkman reports that the anonymous
 callback function manages to obtain the updated data, but still nothing
 get shown on the dialog, just an empty div... ;-)

 Any help or advices for debugging this issue?

 Best regards,
 Etienne

 This is the script that gets evaluated by jQuery (using $.get(...)). A
 json object is returned by the server either containing form validation
 errors or a result object that contains simple strings.

 script type=text/javascript
 $(function(){

 $('#'+'formControlBtn').bind('click', function(){
 //send the form with a ajax request. on success,
 //return a comment preview.
 var formData = $('#'+'commentform').serialize();

 //one-liner to remove old error messages before posting a new comment
 $('p.error').each(function(){$(this).remove()});

 $.post('comment', formData, function(json) {
 var result = json.errordict || json.comment;

 if (result == json.comment) {
 // Look for the comment preview..
 // Display a pop-up window (dialog) with the comment preview
 // in HTML. By clicking on OK or Save the user has no more
 // undo chances and the comment will be made.
 var commentHTMLDialog = $('div id=commentDialog
 class=ui-dialog ui-widget ui-content\/div');

 // Set a title
 $(commentHTMLDialog).attr('title', 'Preview comment');

 // Setup default dialog constructor options
 $(commentHTMLDialog).dialog({
 autoOpen: true,
 bgiframe: false, // must keep this for IE6? default =
 'dont care'
 width: 500,
 modal: true, // prevent reposting while the dialog
 is enabled
 dialogClass: 'generic',
 height: 400,
 overlay: {
 backgroundColor: '#000',
 opacity: 0.5
 },
 buttons: {
 It's all good, add my comment please. : function() {
 $(this).dialog('close');
 },
 Cancel: function() {
 $(this).dialog('close');
 }
 },
 open: function() {
 // Constructor to define what to do when opening
 // the dialog widget
 var commentHTMLBody = $(ul
 id='commentHTMLBody'/ul);
 $(commentHTMLBody).prependTo($(commentHTMLDialog));
 for (var x in result) {
 // create the template on the fly
 $('li'+x+':
 '+result[x]+'\/li').appendTo('#'+'commentHTMLBody');
 };

 } //open
 });

 $(commentHTMLDialog).dialog('open');
 return false;
 //$('#'+'commentForm').html('Thanks for your input!');
 } else {
 // found some validation errors
 for (var x in result) {
 $('p class=error'+'b'+x+':
 \/b'+result[x]+'\/p').appendTo('#'+'commentForm');
 };
 };
 }, json);
 return false;
 });});

 /script

 --
 Etienne Robillard robillard.etie...@gmail.com
 Green Tea Hackers Club http://gthc.org/
 Blog: http://gthc.org/blog/
 PGP Fingerprint: AED6 B33B B41D 5F4F A92A 2B71 874C FB27 F3A9 BDCC 



[jQuery] return value of nested functions is always undefined

2009-06-22 Thread anawak82

Hi,
I am just trying to learn a little bit about jQuery. Now I have a
problem with returning a value from a function.

The following code works fine, when I tested it with alert(price) or
any other way of echoing the value directly. But if I try something
like var test = getPrice(324), the variable test would always be
undefined.

function getPrice(id)
   {
 $.get('db.xml', function(d){
 $(d).find('data').each(function(){
var $data = $(this);
 if ($data.find(id).text() == id)
 {
var price = $data.find(preis).text().trim();
return price;
}
 });
 });
 };

I assume that the nested functions are part of the problem, but I
don't know how to solve it.

Thanks in advance!

Kind regards
Tom


[jQuery] documentation

2009-06-22 Thread YugaWebS

Hi!
Thanks a lot for this plugin!

I've started to explore star-rating plugin today and at this moment I
have two notices about the documentation which could be found at
http://www.fyneworks.com/jquery/star-rating/#tab-Overview.

Firslty, I think that it is not always easy to understand for every
example - step by step:
1) How HTML looked like before the script was implemented;
2) Which definite code we used for this example;
3) What do we have as a result;
These pieces of information are often situated too far from each
other.

Second
In API utilized this kind of code: $('input').rating
('readOnly',false);
But I believe there should be $('input').rating({readOnly: false}); -
this is the way I could make it work.

Best regards, Yugene


[jQuery] Jeditable, Should a rebind be necessary after ajax return?

2009-06-22 Thread imm102

Hi,

I have 3 fields that im attaching jeditable to. I run my own ajax
function to send the form elements to the edit url. All works fine but
the controls seem to get unbound when i click the submit button in
firefox and chrome. If i submit using the enter key they do not get
unbound. I don't think a rebind should ever be necessary as I am
setting the text of the bound element not replacing it.

Does anyone have a clue whats happening here?

$(document).ready(function() {
$(#event_details_email).editable(submitEdit, {
indicator : Saving...,
tooltip   : Click to edit...,
name : Editable.EmailAddress,
id   : elementid,
type : text,
submit  : span class=\mini_button\Ok/span,
cssclass : edit_text
});
$(#event_details_phone).editable(submitEdit, {
indicator : Saving...,
tooltip   : Click to edit...,
name : Editable.PhoneNumber,
id   : elementid,
type : text,
submit  : span class=\mini_button\Ok/span,
cssclass : edit_text
});
$(#event_details_description).editable(submitEdit, {
indicator : Saving...,
tooltip   : Click to edit...,
name : Editable.Description,
id   : elementid,
type : textarea,
submit  : span class=\bigger_button\Ok/span,
cssclass : edit_textarea
});
function submitEdit(value, settings)
{
 var edits = new Object();
 var origvalue = this.revert;
 var textbox = this;
 var result = value;
 edits[settings.name] = [value];
 var returned = $.ajax({
  url: http://localhost/edit/
34,
  type: POST,
  data : edits,
  dataType : json,
  complete : function (xhr,
textStatus)
 {
  var response
=  $.secureEvalJSON(xhr.responseText);
  if
(response.errorMsg != )
  {
//alert
(error setting back to +origvalue);
 
$.jGrowlError(response.errorMsg);
result =
origvalue;
$
(textbox).text(result);
//return
  } else {
  //alert
(success);
 
$.jGrowlSuccess(Update successful);
  $
(textbox).text(result);
  //return
  }
 }
});
 return(result);
}
$.jGrowl.defaults.position = bottom-left;
});

Thanks,


[jQuery] jQuery in an eBay auction template? Is it possible?

2009-06-22 Thread eepeterson

Ok, let me start by saying I'm not a great programmer. I can do well
with HTML  CSS but don't know a ton about js  jQuery.

Anyway, I'd like to include some jQuery in the form of a gallery of
images in my eBay auction. However the problem I run into is that when
I paste the completed code into the eBay I get a message that says
Your listing cannot contain javascript(.cookie, cookie(, replace
(, IFRAME, META, or includes), cookies or base href. So I revised
the code to include no hrefs to the js and pasted it all in the header
instead. I still get the same error. I took a closer look at the code
and of course the instances of the replace() method and so on. I would
like to figure a way around this so I could use jQuery on eBay.

Has anyone had any luck using jQuery in an eBay auction?

Any help you might have would be great. Thanks in advance.


[jQuery] dataset load

2009-06-22 Thread GRaC

My first question and a possible n00b question...
I wanna preload a asp.net dataset by firisng a webservice without
waiting for the document to complete load ... Images etc I know it
will need ajax call... Can xome someone here kindly walk me through
the steps to do this ?


[jQuery] Validate

2009-06-22 Thread Mark

HI
I am trying to use the Validate plugin for Jquery with .NET. I managed
to work it out on one particular page. However I have a minor problem.
Let's suppose you have a page with 2 Query tabs. In the first tab the
user can add a Person which includes Name, Surname etc. In the other
tab the user can add some Person History. Now in the first tab Person
Name is required. So I create a validator on First Name on the first
page and it works ok.
In the second tab I create a required field on another field. Now the
problem is that if Person Name is not empty, and the user clicks on
Add in the second tab but the required field in the second tab is
empty, the Validate() method will return true even though the field in
the second tab is empty.
Therefore I need to find a way how I can create a grouping validator
for the first and second tab like what is in ASP.NET in which it
enabled you to create a group so that when you validate you validate
per group.

I am using ASP.NET and I do not wish to crearte a button with its type
as SUBMIT since I am using AJAX calls and I do not want to submit the
form when the ADD button is clicked.

Thanks


[jQuery] Re: Click events handling conflict due to prototype?

2009-06-22 Thread Cesar Sanz

Use jQuery and not $

- Original Message - 
From: Steve the Canuck steve.san...@gmail.com
To: jQuery (English) jquery-en@googlegroups.com
Sent: Monday, June 22, 2009 10:34 AM
Subject: [jQuery] Re: Click events handling conflict due to prototype?



Btw... I do have a workaround - register my click event on something
outside the table, such as the body tag, and then check the original
event target.  I'd prefer to target just the list item and anchor
though if possible.

On Jun 22, 11:14 am, Steve the Canuck steve.san...@gmail.com wrote:
 Hi,

 I have a simple list inside a table

 ul class=col_actions
 li class=cancel_posting
 a href=/frontend_dev.php/organizer/cancel-booking/20
 linkindex=18Cancel/a
 /li
 /ul

 I have a ready event handler for click events on the anchor:

 $j('.cancel_posting').click( function(e) {
 if (!confirm(Are you sure you want to cancel this booking?)) {
 e.preventDefault();
 }
 });

 However, this event doesn't seem to fire because the table has some
 prototype controls inside it.

 If I just copy the list outside the table as a test, it seems like the
 event handler works fine.

 I am using jquery for all my own code, but some widgets from my PHP
 framework (symfony) are built in prototype, so I've been using both to
 some extent.

 Any ideas about how I can rectify this?

 Thanks!
 Steve


[jQuery] Re: jQuery Autocomplete - After service call if result is NULL then layer should be invisible

2009-06-22 Thread Dushyant Patel


it return result but its null. and in that  case i want to hide layer
by calling select.hide(); but where should i call it.

where to check that data==null and call select.hide();

Please help me on this.

Thanks


On Jun 22, 11:10 am, Jörn Zaefferer joern.zaeffe...@googlemail.com
wrote:
 What happens when yourservicedoesn't return a result? As long as it
 returns an empty result (not an error), it should work fine.

 Jörn

 On Mon, Jun 22, 2009 at 5:01 PM, Dushyant Patelpatel.dushy...@gmail.com 
 wrote:

  Hello,

  I am using jQueryAutocompletePlug-ins(http://bassistance.de/jquery-
  plugins/jquery-plugin-autocomplete/).

  Let me explain my problem:

  If i am looking for shirt and star typing shi and it showing me 10
  results for shirt, but now after shi if i type like shixyzyz it
  should clear list and hideautocompletelayer.

  In my case it is not doing that. Layer stay there with old results.

  Pleaes note that i am makingservicecall using JSONP and following is
  my code.

  $j(.autocomplete).autocomplete('URL/Service.svc/REST/SEARCH/', {
                 minChars: 3,
                 matchContains: true,
                 selectFirst: false,
                 cacheLength: 0,
                 width:307,
                 dataType: jsonp,

  any suggestion or hint on this.

  Please help me.

  Thanks in advance.


[jQuery] Re: Click events handling conflict due to prototype?

2009-06-22 Thread Steve the Canuck

Thanks, I tried this, but it doesn't seem to work:

jQuery('.cancel_posting').click( function(e) {
alert(got here);
if (!confirm(Are you sure you want to cancel this booking?)) {
e.preventDefault();
}
});


On Jun 22, 3:17 pm, Cesar Sanz the.email.tr...@gmail.com wrote:
 Use jQuery and not $

 - Original Message -
 From: Steve the Canuck steve.san...@gmail.com
 To: jQuery (English) jquery-en@googlegroups.com
 Sent: Monday, June 22, 2009 10:34 AM
 Subject: [jQuery] Re: Click events handling conflict due to prototype?

 Btw... I do have a workaround - register my click event on something
 outside the table, such as the body tag, and then check the original
 event target.  I'd prefer to target just the list item and anchor
 though if possible.

 On Jun 22, 11:14 am, Steve the Canuck steve.san...@gmail.com wrote:
  Hi,

  I have a simple list inside a table

  ul class=col_actions
  li class=cancel_posting
  a href=/frontend_dev.php/organizer/cancel-booking/20
  linkindex=18Cancel/a
  /li
  /ul

  I have a ready event handler for click events on the anchor:

  $j('.cancel_posting').click( function(e) {
  if (!confirm(Are you sure you want to cancel this booking?)) {
  e.preventDefault();
  }
  });

  However, this event doesn't seem to fire because the table has some
  prototype controls inside it.

  If I just copy the list outside the table as a test, it seems like the
  event handler works fine.

  I am using jquery for all my own code, but some widgets from my PHP
  framework (symfony) are built in prototype, so I've been using both to
  some extent.

  Any ideas about how I can rectify this?

  Thanks!
  Steve


[jQuery] Re: jQuery Autocomplete - After service call if result is NULL then layer should be invisible

2009-06-22 Thread tarave

here is a link... 
http://groups.google.com/group/jquery-en/browse_thread/thread/9011e7faa57dca06

On Jun 22, 3:18 pm, tarave arav...@yahoo.com wrote:
 I'm having the same problem today.  Looks like another person did too
 and thier fix was to put a hack into the autocomplete plugin code.


[jQuery] Re: jQuery Autocomplete - After service call if result is NULL then layer should be invisible

2009-06-22 Thread tarave

I'm having the same problem today.  Looks like another person did to
and thier fix was to put a hack into the autocomplete plugin code.



[jQuery] Re: dataset load

2009-06-22 Thread Cesar Sanz


jQuery(document).read(...);

this just ensure all dom is completed loaded, so doesn't wait to images, etc 
to be

in the document.
You can make your ajax call here.

- Original Message - 
From: GRaC gunishraicha...@gmail.com

To: jQuery (English) jquery-en@googlegroups.com
Sent: Monday, June 22, 2009 10:10 AM
Subject: [jQuery] dataset load




My first question and a possible n00b question...
I wanna preload a asp.net dataset by firisng a webservice without
waiting for the document to complete load ... Images etc I know it
will need ajax call... Can xome someone here kindly walk me through
the steps to do this ? 




[jQuery] Re: Array to JSON?

2009-06-22 Thread Ricardo

Usually you'll send out parameters in query strings, only receive data
in JSON, which is what jQuery is equipped to do. If you don't want the
weight of a plugin you could use something like this:


function toJSON(obj){
 var json = '({';
$.each(obj, function(k,v){
  var q = typeof v == 'string' ? ~v.indexOf(') ? '' : ' : '';
  if (typeof v == 'object')
 v = toJSON(v).slice(0,-1).substr(1);
  json+= k + ':'+ q + v + q + ',';
});
 return json.slice(0,-1)+'})';
};

On Jun 21, 11:23 pm, Nic Hubbard nnhubb...@gmail.com wrote:
 I have been trying to figure out how I could go from an associative
 array to JSON.  Is there a function for this?


[jQuery] Re: Array to JSON?

2009-06-22 Thread Ricardo

before someone complains: that function won't handle arrays (only
objects)

On Jun 22, 6:39 pm, Ricardo ricardob...@gmail.com wrote:
 Usually you'll send out parameters in query strings, only receive data
 in JSON, which is what jQuery is equipped to do. If you don't want the
 weight of a plugin you could use something like this:

 function toJSON(obj){
  var json = '({';
 $.each(obj, function(k,v){
   var q = typeof v == 'string' ? ~v.indexOf(') ? '' : ' : '';
   if (typeof v == 'object')
      v = toJSON(v).slice(0,-1).substr(1);
   json+= k + ':'+ q + v + q + ',';});

  return json.slice(0,-1)+'})';

 };

 On Jun 21, 11:23 pm, Nic Hubbard nnhubb...@gmail.com wrote:

  I have been trying to figure out how I could go from an associative
  array to JSON.  Is there a function for this?


[jQuery] Re: crazy if... !not working.

2009-06-22 Thread umcosta

ok guys... sorry for the inconvenient. Here is the solution in case
someone needs:

script type=text/javascript src=scripts/jquery.js/script
script type=text/javascript src=scripts/
jquery.localscroll.js/script
script type=text/javascript src=scripts/jquery.scrollto.js/
script
script type=text/javascript src=scripts/jquery.fancybox.js/
script
script type=text/javascript
$(document).ready(function(){
$.localScroll();
$(a.thumb).fancybox();
});
/script


On Jun 22, 9:29 pm, umcosta umco...@gmail.com wrote:
 Ok, here is what I want to do (extracted 
 from:http://docs.jquery.com/Traversing/hasClass):

 script src=http://code.jquery.com/jquery-latest.js;/script
 script
   $(document).ready(function(){

     $(div).click(function(){
       if ( $(this).hasClass(protected) )
         $(this).animate({ left: -10 }, 75)
                .animate({ left: 10 }, 75)
                .animate({ left: -10 }, 75)
                .animate({ left: 10 }, 75)
                .animate({ left: 0 }, 75);
     });

   });
   /script

 And here is my code:

 script type=text/javascript src=scripts/jquery.js/script
 script type=text/javascript src=scripts/jquery.localscroll.js/
 script
 script type=text/javascript src=scripts/jquery.scrollto.js/
 script
 script type=text/javascript src=scripts/jquery.fancybox.js/
 script
 script type=text/javascript
         $(document).ready(function(){

                 $.localScroll();

                 $(a).click(function(){
                    if ( $(this).hasClass(thumb) )
                       $(this).fancybox();
                 });

         });
         /script

 Any ideas???


[jQuery] Re: basic jQuery/JavaScript pattern

2009-06-22 Thread Scott Sauyet


jerome wrote:

(function(){
...
})();

How is this basic to understanding how jQuery works, and how
JavaScript works?


The basic idea is that global variables are evil.  This technique moves 
what would otherwise be global variables into a closure [1], removing 
them from the global scope.  For example, in the following code


var count = 0;
function createClickHandler(nbr) {
return function() {
alert(You clicked dead link  + (1 + nbr));
}
}
var links = document.getElementsByTagName(A);
for (var i = 0; i  links.length; i++) {
var link = links[i];
if (link.getAttribute(href) == #) {
link.onclick = createClickHandler(count++);
}
}

all the variables used are now available in the global scope, including 
count, links, the function createClickHandler, and, perhaps 
surprisingly, i and link.  You can see for yourself by clicking the 
button on this page:


http://scott.sauyet.com/Javascript/Demo/2009-06-22a/

If, however, you surround the code with (function(){ and })();, as 
you can see at


http://scott.sauyet.com/Javascript/Demo/2009-06-22b/

the variables are no longer defined when you click the button.  You've 
removed the variables from the global scope.


As to the syntax, what you are seeing is an anonymous function created 
and then immediately applied.  You could do this with a named function 
like this:


function myFunc() {
// code here
}
myFunc();

but then you've added myFunc to the global namespace.  By removing the 
 function name, you are adding nothing at all to the global namespace. 
 Ideally, this would be accomplished with syntax more like this:


function() {
// code here
}();

i.e., we create the function and apply it.  But that syntax is not 
legal.  For technical reasons, you need to surround the anonymous 
function with parentheses to be able to apply it with the () operator,

and we end up with

(function() {
// code here
})();

As to how closures manage to keep the global namespace clean, you will 
need to read up on closures. [1]


This has become a very common idiom in JavaScript programming, and it 
really is important to understand it if you want to work with any but 
the most basic of modern scripts.


Cheers,

  -- Scott

[1] http://www.google.com/search?q=javascript+closure


[jQuery] Re: crazy if... !not working.

2009-06-22 Thread Charlie





you're loading jquery twice. Remove top one, not recommended to serve
it from jquery site, put your animation script below your local
version of jquery

should work then

umcosta wrote:

  Ok, here is what I want to do (extracted from: http://docs.jquery.com/Traversing/hasClass):

script src="" class="moz-txt-link-rfc2396E" href="http://code.jquery.com/jquery-latest.js">"http://code.jquery.com/jquery-latest.js"/script
script
  $(document).ready(function(){

$("div").click(function(){
  if ( $(this).hasClass("protected") )
$(this).animate({ left: -10 }, 75)
   .animate({ left: 10 }, 75)
   .animate({ left: -10 }, 75)
   .animate({ left: 10 }, 75)
   .animate({ left: 0 }, 75);
});

  });
  /script


And here is my code:

script type="text/_javascript_" src=""/script
script type="text/_javascript_" src=""/
script
script type="text/_javascript_" src=""/
script
script type="text/_javascript_" src=""/
script
script type="text/_javascript_"
	$(document).ready(function(){

		$.localScroll();

		$("a").click(function(){
		   if ( $(this).hasClass("thumb") )
	  $(this).fancybox();
		});

	});
	/script

Any ideas???

  






[jQuery] Re: .load() function control

2009-06-22 Thread Charlie





here's a couple of options:

add a class to your FAQ only used for the click function, remove the
class inside the load success function.
change $("FAQ).click.. to $(".newClickClass").click..

after appending content : removeClass("newClickClass")

or simpler
hide or remove #FAQ if page won't be compromised


mojoeJohn wrote:

  I'm loading content with the .load() method. How do i only allow one
click to the link. I don't want future clicks to keep loading the same
content.

$(document).ready(function(){
$("#FAQ").click(function(){
	$('div id="faqcontent" /').load("content.htm #faqs" , function(){
		$(this).hide()
			.appendTo("#content")
			.slideDown(1000); return false
		});
	});
})


I've got all the content loading correctly, but i don't know where to
go from here to prevent the content from loading several times. Any
ideas?

  






[jQuery] Re: Array to JSON?

2009-06-22 Thread Nic Hubbard

Yeah, I am not too hot on using a plugin for this.  I had hoped there
was just a quick function that I could pass in an array and return
JSON.

On Jun 22, 8:28 am, diogobaeder diogobae...@gmail.com wrote:
 Hmmm... why would one use this plugin if we have Douglas Crockford's
 json2.org, which is the original JSON library from the same creator of
 the concept JSON? And why load more modules into the main jQuery
 object, making it heavier, if we don't use DOM element wrappers in the
 plugin, only conversions to/from JS objects?

 Sorry, I don't mean to be harsh, but it seems to me that this plugin
 is a reinvented wheel, and also that it didn't have to be a jQuery
 plugin to work. Does it have anything that we can't see in json2.org?

 Diogo

 On Jun 21, 11:39 pm, kranthi kranthi...@gmail.com wrote:



  are u looking forhttp://www.google.co.in/search?q=jquery+json+plugin?


[jQuery] Re: Determine if autocomplete returns an empty list and number of records returned

2009-06-22 Thread Dushyant Patel

Could you please tell me where exactly added following script block.

isEmpty: function(data) {
if (data == 0) {
$(#result).html(No match found);
}
}

I am having same problem, but i don't want to show message, i just
want to simply hide layer.


On Jun 5, 4:20 pm, JohnT jtra...@gmail.com wrote:
 Hi. I've just started using jQuery Autocomplete a few weeks ago.

 While using jQuery, I found that I needed to know how many records
 were returned and also if the result set returned was empty. After
 searching the jQuery documentation I couldn't find any property or
 method that returned this value, so I've added that functionality
 myself and wanted to share it with the group.

 1) Determine the number of records returned:

 I wanted to show the user how many results were returned after they
 start typing into the autocomplete field similar to how Google
 indicates the number of results found when you start typing in the
 search box.

 At first I thought the max parameter in the function formatItem
 returned this value. However, it returns the max option that you set
 it to. So if your query returns 100 records and you set max to 25,
 it'll obviously return 25 (not what I wanted).

 So after trying various things, I looked at the jQuery code and simply
 added the number of records returned by the database to the
 formateItem function. In the fillList() function around line 660 I
 added the data.length parameter:

         var formatted = options.formatItem(data[i].data, i+1, max, data
 [i].value, term, data.length);

 And in my autocomplete code, I added the parameter to the end of the
 param list:

         formatItem: function(data, i, total, value, searchTerm, totalResults)

 So now whenever a new search is preformed, I get back the number of
 search result from the database.

 2) Determine if a result set returned was empty

 I wanted to update a div with a message like no records found
 whenever the query yielded no results. Again, after searching the
 jQuery documentation, I couldn't find any property or method that
 would indicate this so I added it to the code.

 In the request function after the line var data = cache.load(term); I
 added the following:

         if (!data) {
                 options.isEmpty(0);
         } else {
                 options.isEmpty(data.length);
         }

 And in my autocomplete code, I added the following:

         isEmpty: function(data) {
                 if (data == 0) {
                         $(#result).html(No match found);
                 }
         }

 Hope this helps others. Since I am new to jQuery I'd appreciate any
 feedback especially if there is a better way to do this.

 Thanks
 John


[jQuery] Re: Toggle Not Working

2009-06-22 Thread Charlie





appears you are trying to use toggle with 2 functions the same way
hover works with it's 'over' function and 'out' function

toggle arguments are toggle(speed,[callback]) 

try this:

$('a.toggle').click(function(){
 
  
$(this).parents('div.portlet').children('.portlet_content').toggle();
   $(this).closest(".portlet_topper").toggleClass("active");

  });



Gercek Karakus wrote:

  Hi everyone,

I am having problems with Toggle. You can see the jQuery and XHTML
code below. Please let me know if you can see what's going wrong here.

Thanks,



$(document).ready(
	function()
	{
		$('a.toggle').click(function()
		{
			$(this).parents('div.portlet').children('.portlet_content').toggle
(function(){
$(this).parents('div.portlet').children('.portlet_topper').addClass
('active');
}, function () {
$(this).parents('div.portlet').children
('.portlet_topper').removeClass('active');
			});
		});
});



div class="portlet"
div class="portlet_topper"
h31. Most Recent Comments/h3
div class="toggle-container"a class="toggle"/a/div
/div
div class="portlet_content"
pLorem ipsum dolor si ipiscing laoreet nibh. In hac
habitasse platea dictumst. Aliquam erat volutpat. Cum sociis natoque
penatibus et magnis dis parturient montes, nascetur ridiculus mus. In
ut justo. Nulla libero./p
/div
/div

  






[jQuery] Re: jQuery Autocomplete - After service call if result is NULL then layer should be invisible

2009-06-22 Thread Dushyant Patel

I tried following one:

In the request function after the line var data = cache.load(term); I
added the following:

if (!data) {
options.isEmpty(0);
} else {
options.isEmpty(data.length);
}

And in my autocomplete code, I added the following:

isEmpty: function(data) {
if (data == 0) {
$(#result).html(No match found);
}
}



but i am getting flicker effect, and most imp is if i type SPACE that
layer is getting invisible. it should not.

Can any one suggest me best option for this.

Jorn: Could you please look into that, please help me out.

Thanks

On Jun 22, 5:19 pm, tarave arav...@yahoo.com wrote:
 here is a 
 link...http://groups.google.com/group/jquery-en/browse_thread/thread/9011e7f...

 On Jun 22, 3:18 pm, tarave arav...@yahoo.com wrote:

  I'm having the same problem today.  Looks like another person did too
  and thier fix was to put a hack into the autocomplete plugin code.


[jQuery] Re: Click events handling conflict due to prototype?

2009-06-22 Thread Charlie





have you tried using jQuery.noConflict(); ?

http://docs.jquery.com/Using_jQuery_with_Other_Libraries

Steve the Canuck wrote:

  Thanks, I tried this, but it doesn't seem to work:

	jQuery('.cancel_posting').click( function(e) {
		alert("got here");
		if (!confirm("Are you sure you want to cancel this booking?")) {
			e.preventDefault();
		}
	});


On Jun 22, 3:17pm, "Cesar Sanz" the.email.tr...@gmail.com wrote:
  
  
Use jQuery and not $

- Original Message -
From: "Steve the Canuck" steve.san...@gmail.com
To: "jQuery (English)" jquery-en@googlegroups.com
Sent: Monday, June 22, 2009 10:34 AM
Subject: [jQuery] Re: Click events handling conflict due to prototype?

Btw... I do have a workaround - register my click event on something
outside the table, such as the body tag, and then check the original
event target. I'd prefer to target just the list item and anchor
though if possible.

On Jun 22, 11:14 am, Steve the Canuck steve.san...@gmail.com wrote:


  Hi,
  


  I have a simple list inside a table
  


  ul class="col_actions"
li class="cancel_posting"
a href=""
linkindex="18"Cancel/a
/li
/ul
  


  I have a ready event handler for click events on the anchor:
  


  $j('.cancel_posting').click( function(e) {
if (!confirm("Are you sure you want to cancel this booking?")) {
e.preventDefault();
}
});
  


  However, this event doesn't seem to fire because the table has some
prototype controls inside it.
  


  If I just copy the list outside the table as a test, it seems like the
event handler works fine.
  


  I am using jquery for all my own code, but some widgets from my PHP
framework (symfony) are built in prototype, so I've been using both to
some extent.
  


  Any ideas about how I can rectify this?
  


  Thanks!
Steve
  

  
  
  






[jQuery] Re: Array to JSON?

2009-06-22 Thread Josh Powell

That's okay, javascript doesn't have associative arrays, only arrays
with object properties.

On Jun 22, 2:45 pm, Ricardo ricardob...@gmail.com wrote:
 before someone complains: that function won't handle arrays (only
 objects)

 On Jun 22, 6:39 pm, Ricardo ricardob...@gmail.com wrote:

  Usually you'll send out parameters in query strings, only receive data
  in JSON, which is what jQuery is equipped to do. If you don't want the
  weight of a plugin you could use something like this:

  function toJSON(obj){
   var json = '({';
  $.each(obj, function(k,v){
    var q = typeof v == 'string' ? ~v.indexOf(') ? '' : ' : '';
    if (typeof v == 'object')
       v = toJSON(v).slice(0,-1).substr(1);
    json+= k + ':'+ q + v + q + ',';});

   return json.slice(0,-1)+'})';

  };

  On Jun 21, 11:23 pm, Nic Hubbard nnhubb...@gmail.com wrote:

   I have been trying to figure out how I could go from an associative
   array to JSON.  Is there a function for this?


[jQuery] Re: jquery-ui dialog and ajax issues updating from 1.2.6 to 1.3.2

2009-06-22 Thread Etienne Robillard

Thanks!

I'll upgrade to jQuery UI 1.7+ and retry.. :D

Best regards,
Etienne


Cesar Sanz wrote:
 I had the problem too..
 
 You must to update jquery and ui too
 
 - Original Message - 
 From: James james.gp@gmail.com
 To: jQuery (English) jquery-en@googlegroups.com
 Sent: Monday, June 22, 2009 12:18 PM
 Subject: [jQuery] Re: jquery-ui dialog and ajax issues updating from 1.2.6 
 to 1.3.2
 
 
 
 When you update jQuery to 1.3+ from an older version, you also have to
 update your UI library to 1.7+ because jQuery 1.3+ is not compatible
 with older versions of jQuery UI.
 
 On Jun 22, 5:25 am, Etienne Robillard robillard.etie...@gmail.com
 wrote:
 Hi,

 I'm using jquery-ui 1.6 custom build with jquery 1.2.6 trying to
 set up a dialog window. Unfortunately I can't update to 1.3.2 since this
 would trigger some unexpected XHR-related bugs like the following:

 Exception ``TypeError: M.xhr is not a function'' thrown from function
 anonymous(M=Object:{12}) in
 http://localhost/media/js/jquery/jquery-1.3.2.min.js

 So I'm sticking with the 1.2.6 build, which works fine despite a
 minor/not-critical XHR issue:

 Exception ``TypeError: s.accepts is undefined'' thrown from function
 anonymous(s=Object:{12}) in
 http://localhost/media/js/jquery/jquery-1.2.6.pack.js

 Notice that this error is reported in FireBug/Venkman, however Firefox
 doesn't seem to care and let the XMLHTTPRequest to execute successfully.

 The code for the dialog window is given below. I don't seem to
 understand why posted data cannot be shown on the dialog box twice.

 Moreover, it will display it as I want on the first $.post request but
 any additional requests triggered with a click event don't show any
 updated data on the dialog box. Venkman reports that the anonymous
 callback function manages to obtain the updated data, but still nothing
 get shown on the dialog, just an empty div... ;-)

 Any help or advices for debugging this issue?

 Best regards,
 Etienne

 This is the script that gets evaluated by jQuery (using $.get(...)). A
 json object is returned by the server either containing form validation
 errors or a result object that contains simple strings.

 script type=text/javascript
 $(function(){

 $('#'+'formControlBtn').bind('click', function(){
 //send the form with a ajax request. on success,
 //return a comment preview.
 var formData = $('#'+'commentform').serialize();

 //one-liner to remove old error messages before posting a new comment
 $('p.error').each(function(){$(this).remove()});

 $.post('comment', formData, function(json) {
 var result = json.errordict || json.comment;

 if (result == json.comment) {
 // Look for the comment preview..
 // Display a pop-up window (dialog) with the comment preview
 // in HTML. By clicking on OK or Save the user has no more
 // undo chances and the comment will be made.
 var commentHTMLDialog = $('div id=commentDialog
 class=ui-dialog ui-widget ui-content\/div');

 // Set a title
 $(commentHTMLDialog).attr('title', 'Preview comment');

 // Setup default dialog constructor options
 $(commentHTMLDialog).dialog({
 autoOpen: true,
 bgiframe: false, // must keep this for IE6? default =
 'dont care'
 width: 500,
 modal: true, // prevent reposting while the dialog
 is enabled
 dialogClass: 'generic',
 height: 400,
 overlay: {
 backgroundColor: '#000',
 opacity: 0.5
 },
 buttons: {
 It's all good, add my comment please. : function() {
 $(this).dialog('close');
 },
 Cancel: function() {
 $(this).dialog('close');
 }
 },
 open: function() {
 // Constructor to define what to do when opening
 // the dialog widget
 var commentHTMLBody = $(ul
 id='commentHTMLBody'/ul);
 $(commentHTMLBody).prependTo($(commentHTMLDialog));
 for (var x in result) {
 // create the template on the fly
 $('li'+x+':
 '+result[x]+'\/li').appendTo('#'+'commentHTMLBody');
 };

 } //open
 });

 $(commentHTMLDialog).dialog('open');
 return false;
 //$('#'+'commentForm').html('Thanks for your input!');
 } else {
 // found some validation errors
 for (var x in result) {
 $('p class=error'+'b'+x+':
 \/b'+result[x]+'\/p').appendTo('#'+'commentForm');
 };
 };
 }, json);
 return false;
 });});

 /script

 --
 Etienne Robillard robillard.etie...@gmail.com
 Green Tea Hackers Club http://gthc.org/
 Blog: http://gthc.org/blog/
 PGP Fingerprint: AED6 B33B B41D 5F4F A92A 2B71 874C FB27 F3A9 BDCC 
 
 


-- 
Etienne Robillard robillard.etie...@gmail.com
Green Tea Hackers Club http://gthc.org/
Blog: http://gthc.org/blog/
PGP Fingerprint: AED6 B33B B41D 5F4F A92A  2B71 874C FB27 F3A9 BDCC


[jQuery] Re: Determine if autocomplete returns an empty list and number of records returned

2009-06-22 Thread Dushyant Patel

i foundnd it, but its getting some flicker effect. how to avoid that?
do you any idea? please share with me.

Thanks

On Jun 22, 7:36 pm, Dushyant Patel patel.dushy...@gmail.com wrote:
 Could you please tell me where exactly added following script block.

         isEmpty: function(data) {
                 if (data == 0) {
                         $(#result).html(No match found);
                 }
         }

 I am having same problem, but i don't want to show message, i just
 want to simply hide layer.

 On Jun 5, 4:20 pm, JohnT jtra...@gmail.com wrote:

  Hi. I've just started using jQuery Autocomplete a few weeks ago.

  While using jQuery, I found that I needed to know how many records
  were returned and also if the result set returned was empty. After
  searching the jQuery documentation I couldn't find any property or
  method that returned this value, so I've added that functionality
  myself and wanted to share it with the group.

  1) Determine the number of records returned:

  I wanted to show the user how many results were returned after they
  start typing into the autocomplete field similar to how Google
  indicates the number of results found when you start typing in the
  search box.

  At first I thought the max parameter in the function formatItem
  returned this value. However, it returns the max option that you set
  it to. So if your query returns 100 records and you set max to 25,
  it'll obviously return 25 (not what I wanted).

  So after trying various things, I looked at the jQuery code and simply
  added the number of records returned by the database to the
  formateItem function. In the fillList() function around line 660 I
  added the data.length parameter:

          var formatted = options.formatItem(data[i].data, i+1, max, data
  [i].value, term, data.length);

  And in my autocomplete code, I added the parameter to the end of the
  param list:

          formatItem: function(data, i, total, value, searchTerm, 
  totalResults)

  So now whenever a new search is preformed, I get back the number of
  search result from the database.

  2) Determine if a result set returned was empty

  I wanted to update a div with a message like no records found
  whenever the query yielded no results. Again, after searching the
  jQuery documentation, I couldn't find any property or method that
  would indicate this so I added it to the code.

  In the request function after the line var data = cache.load(term); I
  added the following:

          if (!data) {
                  options.isEmpty(0);
          } else {
                  options.isEmpty(data.length);
          }

  And in my autocomplete code, I added the following:

          isEmpty: function(data) {
                  if (data == 0) {
                          $(#result).html(No match found);
                  }
          }

  Hope this helps others. Since I am new to jQuery I'd appreciate any
  feedback especially if there is a better way to do this.

  Thanks
  John


[jQuery] Re: Click events handling conflict due to prototype?

2009-06-22 Thread Steve the Canuck

Thanks, yes, I should have mentioned - I do have jQuery.noConflict()
declared at the top of each of my scripts to avoid conflicts in
general.

I've also stepped through the code in a debugger using Firebug.  I put
a breakpoint on my selector for the anchor tag, and I see in the
debugger that it seems to go right past the selector.

But, if I put this link outside the table and run it through the
debugger, the selector does work properly.

Regards,
Steve

On Jun 22, 8:04 pm, Charlie charlie...@gmail.com wrote:
 have you tried using jQuery.noConflict();  
 ?http://docs.jquery.com/Using_jQuery_with_Other_Libraries
 Steve the Canuck wrote:Thanks, I tried this, but it doesn't seem to work: 
 jQuery('.cancel_posting').click( function(e) { alert(got here); if 
 (!confirm(Are you sure you want to cancel this booking?)) { 
 e.preventDefault(); } }); On Jun 22, 3:17 pm, Cesar 
 Sanzthe.email.tr...@gmail.comwrote:Use jQuery and not $ - Original 
 Message - From: Steve the Canucksteve.san...@gmail.comTo: jQuery 
 (English)jquery-en@googlegroups.comSent: Monday, June 22, 2009 10:34 AM 
 Subject: [jQuery] Re: Click events handling conflict due to prototype? Btw... 
 I do have a workaround - register my click event on something outside the 
 table, such as the body tag, and then check the original event target.  I'd 
 prefer to target just the list item and anchor though if possible. On Jun 22, 
 11:14 am, Steve the Canucksteve.san...@gmail.comwrote:Hi,I have a simple 
 list inside a tableul class=col_actions li class=cancel_posting a 
 href=/frontend_dev.php/organizer/cancel-booking/20 
 linkindex=18Cancel/a /li /ulI have a ready event handler for click 
 events on the anchor:$j('.cancel_posting').click( function(e) { if 
 (!confirm(Are you sure you want to cancel this booking?)) { 
 e.preventDefault(); } });However, this event doesn't seem to fire because the 
 table has some prototype controls inside it.If I just copy the list outside 
 the table as a test, it seems like the event handler works fine.I am using 
 jquery for all my own code, but some widgets from my PHP framework (symfony) 
 are built in prototype, so I've been using both to some extent.Any ideas 
 about how I can rectify this?Thanks! Steve


[jQuery] Trigger jquery event on ajax loaded content

2009-06-22 Thread Steve the Canuck

Hi,

I'm using the jquery Star-Rating widget.  However, I'm returning the
set of input radio elements required to display the widget as the
result of an ajax call.

In order to convert these widgets to the star rating display I need to
call the .rating() function based on the selector.

How do I get this code to run once I've made the Ajax call?

thanks,
Steve


[jQuery] jQuery and Google Chrome

2009-06-22 Thread Raph

I am having an issue with unhiding carousels.  When a carousel is
initially hidden (like on a tab), then the div in which it resides is
set to display:block, the carousel is empty.

In IE/FF this is resolved rather easily by not initializing the
carousel (calling $(#myObj).jcarousel(...) until it is first shown.

In Chrome, this does not work.

You can see this behavior on my website (http://www.ucubd.com)

The tabs at the top left each contain a different carousel which is
being dynamically loaded with images via AJAX

If anyone has any ideas - I'd greatly appreciate it.

Thanks,
Raphael


  1   2   >