[jQuery] Native offline jQuery docs for OS X

2009-02-11 Thread Mika Tuupola


I accidentaly posted this to jquery-ui group first. Now I am guilty of  
cross-posting too :)


Ruthless self promotion and ask for help. I created OS X dictionary   
from jQuery docs. Basically it is native offline document format and   
integrates fully with operating system. You can search the docs in   
Spotlight (Leopard only), context menus (Leopard and Tiger) and of   
course the dictionary itself.


So if you could try it out. Report if you have any problems,   
especially Tiger users. I do not have access to Tiger at the moment.


http://www.appelsiini.net/2009/2/search-jquery-api-docs-from-spotlight

Thanks to David Serduke who wrote the Python script for exporting   
jQuery wiki to XML format. Also thanks Jörn Zaefferer whose XSLT   
stylesheets I used as basis for XSLT stylesheet which converts   
exported jQuery docs to OS X dictionary XML source.


--
Mika Tuupola
http://www.appelsiini.net/



[jQuery] Re: Cycle Plugin Adds Relative Position to Slideshow Container

2009-02-11 Thread Derek Perkins

All of my stylesheets are imported above my Cycle script, and all of
my calls to JQuery are already running only after document.ready
fires. Any other thoughts?  My thought for a workaround is to add a
little bit to my script that removes the position:absolute inline
style, but that seems like an unnecessary hack.


[jQuery] Re: .hasClass() not behaving as expected.

2009-02-11 Thread MiD-AwE


Thanks for the reply. I eventually removed the -color and -image for the
css background.



mkmanning wrote:
 
 
 In your code you're attaching the hover event to the anchor tags; in
 the sample html none of the anchors has a class (the class is on the
 parent li element).
 
 On Feb 8, 4:24 pm, MiD-AwE cr.midda...@gmail.com wrote:
 Please help, I've been wrestling with this for too long now.

 I've put together this code to change the background of a div when the
 mouse hovers over a list of divs. One of the listed divs has a class
 name of ash and I want to add a background image on that one hover;
 all of the other listed divs only have colors. The problem is that
 the .hasClass() doesn't seem to be behaving as it should, or I'm not
 doing something, or I'm just completely clueless?

 Below is my code and a sample html to test. Can someone please tell me
 what I'm doing wrong? Why is my $(this).hasClass('ash') not
 recognizing when my mouse hovers over the div with the class=ash?

 Thanks in advance,

 [code]
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
     http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 html xmlns=http://www.w3.org/1999/xhtml; lang=en-us xml:lang=
 en-us
 head
   meta content=text/html; charset=UTF-8
  http-equiv=content-type /
   titlemouseover color changer with preview/title
   script type=text/javascript
  src=http://ajax.googleapis.com/ajax/libs/jquery/1.3.0/
 jquery.min.js/script
   script type=text/javascript
 //![CDATA[
 $(document).ready(function () {
   $.cstmzclrns = {clkclr : white};//$.cstmzclrns.clkclr
   $(#colors ul li a).hover(
     function () {
                         if (!$(this).hasClass('ash')) {
                           var color = $(this).css(background-color);
                     $(#cfilter).css({'background-color' : color});
                                 $(#cfilter).css({'background-image' :
 'none'});
                         } else {
                           $(#cfilter).css({'background-color' :
 'transparent'});
                           $(#cfilter).css({'background-image' :
 'url(img/ts/ash.png)'});
                         }
     }, function () {
                   if ($.cstmzclrns.clkclr == 'ash') {
                           $(#cfilter).css({'background-color' :
 'transparent'});
                           $(#cfilter).css({'background-image' :
 'url(img/ts/ash.png)'});
                         } else {
                           $(#cfilter).css({'background-color' :
 $.cstmzclrns.clkclr});
                                 $(#cfilter).css({'background-image' :
 'none'});
                         }
     }).click(
       function () {
                                 if ($(this).hasClass('ash')) {
                                   $.cstmzclrns = {clkclr : ash};
                                        
 $(#cfilter).css({'background-color' : 'transparent'});
                             $(#cfilter).css({'background-image' :
 'url(img/ts/
 ash.png)'});
                           } else {
                                   $.cstmzclrns = {clkclr :
 $(this).css(background-color)};
           $(#cfilter).css({'background-color' :
 $.cstmzclrns.clkclr});
                                        
 $(#cfilter).css({'background-image' : 'none'});
                           }
   });});

 //]]
 /script
   style media=screen type=text/css
 body {
 background-color: black;}

 #cfilter {
 margin: 0px;
 padding: 0px;
 opacity: 0.503;
 position: absolute;
 width: 473px;
 height: 466px;
 display: block;
 right: 0px;
 top: 0px;
 float: right;
 z-index: 1;
 clear: none;
 background-color: white;}

 #customize {
 border: 3px solid #afa688;
 margin: 0px;
 padding: 10px 10px 10px 13px;
 font-size: 0.8em;
 font-family: Arial,Helvetica,sans-serif;
 display: block;
 float: left;
 clear: left;
 position: absolute;
 opacity: 0.899;
 background-color: #f4e2ab;
 color: black;
 width: 200px;
 top: 25px;
 z-index: 3;}

 #colors {
 border-style: solid;
 border-width: 1px;
 padding: 0px;
 position: relative;
 background-color: white;
 height: 21px;
 top: 9px;
 width: 137px;
 left: 31px;
 display: block;}

 #colors ul {
 border-style: none;
 border-width: 1px;
 list-style-type: none;
 position: relative;
 top: -11px;
 width: 99.9%;
 left: -39px;
 height: 99.9%;}

 #colors ul li {
 margin: 0px;
 padding: 0px;
 float: left;}

 #colors ul li a {
 border: 1px solid black;
 margin: 0px 0px 0px 2px;
 padding: 0px;
 height: 15px;
 display: block;
 list-style-type: none;
 list-style-position: inside;
 width: 15px;
 float: left;}

   /style
 /head
 body style=direction: ltr;
 div id=customizeMouse over color blocks to see the
 design in available colors.
 div id=colors
               ul
                 li class=white
                    #                    background-color: white; color:
 white;. 
                 /li
                 li class=ash
                    #                    background: gray
 url(img/ts/ash.png); color:
 gray;
                   

[jQuery] any way to combine this with additional selectors?

2009-02-11 Thread lhwpa...@googlemail.com

hi i have the following problem: is there any way to combine this in
a selector like $(this) with additional selectors like $(this+
span.hello) ?

i tried this for a time but i everytime get an error. the only way i
see is:  $(#+$(this).attr(id)+  span.hello)
is this the common way ?

thanks for your answers


[jQuery] Re: Delayed Checkboxes in IE

2009-02-11 Thread Stephan Veigl

Hi Karl,

you are right.
I just tested it on IE, FF, Opera and Chrome. click works fine on all
4 browsers for both mouse and keyboard.

by(e)
Stephan


2009/2/10 Karl Swedberg k...@englishrules.com:
 On Feb 10, 2009, at 9:45 AM, Stephan Veigl wrote:

 change your
  $(input:checkbox).change(function () {...
 line to
  $(input:checkbox).bind(change click keypress, function(){...
 to catch the checkbox every time it has been clicked (either with
 mouse or keyboard)

 I'm not sure that keypress is necessary here. click should work for both
 mouse and key interaction. actually, click would probably suffice without
 change as well.

 --Karl
 
 Karl Swedberg
 www.englishrules.com
 www.learningjquery.com



[jQuery] Re: any way to combine this with additional selectors?

2009-02-11 Thread Tze Yang Ng

 hi i have the following problem: is there any way to combine this in
 a selector like $(this) with additional selectors like $(this+
 span.hello) ?

Are u thinking abt applying context to the selector 'span.hello'? If
that is the case, u can do something like this:

$('span.hello',$(this))

Cheers

-- 
http://ngty77.blogspot.com


[jQuery] Re: Only show 5 list item, hide the rest?

2009-02-11 Thread Stephan Veigl

Hi,

ok, in this case it would be, IMHO, the easiest way to split the list
in two uls and clue them together with CSS.

ul id=myList style=margin-bottom: 0px
liItem 1/li
liItem 2/li
liItem 3/li
liItem 4/li
liItem 5/li
/ul
ul id=myListExt style=margin-top: 0px
liItem 6/li
liItem 7/li
liItem 8/li
liItem 9/li
liItem 10/li
/ul

$(document).ready(function(){
   var list = $('#myListExt');
   list.hide();

   $('a#myList-toggle').click(function() {
  list.slideToggle(400);
  return false;
   });
});


Of course you can to the list splitting automatically as well.

by(e)
Stephan


2009/2/11 mofle mofl...@gmail.com:

 Thanks, one problem though.

 I slides each individual li item, i need it to slide it like if i
 would slide the whole list, but only the rest of the list that is
 hidden?





 On Feb 10, 3:01 pm, Stephan Veigl stephan.ve...@gmail.com wrote:
 Hi,

 try this one:

 var list = $('#myList li:gt(4)');
 list.hide();
 $('a#myList-toggle').click(function() {
list.slideToggle(400);
return false;
 });

 by(e)
 Stephan

 2009/2/10 mofle mofl...@gmail.com:



  Hi.

  I have an unordered list like this one:

  ul id=myList
  liItem 1/li
  liItem 2/li
  liItem 3/li
  liItem 4/li
  liItem 5/li
  liItem 6/li
  liItem 7/li
  liItem 8/li
  liItem 9/li
  liItem 10/li
  /ul

  I want to only show the 5 first items, and hide the rest.

  I have a link to toggle the hidden elements on and off:
  a href=# id=myList-toggleShow the rest/a

  I use the slideToggle(400) to slide the rest of the list in.

  Anyone?

  This is what I have now, it just toggles the whole list.
  script type=text/javascript
   $(document).ready(function() {
 $('#myList').hide();
 $('a#myList-toggle').click(function() {
   $('#myList').slideToggle(400);
   return false;
 });
   });
  /script


[jQuery] Images not showing the first time (cache?)

2009-02-11 Thread tlob

http://www.vum.ch/thomas/meienberg/content3.php
when you activate the navigation, images are cropped the first time.
If I remove the css overflow:hidden; in #s1, my navigation for the
images are behind the image.
I have no idea why. Does it have something to do with the cache? How
can I solve this?

thx in advance
tom


[jQuery] Intercept links from flash

2009-02-11 Thread adexcube

Hi, I've got a flash object who loads pdf's and there's a lot of links
on the pdf. Is there a way to catch or intercept all links with
jquery? I want to stop the link redirection, I just want the link
itself.
I tried livequery with no result. :(

Thanks


[jQuery] Re: Intercept links from flash

2009-02-11 Thread Liam Potter


in the flash rather then using getUrl, you could just send the url to a 
javascript var.


adexcube wrote:

Hi, I've got a flash object who loads pdf's and there's a lot of links
on the pdf. Is there a way to catch or intercept all links with
jquery? I want to stop the link redirection, I just want the link
itself.
I tried livequery with no result. :(

Thanks
  


[jQuery] Re: tabs, ajax mode, spinner not removed

2009-02-11 Thread Klaus Hartl

Thanks for this information. I'm about to rewrite this stuff a bit
anyway due to some other bug, and I'll take your findings into
account. Thanks again.

What I really wonder about is, that this code used to work actually.
This is why this whole logic with filtering an images in there... It
surely needs a proper unit test this time!


--Klaus




On 11 Feb., 02:51, brian bally.z...@gmail.com wrote:
 On Tue, Feb 10, 2009 at 4:17 PM, Klaus Hartl klaus.ha...@googlemail.com 
 wrote:

  I've created the ticket aready:
 http://dev.jqueryui.com/ticket/4109

 Thanks, Klaus. I think I've sorted this out, actually. Although I'm
 not certain of a fix.

 I should have been logging this[0].tagName, not
 inner(this)[0].tagName. The answer was staring me right in the face,
 above that cleanup block:

 var inner = function(parent) {
         var $parent = $(parent), $inner = $parent.find('*:last');
         return $inner.length  $inner.is(':not(img)')  $inner || $parent;

 };

 It's the $parent.find('*:last') that's the culprit. Wrapping the img
 in a span does no good because the img, being deepest, will be
 selected every time. Because we don't want the img returned, we'll
 always get $parent--which won't ever be the parent of the IMG because
 that's wrapped in the EM.

 I changed that to:
 $inner = $parent.find('*:not(img):last');

 This works!

 Of course, it fails if I have:
 spinner: 'spanimg src=/css/images/misc/spinner.gif //span'

 ... because the SPAN will be returned by inner() instead of the desired EM.

 So, it seems that there needs to be some other way to get the inner
 element. Maybe the spinner option html fragment needs to be parsed and
 the tags saved in data to better access them later?

 Or, what if, instead of having the EM always, you instead made the
 default to be:
 emloading .../em

 Don't wrap the user-provided HTML fragment inside of an EM and store
 the data in the A instead of the EM. ... and, I'm not sure where I'm
 going with this. I'll have to think about it some.

 Anyway, this seems to be the problem.


[jQuery] Re: Intercept links from flash

2009-02-11 Thread adexcube

Thanks for your response.
have you got any example or link to check?

Thanks

On 11 Feb, 09:55, Liam Potter radioactiv...@gmail.com wrote:
 in the flash rather then using getUrl, you could just send the url to a
 javascript var.

 adexcube wrote:
  Hi, I've got a flash object who loads pdf's and there's a lot of links
  on the pdf. Is there a way to catch or intercept all links with
  jquery? I want to stop the link redirection, I just want the link
  itself.
  I tried livequery with no result. :(

  Thanks


[jQuery] document.createComment usage - can be improved?

2009-02-11 Thread Marc Palmer


Hi,

I'm new to jQuery. I had to use 1.3.1 with the HtmlUnit Java web  
testing library and we found that with publicly released versions of  
HtmlUnit it fails because the JS engine cannot find the function  
document.createComment


Is this a standard DOM method or something widely supported by  
browsers?


I looked in the jQuery source, and this is only used once, and only as  
part of detection of other bugs:


(function(){
// Check to see if the browser returns only elements
// when doing getElementsByTagName(*)

// Create a fake element
var div = document.createElement(div);
div.appendChild( document.createComment() );


If there is a possibility that some browsers do not support  
createComment then shouldn't that code check first for the existence  
of the function?


Just seems that would be in the proper spirit of jQuery, as I  
understand it so far.


$0.02

~ ~ ~
Marc Palmer
Blog  http://www.anyware.co.uk
Twitter   http://twitter.com/wangjammer5
Grails Rocks  http://www.grailsrocks.com










[jQuery] Re: Intercept links from flash

2009-02-11 Thread Liam Potter


no examples, but something like this should work.

*flash:*
on(release) {
   getUrl(javascript:var flashLink = 'http://google.com')
}

*jQuery:*
$(function () {
   var jsLink = flashLink;
});

then you can do what you want to the link in jQuery, as it is held as a 
string



adexcube wrote:

Thanks for your response.
have you got any example or link to check?

Thanks

On 11 Feb, 09:55, Liam Potter radioactiv...@gmail.com wrote:
  

in the flash rather then using getUrl, you could just send the url to a
javascript var.

adexcube wrote:


Hi, I've got a flash object who loads pdf's and there's a lot of links
on the pdf. Is there a way to catch or intercept all links with
jquery? I want to stop the link redirection, I just want the link
itself.
I tried livequery with no result. :(
  
Thanks
  


[jQuery] Re: Only show 5 list item, hide the rest?

2009-02-11 Thread mofle

Hi, thank you for all your help ;)

How can I have the list splitted automatically?

Because the list is for a log, and the newest items are on the top,
and as new items are added, the old ones are pushed down, and hidden.





On Feb 11, 10:31 am, Stephan Veigl stephan.ve...@gmail.com wrote:
 Hi,

 ok, in this case it would be, IMHO, the easiest way to split the list
 in two uls and clue them together with CSS.

 ul id=myList style=margin-bottom: 0px
         liItem 1/li
         liItem 2/li
         liItem 3/li
         liItem 4/li
         liItem 5/li
 /ul
 ul id=myListExt style=margin-top: 0px
         liItem 6/li
         liItem 7/li
         liItem 8/li
         liItem 9/li
         liItem 10/li
 /ul

 $(document).ready(function(){
    var list = $('#myListExt');
    list.hide();

    $('a#myList-toggle').click(function() {
       list.slideToggle(400);
       return false;
    });

 });

 Of course you can to the list splitting automatically as well.

 by(e)
 Stephan

 2009/2/11 mofle mofl...@gmail.com:



  Thanks, one problem though.

  I slides each individual li item, i need it to slide it like if i
  would slide the whole list, but only the rest of the list that is
  hidden?

  On Feb 10, 3:01 pm, Stephan Veigl stephan.ve...@gmail.com wrote:
  Hi,

  try this one:

      var list = $('#myList li:gt(4)');
      list.hide();
      $('a#myList-toggle').click(function() {
         list.slideToggle(400);
         return false;
      });

  by(e)
  Stephan

  2009/2/10 mofle mofl...@gmail.com:

   Hi.

   I have an unordered list like this one:

   ul id=myList
   liItem 1/li
   liItem 2/li
   liItem 3/li
   liItem 4/li
   liItem 5/li
   liItem 6/li
   liItem 7/li
   liItem 8/li
   liItem 9/li
   liItem 10/li
   /ul

   I want to only show the 5 first items, and hide the rest.

   I have a link to toggle the hidden elements on and off:
   a href=# id=myList-toggleShow the rest/a

   I use the slideToggle(400) to slide the rest of the list in.

   Anyone?

   This is what I have now, it just toggles the whole list.
   script type=text/javascript
        $(document).ready(function() {
          $('#myList').hide();
          $('a#myList-toggle').click(function() {
            $('#myList').slideToggle(400);
            return false;
          });
        });
   /script


[jQuery] Re: Another Slide Effect?

2009-02-11 Thread Richard D. Worth
The jQuery UI Slide Effect:

Docs: http://docs.jquery.com/UI/Effects/Slide
Demo: http://jqueryui.com/demos/effects_showhide/#slide

- Richard

On Tue, Feb 10, 2009 at 4:18 PM, Clemens K. c...@madison.at wrote:


 (hope this time the posting works)

 hi.

 recently i transfered to jQuery from mootools. some time ago i made a
 slide-down div with mootools and wanted to get a similar effect with
 jQuery.

 example: www.madison.at - click on login!

 is there a way or a plugin in jQuery, to get the whole box slide down
 at once instead of slide down part by part?

 thanks in advance.

 best.
 c.



[jQuery] Re: Select all even row in table that are not with a specified class.

2009-02-11 Thread m.ugues

Is it possibile to add a condition in or to the not condition?

jQuery(table.font_quotazioni tr:odd:not
('.highlight','.midlight')).addClass(even);

Kind regards

Massimo Ugues



On Dec 23 2008, 10:04 pm, aquaone aqua...@gmail.com wrote:
 Sure.
 $(table.font_quotazioni 
 tr:even:not('.midlight'))...http://docs.jquery.com/Selectors/not#selector

 stephen

 On Tue, Dec 23, 2008 at 10:01, m.ugues m.ug...@gmail.com wrote:

  Hallo all.
  I got a table like this

  table class=font_quotazioni
    thead
       tr
           th title=Data Contabile class=chars4Nome/th
       /tr
    /thead
    tbody
       tr class=midlight 
          tdfoo/td
       /tr
       tr
          tdfoo/td
       /tr
       tr
          tdfoo/td
       /tr
    /tbody
  /table

  In my document.ready I set a class on even rows

  $(table.font_quotazioni tr:even).addClass(even);

  I would like to exclude all the rows that got a certain class (e.g tr
  class=midlight )
  Is it possible?


[jQuery] Re: $(element in other iframe)

2009-02-11 Thread Ami

Thank you.

You write that I need to wait until the iframe has been loaded.
So I can do this?
var frame=$(#iframe)[0].contentdocument;
$(frame).ready(function () {
alert('Iframe has been loaded!');
});

Am I right?

and Thank you again.

On Feb 8, 6:07 pm, Stephan Veigl stephan.ve...@gmail.com wrote:
 Hi Ami

 you can access an iframe with:
   var frame = window.frames[0].document;
 -or-
   var frame = $(#iframe)[0].contentDocument;

   var div = $(div, frame);

 just remember to wait until the iframe has been loaded.

 by(e)
 Stephan

 2009/2/8 Ami aminad...@gmail.com:



  Can I use jQuery to work with elements in other frames?

  For Example:

  html
  iframe id=frame1/iframe

  script
  $(#frame1 document)
  OR
  $(document, $(#frame1))
  /script


[jQuery] Re: Only show 5 list item, hide the rest?

2009-02-11 Thread Stephan Veigl

Hi,

suppose you have everything in #myList, than you could use the
following lines to split the list:

 // move overhang (index  5) to extended list and hide
 $('#myListExt').append($('#myList  li').slice(5))
.hide();


Use this function to add a new list item:

  function addLog(txt) {
var li = $('#myList  li');

// move last item to extended list
if ( li.length  4)
$('#myListExt').prepend(li.slice(4))

// add new item
$('#myList').prepend(li+txt+/li);
  }


by(e)
Stephan


2009/2/11 mofle mofl...@gmail.com:

 Hi, thank you for all your help ;)

 How can I have the list splitted automatically?

 Because the list is for a log, and the newest items are on the top,
 and as new items are added, the old ones are pushed down, and hidden.





 On Feb 11, 10:31 am, Stephan Veigl stephan.ve...@gmail.com wrote:
 Hi,

 ok, in this case it would be, IMHO, the easiest way to split the list
 in two uls and clue them together with CSS.

 ul id=myList style=margin-bottom: 0px
 liItem 1/li
 liItem 2/li
 liItem 3/li
 liItem 4/li
 liItem 5/li
 /ul
 ul id=myListExt style=margin-top: 0px
 liItem 6/li
 liItem 7/li
 liItem 8/li
 liItem 9/li
 liItem 10/li
 /ul

 $(document).ready(function(){
var list = $('#myListExt');
list.hide();

$('a#myList-toggle').click(function() {
   list.slideToggle(400);
   return false;
});

 });

 Of course you can to the list splitting automatically as well.

 by(e)
 Stephan

 2009/2/11 mofle mofl...@gmail.com:



  Thanks, one problem though.

  I slides each individual li item, i need it to slide it like if i
  would slide the whole list, but only the rest of the list that is
  hidden?

  On Feb 10, 3:01 pm, Stephan Veigl stephan.ve...@gmail.com wrote:
  Hi,

  try this one:

  var list = $('#myList li:gt(4)');
  list.hide();
  $('a#myList-toggle').click(function() {
 list.slideToggle(400);
 return false;
  });

  by(e)
  Stephan

  2009/2/10 mofle mofl...@gmail.com:

   Hi.

   I have an unordered list like this one:

   ul id=myList
   liItem 1/li
   liItem 2/li
   liItem 3/li
   liItem 4/li
   liItem 5/li
   liItem 6/li
   liItem 7/li
   liItem 8/li
   liItem 9/li
   liItem 10/li
   /ul

   I want to only show the 5 first items, and hide the rest.

   I have a link to toggle the hidden elements on and off:
   a href=# id=myList-toggleShow the rest/a

   I use the slideToggle(400) to slide the rest of the list in.

   Anyone?

   This is what I have now, it just toggles the whole list.
   script type=text/javascript
$(document).ready(function() {
  $('#myList').hide();
  $('a#myList-toggle').click(function() {
$('#myList').slideToggle(400);
return false;
  });
});
   /script


[jQuery] Ajax TABS with IE6 problem

2009-02-11 Thread urukay


Hi,

I have a problem with IE6 (IE7, Firefox, Chrome, etc there's everything ok )
and jquery tabs. It looks like that IE6 is cashing HTMLs loaded into
tabs by ajax and i just can't figure out how to prevent it (option cache:
false) doesn't work. Every tab is loaded only once.
Tried almost every release i found of JQuery UIs, Tabs.
Also this solution doesn't work either:
   $(#tab-container  div.ui-tabs-panel).empty(); 

here si my code, I'm using Django so that's why {{selected}} etc and i'm
using it to bypass cookie to remember last selected tab, because i had a lot
of problems with it and this kind of remember solution is better for me.

script type=text/javascript

$(document).ready(function(){
var $tabs = $('#message').tabs({remote: true, cache: 
false , selected:
{{selected}},
select: function() {
var 
all=document.getElementsByName('message');
for (var i =0; i  all.length; i++) 
{all[i].checked=false;}
}
});
});
/script
div id=message
ul
'li''a'  h r e f={% url message.views.inbox %}'span'{% trans 
'Inbox'
%}/'span'/ 'a'/'li'
'li''a'  h r e f={% url message.views.outbox %}'span'{% trans
'Outbox' %}/'span'/'a'/li
'li''a'  h r e f={% url message.views.spam %}'span'{% trans 'Spam'
%}/'span'/ 'a'/'li'
/ul
br/
/div

li are changed to appear corectly in this message.

I would appreciate any help.

Thanks o lot

Radovan
-- 
View this message in context: 
http://www.nabble.com/Ajax-TABS-with-IE6-problem-tp21950319s27240p21950319.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] IE7 and ajax isuses + ajax history issues

2009-02-11 Thread Omid S

Hi everyone,

First of all, THANKS for jQuery -- it is the most amazing javascript
tool I have ever used.

I have two questions however.

1. I have an ajax application where breaks when forms are submitted on
IE7 or IE6. I use IE8 and it works fine. My friends use IE7 and the
behavior they get is weird. When they click on the element that
triggers the ajax it is as if all the form fields do not exist.

I looked online and people say to do onSubmit='return false;' or
some version of that, but that doesn't work

2. Lastly, when I use ajax I would like to use the history of the
browser. Is there an easier way to keep the history instead of storing
the called urls in an array. Or is there a design or preferred plug in
out there that I can use to see how they coded it?

Again, this is an amazing tool, anyone who has contributed to jQuery
deserves a free pass to heaven.


[jQuery] Problem in alerting the mouseover values

2009-02-11 Thread puneetpandey85

Hi all,

I am playing around with jquery.autocomplete.js file since last couple
of days. There is a function inside this file name function init(),
inside this there is a function(event) which takes care of mouseover
events. have a look:

function init() {
if (!needsInit)
return;
element = $(div/)
.hide()
.addClass(options.resultsClass)
.css(position, absolute)
.appendTo(document.body);

list = $(ul/).appendTo(element).mouseover( function(event) {
if(target(event).nodeName  
target(event).nodeName.toUpperCase() ==
'LI') {
active = $(li, list).removeClass(CLASSES.ACTIVE).index
(target(event));
$(target(event)).addClass(CLASSES.ACTIVE);
//getSubList('Computers');
//alert($(event.target).list);
//alert($(target(event)).element.parentNode);
//alert($(target(event)).element.value);
}
}).click(function(event) {
$(target(event)).addClass(CLASSES.ACTIVE);
select();
// TODO provide option to avoid setting focus again after 
selection?
useful for cleanup-on-focus
input.focus();
return false;
}).mousedown(function() {
config.mouseDownOnSelect = true;
}).mouseup(function() {
config.mouseDownOnSelect = false;
});

if( options.width  0 )
element.css(width, options.width);

needsInit = false;
}

if you look at closely on the commented lines inside function(event)
added by me, you will find that I am trying to alert the mouseover
value, but I am not getting success in it, I am getting errors like
undefined, [object Object] but not getting the actual value.

My motto is when once I get the mouseover value, I will pass it to a
function [like //getSubList('my_alerted_value');] and use that value
in my html code.

Please help me on this and let me know how should I able to alert the
mouseover value.

Thanks a lot in Advance
Puneet


[jQuery] typo in docs for post entry

2009-02-11 Thread humanclock

Hey, I couldn't tell if this should get posted here or in Trac, so I'm
posting it here.

I wanted to point out a bug in the docs:
http://docs.jquery.com/Post

   function(returned_data)
 {
 alert(data);
 });

should be:

   function(returned_data)
 {
 alert(returned_data);
 });


[jQuery] typo in docs for post entry

2009-02-11 Thread humanclock

Anyway, I wanted to point out a bug in the docs:

alert(data);


[jQuery] Selecting value from html

2009-02-11 Thread r1u0...@gmail.com

Hello!

I've got some question:

I've got variable 'tr' which contains html from table row.
How I can read text from second td tag. This tag contains _colid=2
attribute.

I was trying to do something like that:
$(tr ':'td:(eq(2))').text(); but it's not working.


[jQuery] $.ajax

2009-02-11 Thread SUHAS

$.ajax retriving data from old request.

if I re-open the link then latest data is shown

why it is happening



function getTask(qry)
{
tline = qry;
document.getElementById(tline).innerHTML = Fetching recs
+tline;

var dbcommand = datadbname+dbname+/dbnamedbquery![CDATA
[+qry+]]/dbquerymaxrecs+n+/maxrecs/data;
// alert(dbcommand);
//var o = $.get(http://localhost:1234/dbqex.aspx,{dbcmd:dbcommand},
function(data){alert(Data Loaded:  + data);  });

var o = $.ajax({
type: GET,
url: http://localhost:1234/dbqex.aspx;,
data:dbcmd=+dbcommand,
success: insertTaskDataToForm,
error:function(req,textStatus,errorThrown){
// if url failes you will get textStatus = 'error'
// req and errorThrown do not contain info
alert(textStatus);

}
});
}



regards,

Suhas


[jQuery] JQuery Event Handler not Working

2009-02-11 Thread Jawed

Hi Friends,

I am a newbie here, so I decided to follow a simple example mentioned
in a tutorial, but I stuck here,

 $(a).click(function(event){
   alert(Thanks for visiting!);
event.preventDefault();
 });

the expected behavior of this code should be whenever I click


[jQuery] IE7 Zoom and the cluetip plugin

2009-02-11 Thread astr

Hi, everybody,

I have a problem with IE7/Cluetip plugin. IE7 Currupts the tooltips in
the jQuery ClueTip plugin if you zoom the page. See, eg., the example
on the Cluetip demo page  plugins.learningjquery.com/cluetip/demo/ ,
default style, 9. mouse tracking.

Zooming is a good property, though not if it is poorly implemented. It
seems to be in IE7 (google confirms), so it is either give up the
Cluetip or ignore IE7, unless there is some remedy, which I am not
able to find.  Has anybody hit on a way out of this problem?

The best to all


[jQuery] : Selecting value from html

2009-02-11 Thread Radosław Lejsza
Hello!

I've got some question:

I've got variable 'tr' which contains html or text from table row.
How I can read text from second td tag. This tag contains _colid=2
attribute.

I was trying to do something like that:
$(tr ':'td:(eq(2))').text(); but it's not working.

Cheers

Radek


[jQuery] Ie6 ajax tabs problem

2009-02-11 Thread urukay


Hi,

I have a problem with IE6 (IE7, Firefox, Chrome, etc there's everything ok )
and jquery tabs. It looks like that IE6 is saving all in cashe and i just
can't figure out how to prevent it (option cache: false) doesn't work.
Every tab is loaded only once.
Tried almost every release i found of JQuery UIs, Tabs.
Also this solution doesn't work either:
   $(#message  div.ui-tabs-panel).empty();

here si my code, I'm using Django so that's why {{selected}} etc and i'm
using it to bypass cookie to remember last selected tab, because i had a lot
of problems with it and this kind of remember solution is better for me.

Parts of code is here:
http://dpaste.com/hold/119263/

I would appreciate any help.

Thanks o lot

Radovan
-- 
View this message in context: 
http://www.nabble.com/Ie6-ajax-tabs-problem-tp21952147s27240p21952147.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Problem in selectors

2009-02-11 Thread Cerdrifix

Hallo,

I am experimenting jQuery 1.3.1.
In one of my pages i have a simple table (id=tElenco) with different
rows.
Some of these rows have a class named disabled (tr
class=disabled/tr).

I wrote a script that toggle visibility to disabled rows, depending on
a checkbox:

function toggleDisabled(table, isChecked) {
if (isChecked)
table.find('tr.disabled').show();
else
table.find('tr.disabled').hide();
}

In  jQuery 1.2.6 this script always worked. In jQuery 1.3.1 it has
some troubles.
I tried to compare these two selectors and the results are really
strange.
Here is the console response:

$j('#tElenco tr.disabled')
{...}
[0]: {object}
[1]: {object}
[2]: {object}
[3]: {object}
[4]: {object}
context: {object}
jquery: 1.3.1
length: 5
prevObject: {...}
selector: #tElenco tr.disabled
$j('#tElenco').find('tr.disabled')
{...}
[0]: {object}
context: {object}
jquery: 1.3.1
length: 1
prevObject: {...}
selector: #tElenco tr.disabled

The first selection returns 5 objects (this is correct!). The second
one returns just a single object, the first of the expected 5.

Why is it happening? Has something changed in new release?

Sorry for my English..
thanks,
Davide.



[jQuery] JQuery Event Handler not Working

2009-02-11 Thread Jawed

Hi Friends,

I am a newbie here, so I decided to follow a simple example mentioned
in a tutorial, but I stuck here,

 $(a).click(function(event){

   alert(Thanks for visiting!);
   event.preventDefault();

});


the expected behavior of this code should be whenever I click the link
on my page, the pop should appear saying Thanks for visiting!, and
there would be no redirection. but it is not working in this way, I
click the link and it lead me to the src mentioned in the link, no pop
up, no prevention of default behavior whatsoever.

Thanks
Jawed


[jQuery] Selecting value from html

2009-02-11 Thread r1u0...@gmail.com

Hello!

I've got some question:

I've got variable 'tr' which contains html or text from table row.
How I can read text from second td tag. This tag contains _colid=2
attribute.

I was trying to do something like that:
$(tr ':'td:(eq(2))').text(); but it's not working.

Cheers

Radek


[jQuery] Re: $(element in other iframe)

2009-02-11 Thread Stephan Veigl

Hi Ami,

you can bind the load event to your iframe, but I'm not sure if there
are any browser quirks

see also this plugin:
http://ideamill.synaptrixgroup.com/?p=6


by(e)
Stephan


2009/2/11 Ami aminad...@gmail.com:

 Thank you.

 You write that I need to wait until the iframe has been loaded.
 So I can do this?
 var frame=$(#iframe)[0].contentdocument;
 $(frame).ready(function () {
 alert('Iframe has been loaded!');
 });

 Am I right?

 and Thank you again.

 On Feb 8, 6:07 pm, Stephan Veigl stephan.ve...@gmail.com wrote:
 Hi Ami

 you can access an iframe with:
   var frame = window.frames[0].document;
 -or-
   var frame = $(#iframe)[0].contentDocument;

   var div = $(div, frame);

 just remember to wait until the iframe has been loaded.

 by(e)
 Stephan

 2009/2/8 Ami aminad...@gmail.com:



  Can I use jQuery to work with elements in other frames?

  For Example:

  html
  iframe id=frame1/iframe

  script
  $(#frame1 document)
  OR
  $(document, $(#frame1))
  /script


[jQuery] [treeview] newbie question

2009-02-11 Thread heohni

Hi,

I just got it done to implement my treeview menu:
http://packpilot.s15312582.onlinehome-server.info/?f=packpilot

I know, there are still some debug infos in the [ ] and the css is not
right.

But what I want to know today is, how can I setup my menu to show in
general the first 2 levels epanded?
And how is the menu keeping the informtion when a third level is
exapnded and the page reloads?

It would eb great if someone could help me with that.

Thanks!!


[jQuery] Re: Cycle Plugin Adds Relative Position to Slideshow Container

2009-02-11 Thread Mike Alsup

 All of my stylesheets are imported above my Cycle script, and all of
 my calls to JQuery are already running only after document.ready
 fires. Any other thoughts?  My thought for a workaround is to add a
 little bit to my script that removes the position:absolute inline
 style, but that seems like an unnecessary hack.

I have the same comment.  I'd move all of your stylesheet links so
they are before all of your script tags in the document.  It seems
clear that when Cycle runs the style prop on your container is not yet
'absolute'.  However, if I click one of those images and go to the
linked page, and then use the back button on my browser, the pages
renders just fine.  When I inspect the element in this case it *does*
have absolute position. So I think it is definitely a timing issue.


[jQuery] Re: Safe Ajax Calls?

2009-02-11 Thread SoulRush

I though that it would be nice to make the links with a certain format
like:

a href=ajaxProcess.php?var1=var1valuevar2=var2value class=aj-
link link/a

And make a selection for that kind of links with jquery, that takes
these data to make an ajax call with post...

That selection should be in a .js outside of the source of the pages
and packed or something...

What do you think?

Please I need some feedback :)
Greetings!

On 9 feb, 17:02, SoulRush saavedra@gmail.com wrote:
 By the way, the first parameter takes the vars to send... so in the
 pages I've to dynamically set varname1=value1varname2=value2

 On 9 feb, 10:40, SoulRush saavedra@gmail.com wrote:

  Hi!

  I'm kind of new at the world of ajax and jquery and i'm starting to
  make a site with them.

  In my site i've created a single function (in the header) called
  ajaxQry(...) which takes some parameters like, url to make post or
  get, if I need GEt or POST, the data type of the query, a success
  function and an error function.

  Anyway, it look like this:

  function ajaxQry(sendVars, url, returnType, backFunction,
  errorFunction){

           $.ajax({
            type: POST,
            url: ajax/+url+.asp?nocache=+Math.random(),
            data: sendVars,
            success: backFunction, //ussully this loads the content in the 
  main
  page as html
            dataType: returnType,
            error: errorFunction
          });

  }

  Everything works great but i don't know if there's a better way to do
  this, because in many events of the site I call this function... And
  I'm starting to think that it's pretty insecure What do you think?

  By the way i ussually call the url file (see the function) and return
  HTML content, and then i load it in the page with $(selector).html();
  is that okay?

  Thanks! and sorry for my english :$


[jQuery] Image swap behaviour with fade in/out using hover()

2009-02-11 Thread CrisD

I have been trying to over 3 weeks to write this without success.  So
far I have found swapImage (http://code.google.com/p/jquery-swapimage)
that works well to replace images, and bannerSwapper (http://
plugins.jquery.com/project/BannerSwapper) that pre-loads limited
images and does the swap with fade in/out effect, but I really need a
function that combines the two and allows the default image to fade in
and out using hover()  (http://docs.jquery.com/Events/hover#overout)
I know it is possible, how close I am getting remains to be seen...

Example:
$.('#menu  img').hover(
  function(){//on mouseover
  $(this).fadeOut('img[1]',100,swapImageIn);
  $(this).fadeIn('img[2]',100);
}
  function(){//on mouseout
 $(this).fadeOut('img[2]',100, swapImageBack);
 $(this).fadeIn('img[1]',100);
}


)}
  swapImageIn(){
$(this).replaceWith(img2);
}
  swapImageBack(){
$(this).replaceWith(img1);
}
 a href=# class=swapperimg src=image1.gif {src=image2.gif} /
/a

to fade out, swap and fade new image back in.

Any help in the right direction would be great, I'm nearly at my wit's
end (and my wit is getting nervous ;)

Thanks in advance,

Cris D.


[jQuery] Expand and collapse a list

2009-02-11 Thread mofle

Hi, I'm trying to create a collapsible list, that only shows the first
5 items, and hides the rest. If click the link it will slide in the
rest of the list items, and if I click the link again it will hide the
expanded list items.

How can I do that? and is there a better way to do this?



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

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

var list = $('ul#myList');
var original_height = list.height();
list.css({height:$('#myList li').height()*5});

$('a#myList-toggle').click(function() {
list.animate({height:original_height})
   return false;
});

  });
/script

style type=text/css
ul#myList {
overflow: hidden;
}
/style
/head
body

a href=# id=myList-toggleShow the rest/a

ul id=myList
liItem 1/li
liItem 2/li
liItem 3/li
liItem 4/li
liItem 5/li
liItem 6/li
liItem 7/li
liItem 8/li
liItem 9/li
liItem 10/li
/ul


/body
/html


[jQuery] Re: using :has with selector

2009-02-11 Thread Michael Lawson

If mytext is a string, make sure it's quoted as said before.  Your jquery
selector looks ok (I did something similar recently and it works great)

cheers

Michael Lawson
Content Tools Developer, Global Solutions, ibm.com
Phone:  1-919-517-1568 Tieline:  255-1568
E-mail:  mjlaw...@us.ibm.com

'Examine my teachings critically, as a gold assayer would test gold. If you
find they make sense, conform to your experience, and don't harm yourself
or others, only then should you accept them.'


   
  From:   SteelRing steelr...@gmail.com  
   
  To: jQuery (English) jquery-en@googlegroups.com  
   
  Date:   02/10/2009 05:51 PM  
   
  Subject:[jQuery] Re: using :has with selector
   






This is going to select the td, whereas I need to select the tr.

On Feb 10, 4:41 pm, Mauricio \(Maujor\) Samy Silva
css.mau...@gmail.com wrote:
 TD is a TR children so use the CSS descendant selector tr td.

 $(#tableid tbody tr td.someclass:contains('mytext'))).dosomething();

 PS: mytext is a string and should be quoted.

 Maurício

 -Mensagem Original-
 De: SteelRing steelr...@gmail.com
 Para: jQuery (English) jquery-en@googlegroups.com
 Enviada em: terça-feira, 10 de fevereiro de 2009 19:57
 Assunto: [jQuery] using :has with selector



  Anyone can think of a reason why this shouldn't work? I'm trying to
  select the Row (tr) where the cell of td with class someclass
  contains mytext. Since I want to work on the row (tr) itself, I need
  to use :has because I don't need to select the td itself. Am I wrong
  or am I wrong?

  $(#tableid tbody tr:has(td.someclass:contains(mytext))).dosomething
  ();

inline: graycol.gifinline: ecblank.gif

[jQuery] Re: Intercept links from flash

2009-02-11 Thread Michael Lawson

You could also use the ExternalInterface package.  There is a method in
there called call() where you just pass in the name of the javascript
function, followed by any pramaters.  Easiest thing to do here would have
some setter functions for the vars you want to set so

function setLink(link)
{
  var myLink = link;
}


on flash

import the package;

ExternalInterface.call('setLink','www.google.com');


Hope that helps a little!

cheers

Michael Lawson
Content Tools Developer, Global Solutions, ibm.com
Phone:  1-919-517-1568 Tieline:  255-1568
E-mail:  mjlaw...@us.ibm.com

'Examine my teachings critically, as a gold assayer would test gold. If you
find they make sense, conform to your experience, and don't harm yourself
or others, only then should you accept them.'


   
  From:   Liam Potter radioactiv...@gmail.com
   
  To: jquery-en@googlegroups.com   
   
  Date:   02/11/2009 05:44 AM  
   
  Subject:[jQuery] Re: Intercept links from flash  
   






no examples, but something like this should work.

*flash:*
on(release) {
getUrl(javascript:var flashLink = 'http://google.com')
}

*jQuery:*
$(function () {
var jsLink = flashLink;
});

then you can do what you want to the link in jQuery, as it is held as a
string


adexcube wrote:
 Thanks for your response.
 have you got any example or link to check?

 Thanks

 On 11 Feb, 09:55, Liam Potter radioactiv...@gmail.com wrote:

 in the flash rather then using getUrl, you could just send the url to a
 javascript var.

 adexcube wrote:

 Hi, I've got a flash object who loads pdf's and there's a lot of links
 on the pdf. Is there a way to catch or intercept all links with
 jquery? I want to stop the link redirection, I just want the link
 itself.
 I tried livequery with no result. :(

 Thanks


inline: graycol.gifinline: ecblank.gif

[jQuery] currying in jquery.

2009-02-11 Thread shiva

All,
I have an object like:

p = {

..
click: function(target){

}

};
function curry(fn,s)
{
var scope = s || window;
var args = Array.prototype.slice.call(arguments, 2) || [];

return function()
{
fn.apply(scope, args);
};
}

I register events like:
$('.preview').click(function(){f=curry(preview.click,preview,$(this));f
();});

I am achiving the desired effect  by the above line. I feel it the
above line loks ugly.  Is there any other means of doing this?

TIA,
-Shiva



[jQuery] jQuery UI dialog simple question for a newbie

2009-02-11 Thread EJB

Hi all.

A very simple jquery UI dialog question as I undertake learning this
new tool:

I have a button:

asp:Button id=btnCancelMeeting Text=Cancel Event runat=server
OnClientClick='javascript:return jsConfirmCancellation();' /

that calls this function:

function jsConfirmCancellation() {

return  $(document).ready(function() { $('#CancelDialog').dialog
('open'); });

}

which opens this dialog:
 div id=CancelDialog title=Cancel and Event or MeetingpCancel
this event./p/div

using this function:

$(function() {
// Cancel Event Dialog Box
$('#CancelDialog').dialog({
autoOpen: false,
width: 500,
buttons: {
Cancel This Event: function() 
{$(this).dialog(close);return
true;},
Do Not Cancel: function() 
{$(this).dialog(close);return
false;}
}
});

What doesn't happen is the jsConformcancellation function is not
returning true or false depending on the button clicked.

I am a brand new (2 hours so far) jquery/javascript programmer, so
sorry for the perhaps amateurish question...


[jQuery] Re: jQuery UI dialog simple question for a newbie

2009-02-11 Thread Richard D. Worth
For the benefit of others there, we'd be happy to answer your question over
on the jQuery UI list:

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

Thanks.

- Richard

On Wed, Feb 11, 2009 at 8:48 AM, EJB e...@capestreetfarm.com wrote:


 Hi all.

 A very simple jquery UI dialog question as I undertake learning this
 new tool:

 I have a button:

 asp:Button id=btnCancelMeeting Text=Cancel Event runat=server
 OnClientClick='javascript:return jsConfirmCancellation();' /

 that calls this function:

 function jsConfirmCancellation() {

 return  $(document).ready(function() { $('#CancelDialog').dialog
 ('open'); });

 }

 which opens this dialog:
  div id=CancelDialog title=Cancel and Event or MeetingpCancel
 this event./p/div

 using this function:

$(function() {
// Cancel Event Dialog Box
$('#CancelDialog').dialog({
autoOpen: false,
width: 500,
buttons: {
Cancel This Event: function()
 {$(this).dialog(close);return
 true;},
Do Not Cancel: function()
 {$(this).dialog(close);return
 false;}
}
});

 What doesn't happen is the jsConformcancellation function is not
 returning true or false depending on the button clicked.

 I am a brand new (2 hours so far) jquery/javascript programmer, so
 sorry for the perhaps amateurish question...



[jQuery] Question about jQuery.load()

2009-02-11 Thread M.A.R.C.O

can anybody teach me how i can use jQuery.load() to attach javascript
files.

Thanks for your times.


[jQuery] onclick event on a href calls a function , where to return false to prevent redirection

2009-02-11 Thread goldy

function buildingedit(searchhtmlid, filename, editid, idnum, addnum,
obj)
{
//closeinst(searchhtmlid);

var params = $.evalJSON('{'+editid+':'+idnum+',add:'+addnum
+',showhtml:2}');
var myelem = document.getElementById('lastid');
var lastid = myelem.value;

var $tablerow = $(searchhtmlid+idnum).clone(true);

$(searchhtmlid+lastid).css('background-color','#FF');
if(lastid)
{
if(lastid!=idnum)
{
$.get(filename,
params,
function(returned_data)
{

var rs = $('div 
id=editwindow style=display:none;/
div');

$(searchhtmlid+idnum).hide();

$(searchhtmlid+idnum).after(rs);

//$(searchhtmlid+idnum).css('background-color','#DCE4F5');

$('#editwindow').css('background-color','#DCE4F5');
rs.html(returned_data);
rs.fadeIn(2000, 
function(){

$(this).css('display','block');
});
});

myelem.value = idnum;
setTimeout(prepareForm(+idnum+), 2000);
}
else
{
$('div#editwindow').fadeOut(1000, function(){


$(this).remove();


$(searchhtmlid+idnum).show();


});
myelem.value = 0;
//closeprev(obj);
}
}
else
{
$.get(filename,
params,
function(returned_data)
{
var rs = $('div 
id=editwindow style=display:none;/
div');

$(searchhtmlid+idnum).hide();

$(searchhtmlid+idnum).after(rs);

//$(searchhtmlid+idnum).css('background-color','#DCE4F5');

$('#editwindow').css('background-color','#DCE4F5');
rs.html(returned_data);
rs.fadeIn(2000, 
function(){

$(this).css('display','block');
});
});

myelem.value = idnum;
}

return false;

}


and this is called here

a class=ToggleClose onClick=buildingedit('#descr',
'descriptionsadd.php', 'did', ?= $did ?, 2, this);
href=descriptionsadd.php?add=2did=?= $did ?showhtml=2 /a


[jQuery] Re: Hiding Dialog 'x' button

2009-02-11 Thread Mike Alsup

 I want to hide the 'x' button on the dialog dynamically.
 Is there a good way to do it? or is there a setting? i couldnt find one.
 All i can think of is doing something like
 $(.ui-dialog-titlebar-close).css(display, none);
 However I dont think this is a good way. And if i have more than one dialog
 on the page then all 'x' buttons will disappear.

You have to do this dynamically?  If not, you can just use a css rule
in your stylesheet.


[jQuery] Re: Only show 5 list item, hide the rest?

2009-02-11 Thread Liam Byrne


Just a quickie...

$(document).ready(function() {
   numVisible=4;
   itemHeight=$(#myList li).height();
   $(#myList).css({height:numVisible*itemHeight,overflow:hidden});
});

In IE, this loses the bullet points, but it's a start and maybe someone 
else has a solution for that.


Liam

mofle wrote:

Hi.

I have an unordered list like this one:

ul id=myList
liItem 1/li
liItem 2/li
liItem 3/li
liItem 4/li
liItem 5/li
liItem 6/li
liItem 7/li
liItem 8/li
liItem 9/li
liItem 10/li
/ul

I want to only show the 5 first items, and hide the rest.

I have a link to toggle the hidden elements on and off:
a href=# id=myList-toggleShow the rest/a

I use the slideToggle(400) to slide the rest of the list in.

Anyone?


This is what I have now, it just toggles the whole list.
script type=text/javascript
  $(document).ready(function() {
$('#myList').hide();
$('a#myList-toggle').click(function() {
  $('#myList').slideToggle(400);
  return false;
});
  });
/script



No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.0.233 / Virus Database: 270.10.20/1943 - Release Date: 02/10/09 07:20:00


  




[jQuery] Re: validation with jquery 1.3

2009-02-11 Thread goldy
oh, ye, stupid error
my bad

On Feb 10, 12:38 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
wrote:
 There is no maxlenght method, its maxlength.

 Jörn

 On Tue, Feb 10, 2009 at 10:51 AM, goldy zlati.pehliva...@gmail.com wrote:

  Hei there seems validation works only if all the fields are not
  filled. if i fill one of the required fields the validation passes and
  submit the form.
  $.validator.setDefaults({
                 submitHandler: function() { alert(submitted!); }
         });

         $().ready(function() {

                 // validate signup form on keyup and submit
                 $(#contactForm).validate({
                         rules: {
                                 name: {required: true, maxlenght: 40},
                                 address: {required: true, maxlenght: 30},
                                 zipcode: required,
                                 city: {required: true, maxlenght: 20},
                                 email: {
                                         required: true,
                                         email: true,
                                         maxlenght: 30
                                 },
                                 repeat_email: {
                                         required: true,
                                         email: true,
                                         maxlenght: 30,
                                         equalTo: #email
                                 },
                                 service_name:{required: true,maxlenght: 40},
                                 order_number:{required: true,maxlenght: 10},
                                 reason_of_cancellation:{required: 
  true,maxlenght: 300},
                                 erroneous_page_address:{required: 
  true,maxlenght: 100},
                                 error_description:{required: true,maxlenght: 
  300}
                         },

                         messages: {
                                 name: {
                                         required: Please enter your first 
  and last name,
                                         maxlenght: Your name must consist 
  maximum of 40 characters
                                 },
                                 address: {
                                         required: Please enter your 
  address,
                                         maxlenght: Your address must 
  consist maximum of 40 characters
                                 },
                                 zipcode: Please enter your ZIP code,
                                 city: {
                                         required: Please enter your city,
                                         maxlenght: Your city must consist 
  maximum of 20 characters
                                 },
                                 email:{
                                         required: Please provide an email,
                                         email: Please enter a valid email 
  address,
                                         maxlenght: Your email must consist 
  maximum of 30 characters
                                 },
                                 repeat_email: {
                                         required: Please enter the same 
  email as above,
                                         maxlenght: Your email must consist 
  maximum of 30 characters,
                                         equalTo: Please enter the same 
  email as above
                                 }
                         }
                 });

         });

  On Jan 30, 8:24 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
  wrote:
  Have you updated 
  to1.5.1?http://bassistance.de/2009/01/14/releases-jquery-13-and-validation-pl...

  Jörn

  On Fri, Jan 30, 2009 at 5:17 PM, andré l...@chrom.fr wrote:

   Hello,
   Thanks for your fabulousvalidationform.
   But I 've a problem.When I use jquery 1.2.6, my form works well on IE,
   firefox and safari. But When I use jquery 1.3 in IE the error message
   doesn't work Can you help me ?
   my script :
   $().ready(function() {

          // validate signup form on keyup and submit
          $(#InfoClient).validate({
                  rules: {
                          Nom : required,
                          Prenom : required,
                          DateNaissance : {
                                                          date: true
                                                  },
                          Adresse : required,
                          CodePostal : required,
                          Ville :required,
                          Pays : {
                                          digits: true
                                  },
                          TelFixe: {
                                                  digits:true,
                                                  required: 
   function(element) {
                      

[jQuery] Re: Question about jQuery.load()

2009-02-11 Thread Michael Lawson

There is a jQuery function that works specifically on javascript files:
jQuery.getScript( url, callback )
is that what you're looking for?)
cheers

Michael Lawson
Content Tools Developer, Global Solutions, ibm.com
Phone:  1-919-517-1568 Tieline:  255-1568
E-mail:  mjlaw...@us.ibm.com

'Examine my teachings critically, as a gold assayer would test gold. If you
find they make sense, conform to your experience, and don't harm yourself
or others, only then should you accept them.'


   
  From:   M.A.R.C.O yin_gr...@yahoo.com.hk 
   
  To: jQuery (English) jquery-en@googlegroups.com  
   
  Date:   02/11/2009 09:26 AM  
   
  Subject:[jQuery] Question about jQuery.load()
   






can anybody teach me how i can use jQuery.load() to attach javascript
files.

Thanks for your times.

inline: graycol.gifinline: ecblank.gif

[jQuery] Hiding Dialog 'x' button

2009-02-11 Thread Steven Yang
Hi
I want to hide the 'x' button on the dialog dynamically.
Is there a good way to do it? or is there a setting? i couldnt find one.
All i can think of is doing something like
$(.ui-dialog-titlebar-close).css(display, none);
However I dont think this is a good way. And if i have more than one dialog
on the page then all 'x' buttons will disappear.

Thanks


[jQuery] Re: combine slide and fade

2009-02-11 Thread Christopher
thx! both works nice!

On Wed, Feb 11, 2009 at 4:08 AM, mkmanning michaell...@gmail.com wrote:


 You could try this:
 jQuery.fn.slideFadeToggle = function(speed, easing, callback) {
return this.animate({opacity: 'toggle', height: 'toggle'}, speed,
 easing, callback);
 };

 On Feb 10, 12:31 pm, Paul Mills paul.f.mi...@gmail.com wrote:
  Hi Chris,
  It's a bit tricky trying to get 2 effects to run at the same time on
  the same jQuery selection. My approach would be to change the HTML
  mark up so that the 2 effects can be applied to different selections.
  So if you have some HTML like this:
buttonToggle/button
p id=text
span
  This is the content to be hidden and shown
span
/p
 
  You can apply the slide effect to the p and the fade to the span.
  JavaScript a bit like this:
  $(button).toggle(function () {
$(#text span).fadeOut(slow);
$(#text).slideUp(slow);
  },function() {
$(#text span).fadeIn(slow);
$(#text).slideDown(slow);
  });
 
  Hope that helps
  Paul



[jQuery] Re: Using jQuery Validation with Dot Net

2009-02-11 Thread Aaron Gundel

After looking this over, I found that the validator wasn't picking up
your submit button, which isn't really a button.  It's the link you
use to submit.  the validation plugin won't catch this because it
[your link] appears to do a straight up call to form.submit().  I
popped a submit button in there and all your rules started working.
Hope this helps,

Aaron

On Tue, Feb 10, 2009 at 11:14 AM, Jon cakeordeat...@gmail.com wrote:

 I've set up a test site here:
 http://test.sunshine-design.co.uk/

 I hope you can point me in the right direction, i've not had any
 further luck solving this!

 Thanks

 On Feb 9, 3:10 pm, Aaron Gundel aaron.gun...@gmail.com wrote:
 Yes, it would be helpful.  Can't really see what's going on in the
 snippet you provided.  As Rob mentioned, there's no mention of the
 form (even though it is there on the page).  It might give some
 additional clues as to where things have gone wrong.

 On Mon, Feb 9, 2009 at 3:46 AM, Jon cakeordeat...@gmail.com wrote:

  @ RobG: #aspnetForm is the form that wraps the whole of adotnet
  page. I simply posted the html snippet from the form itself.
  Individual forms do not have their own form tags, there is one large
  one that encloses the whole page - part of thedotnetinfrastructure.

  @ Aaron Grundel: No, but i will put one up tonight if it will help.
  I'm eager to use this validation plugin!

  On Feb 9, 2:14 am, RobG rg...@iinet.net.au wrote:
  On Feb 9, 8:30 am, Jon cakeordeat...@gmail.com wrote:

   I'm having issues getting the validation plugin (http://bassistance.de/
   jquery-plugins/jquery-plugin-validation/) to work withdotnet.
   Whatever i try i can't stop the form from submitting. I've tried
   several things i've found on this group and the web. Can anyone help
   me getting this to work?

   Here's my html.

   span id=ctl00_Control_LeftColumn_CF_Contact class=ContactForm
   p class=SuccessMessageSubmitted/p
   span class=Field
   span class=LabelName /span
   span class=Validation
   span id=ctl00_Control_LeftColumn_CF_Contact_ctl01_ctl04
   style=display: none;/
   /span
   input id=ctl00_Control_LeftColumn_CF_Contact_ctl01_TB_TextBox
   class=TextBox Name type=text name=ctl00$Control_LeftColumn
   $CF_Contact$ctl01$TB_TextBox/
   /span
   span class=Field
   /span
   span class=Field
   /span
   a id=ctl00_Control_LeftColumn_CF_Contact_LB_Submit class=Submit
   href=javascript:__doPostBack('ctl00$Control_LeftColumn$CF_Contact
   $LB_Submit','') style=background-color: rgb(51, 51, 51);Submit/a
   /span

  Invalid markup, there is no form.

   And here is my javascript:

   $(document).ready(function(){
   $(#aspnetForm).validate({

  Where is #aspnetForm?

  --
  Rob


[jQuery] Re: : Selecting value from html

2009-02-11 Thread Paul Mills

Try this
$('tr td:eq(1)').text();

indexing starts from zero so second column is index=1.

Paul

On Feb 11, 8:43 am, Radosław Lejsza r1u0...@gmail.com wrote:
 Hello!

 I've got some question:

 I've got variable 'tr' which contains html or text from table row.
 How I can read text from second td tag. This tag contains _colid=2
 attribute.

 I was trying to do something like that:
 $(tr ':'td:(eq(2))').text(); but it's not working.

 Cheers

 Radek


[jQuery] Search for plugin - 3 horizontal growing elements

2009-02-11 Thread Martin Hintzmann

Hi :D

I am searching for a jQuery plugin that can put 3 elements side-by-
side, when you move your mouse over one of the elements it grows
horizontal and take space from the 2 other elements.

A flash version of this can be seen at the following url:
http://www.arken.dk/

Hope someone can help me and thanks in advance
Martin Hintzmann


[jQuery] Re: Is A Child Of?

2009-02-11 Thread Ami

The Best solution:

I have writed a very small plugin (1 line) for that, by using the code
of Richard

jQuery.fn.childOf=function(a){var b=this;return ($(b).parents().filter
(function() { return this === $(a)[0]; }).length )}

For Example:
$(div).childOf(document.body)
$(div).childOf($(document.body))

I hope that there is  no bugs in this code.


On 22 ינואר, 11:25, James Hughes j.hug...@kainos.com wrote:
 Hi,

 This is probably a really easy question an I apologise if it appear stupid 
 but I am clueless right now.  Given 2 jQuery objects (a,b) how can I tell if 
 b is a child of a?

 James

 
 This e-mail is intended solely for the addressee and is strictly 
 confidential; if you are not the addressee please destroy the message and all 
 copies. Any opinion or information contained in this email or its attachments 
 that does not relate to the business of Kainos
 is personal to the sender and is not given by or endorsed by Kainos. Kainos 
 is the trading name of Kainos Software Limited, registered in Northern 
 Ireland under company number: NI19370, having its registered offices at: 
 Kainos House, 4-6 Upper Crescent, Belfast, BT7 1NT,
 Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
 registered in Ireland for VAT under number: 9950340E. This email has been 
 scanned for all known viruses by MessageLabs but is not guaranteed to be 
 virus free; further terms and conditions may be
 found on our website -www.kainos.com


[jQuery] Re: Search for plugin - 3 horizontal growing elements

2009-02-11 Thread Martin Hintzmann

... sorry I should have google it a bit more before asking for
help...

What I was searching for is called a horizontal accordian.

And I found a very good example right here
http://designreviver.com/tutorials/jquery-examples-horizontal-accordion/


[jQuery] Re: $.post NOT_ENOUGH_ARGS

2009-02-11 Thread Tim Johnson

On Tuesday 10 February 2009, mkmanning wrote:
 For the second argument use $(form).serialize()

 You should also use onsubmit=return CheckForm0(this);
 although the best practice would be to remove the inline script and
 bind
 the submit event like this:
  $('form').submit(function(){
  //do your ajax here and return false
 });
  But what would bind the form in your example? I frequently
  work with multiple forms. I.E. is 'form' in your $.submit()
  above the name or ID of the form or is it an object from which
  name or ID could be extracted as a property.
  Thanks
  Tim


[jQuery] catch-all clicks

2009-02-11 Thread BrainBurner

Hello,
is there a way to catch-all click on the page?

I tried $(html).click(fn), but it doesn't work..


[jQuery] Re: Text append / replace not working in ffx 2.x and HtmlUnit

2009-02-11 Thread Marc Palmer



On 10 Feb 2009, at 22:51, Marc Palmer wrote:



Hi,

Forgive me as I'm a total jQuery n00b. However, I am rather confused.

I have the following trivial code:

html
head
script src=jquery-1.3.1.min.js type=text/javascript/
script type=text/javascript
$(document).ready(function () {
$(p).text(The DOM is now loaded and can be manipulated.);
});
/script
/head
body

p
/p
/body
/html

This is effectively lifted from the ready() documentation page
http://docs.jquery.com/Events/ready#fn

This code works fine in Safari 3 on my machine. It does not work at
all in Firefox 2.x on the same machine. However... the documentation
page -does- do the substitution fine.

More importantly, the firefox problem is just a distraction because I
find the same behaviour (text replacement not working) when I run
HtmlUnit (2.5 snapshot) tests in Java with the same HTML above.



FYI this is because there is no DOCTYPE and the / on the first script  
tag confuses the parser in ffx2 / htmlunit which means it doesn't  
include the 2nd script tag. Safari seems to be bug in that it assumes  
the document is valid HTML.


~ ~ ~
Marc Palmer
Blog  http://www.anyware.co.uk
Twitter   http://twitter.com/wangjammer5
Grails Rocks  http://www.grailsrocks.com







[jQuery] Re: using :has with selector

2009-02-11 Thread SteelRing

contains will work with or without quote around 'mytext'. How do I
know it works? because $(#tableid tbody tr td.someclass:contains
(mytext)).dosomething(); is working just fine for selecting td (as
well as with 'mytext' quoted) but as soon as the tr:has
(td.comeclass:contains(mytext)) is added (regardless of 'mytext'
quoted or not, i tried both) the tr is not selected (which is what I
want, i dont want to select td)

I thought about just selecting the td and then .parent() it but I try
not to use any destructive operation if I could. Is my selector
construct simply not supported by jquery or is it a bug in 1.3.1? I
haven't tried it with the 1.2.6.

On Feb 11, 7:46 am, Michael Lawson mjlaw...@us.ibm.com wrote:
 If mytext is a string, make sure it's quoted as said before.  Your jquery
 selector looks ok (I did something similar recently and it works great)

 cheers

 Michael Lawson
 Content Tools Developer, Global Solutions, ibm.com
 Phone:  1-919-517-1568 Tieline:  255-1568
 E-mail:  mjlaw...@us.ibm.com

 'Examine my teachings critically, as a gold assayer would test gold. If you
 find they make sense, conform to your experience, and don't harm yourself
 or others, only then should you accept them.'

   From:       SteelRing steelr...@gmail.com                                 
                                                    

   To:         jQuery (English) jquery-en@googlegroups.com                 
                                                    

   Date:       02/10/2009 05:51 PM                                             
                                                    

   Subject:    [jQuery] Re: using :has with selector                           
                                                    

 This is going to select the td, whereas I need to select the tr.

 On Feb 10, 4:41 pm, Mauricio \(Maujor\) Samy Silva

 css.mau...@gmail.com wrote:
  TD is a TR children so use the CSS descendant selector tr td.

  $(#tableid tbody tr td.someclass:contains('mytext'))).dosomething();

  PS: mytext is a string and should be quoted.

  Maurício

  -Mensagem Original-
  De: SteelRing steelr...@gmail.com
  Para: jQuery (English) jquery-en@googlegroups.com
  Enviada em: terça-feira, 10 de fevereiro de 2009 19:57
  Assunto: [jQuery] using :has with selector

   Anyone can think of a reason why this shouldn't work? I'm trying to
   select the Row (tr) where the cell of td with class someclass
   contains mytext. Since I want to work on the row (tr) itself, I need
   to use :has because I don't need to select the td itself. Am I wrong
   or am I wrong?

   $(#tableid tbody tr:has(td.someclass:contains(mytext))).dosomething
   ();



  graycol.gif
  1KViewDownload

  ecblank.gif
  1KViewDownload


[jQuery] Re: Increment Value. What am I doing wrong?

2009-02-11 Thread shapper

You mean the following:

$index = $('#Index');
parseInt($index.val())--;

This still gives me the same error.

Could someone, please, tell me how to do this?

Thanks,
Miguel

On Feb 11, 6:38 am, Ralph Whitbeck ralph.whitb...@gmail.com wrote:
 Karl is right, you need to convert it from a string first.

 shapper wrote:
  Hello,

  I have an input on my page as follows:

    input id=Index name=Index type=hidden value=0 /

  I am trying to increase and decrease the value of the input as
  follows:

          $index = $('#Index');
          $index.val()--;

  I always get an error:
  invalid assignment left-hand side

  What am I doing wrong?

  Thanks,
  Miguel


[jQuery] Re: catch-all clicks

2009-02-11 Thread Stephan Veigl

Hi,

$().click( function() {...});

should work

by(e)
Stephan


2009/2/11 BrainBurner brainbur...@gmail.com:

 Hello,
 is there a way to catch-all click on the page?

 I tried $(html).click(fn), but it doesn't work..


[jQuery] possible jQuery ui icon bug

2009-02-11 Thread jim

Run the jQuery UI Sortable - Portlets Demo and try swapping  ui-
icon-minusthick for ui-icon-plusthick, and you will notice that it
only seems to see the ui-icon-minusthick part of the image. This
appears to be the case for any pairing of icons where the second icon
appears to the right of the first icon in the ui-icons_*.png file.


[jQuery] Animation effect fails to run on 'load'ed content

2009-02-11 Thread rymi...@gmail.com

Hi, I've seen this problem before, and I think I've seen the solution
to it too, but I can't for the life of me find it again now.

I have an empty, hidden div with a unique id. I'm loading some remote
content into that using

$('#ttAjax').load('whatever.something');

After this I want to show it gradually using an animated effect like
show('medium'). However, instead of showing gradually, it just snaps
into view as if it was just show().

I seem to recall you need to reinitialise jQuery somehow, but I can't
think how. Is anyone able to help?

Cheers,
Steve


[jQuery] Having trouble using URL Parms with .load()....

2009-02-11 Thread webspee...@gmail.com

Hey all.

I have a form with about 20 fields elements and I also have 4 hidden
fields that I'm trying to send to the back end program.  If I run the
code as is but don't send any parameters in the URL, it returns the
output from my back end program fine. If I send the URL parms, the
back end code executes with all the parms having values, but I don't
get any output back from the back end program.

I tried using escape(url) and although I'm able to get output
returned, it's an error about the URL containing invalid syntax. The
back end program simply does a echo type command of the input parms
in a table format. If the URL parms are not sent, I get the table with
the headers, but of course no data. Sending the URL parms I get
nothing.

I pieced together some of the JQuery code, but I created the each
loop that creates the URL string. Since this is what I actually wrote,
I'm thinking it is the issue.

Any ideas?

Here is the code:

CODE BEGIN

input type=hidden name=prowid id=prowid value=
input type=hidden name=pdirectin id=pdirection value=
input type=hidden name=sortfield id=sortfield value=default
input type=hidden name=mode id=mode value=

form id=contactForm onsubmit=return false; action=
 fieldset class=formfieldset
   legendCompany/Name Information/legend
 label for=position style=padding-top:
0px;Function:/label
 select name=position id=position style=width:
200px;/selectbr /
 label for=dept style=padding-top: 3px;Department:/
label
 input type=text id=dept id=dept
class=ac_input contacttext style=width: 200px;br /
 label for=ctitleTitle:/label
 input type=text id=ctitle id=ctitle
class=ac_input contacttext style=width: 200px;br /
 label for=fnameFirst Name:/label
 input type=text id=fname id=fname
class=ac_input contacttext style=width: 200px;br /
 label for=lnameLast Name:/label
 input type=text id=lname id=lname
class=ac_input contacttext style=width: 200px;br /
 /fieldset
 fieldset class=formfieldset
   legendAddress Information/legend
 label for=addr1Addr 1:/label
 input type=text id=addr1 id=addr1
class=ac_input contacttext style=width: 200px;br /
 label for=addr2Addr 2:/label
 input type=text id=addr2 id=addr2
class=ac_input contacttext style=width: 200px;br /
 label for=cityCity/St/Zip:/label
 input type=text id=city  id=city
class=ac_input contacttext style=width: 100px;
 input type=text id=state id=state
class=ac_input contacttext style=width: 30px;
 input type=text id=zip   id=zip
class=ac_input contacttext style=width: 60px;
 /fieldset
 fieldset class=formfieldset
   legendPhone Information/legend
 label for=phonePhone:/label
 input type=text id=phone id=phone
class=ac_input contacttext style=width: 200px;br /
 label for=faxFax:/label
 input type=text id=fax   id=fax
class=ac_input contacttext style=width: 200px;br /
 label for=phone_800800 Phone:/label
 input type=text id=phone_800 id=phone_800
class=ac_input contacttext style=width: 200px;br /
 label for=cellCell:/label
 input type=text id=cell  id=cell
class=ac_input contacttext style=width: 200px;br /
 label for=homeHome:/label
 input type=text id=home  id=home
class=ac_input contacttext style=width: 200px;br /
 /fieldset
 fieldset class=formfieldset
   legendEmail Preferences/legend
 label for=emailEmail:/label
   input type=text id=email id=email
class=ac_input contacttext style=width: 200px;br /
 label for=email2Email2:/label
   input type=text id=email2id=email2
class=ac_input contacttext style=width: 200px;br /
 label for=flyer1Flyer 1:/label
   input type=checkbox id=flyer1 id=flyer1
value=nobr /
 label for=flyer2Flyer 2:/label
   input type=checkbox id=flyer2 id=flyer2
value=nobr /
 label for=flyer3Flyer 3:/label
   input type=checkbox id=flyer3 id=flyer3
value=no
 /fieldset
 input type=button name=btnPrev id=btnPrev
value=Previous onClick=$('#pdirection').val
('previous');getContactRow()nbsp;nbsp;nbsp;
 input type=button name=btnNext id=btnNext
value=Next onClick=$('#pdirection').val('next');getContactRow
()
 div id=actionButtons class=
 input type=submit name=btnAdd id=btnAdd value=Add
Contact onClick=$('#mode').val('add'); /
 /div !-- actionButtons --
 /form

// Add, Update and Delete action
$(document).ready(function() {
 // attach a submit handler to the form
 $(form#contactForm).submit(function()
 {
   var url = ../pu/puajax-h.html?mode= + $(#mode).val();
   

[jQuery] Appending Results to p

2009-02-11 Thread Cyril

Hi,

I posted the thread below in the wrong forum... im hoping to get a
solution here.. hopefully..


Thanks




Original Post:


Hi

I'm having problems appending my results to a paragraph without
refreshing ...
I've done a simple ajax test on my own form but calling google.ca to
do a search . I want to output the result within a DIV on the current
page without refreshing the page. For some reason, it is displaying
the whole result in a new page instead.

Can anyone tell me what I am doing wrong here?

Thanks

Follow Up:
=

It looks like there was an error in the js, and that the posted result
is due to the HTML POST, rather than the ajax POST.
Further digging, I found the error in the error console of firefox...

Error: [Exception... Access to restricted URI denied  code: 1012
nsresult: 0x805303f4 (NS_ERROR_DOM_BAD_URI)  location: file:///C:/
Inetpub/wwwroot/links/jquery.js Line: 3395] Source File:
file:///C:/Inetpub/wwwroot/links/jquery.js
Line: 3395

ps Ive just installed firebug and opened the console, and htought that
the js errors should be displayed in the console, so when i didnt see
anything i assumed the script were fine... but i still have to open
the error console CTRL SHIFT - J  ( BT W is this how you guys do it to
make sure everything is kosher when using in combination to firebug?)
=



!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
html xmlns=http://www.w3.org/1999/xhtml;
head
meta http-equiv=Content-Type content=text/html;
charset=iso-8859-1 / script language=JavaScript type=text/
javascript src=../links/ jquery.js/script link rel=stylesheet
type=text/css href=mycss.css


script language=javascript

$(document).ready(function(){
 $('#submit').click(function(){
$('#container').append('img src=loading-balls.gif
alt=loading ... id=loadingImg/');
var q = $('#q').val();
$.ajax({
url: 'http://www.google.ca/search',
type: GET',
data: 'q=' + q,

success: function(result) {
//console.log(result);
$('#response').remove();
$('#container').append('p id=response' + result + 
'/p');
$('#loadingImg').fadeOut(500);
}
});
return false;

});


});
/script
/head
body

form id=form1 name=form1 method=GET action=http:// 
www.google.ca/search


  pSearch Criteria
input name=q type=text id=q / /p
  pSubmit
input type=submit name=Submit value=Submit id=submit /
  /p
  div id=container/div
/form
/body
/html


[jQuery] Validate - submit confirmation message

2009-02-11 Thread Josephine

Hi.

I have the form working properly with the Validate plugin, but when
the massage is sent, I get a page showing the PHP code. How can I get
a page with a confirmation that the message has been sent, instead?

I'm not good at this, so I appreciate any help.

Thank you very much.


[jQuery] Tutorials on jQuery

2009-02-11 Thread andy

A basic introduction to jQuery
and the concepts that you need
to know to use it.


^
http://coaxialcable.webs.com/
^


[jQuery] Re: IE7 Zoom and the cluetip plugin

2009-02-11 Thread Karl Swedberg


On Feb 11, 2009, at 3:27 AM, astr wrote:



Hi, everybody,

I have a problem with IE7/Cluetip plugin. IE7 Currupts the tooltips in
the jQuery ClueTip plugin if you zoom the page. See, eg., the example
on the Cluetip demo page  plugins.learningjquery.com/cluetip/demo/ ,
default style, 9. mouse tracking.

Zooming is a good property, though not if it is poorly implemented. It
seems to be in IE7 (google confirms), so it is either give up the
Cluetip or ignore IE7, unless there is some remedy, which I am not
able to find.  Has anybody hit on a way out of this problem?

The best to all


Hi,

I'm sorry you're having trouble with this. I wish there were something  
I could do to fix it, but I'm not sure where to start, to be honest.  
If anyone else has some suggestions, I'd love to hear them.
Not only is the positioning off when you zoom, but that (experimental)  
example you mention has other problems. Seems that when I move the  
mouse over the link, the tooltip moves but the text it contains stays  
put. Very strange.


Incidentally, the jQuery UI Dialog has some issues of its own wrt IE7  
zooming.

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

I'm guessing this has something to do with how IE7 reports its  
offsets. Would be interested to hear if others have found solutions.  
In the meantime, I do some research of my own.


Thanks for reporting the problem. Sorry I don't have a quick fix for  
you.


--Karl

Karl Swedberg
www.englishrules.com
www.learningjquery.com



[jQuery] Re: tabs, ajax mode, spinner not removed

2009-02-11 Thread brian

On Wed, Feb 11, 2009 at 5:16 AM, Klaus Hartl klaus.ha...@googlemail.com wrote:

 Thanks for this information. I'm about to rewrite this stuff a bit
 anyway due to some other bug, and I'll take your findings into
 account. Thanks again.

No problem. I'll try again to get logged into Trac, create a new UID,
if necessary, and add some of this to the bug listing. I'll remove my
wild speculation, though ;-)

 What I really wonder about is, that this code used to work actually.
 This is why this whole logic with filtering an images in there... It
 surely needs a proper unit test this time!

I really wonder about that EM that's used to wrap the spinner option.
It seems to me that it'd be simpler to just include that in the
default text. That way, cleanup() could just switch everything inside
the A. Unless there's some issue with storing the label data in the A.


[jQuery] JQuery Animate Event

2009-02-11 Thread rene.olivo

Is there a way to execute a function while there's an even in
transition?

thanks


[jQuery] move table row based on a cell. Row filtering

2009-02-11 Thread jmbertucci

Hi all,

I'm a little stuck.  I have two tables.  One has several rows of data
with multiple columns.  The other is empty.  What I'm trying to do is
filter out rows from the main table and place them into the trash
can table based on the values of different table cells.

As an example.  The main table's second column has a date.  I want to
move any row who's second column data doesn't match the submitted
filter date.

I've got the following code to iterate through each table row...

$('li#data-main tbody tr').each(function(){
[...]
});

However, I'm not sure how to access a specific column of that row, to
get the HTML value and compare it to the entered value.  In this case,
I want to check the second column and do some function on the HTML
value to compare the date.

Then, if the dates don't match, I'll move the current row to a
different tables tbody.

Any suggestions?

Cheers!
John


[jQuery] Gathering page elements when using .post()....

2009-02-11 Thread webspee...@gmail.com

Hey all.

I need to gather the name/value of 25 elements. Is there a quick way
of doing this with .post() rather than manually setting each one
individually?

I can do it with a URL, but I want to use POST, not GET.

Any suggestions?


[jQuery] Re: Increment Value. What am I doing wrong?

2009-02-11 Thread ruizbennett

$index = $('#Index');
$val = parseInt($index.val());
$val--;
$val should be the number you want.


[jQuery] Re: Increment Value. What am I doing wrong?

2009-02-11 Thread ruizbennett

$index = $('#Index');
$val = parseInt($index.val());
$val--;


Use $val

On Feb 11, 9:37 am, shapper mdmo...@gmail.com wrote:
 You mean the following:

         $index = $('#Index');
         parseInt($index.val())--;

 This still gives me the same error.

 Could someone, please, tell me how to do this?

 Thanks,
 Miguel

 On Feb 11, 6:38 am, Ralph Whitbeck ralph.whitb...@gmail.com wrote:

  Karl is right, you need to convert it from a string first.

  shapper wrote:
   Hello,

   I have an input on my page as follows:

     input id=Index name=Index type=hidden value=0 /

   I am trying to increase and decrease the value of the input as
   follows:

           $index = $('#Index');
           $index.val()--;

   I always get an error:
   invalid assignment left-hand side

   What am I doing wrong?

   Thanks,
   Miguel


[jQuery] incomplete data receive with POST method

2009-02-11 Thread rocky

i m posting some data on url page but it displays incomplete.following
is the code snippet,what thing i m doing wrong plz notify me so that i
correct,thanks


test.js

var list=vc++;

$.ajax({
type: POST,
url: test.php,
dataType: json,
data: book=+list,
timeout: 5000,
success: successA,
error: errorA
});

function successA(data){
//code
}

function errorA(data){
 //code
}


test.php

echo $_POST['book'];
//it displays only vc not vc++ (using POST method)


[jQuery] Re: Tutorials on jQuery

2009-02-11 Thread Karl Swedberg

spam. :(

Sorry it got through. Just banned the email address.

--Karl


Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Feb 11, 2009, at 10:11 AM, andy wrote:



A basic introduction to jQuery
and the concepts that you need
to know to use it.


^
http://coaxialcable.webs.com/
^




[jQuery] jeditable addition of checkboxes, doubleclick to select.

2009-02-11 Thread Brian Loomis


I've added onto jeditable to make checkboxes work by combining several  
examples I've seen online.


Unfortunately I am not able to get the checkbox to select without  
first selecting the containing element (which has the appearance of  
having to get the checkbox a double click to check it)  However - the  
checkbox unselects with only one click.  I do not have to click the  
containing element to get this behavior.


I would like to get the checkbox to select with one click - before my  
designer whomps me with the usability paddle and makes me do a tear  
out and use standard forms.


Here's the jeditable addition at the end of the jquery.jeditable.js  
file.



// Create a custom input type 
for checkboxes
$.editable.addInputType(checkbox, {
element : function(settings, original) {
var input = $('input 
type=checkbox');
$(this).append(input);

// Update input's 
value when clicked

$(input).click(function() {
var value = 
$(input).attr(checked) ? 'Yes' : 'No';

$(input).val(value);
});
return(input);
},
content : function(string, settings, 
original) {
var checked = string == 
Yes ? 1 : 0;
var input = 
$(':input:first', this);

$(input).attr(checked, checked);
var value = 
$(input).attr(checked) ? 'Yes' : 'No';
$(input).val(value);
}
});

And here's the code that's calling it on the page.

script language=JavaScript type=text/javascript
!--
 $(document).ready(function() {

	$(.editable_field1).editable(http://www.sampledomain.com/test/work_this_checkbox.lasso?ID=3667field=Partners11 
, {

//  cancel: 
'Cancel',
name : 
'content',
submit: 0,
onblur  
: 'submit',
tooltip   : 
'Select by Checking...',
type  : 
'checkbox',


});
});
--
/script

Thanks in advance for any ideas.

Brian Loomis


[jQuery] Re: Cannot Get JQuery Ajax to work in Google Chrome browser

2009-02-11 Thread Beres Botond

I believe that for POST the correct way to send parameters is like
this:

data: {pageScroll: maxScroll, pageTime: endTime, location: currentURL}

However it is weird that it works for you in IE and Firefox, as you
have it now.
Worth a try anyway.


On Feb 11, 3:09 am, Karl Rudd karl.r...@gmail.com wrote:
 It's probably something to do with what Opera and WebKit allow in the
 unload handler. In fact doing a Google on opera unload trigger link
 turned up these two links:

  http://objectmix.com/javascript/631919-unload-event-more-restrictive-...
  https://bugs.webkit.org/show_bug.cgi?id=19922

 Karl Rudd



 On Wed, Feb 11, 2009 at 11:49 AM, Mike malonem...@gmail.com wrote:

  Can anyone help me out with this? Here is a version of the update.php
  script which will just write what the info it gets to a log file. I
  found that the ajax works in IE and Firefox, but not on Chrome or
  Opera:

  update.php:

  $debug = true;

   function update_log_event ($filename, $linenum, $message,
  $extra_text=)
   {
      $log_filename   = dirname(__FILE__) . '/update_log.txt';
      $logfile_header = '?php header(Location: /); exit();' . \r
  \n . '/* === Update LOG file === */' . \r
  \n;
      $logfile_tail   = \r\n?;

      // Delete too long logfiles.
      if (file_exists ($log_filename)  filesize($log_filename)
 100)
         unlink ($log_filename);

      $filename = basename ($filename);

      if (file_exists ($log_filename))
         {
         // 'r+' non destructive R/W mode.
         $fhandle = fopen ($log_filename, 'r+');
         if ($fhandle)
            fseek ($fhandle, -strlen($logfile_tail), SEEK_END);
         }
      else
         {
         $fhandle = fopen ($log_filename, 'w');
         if ($fhandle)
            fwrite ($fhandle, $logfile_header);
         }
      if ($fhandle)
         {
         fwrite ($fhandle, \r\n//  . date(F j, Y, g:i a). |$filename
  ($linenum)|:  . $message . ($extra_text?\r\n//    Extra Data:
  $extra_text:) . $logfile_tail);
         fclose ($fhandle);
         }
   }

   if ($debug) {
     $message = Update Started URL:  . $_POST['location'] . 
  pageTime:  . $_POST['pageTime'] .  Scroll:  . $_POST
  ['pageScroll'] . \n;
     update_log_event (__FILE__, __LINE__, $message, $extra_text=);
   }

  On Feb 10, 2:09 am, Mikedeezy33 malonem...@gmail.com wrote:
  I have a piece of code that updates a script with the page scroll and
  time on page when the user closes the page. I have this working in
  Firefox and IE, but it will not work in Chrome. Chrome will calculate
  the values correctly in jscript, but it will not post to the script. I have
  narrowed down the problem to being in the JQuery call to the ajax
  function. Does anyone know what I am doing wrong here?

  var maxScroll = 0;
  var pageOpen = new Date();
  var currentURL = window.location;
  var updateURL = /wp-content/plugins/extra-tracking/update.php;
  var intervalUpdate = false;

    if (intervalUpdate) {
      setInterval( update, 15000);
    }

    jQuery(window).scroll(function(){
        scrollPercent = Math.floor(jQuery(window).scrollTop() / ( jQuery
  (document).height() - jQuery(window).height() ) * 100 );
        if (scrollPercent  maxScroll) {
           maxScroll = scrollPercent;
        }
    });

    function update() {
      time = pageTime();
      temp = jQuery.ajax({
            type: POST,
            url: updateURL,
            data: pageScroll=+maxScroll+pageTime=+time
  +location=+currentURL
            //success: function(msg){ alert(Page time:  + time +  Page
  Scroll  + maxScroll); }
            });
      return false;
    }

    function pageTime() {
      curTime = new Date();
      minutes = (curTime.getMinutes() - pageOpen.getMinutes());
      seconds = (curTime.getSeconds() - pageOpen.getSeconds());
      time = (seconds + (minutes * 60));
      if (time  0) { time = 0; }
      return time;
    }

  jQuery(window).unload( function ()
    {
       endTime = pageTime();
       temp = jQuery.ajax({
            type: POST,
            url: updateURL,
            data: pageScroll=+maxScroll+pageTime=+endTime
  +location=+currentURL
            //success: function(msg){ alert(Page time:  + time +  Page
  Scroll  + maxScroll); }
            //error: function (xhr, desc, exceptionobj) { alert
  (xhr.responseText); }
            });
    } );


[jQuery] add a child node using jQuery

2009-02-11 Thread Alain Roger
Hi,

i have a table tage and i would like to add a thead node using jQuery.
what is the best method in order to get tablethead.../thead/table ?

thx

-- 
Alain
---
Windows XP x64 SP2 / Fedora 10 KDE 4.2
PostgreSQL 8.3.5 / MS SQL server 2005
Apache 2.2.10
PHP 5.2.6
C# 2005-2008


[jQuery] how to include JQuery from a page loaded by AJAX?

2009-02-11 Thread Davis

Hello,

I got a simple page ( html ) loaded by AJAX, but it seems JQuery
inside that page didn't work, appreciate if anyone can give me some
hints how to implement it.

html content, just simply corners a DIV guestbook

script type=text/javascript
/* ![CDATA[ */
{literal}

jQuery(document).ready(function(){
(function($){
$('#guestbook').corners({radio:5, outColor:'red'});
})(jQuery);
});

{/literal}
/* ]] */
/script

div id=guestbookGuestbook/div

PS: I am using 1.2.6 JQuery

many thanks/Davis.


[jQuery] Re: How to get the selected values in multi-select

2009-02-11 Thread Beres Botond

It seems to me, that just gets the first option value from the
multiple select, and not
necessarily a selected one. At least if #selection points to the
selection widget.

$('#selection  option:selected').each(function() (
// this should loop through all the selected elements
alert($(this).val())

});

If this doesn't work, maybe post your HTML here.




On Feb 11, 3:25 am, min inuyasha...@gmail.com wrote:
 Hi, everyone.

 The following code can only get only one selected value in the
 multiple selection widget: $('#selection')[0].value

 However, I want to get all the selected values in the multi-select.

 Could you plesease give me some suggestions

 thanks
 min


[jQuery] Re: trigger click event of anchor endless recursion

2009-02-11 Thread mkmanning

Triggering the click on 'a' fires the click on the the 'td', which
triggers the click on 'a', which fires the click on 'td', etc. :)

On Feb 11, 9:40 am, johnallan jral...@hotmail.com wrote:
 jquery 1.3.1

 jq(#miniCalendarTable td).hover(
         function(){ jq(this).addClass(hover) },
         function(){ jq(this).removeClass(hover) }
 ).click(function(){
         jq(this).children(a).trigger(click);

 });

 this is my script.. i swear I have done this before but maybe not.

 the hover works fine... but when the click function runs I get endless
 recursion...

 when i return the length of the children(a) it is 1

 any ideas?


[jQuery] Re: caching getScript() :: ajax question

2009-02-11 Thread dirk w

any ideas?

On 10 Feb., 17:31, dirk w dirkwendl...@googlemail.com wrote:
 hello,
 i am getting a script which calls back some json to my function
 showMyVideos.
 during my research in this group i read that getScript wouldn't cache.
 in my case i would like to add some cache (lazy loading) to my
 getScript function since it isn't necessary to update a already
 searched result (during one session).

 i am not an expert on jquery.ajax and didn't figured it out. i guess i
 messed it up with the execution of the link (remember: there's a
 callback function to call).

 # works, but doesn't cache
 $(#searchForm).submit(function()
 {
         $val = $('#searchText').val();
         $url = 'http://gdata.youtube.com/feeds/api/videos?q='+ $val +
 'alt=json-in-scriptcallback=showMyVideosmax-results=50format=5';
         $.getScript($url);

 });


[jQuery] Re: onclick event on a href calls a function , where to return false to prevent redirection

2009-02-11 Thread mkmanning
Inline JavaScript is generally frowned upon nowadays. A better
approach, if you can do it, is to separate your behavior from your
markup, the same as you separate your structure from your
presentation. It makes for cleaner, more accessible, and more
maintainable code. For the example above:

//attach behavior in your jQuery domready function
...
$('a.ToggleClose').click(function(){
buildingedit('#descr', 'descriptionsadd.php', 'did', ?= $did ?, 2,
this);
return false;
});

As you've most likely seen with CSS, this separation has many
advantages relating to purity and maintenance, and unobtrusive
Javascript tends to focus more on enhancing an existing, functional
interface. This subtle difference is important when you're talking
about graceful degradation/progressive enhancement.

Just saying. :)
...
On Feb 11, 9:26 am, brian bally.z...@gmail.com wrote:
 If you bind your event handlers using an element's onclick attribute
 (or onwhatever) you should write it like so:

 onclick=return myClickHandler(...);

 And return false from the function to avoid having the link followed.

 Note that the attribute should be all lowercase, btw. The camelcase
 version is used when referring to it as a member of a DOM element, eg.
 some_element.onClick = ...

 On Wed, Feb 11, 2009 at 9:28 AM, goldy zlati.pehliva...@gmail.com wrote:

  function buildingedit(searchhtmlid, filename, editid, idnum, addnum,
  obj)
  {
         //closeinst(searchhtmlid);

         var params = $.evalJSON('{'+editid+':'+idnum+',add:'+addnum
  +',showhtml:2}');
         var myelem = document.getElementById('lastid');
         var lastid = myelem.value;

         var $tablerow = $(searchhtmlid+idnum).clone(true);

         $(searchhtmlid+lastid).css('background-color','#FF');
         if(lastid)
         {
                 if(lastid!=idnum)
                 {
                         $.get(filename,
                                                 params,
                                                 function(returned_data)
                                                 {

                                                         var rs = $('div 
  id=editwindow style=display:none;/
  div');
                                                         
  $(searchhtmlid+idnum).hide();
                                                         
  $(searchhtmlid+idnum).after(rs);
                                                         
  //$(searchhtmlid+idnum).css('background-color','#DCE4F5');
                                                         
  $('#editwindow').css('background-color','#DCE4F5');
                                                         
  rs.html(returned_data);
                                                         rs.fadeIn(2000, 
  function(){
                                                                         
  $(this).css('display','block');
                                                                 });
                                                 });

                         myelem.value = idnum;
                         setTimeout(prepareForm(+idnum+), 2000);
                 }
                 else
                 {
                         $('div#editwindow').fadeOut(1000, function(){
                                                                              
                                                                              
         $(this).remove();
                                                                              
                                                                              
         $(searchhtmlid+idnum).show();
                                                                              
                                                                              
         });
                         myelem.value = 0;
                         //closeprev(obj);
                 }
         }
         else
         {
                 $.get(filename,
                                                 params,
                                                 function(returned_data)
                                                 {
                                                         var rs = $('div 
  id=editwindow style=display:none;/
  div');
                                                         
  $(searchhtmlid+idnum).hide();
                                                         
  $(searchhtmlid+idnum).after(rs);
                                                         
  //$(searchhtmlid+idnum).css('background-color','#DCE4F5');
                                                         
  $('#editwindow').css('background-color','#DCE4F5');
                                                         
  rs.html(returned_data);
                                                         rs.fadeIn(2000, 
  function(){
                                                                         
  $(this).css('display','block');
                      

[jQuery] Re: onclick event on a href calls a function , where to return false to prevent redirection

2009-02-11 Thread brian

If you bind your event handlers using an element's onclick attribute
(or onwhatever) you should write it like so:

onclick=return myClickHandler(...);

And return false from the function to avoid having the link followed.

Note that the attribute should be all lowercase, btw. The camelcase
version is used when referring to it as a member of a DOM element, eg.
some_element.onClick = ...

On Wed, Feb 11, 2009 at 9:28 AM, goldy zlati.pehliva...@gmail.com wrote:

 function buildingedit(searchhtmlid, filename, editid, idnum, addnum,
 obj)
 {
//closeinst(searchhtmlid);

var params = $.evalJSON('{'+editid+':'+idnum+',add:'+addnum
 +',showhtml:2}');
var myelem = document.getElementById('lastid');
var lastid = myelem.value;

var $tablerow = $(searchhtmlid+idnum).clone(true);

$(searchhtmlid+lastid).css('background-color','#FF');
if(lastid)
{
if(lastid!=idnum)
{
$.get(filename,
params,
function(returned_data)
{

var rs = $('div 
 id=editwindow style=display:none;/
 div');

 $(searchhtmlid+idnum).hide();

 $(searchhtmlid+idnum).after(rs);

 //$(searchhtmlid+idnum).css('background-color','#DCE4F5');

 $('#editwindow').css('background-color','#DCE4F5');
rs.html(returned_data);
rs.fadeIn(2000, 
 function(){

 $(this).css('display','block');
});
});

myelem.value = idnum;
setTimeout(prepareForm(+idnum+), 2000);
}
else
{
$('div#editwindow').fadeOut(1000, function(){
   
   
$(this).remove();
   
   
$(searchhtmlid+idnum).show();
   
   
});
myelem.value = 0;
//closeprev(obj);
}
}
else
{
$.get(filename,
params,
function(returned_data)
{
var rs = $('div 
 id=editwindow style=display:none;/
 div');

 $(searchhtmlid+idnum).hide();

 $(searchhtmlid+idnum).after(rs);

 //$(searchhtmlid+idnum).css('background-color','#DCE4F5');

 $('#editwindow').css('background-color','#DCE4F5');
rs.html(returned_data);
rs.fadeIn(2000, 
 function(){

 $(this).css('display','block');
});
});

myelem.value = idnum;
}

return false;

 }


 and this is called here

 a class=ToggleClose onClick=buildingedit('#descr',
 'descriptionsadd.php', 'did', ?= $did ?, 2, this);
 href=descriptionsadd.php?add=2did=?= $did ?showhtml=2 /a


[jQuery] Re: Is A Child Of?

2009-02-11 Thread Ricardo Tomasi

You can shave a few ms off that by using the current object itself,
and cacheing the other element:

jQuery.fn.in = function(a){
  var a = $(a)[0];
  return !!this.parents().filter(function(){ return this ===
a;}).length;
};

Also be aware that this actually checks if the element is a
*descendant* of the other, not just a child. For a simple (and faster)
'childOf' check use this:

jQuery.fn.childOf = function(a){
  var p = false;
  this.each(function(){
  if (this.parentNode == a) p = true;
   });
   return p;
};

cheers,
- ricardo

On Feb 11, 1:56 pm, Ami aminad...@gmail.com wrote:
 The Best solution:

 I have writed a very small plugin (1 line) for that, by using the code
 of Richard

 jQuery.fn.childOf=function(a){var b=this;return ($(b).parents().filter
 (function() { return this === $(a)[0]; }).length )}

 For Example:
 $(div).childOf(document.body)
 $(div).childOf($(document.body))

 I hope that there is  no bugs in this code.

 On 22 ינואר, 11:25, James Hughes j.hug...@kainos.com wrote:

  Hi,

  This is probably a really easy question an I apologise if it appear stupid 
  but I am clueless right now.  Given 2 jQuery objects (a,b) how can I tell 
  if b is a child of a?

  James

  
  This e-mail is intended solely for the addressee and is strictly 
  confidential; if you are not the addressee please destroy the message and 
  all copies. Any opinion or information contained in this email or its 
  attachments that does not relate to the business of Kainos
  is personal to the sender and is not given by or endorsed by Kainos. Kainos 
  is the trading name of Kainos Software Limited, registered in Northern 
  Ireland under company number: NI19370, having its registered offices at: 
  Kainos House, 4-6 Upper Crescent, Belfast, BT7 1NT,
  Northern Ireland. Registered in the UK for VAT under number: 454598802 and 
  registered in Ireland for VAT under number: 9950340E. This email has been 
  scanned for all known viruses by MessageLabs but is not guaranteed to be 
  virus free; further terms and conditions may be
  found on our website -www.kainos.com


[jQuery] trigger click event of anchor endless recursion

2009-02-11 Thread johnallan

jquery 1.3.1

jq(#miniCalendarTable td).hover(
function(){ jq(this).addClass(hover) },
function(){ jq(this).removeClass(hover) }
).click(function(){
jq(this).children(a).trigger(click);
});

this is my script.. i swear I have done this before but maybe not.

the hover works fine... but when the click function runs I get endless
recursion...

when i return the length of the children(a) it is 1

any ideas?




[jQuery] Re: Increment Value. What am I doing wrong?

2009-02-11 Thread Ricardo Tomasi

Increment/decrement is for variables. You can't use it directly on a
number. Try '3--'.

Make it simple, if you use subtraction the type conversion is done for
you:

$index = $('#Index');
val = $index.val()-1;

On Feb 11, 2:37 pm, shapper mdmo...@gmail.com wrote:
 You mean the following:

         $index = $('#Index');
         parseInt($index.val())--;

 This still gives me the same error.

 Could someone, please, tell me how to do this?

 Thanks,
 Miguel

 On Feb 11, 6:38 am, Ralph Whitbeck ralph.whitb...@gmail.com wrote:

  Karl is right, you need to convert it from a string first.

  shapper wrote:
   Hello,

   I have an input on my page as follows:

     input id=Index name=Index type=hidden value=0 /

   I am trying to increase and decrease the value of the input as
   follows:

           $index = $('#Index');
           $index.val()--;

   I always get an error:
   invalid assignment left-hand side

   What am I doing wrong?

   Thanks,
   Miguel


[jQuery] Re: how to include JQuery from a page loaded by AJAX?

2009-02-11 Thread Donkeybob

and also . . .do you have the jquery.js file linked in the new page?

On Feb 11, 1:22 pm, Donkeybob rip...@gmail.com wrote:
 when you say loaded by AJAX . . . .are you using another javascript
 framework to call this other page? if you have any other functions
 could something be conflicting with the jquery? . . .could you post
 your code that calls the page?

 On Feb 11, 12:04 pm, Davis ywk...@gmail.com wrote:

  Hello,

  I got a simple page ( html ) loaded by AJAX, but it seems JQuery
  inside that page didn't work, appreciate if anyone can give me some
  hints how to implement it.

  html content, just simply corners a DIV guestbook

  script type=text/javascript
  /* ![CDATA[ */
  {literal}

          jQuery(document).ready(function(){
          (function($){
                  $('#guestbook').corners({radio:5, outColor:'red'});
          })(jQuery);
          });

  {/literal}
  /* ]] */
  /script

  div id=guestbookGuestbook/div

  PS: I am using 1.2.6 JQuery

  many thanks/Davis.


[jQuery] Re: Increment Value. What am I doing wrong?

2009-02-11 Thread brian

On Wed, Feb 11, 2009 at 1:23 PM, Ricardo Tomasi ricardob...@gmail.com wrote:

 Increment/decrement is for variables. You can't use it directly on a
 number. Try '3--'.

 Make it simple, if you use subtraction the type conversion is done for
 you:

 $index = $('#Index');
 val = $index.val()-1;

Except, as Karl pointed out, val() will return a string.

var val = parseInt($index.val());
$index.val(--val);


[jQuery] Re: incomplete data receive with POST method

2009-02-11 Thread James

I think the + character is being interpreted as a space in the URL.
Try using encodeURI() on the variable like:
data: book=+encodeURI(list)

http://xkr.us/articles/javascript/encode-compare/

On Feb 11, 6:17 am, rocky guess.19812...@gmail.com wrote:
 i m posting some data on url page but it displays incomplete.following
 is the code snippet,what thing i m doing wrong plz notify me so that i
 correct,thanks

 test.js

 var list=vc++;

 $.ajax({
         type: POST,
         url: test.php,
         dataType: json,
         data: book=+list,
         timeout: 5000,
         success: successA,
         error: errorA

 });

 function successA(data){
 //code

 }

 function errorA(data){
  //code

 }

 test.php

 echo $_POST['book'];
 //it displays only vc not vc++ (using POST method)


[jQuery] how to differentiate between click and dragend events?

2009-02-11 Thread legofish

Hi,

I am using the drag plugin (http://blog.threedubmedia.com/2008/08/
eventspecialdrag.html) to design some interactions for a UI element.

The element foo, needs to respond to a click, as well as to a drag
(different responses for each). The plugin gives you handy drag events
to work with.

So I have:
$(#foo).bind('dragend', function(e){   dragged()   });
$(#foo).bind('click', function(e){   clicked()   });

When foo is simply clicked on, then clicked() is executed and all is
well.
However, when foo is dragged, dragged() is called and right after that
clicked() is called as well.
I don't want clicked() to be called when foo is dragged, but I can't
seem to figure out how to avoid that. Help is much appreciated.


[jQuery] Re: Safe Ajax Calls?

2009-02-11 Thread Ricardo Tomasi

*and don't forget to return false or do e.preventDefault()

$('.aj-link').click(function(){
   var page = $(this).attr('href');
   $('#targetDIV').load('ajax/'+page+'nocache='+Math.random());
   return false;
});

On Feb 11, 4:57 pm, Ricardo Tomasi ricardob...@gmail.com wrote:
 $('.aj-link').click(function(){
    var page = $(this).attr('href');
    $('#targetDIV').load('ajax/'+page+'nocache='+Math.random());

 });

 http://docs.jquery.com/Selectorshttp://docs.jquery.com/Eventshttp://docs.jquery.com/Ajax

 On Feb 11, 10:40 am, SoulRush saavedra@gmail.com wrote:

  I though that it would be nice to make the links with a certain format
  like:

  a href=ajaxProcess.php?var1=var1valuevar2=var2value class=aj-
  link link/a

  And make a selection for that kind of links with jquery, that takes
  these data to make an ajax call with post...

  That selection should be in a .js outside of the source of the pages
  and packed or something...

  What do you think?

  Please I need some feedback :)
  Greetings!

  On 9 feb, 17:02, SoulRush saavedra@gmail.com wrote:

   By the way, the first parameter takes the vars to send... so in the
   pages I've to dynamically set varname1=value1varname2=value2

   On 9 feb, 10:40, SoulRush saavedra@gmail.com wrote:

Hi!

I'm kind of new at the world of ajax and jquery and i'm starting to
make a site with them.

In my site i've created a single function (in the header) called
ajaxQry(...) which takes some parameters like, url to make post or
get, if I need GEt or POST, the data type of the query, a success
function and an error function.

Anyway, it look like this:

function ajaxQry(sendVars, url, returnType, backFunction,
errorFunction){

         $.ajax({
          type: POST,
          url: ajax/+url+.asp?nocache=+Math.random(),
          data: sendVars,
          success: backFunction, //ussully this loads the content in 
the main
page as html
          dataType: returnType,
          error: errorFunction
        });

}

Everything works great but i don't know if there's a better way to do
this, because in many events of the site I call this function... And
I'm starting to think that it's pretty insecure What do you think?

By the way i ussually call the url file (see the function) and return
HTML content, and then i load it in the page with $(selector).html();
is that okay?

Thanks! and sorry for my english :$


[jQuery] Re: how to include JQuery from a page loaded by AJAX?

2009-02-11 Thread Donkeybob

when you say loaded by AJAX . . . .are you using another javascript
framework to call this other page? if you have any other functions
could something be conflicting with the jquery? . . .could you post
your code that calls the page?

On Feb 11, 12:04 pm, Davis ywk...@gmail.com wrote:
 Hello,

 I got a simple page ( html ) loaded by AJAX, but it seems JQuery
 inside that page didn't work, appreciate if anyone can give me some
 hints how to implement it.

 html content, just simply corners a DIV guestbook

 script type=text/javascript
 /* ![CDATA[ */
 {literal}

         jQuery(document).ready(function(){
         (function($){
                 $('#guestbook').corners({radio:5, outColor:'red'});
         })(jQuery);
         });

 {/literal}
 /* ]] */
 /script

 div id=guestbookGuestbook/div

 PS: I am using 1.2.6 JQuery

 many thanks/Davis.


[jQuery] Re: New Plugin: jQuery Finder (Mac-style 'Treeview' with Columns)

2009-02-11 Thread Todd Parker

Hi Nicolas - I just wanted to say that you did a stellar job of using
the new CSS framework. I'm the design lead for the jQuery UI team and
was involved in the creation of the framework and this is the best
example of leveraging the power of this system. Just curious, did you
run into any issues or tips that you'd like to share with us? Anyone
use the CSS framework that you'd like to share?

I added links to this in the docs wiki in the ThemeRoller ready page:
http://docs.jquery.com/UI/Theming/ThemeRollerReady

On Feb 7, 2:04 pm, Nicolas R ruda...@googlemail.com wrote:
 IE 7 seems to be ok now, but there's a CSS bug I can't figure out (see
 the width of list items, it collapses to the width of the text they
 contain)

 I figured out how to make it work on IE6 (mostly), but as the changes
 are very specific I did not include them in the code. If anyone
 requires ie6 support just ask.

 Chrome is also ok.

 I also added some more data on the api.

 On Feb 6, 10:55 pm, Rick Faircloth r...@whitestonemedia.com wrote:

  Malformed in IE 7...

   -Original Message-
   From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On 
   Behalf Of Nicolas R
   Sent: Friday, February 06, 2009 1:33 PM
   To: jQuery (English)
   Subject: [jQuery] Re: New Plugin: jQuery Finder (Mac-style 'Treeview' 
   with Columns)

   v0.6a is out
  http://www.nicolas.rudas.info/jQuery/Finder/

   Following up on Nikola's idea, I've also made this:
  http://www.nicolas.rudas.info/jQuery/Finder/v0.6a/api.html

   The jQuery API, finder style. It's doesn't give any API docs tho at
   the moment, just a list of methods (the json data provided by jquery
   are a bit messy and a bit of a hussle to translate to html)


[jQuery] Re: document.createComment usage - can be improved?

2009-02-11 Thread Ricardo Tomasi

It's part of the DOM Level 1 specs, should be supported by all current
browsers:

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

You can overwrite it though, document.createComment = null ||
anything;

On Feb 11, 8:20 am, Marc Palmer wangjamm...@googlemail.com wrote:
 Hi,

 I'm new to jQuery. I had to use 1.3.1 with the HtmlUnit Java web  
 testing library and we found that with publicly released versions of  
 HtmlUnit it fails because the JS engine cannot find the function  
 document.createComment

 Is this a standard DOM method or something widely supported by  
 browsers?

 I looked in the jQuery source, and this is only used once, and only as  
 part of detection of other bugs:

 (function(){
         // Check to see if the browser returns only elements
         // when doing getElementsByTagName(*)

         // Create a fake element
         var div = document.createElement(div);
         div.appendChild( document.createComment() );

 If there is a possibility that some browsers do not support  
 createComment then shouldn't that code check first for the existence  
 of the function?

 Just seems that would be in the proper spirit of jQuery, as I  
 understand it so far.

 $0.02

 ~ ~ ~
 Marc Palmer
 Blog         http://www.anyware.co.uk
 Twitter      http://twitter.com/wangjammer5
 Grails Rocks http://www.grailsrocks.com


[jQuery] Re: using :has with selector

2009-02-11 Thread Ricardo Tomasi

Try doing it in two steps:

$(#tableid tbody tr:has(td.someclass)).filter(':contains
(mytext)').doSomething()

On Feb 10, 7:57 pm, SteelRing steelr...@gmail.com wrote:
 Anyone can think of a reason why this shouldn't work? I'm trying to
 select the Row (tr) where the cell of td with class someclass
 contains mytext. Since I want to work on the row (tr) itself, I need
 to use :has because I don't need to select the td itself. Am I wrong
 or am I wrong?

 $(#tableid tbody tr:has(td.someclass:contains(mytext))).dosomething
 ();


[jQuery] Re: Select all even row in table that are not with a specified class.

2009-02-11 Thread Ricardo Tomasi

Yes, you can. In doubt, just try it, it doesn't hurt :)

$(table.font_quotazioni tr:odd:not(.highlight,.midlight)).addClass
(even);
$(table.font_quotazioni tr:odd:not(.highlight):not
(.midlight)).addClass(even);
$(table.font_quotazioni tr:odd).not(.highlight, .midlight).addClass
(even);

On Feb 11, 9:12 am, m.ugues m.ug...@gmail.com wrote:
 Is it possibile to add a condition in or to the not condition?

 jQuery(table.font_quotazioni tr:odd:not
 ('.highlight','.midlight')).addClass(even);

 Kind regards

 Massimo Ugues

 On Dec 23 2008, 10:04 pm, aquaone aqua...@gmail.com wrote:

  Sure.
  $(table.font_quotazioni 
  tr:even:not('.midlight'))...http://docs.jquery.com/Selectors/not#selector

  stephen

  On Tue, Dec 23, 2008 at 10:01, m.ugues m.ug...@gmail.com wrote:

   Hallo all.
   I got a table like this

   table class=font_quotazioni
     thead
        tr
            th title=Data Contabile class=chars4Nome/th
        /tr
     /thead
     tbody
        tr class=midlight 
           tdfoo/td
        /tr
        tr
           tdfoo/td
        /tr
        tr
           tdfoo/td
        /tr
     /tbody
   /table

   In my document.ready I set a class on even rows

   $(table.font_quotazioni tr:even).addClass(even);

   I would like to exclude all the rows that got a certain class (e.g tr
   class=midlight )
   Is it possible?


  1   2   >