[jQuery] ajax xml question

2009-09-16 Thread David .Wu

This is the source code that I want to get the weather from Google
API, Firefox, Safari, Opera will work, but IE can't get the value, so
I did some test, and I found the reason

xml structure in php page
$.get({"a.php"}, '', function() {}, "html"); // all browser work
besides IE
$.get({"a.php"}, '', function() {}, "xml"); // all browser not work

xml structure in xml page
$.get({"a.xml"}, '', function() {}, "html"); // all browser work
$.get({"a.xml"}, '', function() {}, "xml"); // all browser work

How to make IE accept xml that the file extension name is not xml?

http://www.google.com/ig/api?
weather=Taipei');
exit;
}
?>

http://www.w3.org/1999/xhtml";>


weather









$(function() {
$('#btn').click(function() {
$.get('weather.php?weather=1', '', function(data) {
$('#res').html($(data).find('current_conditions').find
('condition').attr('data'));
});
});
});



[jQuery] Re: selecting elements that match a regular expression

2009-09-16 Thread Macsig

Thanks guys

lanxiazhi's solution works just fine.

Have a good 1!



Sig

On Sep 16, 7:15 pm, Steven Black  wrote:
> Try James Padolsey's Regex Selector plugin for jQuery
>  http://james.padolsey.com/javascript/regex-selector-for-jquery/
>
> **--**  Steve
>
> On Sep 16, 9:34 pm, macsig  wrote:
>
>
>
> > Hello guys,
> > is there a way to select elements that match a regular expression?
>
> > I have a set of divs with id = "wrap_n" where n is a progressive and I
> > need to select them and for each 1 I have to add a function that
> > togggle the "elem_n" div.
>
> > Thanks
>
> > Sig


[jQuery] Re: selecting elements that match a regular expression

2009-09-16 Thread Macsig

Thanks guys

@lanxiazhi   how do you implement getNum()? A simple split?

Thanks again.


Sig

On Sep 16, 6:55 pm, lanxiazhi  wrote:
> Yes,you can do this.
> $("[id*=wrap_]").click(
>   function()
>  {
>     var id=$(this).attr("id");
>     var targetId="elem_"+getNum(id);
>     $("#"+targetId).toggle();
>  }
> );
>
> 2009/9/17 macsig 
>
>
>
>
>
> > Hello guys,
> > is there a way to select elements that match a regular expression?
>
> > I have a set of divs with id = "wrap_n" where n is a progressive and I
> > need to select them and for each 1 I have to add a function that
> > togggle the "elem_n" div.
>
> > Thanks
>
> > Sig


[jQuery] Re: Superfish menu problem.

2009-09-16 Thread rupak mandal
1) Remove position:relative from ".main" class constant.css  (not tested).
2)To remove the back ground, remove back ground  from sf-menu #current and
sf-menu .active in superfish.css

3)Remove background from "menu li" class template.css.


Thanks
Rupak


On Thu, Sep 17, 2009 at 10:24 AM, sholland wrote:

>
> Thank you! Thank you! I think I have almost conquered it, but a couple
> things left I can't seem to overcome.
>
> 1.  In IE7 the dropdown menu is going behind the image.
> 2.  I would like to turn off the background around the home button.  I
> have searched and searched for this and cannot seem to locate where it
> is being called.  Any suggestions?
> 3. Lastly, If you look at the menu now you will notice a tiny set of
> blue arrows at the beginning/or end of each menu item. Again, I can't
> seem to find a reference to them anywhere.
>
> Thanks for taking the time out to help me.  I really appreciate it.
>
> Thanks again,
> Suzanna
>
>
> On Sep 16, 1:46 am, rupak mandal  wrote:
> > Drop-down menu is working, but it will no display due to overflow:hidden
> in
> > "clear". You have to make some changes.
> >
> > Add  height  & width  in tail-top-menu and remove "clear" class from that
> > div.
> >
> >  .tail-top-menu
> > {
> > height:30px;
> > width:100%
> >
> > }
> >
> > and also add height in ".sf-menu a" && "sf-menu li"  class according to
> > requirement ...
> >
> > I think this will resolve your problem.
> >
> > Thanks
> > Rupak
> >
> > On Wed, Sep 16, 2009 at 11:04 AM, sholland  >wrote:
> >
> >
> >
> > > Here aree the CSS styles being applied to that menu position by the
> > > template and by the superfish css.
> >
> > > Thanks
> > > Suzanna
> >
> > > ***TEMPLATE
> > > CSS*
> >
> > > .tail-top-menu{ background:#f0f0f1  url(../images/top_menu_tail.gif)
> > > bottom left repeat-x;}
> >
> > >
> **
> > > body, td, th, div, p, label{
> > >color:#838383;
> > >font:normal 12px/16px Arial, Helvetica, sans-serif;
> > > }
> >
> > > a {
> > >color:#5D5D60;
> > >text-decoration:underline;
> > > }
> >
> > > a:hover {
> > >color:#5D5D60 ;
> > >text-decoration:none
> > > }
> > > select{color:#878B8E; font-size:11px;}
> >
> > >
> ***
> > > .clear{ width:100%; overflow:hidden;}
> >
> > >
> ***
> > > * {
> > >padding:0px 0px 0px 0px;
> > >margin:0px 0px 0px 0px;
> > > }
> >
> > > *
> > > ul
> >
> > > {
> >
> > > list-style-type: disc;
> >
> > > list-style-image: none;
> >
> > > list-style-position: outside;
> >
> > > margin-top: 0px;
> >
> > > margin-right: 0px;
> >
> > > margin-bottom: 0px;
> >
> > > margin-left: 15px;
> >
> > > }
> >
> > > .menu
> >
> > > {
> >
> > > margin-top: 14px;
> >
> > > margin-right: 0pt;
> >
> > > margin-bottom: 0px;
> >
> > > margin-left: 31px;
> >
> > > list-style-type: none;
> >
> > > list-style-image: none;
> >
> > > list-style-position: outside;
> >
> > > padding-top: 1px;
> >
> > > }
> >
> > > END TEMPLATE
> > > CSS
> >
> > > **SUPERFISH
> > > CSS
> > > .sf-menu, .sf-menu *
> >
> > > {
> >
> > > margin-top: 0pt;
> >
> > > margin-right: 0pt;
> >
> > > margin-bottom: 0pt;
> >
> > > margin-left: 0pt;
> >
> > > padding-top: 0pt;
> >
> > > padding-right: 0pt;
> >
> > > padding-bottom: 0pt;
> >
> > > padding-left: 0pt;
> >
> > > list-style-type: none;
> >
> > > list-style-image: none;
> >
> > > list-style-position: outside;
> >
> > > }
> >
> > > .sf-menu
> >
> > > {
> >
> > > line-height: 1;
> >
> > > }
> >
> > > .sf-menu
> >
> > > {
> >
> > > float: left;
> >
> > > margin-bottom: 1em;
> >
> > > }
> >
> > > a
> >
> > > {
> >
> > > color: #5d5d60;
> >
> > > text-decoration: underline;
> >
> > > }
> >
> > > a:hover
> >
> > > {
> >
> > > color: #5d5d60;
> >
> > > text-decoration: none;
> >
> > > }
> >
> > > .menu li a
> >
> > > {
> >
> > > color: #91caff;
> >
> > > font-size: 13px;
> >
> > > text-decoration: none;
> >
> > > padding-top: 0pt;
> >
> > > padding-right: 0pt;
> >
> > > padding-bottom: 0pt;
> >
> > > padding-left: 27px;
> >
> > > }
> >
> > > .menu li a:hover
> >
> > > {
> >
> > > color: #ff;
> >
> > > text-decoration: underline;
> >
> > > }
> >
> > > .sf-menu, .sf-menu *
> >
> > > {
> >
> > > margin-top: 0pt;
> >
> > > margin-right: 0pt;
> >
> > > margin-bottom: 0pt;
> >
> > > margin-left: 0pt;
> >
> > > padding-top: 0pt;
> >
> > > padding-right: 0pt;
> >
> > > padding-bottom: 0pt;
> >
> > > padding-left: 0pt;
> >
> > > list-style-type: none;
> >
> > > list-style-image: none;
> >
> > > list-style-position: outside;
> >
> > > 

[jQuery] Re: Superfish menu problem.

2009-09-16 Thread sholland

Thank you! Thank you! I think I have almost conquered it, but a couple
things left I can't seem to overcome.

1.  In IE7 the dropdown menu is going behind the image.
2.  I would like to turn off the background around the home button.  I
have searched and searched for this and cannot seem to locate where it
is being called.  Any suggestions?
3. Lastly, If you look at the menu now you will notice a tiny set of
blue arrows at the beginning/or end of each menu item. Again, I can't
seem to find a reference to them anywhere.

Thanks for taking the time out to help me.  I really appreciate it.

Thanks again,
Suzanna


On Sep 16, 1:46 am, rupak mandal  wrote:
> Drop-down menu is working, but it will no display due to overflow:hidden in
> "clear". You have to make some changes.
>
> Add  height  & width  in tail-top-menu and remove "clear" class from that
> div.
>
>  .tail-top-menu
> {
>     height:30px;
>     width:100%
>
> }
>
> and also add height in ".sf-menu a" && "sf-menu li"  class according to
> requirement ...
>
> I think this will resolve your problem.
>
> Thanks
> Rupak
>
> On Wed, Sep 16, 2009 at 11:04 AM, sholland wrote:
>
>
>
> > Here aree the CSS styles being applied to that menu position by the
> > template and by the superfish css.
>
> > Thanks
> > Suzanna
>
> > ***TEMPLATE
> > CSS*
>
> > .tail-top-menu{ background:#f0f0f1  url(../images/top_menu_tail.gif)
> > bottom left repeat-x;}
>
> > **
> > body, td, th, div, p, label{
> >    color:#838383;
> >    font:normal 12px/16px Arial, Helvetica, sans-serif;
> > }
>
> > a {
> >    color:#5D5D60;
> >    text-decoration:underline;
> > }
>
> > a:hover {
> >    color:#5D5D60 ;
> >    text-decoration:none
> > }
> > select{color:#878B8E; font-size:11px;}
>
> > ***
> > .clear{ width:100%; overflow:hidden;}
>
> > ***
> > * {
> >    padding:0px 0px 0px 0px;
> >    margin:0px 0px 0px 0px;
> > }
>
> > *
> > ul
>
> > {
>
> > list-style-type: disc;
>
> > list-style-image: none;
>
> > list-style-position: outside;
>
> > margin-top: 0px;
>
> > margin-right: 0px;
>
> > margin-bottom: 0px;
>
> > margin-left: 15px;
>
> > }
>
> > .menu
>
> > {
>
> > margin-top: 14px;
>
> > margin-right: 0pt;
>
> > margin-bottom: 0px;
>
> > margin-left: 31px;
>
> > list-style-type: none;
>
> > list-style-image: none;
>
> > list-style-position: outside;
>
> > padding-top: 1px;
>
> > }
>
> > END TEMPLATE
> > CSS
>
> > **SUPERFISH
> > CSS
> > .sf-menu, .sf-menu *
>
> > {
>
> > margin-top: 0pt;
>
> > margin-right: 0pt;
>
> > margin-bottom: 0pt;
>
> > margin-left: 0pt;
>
> > padding-top: 0pt;
>
> > padding-right: 0pt;
>
> > padding-bottom: 0pt;
>
> > padding-left: 0pt;
>
> > list-style-type: none;
>
> > list-style-image: none;
>
> > list-style-position: outside;
>
> > }
>
> > .sf-menu
>
> > {
>
> > line-height: 1;
>
> > }
>
> > .sf-menu
>
> > {
>
> > float: left;
>
> > margin-bottom: 1em;
>
> > }
>
> > a
>
> > {
>
> > color: #5d5d60;
>
> > text-decoration: underline;
>
> > }
>
> > a:hover
>
> > {
>
> > color: #5d5d60;
>
> > text-decoration: none;
>
> > }
>
> > .menu li a
>
> > {
>
> > color: #91caff;
>
> > font-size: 13px;
>
> > text-decoration: none;
>
> > padding-top: 0pt;
>
> > padding-right: 0pt;
>
> > padding-bottom: 0pt;
>
> > padding-left: 27px;
>
> > }
>
> > .menu li a:hover
>
> > {
>
> > color: #ff;
>
> > text-decoration: underline;
>
> > }
>
> > .sf-menu, .sf-menu *
>
> > {
>
> > margin-top: 0pt;
>
> > margin-right: 0pt;
>
> > margin-bottom: 0pt;
>
> > margin-left: 0pt;
>
> > padding-top: 0pt;
>
> > padding-right: 0pt;
>
> > padding-bottom: 0pt;
>
> > padding-left: 0pt;
>
> > list-style-type: none;
>
> > list-style-image: none;
>
> > list-style-position: outside;
>
> > }
>
> > .sf-menu a
>
> > {
>
> > display: block;
>
> > position: relative;
>
> > }
>
> > .sf-menu a
>
> > {
>
> > border-left-width-value: 1px;
>
> > border-left-style-value: solid;
>
> > border-left-color-value: #ff;
>
> > border-left-width-ltr-source: physical;
>
> > border-left-width-rtl-source: physical;
>
> > border-left-style-ltr-source: physical;
>
> > border-left-style-rtl-source: physical;
>
> > border-left-color-ltr-source: physical;
>
> > border-left-color-rtl-source: physical;
>
> > border-top-width: 1px;
>
> > border-top-style: solid;
>
> > border-top-color: #cfdeff;
>
> > padding-top: 0.75em;
>
> > padding-right: 1em;
>
> > padding-bottom: 0.75em;
>
> > padding-left: 1em;
>
> > text-decoration: none;
>
> > }
>
> > .sf-menu a, .sf-menu a:visited
>
> > {
>
> > color: #1133aa;
>
> > }
>
> > 

[jQuery] Multiple jcarousel textscroller instances displaying RSS

2009-09-16 Thread pdxgeek

Hello all,
Quick question from a n00b...

I'm trying to setup multiple jcarousel textscroller instances on one
page displaying rss feeds and somehow I cannot seperate them.  Despite
doing what I thought was setting up unique instances, they both end up
displaying the content of the second rss feed called in the code.  I
suspect I'm missing a very basic change that will allow the two
instances to operate seperately.  Here's the jcarousel instnce code
for both... any assistance is greatly appreciated!

//FIRST SCROLLER

//INITIALIZE
jQuery('#mycarousel-txtscroll-01').jcarousel({
vertical: true,
size: 0,
initCallback: mycarousel_initCallback
});

function mycarousel_initCallback(carousel, state)
{
// Lock until all items are loaded. That prevents jCarousel from
// setup correctly and we have to do that in the ajax callback
// function with carousel.setup().
// We're doing that because we don't know the exact height of each
// items until they are added to the list.
carousel.lock();

jQuery.get(
'wp/wp-content/themes/uxable/special_textscroller.php',
{
'feed': 'http://feeds.feedburner.com/adaptivepath'
},
function(xml) {
mycarousel_itemAddCallback(carousel, xml);
},
'xml'
);
};

function mycarousel_itemAddCallback(carousel, xml)
{
var $items = jQuery('item', xml);

$items.each(function(i) {
carousel.add(i + 1, mycarousel_txtscroll_01_getItemHTML
(this));
});

carousel.size($items.size());

// Unlock and setup.
carousel.unlock();
carousel.setup();
};

/* Item html creation helper */
function mycarousel_txtscroll_01_getItemHTML(item)
{
return ''+$('title',
item).text()+''+mycarousel_truncate($('description',
item).text(), 90)+'';
};

/**
 * Utility function for truncating a string without breaking words.
 */
function mycarousel_truncate(str, length, suffix) {
if (str.length <= length) {
return str;
}

if (suffix == undefined) {
suffix = '...';
}

return str.substr(0, length).replace(/\s+?(\S+)?$/g, '') + suffix;
};

/**
 * We show a simple loading indicator
 * using the jQuery ajax events
 */
jQuery().ajaxStart(function() {
jQuery(".jcarousel-clip-vertical").addClass('loading');
});

jQuery().ajaxStop(function() {
jQuery(".jcarousel-clip-vertical").removeClass('loading');
});

//SECOND SCROLLER

//INITIALIZE
jQuery('#mycarousel-txtscroll-02').jcarousel({
vertical: true,
size: 0,
initCallback: mycarousel_initCallback
});

function mycarousel_initCallback(carousel, state)
{
// Lock until all items are loaded. That prevents jCarousel from
// setup correctly and we have to do that in the ajax callback
// function with carousel.setup().
// We're doing that because we don't know the exact height of each
// items until they are added to the list.
carousel.lock();

jQuery.get(
'wp/wp-content/themes/uxable/special_textscroller.php',
{
'feed': 'http://www.boxesandarrows.com/rss.xml'
},
function(xml) {
mycarousel_itemAddCallback(carousel, xml);
},
'xml'
);
};

function mycarousel_itemAddCallback(carousel, xml)
{
var $items = jQuery('item', xml);

$items.each(function(i) {
carousel.add(i + 1, mycarousel_txtscroll_01_getItemHTML
(this));
});

carousel.size($items.size());

// Unlock and setup.
carousel.unlock();
carousel.setup();
};

/* Item html creation helper */
function mycarousel_txtscroll_01_getItemHTML(item)
{
return ''+$('title',
item).text()+''+mycarousel_truncate($('description',
item).text(), 90)+'';
};

/**
 * Utility function for truncating a string without breaking words.
 */
function mycarousel_truncate(str, length, suffix) {
if (str.length <= length) {
return str;
}

if (suffix == undefined) {
suffix = '...';
}

return str.substr(0, length).replace(/\s+?(\S+)?$/g, '') + suffix;
};

/**
 * We show a simple loading indicator
 * using the jQuery ajax events
 */
jQuery().ajaxStart(function() {
jQuery(".jcarousel-clip-vertical").addClass('loading');
});

jQuery().ajaxStop(function() {
jQuery(".jcarousel-clip-vertical").removeClass('loading');
});


[jQuery] Re: Error when update jquery from 1.2.4 to 1.3.2

2009-09-16 Thread Charlie Griefer
In 1.3 the @ was deprecated.

see http://docs.jquery.com/Release:jQuery_1.3 under "Changes"

now you just want $("form[name='adminform']").submit();

On Wed, Sep 16, 2009 at 9:03 PM, tongkienphi  wrote:

>
> Hi every body.
>
> In my porject use jquery version 1.2.4, but this version can not run
> Calendar app because in this app have use version 1.3.2 .. When i
> updated to 1.3.2 script Calendar work well but in my project have
> errror somewhere ..
>
> ex: on line 1642 have error from .. throw "Syntax error, unrecognized
> expression: " + expr;
> In the versioin 1.2.4 i use this code before to submit form
>
> $("fo...@name=adminform]").submit();
>
> but in the version 1.3.2 this code not work.




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


[jQuery] Error when update jquery from 1.2.4 to 1.3.2

2009-09-16 Thread tongkienphi

Hi every body.

In my porject use jquery version 1.2.4, but this version can not run
Calendar app because in this app have use version 1.3.2 .. When i
updated to 1.3.2 script Calendar work well but in my project have
errror somewhere ..

ex: on line 1642 have error from .. throw "Syntax error, unrecognized
expression: " + expr;
In the versioin 1.2.4 i use this code before to submit form

$("fo...@name=adminform]").submit();

but in the version 1.3.2 this code not work.


[jQuery] Re: jQuery PDF Viewer?

2009-09-16 Thread benji++

It seems that I've answered my own question…  I realized that, as
Jeffrey Kretz mentioned, I needed to rely on Flash to do the PDF
rendering … it was obviously not something that Javascript would do.
I found several good solutions for an online PDF viewer, my favorite
being issuu.com.  With the viewer taken care of, then all that's
needed is to embed it in an iframe, or (my preference) put it in a
thickbox, fancybox, shadowbox, etc. modal window.  The solutions I
found are:

* Issuu  ( issuu.com )  <-- My Favorite
* iPaper  ( scribd.com )
* Vuzit DocuPub  ( http://vuzit.com/products/docupub_platform )
* embedded Google Docs  ( docs.google.com )  <--- a very nice quick &
easy, on-the-fly solution … see below…
* ZOHO Viewer  ( viewer.zoho.com )
* PDFMeNot  ( pdfmenot.com )

Issuu is really an awesome viewer, though all of the others have their
merits (I can't speak for PDFMeNot, though, 'cause I could never get
it to work … maybe that speaks for itself?).  Issuu's SmartLook
feature (issuu.com/smartlook) searches your sites and converts all
your links to PDFs so that they pop in in Issuu's modal window
instead.  I'm trying to get it to work on my site now.

iPaper is very nice too.  It has a book format which, while not as
sleek as Issuu's magazine format, is still impressive.

Vuzit has a free edition, but it's basically commercial.  Not too
expensive for starters.  It does allow you to protect your documents
from copying and downloading, at least it says.

The Google Docs thing is pretty handy -- you don't even need to upload
your document anywhere, just do like so:
http://docs.google.com/gview?url=http://
infolab.stanford.edu/pub/papers/google.pdf&embedded=true" style="width:
600px; height:500px;" frameborder="0">
…and voila, a PDF in your webpage.  That would be cool to use with a
database -- just pull the url of the PDF into your script and Google
handles the rest.  The interface is pretty basic, but it works.

Right now I'm trying to embed an Issuu PDF inside a FancyBox.  Props
to fancybox.net … whoever you are.


[jQuery] Re: Jquery Newbie needing help..

2009-09-16 Thread Karl Swedberg
If the animations are acting on the same element(s), you can just  
chain them and they'll occur sequentially. Also, just to be safe, I'd  
make sure the image isn't currently animated before triggering the  
fades:


$(document).ready(function() {
  $('img.twitter').click(function() {
if (!$(this).is(':animated')) {
  $ 
(this).fadeOut('fast').fadeIn('fast').fadeOut('fast').fadeIn('fast');

}
  });
});

--Karl


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




On Sep 16, 2009, at 9:28 PM, amuhlou wrote:



A couple things..

1. The click function can't be used to fadeIn the image again...
because you wouldn't be able to click on it when it's hidden

2. Do you want a single click to cause the fadeOut-fadeIn-fadeOut-
fadeIn? If so, you could use the callback functions of the fadeIn and
fadeOut transitions:

$(document).ready(function(){
   $('img.twitter).click(function(){
   $(this).fadeOut('fast', function(){
   $(this).fadeIn('fast',function(){
   $(this).fadeOut('fast', function(){
   $(this).fadeIn('fast');
   });
   });
   });
   });
});

The callback function runs when the transition is complete.


On Sep 16, 8:36 pm, Galaxy Man  wrote:
Hi guys.. this is the first time I use Jquery Directly & with my  
hands

purely.. I wrote this code:
$("img.twitter").click(function(){

$("img.twitter").fadeOut("fast");

});

$("img.twitter").click(function(){

$("img.twitter").fadeIn("fast");

});

$("img.twitter").click(function(){

$("img.twitter").fadeOut("fast");

});

$("img.twitter").click(function(){

$("img.twitter").fadeIn("fast");

});

I want an image with the class twitter to fade in& out twice.. but it
doesn't work.. when I tried to replace it with this:
$(document).click(function(){

$("img.twitter").fadeOut("fast");

});

$(document).click(function(){

$("img.twitter").fadeIn("fast");

});

$(document).click(function(){

$("img.twitter").fadeOut("fast");

});

$(document).click(function(){

$("img.twitter").fadeIn("fast");

});

it works but when when clicking on any place on the page, I don't  
need
it like that, I need it only on the image.. what is the wrong in  
that?




[jQuery] Re: jQuery PDF Viewer?

2009-09-16 Thread Rodrigo Sebastián Alfonso
I have to agree with Jeffrey there.

I do not think that JavasScript (i don't say I'm certain because you never
know) has a way of interpreting binary data, jQuery or no jQuery.

If you're familiar with reading binary data in some other language, this
might help you, although I cannot say I've tested it:

http://www.codeproject.com/KB/scripting/Exsead7.aspx

H.A.N.D.

On Wed, Sep 16, 2009 at 9:14 PM, Jeffrey Kretz wrote:

>
> Are you trying to have the browser render a PDF document WITHOUT the client
> having the PDF reader installed?
>
> It seems to me you would need to rely on some sort of server-side
> technology
> that would convert the PDF document into straight HTML or perhaps a SWF.
>
> JK
>
> -Original Message-
> From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
> Behalf Of benji++
> Sent: Wednesday, September 16, 2009 3:37 PM
> To: jQuery (English)
> Subject: [jQuery] Re: jQuery PDF Viewer?
>
>
> On Sep 16, 5:21 am, Geert Baven  wrote:
> >  Bumpbox works in all modern browsers. based on mootools
> > Here's a list in which browsers it has been successfully tested:
> >
> >- *Firefox 3 - 3.5*
> >- *Internet Explorer 6 | 7 | 8*
> >- *Google Chrome*
> >- *Apple Safari 3 | 4*
> >- *Opera 9.04*
>
>
> This one too only works if the browser has the Adobe Reader plugin,
> otherwise you just get the browser's default behavior.  So it's a lot
> of showbiz with all that boingy window for no result.  I tried it in
> Firefox and the window boinged open, but then I just got the usual
> Firefox dialog asking if I wanted to download the PDF.
>
> Thanks anyway for the suggestion though.  The plugin looks good
> otherwise, I just wouldn't say that it supports PDF, really.
>
>


-- 
Rodrigo Alfonso


[jQuery] Re: selecting elements that match a regular expression

2009-09-16 Thread Steven Black

Try James Padolsey's Regex Selector plugin for jQuery
 http://james.padolsey.com/javascript/regex-selector-for-jquery/

**--**  Steve

On Sep 16, 9:34 pm, macsig  wrote:
> Hello guys,
> is there a way to select elements that match a regular expression?
>
> I have a set of divs with id = "wrap_n" where n is a progressive and I
> need to select them and for each 1 I have to add a function that
> togggle the "elem_n" div.
>
> Thanks
>
> Sig


[jQuery] Re: (autocomplete) how to have autocomplete use dynamic data (for implementing a search engine's entry field)

2009-09-16 Thread lanxiazhi
your server routine is just a web page,wait for the browser to request.you
set up the autocomplete like this:
$(..).autocomplete(web_page_url,{options..}).every time when the user press
a key,autocomplete will make a request to your web page,you fetch the
parameter  q,and you will know what the user have put in the autocomplete
textfield.then you run your routine,and at last,write the response like
this:
fog
fox
one item a line,so autocomplete will know.

the autocomplete plugin bundle file comes with some .php files,that is
server-side code,you can review it.


[jQuery] Re: (validate) temporary deactivate validate listener of fields

2009-09-16 Thread lanxiazhi
Refer to documentation.

2009/9/17 Sandler 

>
> Hi, im loading data via json dynamical from the server. Now i try to
> optimate the speed of my application and so i want to disable the
> validate of the fields during the data loading from the server.
> Is there a simple solution to this? like validate = false
> Thanks a lot and greets from austria!
>
> Sandler
>


[jQuery] Re: selecting elements that match a regular expression

2009-09-16 Thread lanxiazhi
Yes,you can do this.
$("[id*=wrap_]").click(
  function()
 {
var id=$(this).attr("id");
var targetId="elem_"+getNum(id);
$("#"+targetId).toggle();
 }
);

2009/9/17 macsig 

>
> Hello guys,
> is there a way to select elements that match a regular expression?
>
> I have a set of divs with id = "wrap_n" where n is a progressive and I
> need to select them and for each 1 I have to add a function that
> togggle the "elem_n" div.
>
> Thanks
>
>
> Sig


[jQuery] Re: Troubles with appending page title and url to social link

2009-09-16 Thread lanxiazhi
You may add these tow lines before set the attr:
var url=document.URL;
var title=document.title;

besides,URL and title is not properties of the window object,you cannot
refer to them directly.

2009/9/17 amuhlou 

>
> where are the title and url variables coming from?
>
>
> On Sep 16, 9:05 pm, Jacques  wrote:
> > Hi everyone I am trying to append the full page url and contents of
> > the title tag to some social bookmarking links I have the code below
> > but it does not seem to be working can anyone see what I am doing
> > wrong or point me in the right direction?
> >
> > http://www.w3.org/1999/xhtml";>
> > 
> > 
> > test social
> > http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/
> > jquery.min.js" type="text/javascript">
> > 
> > 
> > 
> >   
> >  > target="_blank">share with delicious
> >  > target="_blank">share with stumbleupon
> >   
> > 
> > 
> > $(document).ready(function(){
> > $('#shareit-delicious').attr('href', '
> http://del.icio.us/post?
> > v=4&noui&jump=close&url=' + url + '&title=' + title);
> > $('#shareit-stumbleupon').attr('href', '
> http://www.stumbleupon.com/
> > submit?url=' + url + '&title=' + title);
> > });
> > 
> > 
> > 
>


[jQuery] Re: Troubles with appending page title and url to social link

2009-09-16 Thread amuhlou

where are the title and url variables coming from?


On Sep 16, 9:05 pm, Jacques  wrote:
> Hi everyone I am trying to append the full page url and contents of
> the title tag to some social bookmarking links I have the code below
> but it does not seem to be working can anyone see what I am doing
> wrong or point me in the right direction?
>
> http://www.w3.org/1999/xhtml";>
> 
> 
> test social
> http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/
> jquery.min.js" type="text/javascript">
> 
> 
> 
>   
>      target="_blank">share with delicious
>      target="_blank">share with stumbleupon
>   
> 
> 
>         $(document).ready(function(){
>                 $('#shareit-delicious').attr('href', 'http://del.icio.us/post?
> v=4&noui&jump=close&url=' + url + '&title=' + title);
>                 $('#shareit-stumbleupon').attr('href', 
> 'http://www.stumbleupon.com/
> submit?url=' + url + '&title=' + title);
>         });
> 
> 
> 


[jQuery] selecting elements that match a regular expression

2009-09-16 Thread macsig

Hello guys,
is there a way to select elements that match a regular expression?

I have a set of divs with id = "wrap_n" where n is a progressive and I
need to select them and for each 1 I have to add a function that
togggle the "elem_n" div.

Thanks


Sig


[jQuery] Re: Jquery Newbie needing help..

2009-09-16 Thread amuhlou

A couple things..

1. The click function can't be used to fadeIn the image again...
because you wouldn't be able to click on it when it's hidden

2. Do you want a single click to cause the fadeOut-fadeIn-fadeOut-
fadeIn? If so, you could use the callback functions of the fadeIn and
fadeOut transitions:

$(document).ready(function(){
$('img.twitter).click(function(){
$(this).fadeOut('fast', function(){
$(this).fadeIn('fast',function(){
$(this).fadeOut('fast', function(){
$(this).fadeIn('fast');
});
});
});
});
});

The callback function runs when the transition is complete.


On Sep 16, 8:36 pm, Galaxy Man  wrote:
> Hi guys.. this is the first time I use Jquery Directly & with my hands
> purely.. I wrote this code:
> $("img.twitter").click(function(){
>
> $("img.twitter").fadeOut("fast");
>
> });
>
> $("img.twitter").click(function(){
>
> $("img.twitter").fadeIn("fast");
>
> });
>
> $("img.twitter").click(function(){
>
> $("img.twitter").fadeOut("fast");
>
> });
>
> $("img.twitter").click(function(){
>
> $("img.twitter").fadeIn("fast");
>
> });
>
> I want an image with the class twitter to fade in& out twice.. but it
> doesn't work.. when I tried to replace it with this:
> $(document).click(function(){
>
> $("img.twitter").fadeOut("fast");
>
> });
>
> $(document).click(function(){
>
> $("img.twitter").fadeIn("fast");
>
> });
>
> $(document).click(function(){
>
> $("img.twitter").fadeOut("fast");
>
> });
>
> $(document).click(function(){
>
> $("img.twitter").fadeIn("fast");
>
> });
>
> it works but when when clicking on any place on the page, I don't need
> it like that, I need it only on the image.. what is the wrong in that?


[jQuery] Re: From adult google group.

2009-09-16 Thread Karl Swedberg

On Sep 16, 2009, at 3:37 PM, moiramethot45250 wrote:



For jquery-en group members. HD tube adult movies. Sorted by rating of
millions users...


Sorry that one slipped through. User is now banned.

--Karl


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



[jQuery] (validate) temporary deactivate validate listener of fields

2009-09-16 Thread Sandler

Hi, im loading data via json dynamical from the server. Now i try to
optimate the speed of my application and so i want to disable the
validate of the fields during the data loading from the server.
Is there a simple solution to this? like validate = false
Thanks a lot and greets from austria!

Sandler


[jQuery] Jquery Newbie needing help..

2009-09-16 Thread Galaxy Man

Hi guys.. this is the first time I use Jquery Directly & with my hands
purely.. I wrote this code:
$("img.twitter").click(function(){

$("img.twitter").fadeOut("fast");

});
$("img.twitter").click(function(){

$("img.twitter").fadeIn("fast");

});
$("img.twitter").click(function(){

$("img.twitter").fadeOut("fast");

});
$("img.twitter").click(function(){

$("img.twitter").fadeIn("fast");

});

I want an image with the class twitter to fade in& out twice.. but it
doesn't work.. when I tried to replace it with this:
$(document).click(function(){

$("img.twitter").fadeOut("fast");

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

$("img.twitter").fadeIn("fast");

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

$("img.twitter").fadeOut("fast");

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

$("img.twitter").fadeIn("fast");

});
it works but when when clicking on any place on the page, I don't need
it like that, I need it only on the image.. what is the wrong in that?


[jQuery] (autocomplete) how to have autocomplete use dynamic data (for implementing a search engine's entry field)

2009-09-16 Thread Mike Wertheim
I'm looking into using the autocomplete plugin from
http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/.

The provided examples all use static data.

What I want to do is to mimic the behavior that search engines (like Google,
Yahoo, Bing, etc.) use for the auto-complete on their entry fields...  After
the user enters each character into the text field, the search engine's auto
complete generates a new set of selectable options based on the current
value of the text field.  So if the user enters "fog" into the text field,
the text field shows one set of options after the user enters the "f", and
then a refined set of options after the user enters the "o", and then an
even more refined set of options after the user enters the "g".

My server has a back-end routine that will take the string that the user has
entered so far, and returns the auto-complete data for that particular
string.  (Not this this is relevant to jquery, but my server implements this
by making calls to http://google.com/complete/search?q=fog.)  The server
outputs a javascript string that looks like this:
var autocompleteData = ["some value", "some other value", "yet another
value", "and so on"];

What I need is for the autocomplete module to invoke my server routine after
each keystroke.

Is this possible?


[jQuery] The PHP connector used in this demo has been modified to prevent access to folders below the demo directory.

2009-09-16 Thread mbs400

About six weeks ago while I still had Leopard on my machine, I created
a jquery page that accesses the Zend php classes:

private $_lib_path = "/usr/local/zend/share/ZendFramework/library/" ;

The webpage calling jquery lives in "/Library/WebServer/Documents" and
it calls classes within $_lib_path.

The page worked great, and I used it for a couple of weeks. This
morning I tried to access the page, and it is blank, and the following
message displays where the jquery display used to be.

I created this page using Leopard about six weeks ago, and a few days
ago I installed Snow Leopard. I have not changed anything that I know
of...

I have a pretty good idea what the message is trying to tell me, and
am curios what has changed to trigger this ?

Any way to get around this problem ?

I don't want to move the library.

Thanks for any help...


[jQuery] Re: jQuery PDF Viewer?

2009-09-16 Thread Jeffrey Kretz

Are you trying to have the browser render a PDF document WITHOUT the client
having the PDF reader installed?

It seems to me you would need to rely on some sort of server-side technology
that would convert the PDF document into straight HTML or perhaps a SWF.

JK

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of benji++
Sent: Wednesday, September 16, 2009 3:37 PM
To: jQuery (English)
Subject: [jQuery] Re: jQuery PDF Viewer?


On Sep 16, 5:21 am, Geert Baven  wrote:
>  Bumpbox works in all modern browsers. based on mootools
> Here's a list in which browsers it has been successfully tested:
>
>    - *Firefox 3 - 3.5*
>    - *Internet Explorer 6 | 7 | 8*
>    - *Google Chrome*
>    - *Apple Safari 3 | 4*
>    - *Opera 9.04*


This one too only works if the browser has the Adobe Reader plugin,
otherwise you just get the browser's default behavior.  So it's a lot
of showbiz with all that boingy window for no result.  I tried it in
Firefox and the window boinged open, but then I just got the usual
Firefox dialog asking if I wanted to download the PDF.

Thanks anyway for the suggestion though.  The plugin looks good
otherwise, I just wouldn't say that it supports PDF, really.



[jQuery] Re: Radio buttons, element retrieval, pre-validation, pre-submission

2009-09-16 Thread ShrimpWagon

I addressed the Radio buttons and the element retrieval issue by
lessening the restrictions you put on the prototype.elements function:

[code]
elements: function() {
var validator = this,
rulesCache = {};

// select all valid inputs inside the form (no submit or reset
buttons)
// workaround $Query([]).add until http://dev.jquery.com/ticket/2114
is solved

return $([]).add(this.currentForm.elements).filter(":input").not
(":submit, :reset, :image, [disabled]");
},
[/code]

I also had to comment out this section of the prototype.check
function:

[code]
if (this.checkable(element)) {
element = this.findByName( element.name )[0];
}
[/code]

It seems to be working great and it cycles through all of the input
elemens.

Hope this helps someone.

On Sep 16, 4:48 pm, ShrimpWagon  wrote:
> Is it that big of a problem that it can't cycle through each radio
> button independently? I noticed that the script starts by getting all
> of the filtered inputs. But then it cycles through each one and gets
> them again by name. Why can't you just use what was already retrieved
> without getting it by name?
>
> Also, it would be nice to have a pre validation handler that could run
> before any validation takes place. It could return true of false
> depending on if it should even continue with validation. This
> suggestion also applies to a pre submission handler. Would be nice to
> maybe do something before the form is submitted but after a successful
> form validation.


[jQuery] Re: (validate), submitHandler and custom function

2009-09-16 Thread bgumbiker

Any Idea?
thanks

On Sep 15, 12:17 pm, bgumbiker  wrote:
> Indeed the message is sent with $.post(...) however it looks like the
> following code is not called:
>
> jQuery.ajaxSetup({
>   'beforeSend': function(xhr) {xhr.setRequestHeader("Accept", "text/
> javascript")}
>
> });
>
> and the server side code does not handle the request properly.
>
> Thanks!
> Bogumil
>
> On Sep 13, 10:01 pm, Jörn Zaefferer 
> wrote:
>
> > Try this:
>
> > submitHandler: function(form) {
> >   $.post(form.action, $(this).serialize(), null, "script");
>
> > }
>
> > Jörn
>
> > On Sun, Sep 13, 2009 at 12:42 AM, bgumbiker  
> > wrote:
>
> > > Hello,
> > > I am looking for a way to call successfully custom function from
> > > submitHandler to do proper ajax post.
>
> > > Here is my custom function:
>
> > > jQuery.fn.submitWithAjax = function() {
> > >  this.submit(function() {
> > >    $.post(this.action, $(this).serialize(), null, "script");
> > >    return false;
> > >  })
> > >  return this;
> > > };
>
> > > Before using validate plugin I had following which worked fine:
>
> > > $(document).ready(function() {
> > >   $("#my_form").submitWithAjax();
> > >  }
>
> > > Now I have added the validation part and have no idea how to call my
> > > custom submitWithAjax function??
>
> > > $(document).ready(function() {
>
> > >    $("#my_form").validate({
>
> > >                /*Validations - works perfectly!! */
>
> > >             },
>
> > >             submitHandler: function(form) {
>
> > >             /* $("#my_form").submitWithAjax(); - this works but
> > > introduces recursion */
>
> > >             /* how to call custom subitWithAjax() ? */
>
> > >             }
>
> > >        });
> > > })
>
> > > Thanks!


[jQuery] Re: AJAX: Display raw XML Document

2009-09-16 Thread Jonathan

That did it. I was using success which did not provide access to the
xml as a string I could output, but complete works great. Thanks! Now
I cane easily get the text, the HTTP Response code.

On Sep 16, 1:32 pm, Mike Alsup  wrote:
> > I still can't find a solution to simply print out the XML response
> > from an AJAX call. I'm surprised jQuery can't handle something that
> > simple, as it can otherwise do so much.
>
> > The other js libraries don't seem to have a problem with it, it looks
> > like jQuery just isn't up to the task, and I can't use it for this
> > project.
>
> Try hooking the 'complete' callback and access the responseText
> property of the XHR:
>
> $.ajax({
>     ...
>     complete: function(xhr, status) {
>         alert(xhr.responseText);
>     }
>
> });


[jQuery] Re: jQuery PDF Viewer?

2009-09-16 Thread benji++

On Sep 16, 5:21 am, Geert Baven  wrote:
>  Bumpbox works in all modern browsers. based on mootools
> Here's a list in which browsers it has been successfully tested:
>
>    - *Firefox 3 - 3.5*
>    - *Internet Explorer 6 | 7 | 8*
>    - *Google Chrome*
>    - *Apple Safari 3 | 4*
>    - *Opera 9.04*


This one too only works if the browser has the Adobe Reader plugin,
otherwise you just get the browser's default behavior.  So it's a lot
of showbiz with all that boingy window for no result.  I tried it in
Firefox and the window boinged open, but then I just got the usual
Firefox dialog asking if I wanted to download the PDF.

Thanks anyway for the suggestion though.  The plugin looks good
otherwise, I just wouldn't say that it supports PDF, really.


[jQuery] Re: jQuery PDF Viewer?

2009-09-16 Thread benji++

On Sep 16, 3:54 am, Sam Sherlock  wrote:
> I have'nt tried this but it does look goodhttp://pdfobject.com/
> - S

Thanks, Sam, but that one works the same as Alsup's mentioned above.
If your browser doesn't have the Adobe Reader plugin, then it just
gives you a message saying you don't have PDF support and asks if you
want to download the PDF instead -- which is exactly the kind of user
decision I'm trying to avoid.


[jQuery] Re: [validate] Custom functions onfocusin / -out

2009-09-16 Thread Jörn Zaefferer

You could also just bind focus and blur events to each element for the
same effect, without requiring a change to the plugin code.

Jörn

On Wed, Sep 16, 2009 at 11:32 PM, Philipp  wrote:
>
> Hi!
>
> I added a nice little tweak which allows me to define custom functions
> called on (un) focussing a form element:
>
> jquery.validate.js got three additional lines at the end of onfocusin
> function (line 200):
>                        if (this.settings.focusFunction) {
>                                this.settings.focusFunction(element);
>                        }
> and at the end of onfocusout function:
>                        if (this.settings.blurFunction) {
>                                this.settings.blurFunction(element);
>                        }
>
> By defining a "focusFunction" / "blurFunction" within a jQuery
> ('#...').validate({})-block I was able to add a custom behaviour to
> those two events without writing additional JavaScript code. In my
> case I simply display or hide a div containing some help for the form
> element.
>
> Maybe this little code change will help somebody or even find its way
> to the official release.
>
> Kind regards and thank you for your validator!
>  Philipp
>


[jQuery] Re: ANN "eyedropper" color picker plugin

2009-09-16 Thread Scott Trudeau
This wouldn't be too difficult to turn into a greasemonkey script.  It
wouldn't work for images that are hosted from a domain other than the parent
page, however, which is a frequent case; Firefox will throw canvas security
exceptions for every img element not in the domain if you do
$('img').dropper().  You could probably do a $('img').each() loop and check
that the src attribute is in the page domain before making the image
"pickable," but you would only be able to "pick" from a subset of (possibly
0) images on the page.

You could also turn it into a bookmarklet a la Karl Swedberg's jquerify
bookmarklet (same caveats apply, greasemonkey not required):

http://www.learningjquery.com/2009/04/better-stronger-safer-jquerify-bookmarklet

Scott

On Wed, Sep 16, 2009 at 5:45 PM, Jack Killpatrick  wrote:

>  great, thanks. This would be really handy as a greasemonkey script. I use
> a FF plugin that does the eyedropper thing a lot (during design work), but
> it has it's shortcomings. If a greasemonkey script gave me the eyedropper
> and a box with the sampled color and hex value, that'd be rad.
>
> - Jack
>
>
> Scott Trudeau wrote:
>
>
> Since github seems to be suffering from a DoS attack, I posted a demo here:
>
> http://sstrudeau.com/jquery-dropper/demo/index.html
>
> Scott
>
> On Wed, Sep 16, 2009 at 12:47 PM, Scott Trudeau 
> wrote:
>
>>
>> [cross posted from the plugin list, which seems to have died in
>> February]
>>
>> Hey folks,
>>
>> I've been absent from the jquery lists for quite awhile, but just
>> recently had the opportunity to build a cool little plugin for a
>> project I'm working on so I decided to release it to the public.  This
>> plugin acts as an "eyedropper"-style color picker, allowing a user to
>> select a color by clicking a pixel in an image.
>>
>> The plugin replaces selected img elements on the page with a canvas
>> element, and provides click, mousemove and mouseout event callbacks.
>> The callback is sent a color object (describing the color under the
>> mouse for the event). It also shows a little hovering preview of the
>> color near the cursor when over the image.
>>
>> You can find it on github with a simple demo included:
>>
>> http://github.com/sstrudeau/jquery-dropper
>>
>> I'm hoping to receive some feedback on things like:
>>
>> * callback function naming conventions
>> * which other arguments would be useful & appropriate to send via the
>> callback
>> * should I instead (or also) trigger events instead/as well as offer
>> callbacks?
>> * any best practice examples for making something like the color hover
>> chip style-able, optional?
>> * any other feedback
>>
>> No live demo yet -- but if I hear a clamor, I might find a place to
>> tuck one.
>>
>> Notable limitations: doesn't work on IE (the VML canvas hack doesn't
>> offer pixel-level access to images) and images must be hosted from the
>> same domain as the origin page (canvas security limitation).
>>
>> Thanks,
>>
>> Scott
>>
>
>
>


[jQuery] Re: Page load question

2009-09-16 Thread the intern

Never mind, a seem to have figured it out

Here is the code that I used to do this


$(document).ready(function(){
e = $('[id$=_y]');
for (i = 0; i < e.length; i++)
if (e[i].checked == true)
{
$('#' + ($(e[i]).attr('id').charAt(1)) + 
'_questionsLink').show();
$('#' + ($(e[i]).attr('id').charAt(1)) + 
'_toggle').val('show
additional questions');
}
});



[jQuery] [validate] Custom functions onfocusin / -out

2009-09-16 Thread Philipp

Hi!

I added a nice little tweak which allows me to define custom functions
called on (un) focussing a form element:

jquery.validate.js got three additional lines at the end of onfocusin
function (line 200):
if (this.settings.focusFunction) {
this.settings.focusFunction(element);
}
and at the end of onfocusout function:
if (this.settings.blurFunction) {
this.settings.blurFunction(element);
}

By defining a "focusFunction" / "blurFunction" within a jQuery
('#...').validate({})-block I was able to add a custom behaviour to
those two events without writing additional JavaScript code. In my
case I simply display or hide a div containing some help for the form
element.

Maybe this little code change will help somebody or even find its way
to the official release.

Kind regards and thank you for your validator!
 Philipp


[jQuery] Re: ANN "eyedropper" color picker plugin

2009-09-16 Thread Jack Killpatrick
great, thanks. This would be really handy as a greasemonkey script. I 
use a FF plugin that does the eyedropper thing a lot (during design 
work), but it has it's shortcomings. If a greasemonkey script gave me 
the eyedropper and a box with the sampled color and hex value, that'd be 
rad.


- Jack

Scott Trudeau wrote:


Since github seems to be suffering from a DoS attack, I posted a demo 
here:


http://sstrudeau.com/jquery-dropper/demo/index.html

Scott

On Wed, Sep 16, 2009 at 12:47 PM, Scott Trudeau 
mailto:scott.trud...@gmail.com>> wrote:



[cross posted from the plugin list, which seems to have died in
February]

Hey folks,

I've been absent from the jquery lists for quite awhile, but just
recently had the opportunity to build a cool little plugin for a
project I'm working on so I decided to release it to the public.  This
plugin acts as an "eyedropper"-style color picker, allowing a user to
select a color by clicking a pixel in an image.

The plugin replaces selected img elements on the page with a canvas
element, and provides click, mousemove and mouseout event callbacks.
The callback is sent a color object (describing the color under the
mouse for the event). It also shows a little hovering preview of the
color near the cursor when over the image.

You can find it on github with a simple demo included:

http://github.com/sstrudeau/jquery-dropper

I'm hoping to receive some feedback on things like:

* callback function naming conventions
* which other arguments would be useful & appropriate to send via the
callback
* should I instead (or also) trigger events instead/as well as offer
callbacks?
* any best practice examples for making something like the color hover
chip style-able, optional?
* any other feedback

No live demo yet -- but if I hear a clamor, I might find a place to
tuck one.

Notable limitations: doesn't work on IE (the VML canvas hack doesn't
offer pixel-level access to images) and images must be hosted from the
same domain as the origin page (canvas security limitation).

Thanks,

Scott






[jQuery] Re: Superfish and IE8 - drop-down menus "flashing" down on page load

2009-09-16 Thread Ralph Whitbeck
It seems like the submenu UL is being hidden on load via the javascript.
Can you set the CSS to display:none and that should make it load without
showing the submenu.

Ralph

On Wed, Sep 16, 2009 at 2:37 PM, graykiwi  wrote:

>
> I have successfully installed superfish-powered drop-down menus in my
> horizontal nav bar, but I get an irritating (and inconsistent) issue
> when I click on a nav link: the drop-down menus briefly "flash" down
> as the new page loads. In fact the page as a whole flashes. This
> behavior only occurs in IE8 (haven't tried 7) - Firefox, Safari,
> Chrome are all fine. The url is: peacefulnations.org
>
> I'd appreciate any help.
>
> Thanks.
>


[jQuery] Re: ANN "eyedropper" color picker plugin

2009-09-16 Thread Jack Killpatrick


Sounds cool, consider this some clamor for a live demo :-)

Thanks,
Jack

Scott Trudeau wrote:

[cross posted from the plugin list, which seems to have died in
February]

Hey folks,

I've been absent from the jquery lists for quite awhile, but just
recently had the opportunity to build a cool little plugin for a
project I'm working on so I decided to release it to the public.  This
plugin acts as an "eyedropper"-style color picker, allowing a user to
select a color by clicking a pixel in an image.

The plugin replaces selected img elements on the page with a canvas
element, and provides click, mousemove and mouseout event callbacks.
The callback is sent a color object (describing the color under the
mouse for the event). It also shows a little hovering preview of the
color near the cursor when over the image.

You can find it on github with a simple demo included:

http://github.com/sstrudeau/jquery-dropper

I'm hoping to receive some feedback on things like:

* callback function naming conventions
* which other arguments would be useful & appropriate to send via the
callback
* should I instead (or also) trigger events instead/as well as offer
callbacks?
* any best practice examples for making something like the color hover
chip style-able, optional?
* any other feedback

No live demo yet -- but if I hear a clamor, I might find a place to
tuck one.

Notable limitations: doesn't work on IE (the VML canvas hack doesn't
offer pixel-level access to images) and images must be hosted from the
same domain as the origin page (canvas security limitation).

Thanks,

Scott

  





[jQuery] Re: this.reset() doesn't work

2009-09-16 Thread KeeganWatkins

@Dhruva-

>> It should be $(this).reset();

That won't work. Note that reset() is a method that is available on
raw form elements in the DOM, but not on a jQuery-wrapped set.

// Example for Firebug
console.log(jQuery.fn.reset) // undefined

@pritisolanki -
You can't expect the selector engine (or your page, for that matter)
to work properly when you have several ID's that are the same. You
have three forms that all have an id="form" in your sample HTML. This
is non-compliant with W3C standards and can cause a whole mess of
problems. If you need to select them all, use the class attribute
instead.

Furthermore, you are using the name and ID attribute in a way which
contributes to what is often called the "deadly expando". You should
definitely consider avoiding ID and name attributes such as "form",
"submit", "text", etc as described in these articles ->
http://ejohn.org/blog/deadly-expandos/ and http://jibbering.com/faq/names/
. "form" as an ID doesn't directly induce this phenomena, but the
principle is the same: don't use attribute values which might conflict
with DOM properties.

Change your ID's to be unique and all should be good. For reuse, you
could create a simple plugin:
$.fn.reset = function() {
return this.each(function() {
// Check against forms, and for the reset method
if (this.tagName.toLowerCase() === "form" && this.reset) {
this.reset();
}
});
}

Usage:
$("#myForm").reset();

On Sep 16, 7:50 am, Dhruva Sagar  wrote:
> It should be $(this).reset();
> But since your using an id in the selector, that will reset only the
> particular form you want.
> If you wish to reset all the forms in the page you should do something
> similar to this :
>
> $('form').each(function(){
>    $(this).reset();
>
> });
>
> You should of course put this piece of code in the document ready function.
>
> Thanks & Regards,
> Dhruva Sagar.
>
> Pablo Picasso
> - "Computers are useless. They can only give you answers."
>
> On Wed, Sep 16, 2009 at 1:45 PM, pritisolanki  wrote:
>
> > Hi,
>
> > I am trying to reset all the form element but it is not working can
> > someone suggest the reason.
>
> >  >www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> > http://www.w3.org/1999/xhtml";>
> > 
> > 
> > jQuery Starterkit
>
> >  > href="screen.css" />
> > 
> > 
> > 
> > 
> > 
> > 
> > 
>
> > jQuery Starterkit
> > This page contains code to test the examples. Most of it is only
> > relevant for a example.
>
> > Some link
> > 
> > 
> > Hehehehe so think you can hide me :-p  > p>
> > 
> > 
> >        
> >                Form 1
> >                
> >        
>
> >        
> >                Form 2
> >                
> >        
>
> >        
> >                Form 3
> >                
> >                
> >        
> > 
> >        Reset!
>
> > 
> > 


[jQuery] Re: Ajax

2009-09-16 Thread Matthew Rolph
thanks!! i also added a extra link to show both, id selectors for the tag

On Tue, Sep 15, 2009 at 9:02 PM, Steven Yang  wrote:

> your first link works find
> the second one doesnt work because you have the wrong id on your 
> and the id is the same as your 
>
>
>
>
> On Tue, Sep 15, 2009 at 7:05 PM, Matthew Rolph wrote:
>
>> well, i fixed that at least the source shows right now
>> can you see any probs. now?
>>
>>
>> On Mon, Sep 14, 2009 at 9:15 PM, Steven Yang wrote:
>>
>>> hi
>>> this is all i see in the source of your page
>>>
>>> Ajax - jQuery Tests >> src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.js";>
>>>  

[jQuery] Error using jCarousel on IE 8

2009-09-16 Thread Mythic Web Design

I'm having some trouble getting the jCarousel plugin to work under IE
8.

On this site:

http://dev.kandeart.com/

I get this error:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/
4.0; Tablet PC 1.7; .NET CLR 1.0.3705; InfoPath.2)
Timestamp: Wed, 16 Sep 2009 20:27:14 UTC


Message: 'null' is null or not an object
Line: 35
Char: 2
Code: 0
URI: http://dev.kandeart.com/scripts/kandeart.js

   It works fine in both FF3 and IE6, so I don't understand what's
causing the problem. Any assistance would be appreciated.


[jQuery] Re: Attaching methods to identical forms, but only invoking the method on the current form

2009-09-16 Thread Stephen

Hi Mike,
Ah, the "this" object!  I forgot about that.  Thank you  for code
snippet!

--Stephen

On Sep 16, 3:38 pm, Mike Alsup  wrote:
> > I have a form that is repeated through out the page by the backend,
> > which I have no control over.
> > 
> > 
> > Cancel
> > 
>
> > I want to attach an event to the link to clear the textarea.
> > $(".comment_form_cancel").live("click", function(event) {
> >         $(".your_comment").val('');
> >         event.preventDefault();
>
> > });
>
> > This method would be attached to all instances of the form.  However,
> > I would like only the form the user is currently working on to trigger
> > the method.  For example, if there are 3 forms, I click the cancel
> > link on the 3rd form, the clearing should only happen on the 3rd form,
> > not all forms.  Is there a way to do this?
>
> This should work:
>
> $(".comment_form_cancel").live("click", function(event) {
>         $(this).prev(".your_comment").val('');
>         event.preventDefault();
>
> });


[jQuery] facebox over iframe

2009-09-16 Thread l_kris06

Hi all,

 I have a couple of iframes and one of them trigger facebox, and its
opened within the iframe, I want it to open on the parent window. any
help would be great.


[jQuery] Re: jquery validate and datepicker.

2009-09-16 Thread Williamk

Thanks Karl.
I will direct any ui questions to the UI group from now on.
That  said, I appreciate your help.
:)

Kind regards,
William


On Sep 14, 11:04 am, Karl Swedberg  wrote:
> Hi,
>
> Sorry you haven't received a response yet. Usually Jörn picks up  
> questions about the validate picker, but he's been traveling for the  
> past week. Also, datepicker questions are usually handled on the  
> jquery-ui google group. In any case, it looks like the the validation  
> message is triggered on blur of the field. I don't recall how  
> datepicker works, but I would sort of expect the focus to go back to  
> the date input element when a date is selected from the datepicker.  
> Since that isn't happening now, you can make it happen by adding an  
> onClose or onSelect method to your datepicker 
> options:http://jqueryui.com/demos/datepicker/#event-onSelect
>   That way, the validation thing will be triggered when the user  
> clicks or tabs out of the field after that point.
>
> Hope that helps.
>
> --Karl
>
> 
> Karl Swedbergwww.englishrules.comwww.learningjquery.com
>
> On Sep 13, 2009, at 6:45 PM, Williamk wrote:
>
>
>
>
>
> > Was it something I said? Or didn't say?
> > :/
>
> > On Sep 8, 8:28 am, Williamk  wrote:
> >> Oh, I put the demo page for the remember the milk with the datepicker
> >> on a site, so you can see what I am talking about.
> >> No porn or viagra or Nigerian cons or anything else dubious.
> >> If you are interested:http://avianflew.com/milk/
>
> >> On Sep 7, 9:48 pm, Williamk  wrote:
>
> >>> For some reason, and this is baffling me, if I use both the  
> >>> validation
> >>> plugin and the datepicker plugin, some voodoo is occurring.
> >>> I have to select the date twice for it to validate.
> >>> For example, here are the steps I took:
> >>> I try to submit the form without dates in the fields.
> >>> The form is not sent and the date fields are flagged.
> >>> If you open it once and select a date, the calendar closes, but it
> >>> still shows as invalid.
> >>> If you repeat this action, selecting the same exact field and  
> >>> opening
> >>> the calendar and selecting the date again, then it shows as valid.
> >>> I'm not sure how to shoehorn this into validating on the first click
> >>> on the calendar.
> >>> And to be honest, I'm terrified I'm going to get flamed  over this.
> >>> I generally consider myself pretty resourceful, but this is making  
> >>> me
> >>> a little bit loco.


[jQuery] Re: [validate] Help with errorPlacement

2009-09-16 Thread Loony2nz

o...duh :)

i have to keep in mind that I have to traverse the DOM tree

Thanks :)

On Sep 16, 12:19 pm, Jörn Zaefferer 
wrote:
> You need to go up one more level:
>
> errorPlacement: function(error, element){
>   error.appendTo( element.parent().parent().next().find(".errorMsg") );
>
> }
>
> Jörn
>
> On Wed, Sep 16, 2009 at 8:18 PM, Loony2nz  wrote:
>
> > Hello,
>
> > I need help with targeting a class on a TD to hold error messages with
> > jQuery form validator plug-in.
>
> > This is my sampling of code:
>
> > < script>
> > 
> > errorPlacement: function(error, element){
> >   error.appendTo( element.parent().next());
> > }
> > 
>
> > 
> >    First Name > style="color:#f00;">*
> >      > size="20" type="text" />
> > 
> > 
> >     
> >     
> > 
>
> > I want to target the TD with the class: errorMsg to hold the error
> > message.
>
> > I've tried  error.appendTo( element.parent().next('.errorMsg')); to no
> > avail.
>
> > Any help would be much appreciated.
>
> > Thanks


[jQuery] Re: Attaching methods to identical forms, but only invoking the method on the current form

2009-09-16 Thread Mike Alsup

> I have a form that is repeated through out the page by the backend,
> which I have no control over.
> 
> 
> Cancel
> 
>
> I want to attach an event to the link to clear the textarea.
> $(".comment_form_cancel").live("click", function(event) {
>         $(".your_comment").val('');
>         event.preventDefault();
>
> });
>
> This method would be attached to all instances of the form.  However,
> I would like only the form the user is currently working on to trigger
> the method.  For example, if there are 3 forms, I click the cancel
> link on the 3rd form, the clearing should only happen on the 3rd form,
> not all forms.  Is there a way to do this?

This should work:

$(".comment_form_cancel").live("click", function(event) {
$(this).prev(".your_comment").val('');
event.preventDefault();
});




[jQuery] From adult google group.

2009-09-16 Thread moiramethot45250

For jquery-en group members. HD tube adult movies. Sorted by rating of
millions users http://www.2watch4.com/redsdkp/includes/db/www/


[jQuery] Re: [validate] Help with errorPlacement

2009-09-16 Thread Jörn Zaefferer

You need to go up one more level:

errorPlacement: function(error, element){
  error.appendTo( element.parent().parent().next().find(".errorMsg") );
}

Jörn

On Wed, Sep 16, 2009 at 8:18 PM, Loony2nz  wrote:
>
> Hello,
>
> I need help with targeting a class on a TD to hold error messages with
> jQuery form validator plug-in.
>
> This is my sampling of code:
>
> < script>
> 
> errorPlacement: function(error, element){
>   error.appendTo( element.parent().next());
> }
> 
>
> 
>    First Name style="color:#f00;">*
>      size="20" type="text" />
> 
> 
>     
>     
> 
>
> I want to target the TD with the class: errorMsg to hold the error
> message.
>
> I've tried  error.appendTo( element.parent().next('.errorMsg')); to no
> avail.
>
> Any help would be much appreciated.
>
> Thanks


[jQuery] Re: AJAX: Display raw XML Document

2009-09-16 Thread Mike Alsup

> I still can't find a solution to simply print out the XML response
> from an AJAX call. I'm surprised jQuery can't handle something that
> simple, as it can otherwise do so much.
>
> The other js libraries don't seem to have a problem with it, it looks
> like jQuery just isn't up to the task, and I can't use it for this
> project.

Try hooking the 'complete' callback and access the responseText
property of the XHR:

$.ajax({
...
complete: function(xhr, status) {
alert(xhr.responseText);
}
});



[jQuery] Attaching methods to identical forms, but only invoking the method on the current form

2009-09-16 Thread Stephen

Hi,
I have a form that is repeated through out the page by the backend,
which I have no control over.


Cancel


I want to attach an event to the link to clear the textarea.
$(".comment_form_cancel").live("click", function(event) {
$(".your_comment").val('');
event.preventDefault();
});

This method would be attached to all instances of the form.  However,
I would like only the form the user is currently working on to trigger
the method.  For example, if there are 3 forms, I click the cancel
link on the 3rd form, the clearing should only happen on the 3rd form,
not all forms.  Is there a way to do this?

Thanks,
Stephen


[jQuery] Superfish and IE8 - drop-down menus "flashing" down on page load

2009-09-16 Thread graykiwi

I have successfully installed superfish-powered drop-down menus in my
horizontal nav bar, but I get an irritating (and inconsistent) issue
when I click on a nav link: the drop-down menus briefly "flash" down
as the new page loads. In fact the page as a whole flashes. This
behavior only occurs in IE8 (haven't tried 7) - Firefox, Safari,
Chrome are all fine. The url is: peacefulnations.org

I'd appreciate any help.

Thanks.


[jQuery] Re: AJAX: Display raw XML Document

2009-09-16 Thread Knight, Doug

Just my two cents, I have to agree, it would be nice to be able to at a minimum 
dump the actual XML from the Ajax call.

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf 
Of Jonathan
Sent: Wednesday, September 16, 2009 1:33 PM
To: jQuery (English)
Subject: [jQuery] Re: AJAX: Display raw XML Document


I still can't find a solution to simply print out the XML response
from an AJAX call. I'm surprised jQuery can't handle something that
simple, as it can otherwise do so much.

The other js libraries don't seem to have a problem with it, it looks
like jQuery just isn't up to the task, and I can't use it for this
project.

Disappointed.

On Sep 14, 11:53 pm, Jonathan  wrote:
> I'm re-writing a test page for a RESTful web service with AJAX, and
> need to be able to display the XML or JSON response in a textarea or a
> div. I'm re-writing the web page to work off jQuery, but I'm stuck
> here.
>
> The best response I can get is: [Object XMLDocument]
>
> I have to set a custom Authorization header, set an HTTP method (get,
> put, post, or delete), send data, and display the raw XML (or JSON,
> depending on the request) response in the page.
>
> With firebug I see the XML response is there, but I can't figure out
> how to display that raw XML with jQuery. It worked with the prototype
> js, but I'm stumped trying to get it to work with jQuery.
>
> It seems like a simple enough task, the XML is there, I want to print
> it out on the page. I've spent hours searching through the jQuery docs
> and online examples to no avail.
>
> Any ideas?


[jQuery] Re: keeping table header fix

2009-09-16 Thread Macsig

Yes, I do but I don't see how that can help me out.

Thanks

On Sep 16, 4:01 am, Liam Byrne  wrote:
> do you actually have the headers in a , with the content in  ?
>
> Most people forget about those.
>
> L
>
>
>
> macsig wrote:
> > Hello guys,
> > I'd like to know if there is a way to keep a table header fixed on top
> > of a div while I scroll the table rows.
> > I have a div high 200px and the table itself is around 300px so when I
> > scroll down I'd like to always see the header on top.
> > I already use for the table tablesorter so the solution must be
> > compatible with that plug-in.
>
> > Thanks and have a nice day!
>
> > Sig
> > 
>
> > No virus found in this incoming message.
> > Checked by AVG -www.avg.com
> > Version: 8.5.409 / Virus Database: 270.13.100/2375 - Release Date: 09/16/09 
> > 05:51:00


[jQuery] Re: Browser Stop call's ajax.Error

2009-09-16 Thread nirazue...@gmail.com

Thank you.
Can you think up with a solution to this? How can I "detect" when the
call is begin terminated?

On Sep 14, 5:32 pm, MiKiTiE  wrote:
> Probably because you're sending the data to the url, but stopping the
> process before it can produce a result.
>
> On Sep 13, 7:52 pm, "nirazue...@gmail.com" 
> wrote:
>
> > Hi, I've noticed that when I click the Stop button on the browser, or
> > navigate to another page, jQuery.ajax calls the error event.
>
> > You can see the problem live at:http://www.pingmyport.com/
>
> > Code:
>
> >    this.getJson = function(timeout) {
> >       if(this.XMLHttpRequest) this.XMLHttpRequest.abort();
> >       this.XMLHttpRequest = $.ajax({
> >          complete: function(){$("#kitLoader").hide();},
> >          data: {
> >             Address: him.Address,
> >             portNum: him.portNum,
> >             portType: him.portType
> >          },
> >          dataType: "json",
> >          error: him.serviceUnavailable,
> >          success: him.processJson,
> >          timeout: timeout,
> >          type: "POST",
> >          url: "http://www.pingmyport.com/checkPort.php";
> >       });
> >    };


[jQuery] Re: ANN "eyedropper" color picker plugin

2009-09-16 Thread Scott Trudeau
Since github seems to be suffering from a DoS attack, I posted a demo here:

http://sstrudeau.com/jquery-dropper/demo/index.html

Scott

On Wed, Sep 16, 2009 at 12:47 PM, Scott Trudeau wrote:

>
> [cross posted from the plugin list, which seems to have died in
> February]
>
> Hey folks,
>
> I've been absent from the jquery lists for quite awhile, but just
> recently had the opportunity to build a cool little plugin for a
> project I'm working on so I decided to release it to the public.  This
> plugin acts as an "eyedropper"-style color picker, allowing a user to
> select a color by clicking a pixel in an image.
>
> The plugin replaces selected img elements on the page with a canvas
> element, and provides click, mousemove and mouseout event callbacks.
> The callback is sent a color object (describing the color under the
> mouse for the event). It also shows a little hovering preview of the
> color near the cursor when over the image.
>
> You can find it on github with a simple demo included:
>
> http://github.com/sstrudeau/jquery-dropper
>
> I'm hoping to receive some feedback on things like:
>
> * callback function naming conventions
> * which other arguments would be useful & appropriate to send via the
> callback
> * should I instead (or also) trigger events instead/as well as offer
> callbacks?
> * any best practice examples for making something like the color hover
> chip style-able, optional?
> * any other feedback
>
> No live demo yet -- but if I hear a clamor, I might find a place to
> tuck one.
>
> Notable limitations: doesn't work on IE (the VML canvas hack doesn't
> offer pixel-level access to images) and images must be hosted from the
> same domain as the origin page (canvas security limitation).
>
> Thanks,
>
> Scott
>


[jQuery] [validate] Help with errorPlacement

2009-09-16 Thread Loony2nz

Hello,

I need help with targeting a class on a TD to hold error messages with
jQuery form validator plug-in.

This is my sampling of code:

< script>

errorPlacement: function(error, element){
   error.appendTo( element.parent().next());
}



First Name*
 


 
 


I want to target the TD with the class: errorMsg to hold the error
message.

I've tried  error.appendTo( element.parent().next('.errorMsg')); to no
avail.

Any help would be much appreciated.

Thanks


[jQuery] Re: How to check is element "droppable"

2009-09-16 Thread Boris Trivic

thanks a lot, that's answer.

Best regards!

On Sep 16, 7:29 pm, "Richard D. Worth"  wrote:
> var isDroppable = $("#first").is(".ui-droppable"); // boolean
>
> or
>
> var droppables = $("div").filter(".ui-droppable"); // collection
>
> Also note, there's a separate list for jQuery UI questions, should you have
> any more:
>
> http://groups.google.com/group/jquery-ui
>
> - Richard
>
> On Wed, Sep 16, 2009 at 1:15 PM, Boris Trivic  wrote:
>
> > yes I'm using jQuery droppable. I am trying to check if some element
> > is droppable. Example:
>
> > /// code:
> > 
> >   $("#first").droppable();
> >...
> >...
> > 
>
> > 
> > 
> > /// end code
>
> > now I need to check both divs (first and second) and find out which is
> > droppable. In this example: script must write: "div 'first' is
> > droppable, div 'second' is not droppable"
>
> > Understand now?
>
> > On Sep 16, 2:49 pm, "Richard D. Worth"  wrote:
> > > It's not clear. Are you trying to use an element with a tag name of
> > > 'droppable'? Are you using jQuery UI Droppable?
> > > - Richard
>
> > > On Tue, Sep 15, 2009 at 2:36 PM, Boris Trivic 
> > wrote:
>
> > > > if question isn't clear, I can explain better :)
>
> > > > On Sep 15, 7:33 pm, Boris Trivic  wrote:
> > > > > Hi.
>
> > > > > How I can check this? I have next part of code where I must check is
> > > > > element "tag" = droppable.
>
> > > > > Instead code after "// pseudo:" i must add some function that check
> > if
> > > > > element is droppable. If true it must write some text in that element
> > > > > (For example: $(tag).text('bla bla') )
>
> > > > > // code /
> > > > > function help(){
> > > > > // array generated by PHP:
> > > > > 
> > > > > // random num. from upper array:
> > > > > var rand = Math.floor( Math.random() *
> > cor.length
> > > > );
> > > > > // Set tag
> > > > > if(rand != 0){
> > > > > var tag = '#p'+rand;
> > > > > }
> > > > > // here goes code that check if "tag" is
> > > > > droppable...
> > > > >/// pseudo:
> > > > >if(tag is droppable){
> > > > > alert('is dropable');
> > > > >}}
>
> > > > >  CODE /


[jQuery] Re: AJAX: Display raw XML Document

2009-09-16 Thread Jonathan

I still can't find a solution to simply print out the XML response
from an AJAX call. I'm surprised jQuery can't handle something that
simple, as it can otherwise do so much.

The other js libraries don't seem to have a problem with it, it looks
like jQuery just isn't up to the task, and I can't use it for this
project.

Disappointed.

On Sep 14, 11:53 pm, Jonathan  wrote:
> I'm re-writing a test page for a RESTful web service with AJAX, and
> need to be able to display the XML or JSON response in a textarea or a
> div. I'm re-writing the web page to work off jQuery, but I'm stuck
> here.
>
> The best response I can get is: [Object XMLDocument]
>
> I have to set a custom Authorization header, set an HTTP method (get,
> put, post, or delete), send data, and display the raw XML (or JSON,
> depending on the request) response in the page.
>
> With firebug I see the XML response is there, but I can't figure out
> how to display that raw XML with jQuery. It worked with the prototype
> js, but I'm stumped trying to get it to work with jQuery.
>
> It seems like a simple enough task, the XML is there, I want to print
> it out on the page. I've spent hours searching through the jQuery docs
> and online examples to no avail.
>
> Any ideas?


[jQuery] Re: How to check is element "droppable"

2009-09-16 Thread Richard D. Worth
var isDroppable = $("#first").is(".ui-droppable"); // boolean

or

var droppables = $("div").filter(".ui-droppable"); // collection

Also note, there's a separate list for jQuery UI questions, should you have
any more:

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

- Richard

On Wed, Sep 16, 2009 at 1:15 PM, Boris Trivic  wrote:

>
> yes I'm using jQuery droppable. I am trying to check if some element
> is droppable. Example:
>
> /// code:
> 
>   $("#first").droppable();
>...
>...
> 
>
> 
> 
> /// end code
>
> now I need to check both divs (first and second) and find out which is
> droppable. In this example: script must write: "div 'first' is
> droppable, div 'second' is not droppable"
>
> Understand now?
>
>
> On Sep 16, 2:49 pm, "Richard D. Worth"  wrote:
> > It's not clear. Are you trying to use an element with a tag name of
> > 'droppable'? Are you using jQuery UI Droppable?
> > - Richard
> >
> > On Tue, Sep 15, 2009 at 2:36 PM, Boris Trivic 
> wrote:
> >
> > > if question isn't clear, I can explain better :)
> >
> > > On Sep 15, 7:33 pm, Boris Trivic  wrote:
> > > > Hi.
> >
> > > > How I can check this? I have next part of code where I must check is
> > > > element "tag" = droppable.
> >
> > > > Instead code after "// pseudo:" i must add some function that check
> if
> > > > element is droppable. If true it must write some text in that element
> > > > (For example: $(tag).text('bla bla') )
> >
> > > > // code /
> > > > function help(){
> > > > // array generated by PHP:
> > > > 
> > > > // random num. from upper array:
> > > > var rand = Math.floor( Math.random() *
> cor.length
> > > );
> > > > // Set tag
> > > > if(rand != 0){
> > > > var tag = '#p'+rand;
> > > > }
> > > > // here goes code that check if "tag" is
> > > > droppable...
> > > >/// pseudo:
> > > >if(tag is droppable){
> > > > alert('is dropable');
> > > >}}
> >
> > > >  CODE /
>


[jQuery] ClueTip problem on initially hidden fields

2009-09-16 Thread Sarah B.

I am using the clueTip plugin to show help hovers on my application.
It works like a charm, except when I have initially hidden fields on
the page.  For example, several fields default to
style="display:none;" and then when an onchange event occurs on a
dropdown, these fields are shown.  When you mouseover the help image
to see the clueTip on these fields which were initially hidden, the
clueTip flashes and acts funny.

Here is the jQuery:

$(document).ready(function() {
$('span.toolt...@title]').cluetip({
splitTitle: '|',
arrows: true,
dropShadow: false,
positionBy: 'auto',
cluetipClass: 'jtip'}
);
});


Here is the html:

Heading




[jQuery] jCarousel 0.2.3 hangs IE7 on window resize event

2009-09-16 Thread Malic

I've discovered that http://sorgalla.com/jcarousel/ will hang IE7 (but
not IE8) when the this.funcResize handler (bound to window.onresize)
is called.

The setup for this is in init around line 226:
$(window).unbind('resize', this.funcResize).bind('resize',
this.funcResize);

What happens is that IE7 fires off onresize every time a resize occurs
- even when you are in the middle of servicing a resize event.  The
loop goes on and results in a frozen browser with ever increasing
resource consumption.  Something outside of jCarousel (jQuery UI
"tabs" in my case to be specific) could cause the resize event to
occur.

I tried to employ the technique mentioned here - remove event handling
for onresize then add it back when it's done:
http://remysharp.com/2008/05/15/windowonresize-hangs-ie6-and-ie7/#comment-93255

...this didn't work for me though.  Admittedly, I didn't work that
hard at it.  In the end, I've disabled the jCarousel resizing smarts
because I didn't need it for my purposes.  But a permanent fix would
be nice.

At least that is what I think is going on - does anyone have a
differing point of view?




[jQuery] Re: JQUERY listnav: includeAll Parameter translation

2009-09-16 Thread Jack Killpatrick


I like that, will definitely consider it for the next rev. If you want 
to change it in the version you have, look for this:


>ALL<

and change it to whatever you want:

>Alle<

Thx,
Jack

mansoft wrote:

It would be nice, if the "includeAll" parameter could be changed or
extended to work like the "noMatchText":
Instead of true or false it should be empty or the text for the link
i.e "All", "Alle", "tous", "todos" 

  





[jQuery] Re: How to check is element "droppable"

2009-09-16 Thread Boris Trivic

yes I'm using jQuery droppable. I am trying to check if some element
is droppable. Example:

/// code:

   $("#first").droppable();
...
...




/// end code

now I need to check both divs (first and second) and find out which is
droppable. In this example: script must write: "div 'first' is
droppable, div 'second' is not droppable"

Understand now?


On Sep 16, 2:49 pm, "Richard D. Worth"  wrote:
> It's not clear. Are you trying to use an element with a tag name of
> 'droppable'? Are you using jQuery UI Droppable?
> - Richard
>
> On Tue, Sep 15, 2009 at 2:36 PM, Boris Trivic  wrote:
>
> > if question isn't clear, I can explain better :)
>
> > On Sep 15, 7:33 pm, Boris Trivic  wrote:
> > > Hi.
>
> > > How I can check this? I have next part of code where I must check is
> > > element "tag" = droppable.
>
> > > Instead code after "// pseudo:" i must add some function that check if
> > > element is droppable. If true it must write some text in that element
> > > (For example: $(tag).text('bla bla') )
>
> > > // code /
> > > function help(){
> > > // array generated by PHP:
> > > 
> > > // random num. from upper array:
> > > var rand = Math.floor( Math.random() * cor.length
> > );
> > > // Set tag
> > > if(rand != 0){
> > > var tag = '#p'+rand;
> > > }
> > > // here goes code that check if "tag" is
> > > droppable...
> > >/// pseudo:
> > >if(tag is droppable){
> > > alert('is dropable');
> > >}}
>
> > >  CODE /


[jQuery] Re: Page load question

2009-09-16 Thread the intern

Here is my jQuery:


$(document).ready(function(){
   $('[id$=_questions],[id$=_questionsLink]').hide();
$('[id$=_y]').bind('click',function(){
   var thiis = $(this).attr('id').charAt(1);
   $('#'+thiis+'_questions').show();
   $('#'+thiis+'_questionsLink').show();
   });
$('[id$=_n]').bind('click',function(){
   var thiis = $(this).attr('id').charAt(1);
   $('[class$=_condition]').val("");
   $('[id$=_date]').find('option:first').attr
('selected','selected').parent('select');
   $('#'+thiis+'_questions').hide();
   $('#'+thiis+'_questionsLink').hide();
   });
$('[id$=toggle]').bind('click',function(){
   var thiis = $(this).attr('id').charAt(0);
   $('#'+thiis+'_questions').toggle();
   $(this).val($(this).val() == 'hide additional questions' ? 'show
additional questions' : 'hide additional questions');
   });
});



Here is the code for the first question:


  
1. Have you ever had
symptoms, been diagnosed with, or been treated for:
  
  
a.
 High Blood Pressure 

  
  Yes


  
  No

  

  



Disease, Injury, or Medical Condition?

Treatment, Medication, Dosage?
Date Treatment Began?
Date Treatment Ended?

  





  
Was Individual Hospitalized?
Attending Physician?
Physician Phone Number?
Degree of Recovery?

  

Yes
No






  
  


On Sep 9, 12:22 pm, "Cesar Sanz"  wrote:
> Well, can you show us some mark-up?
>
> - Original Message -
> From: "the intern" 
> To: "jQuery (English)" 
> Sent: Tuesday, September 08, 2009 1:54 PM
> Subject: [jQuery] Page load question
>
> > What I have is a form where people will answer yes or no questions.
> > What I need is, that when the page is loaded, a way to go though the
> > questions and check to see which ones are marked as yes. The reason
> > for this is, when yes is checked, there are additional questions that
> > open up using .show(). Right now, if the page is refreshed or
> > reloaded, all the additional questions hide regardless if the yes is
> > check or not.
>
> > Thanks in advance
>
> > Aaron


[jQuery] Re: New to JQuery

2009-09-16 Thread Emeka
Kumaran and Whitbeck,

Thanks so much!

Regards,
Emeka

On Wed, Sep 16, 2009 at 3:13 PM, Ralph Whitbeck wrote:

> The Learning jQuery book is also another great book.
>
> Also take a look at http://learningjquery.com and
> http://15daysofjquery.com/ is a great site to get started.
>
> Also you can post your questions to the group here and we'll help you out.
>
> Good Luck
> Ralph
>
>
> On Wed, Sep 16, 2009 at 10:50 AM, Anantha Kumaran <
> ananthakuma...@gmail.com> wrote:
>
>>  Read  jQuery in Action  to get Started
>> and then read the api doc to master it
>>
>> On Wed, Sep 16, 2009 at 6:13 PM, Emeka  wrote:
>>
>>> Hello All,
>>>
>>> I am new here and I would need your  support in order  to get started.
>>> Where can I get tutorials and wikibooks on JQuery?  Also recommend books.
>>>
>>> Regards,
>>> Emeka
>>
>>
>>
>


[jQuery] ANN "eyedropper" color picker plugin

2009-09-16 Thread Scott Trudeau

[cross posted from the plugin list, which seems to have died in
February]

Hey folks,

I've been absent from the jquery lists for quite awhile, but just
recently had the opportunity to build a cool little plugin for a
project I'm working on so I decided to release it to the public.  This
plugin acts as an "eyedropper"-style color picker, allowing a user to
select a color by clicking a pixel in an image.

The plugin replaces selected img elements on the page with a canvas
element, and provides click, mousemove and mouseout event callbacks.
The callback is sent a color object (describing the color under the
mouse for the event). It also shows a little hovering preview of the
color near the cursor when over the image.

You can find it on github with a simple demo included:

http://github.com/sstrudeau/jquery-dropper

I'm hoping to receive some feedback on things like:

* callback function naming conventions
* which other arguments would be useful & appropriate to send via the
callback
* should I instead (or also) trigger events instead/as well as offer
callbacks?
* any best practice examples for making something like the color hover
chip style-able, optional?
* any other feedback

No live demo yet -- but if I hear a clamor, I might find a place to
tuck one.

Notable limitations: doesn't work on IE (the VML canvas hack doesn't
offer pixel-level access to images) and images must be hosted from the
same domain as the origin page (canvas security limitation).

Thanks,

Scott


[jQuery] Re: "Object doesn't support this property or method" in IE

2009-09-16 Thread knox203

Forget it, looks like it's working now with both of your replies, you
guys rock! Ricardo, your code removed the java error in IE, thanks.
Rupak, I went back and added  tags to my source file, and sure
enough, IE is now returning the data like it's supposed to!

Thanks again guys,
   - Adam

On Sep 16, 12:05 am, rupak mandal  wrote:
> I have face similar problem . Just check is there any html  open or close
> tag missing in "provStats.php".
>
> Thanks
> Rupak
>
> On Wed, Sep 16, 2009 at 12:16 PM, Ricardo  wrote:
>
> > Hmm. No idea why it doesn't work in IE, but here are some general
> > observations:
>
> > You don't need the "jQuery(function(){" part around the function.
> > setTimeout(updateStatus, 2); // use the function object
> > $(document).ready(updateStatus); //same here, pass the object, don't
> > call the function. this can also go in the  script along with
> > the rest
>
> > See how that works out, here's the code:http://snipt.org/mogk
> > And you could use some logic to make it less spaguetti too:
> >http://snipt.org/mogl
>
> > On Sep 15, 3:08 pm, knox203  wrote:
> > > Hello everyone, I have the following code that works great in Firefox,
> > > Opera, Safari, but fails to work in IE. Can anyone take a look and
> > > maybe tell me what I'm doing wrong? Thanks!
>
> > > 
> > > 
> > > 
> > >         function updateStatus(){
> > >                 jQuery(function(){
> > >                 $("#prov1hCount").load("source/provStats.php
> > #prov1hCount");
> > >                         $("#prov1hOntime").load("source/provStats.php
> > #prov1hOntime");
> > >                         $("#prov1hLate").load("source/provStats.php
> > #prov1hLate");
> > >                         $("#prov1hPuAverage").load("source/provStats.php
> > > #prov1hPuAverage");
>
> > $("#prov1hMTDPuAverage").load("source/provStats.php
> > > #prov1hMTDPuAverage");
> > >                         $("#prov2hCount").load("source/provStats.php
> > #prov2hCount");
> > >                         $("#prov2hOntime").load("source/provStats.php
> > #prov2hOntime");
> > >                         $("#prov2hLate").load("source/provStats.php
> > #prov2hLate");
> > >                         $("#prov2hPuAverage").load("source/provStats.php
> > > #prov2hPuAverage");
> > >                         $("#prov2hDelAverage").load("source/provStats.php
> > > #prov2hDelAverage");
>
> > $("#prov2hMTDPuAverage").load("source/provStats.php
> > > #prov2hMTDPuAverage");
> > >                  });
> > >         setTimeout("updateStatus()",2);
> > >   }
> > > 
> > > 
> > > 
> > > ...
> > > 
> > > 
> > >  $(document).ready(updateStatus());
> > > 


[jQuery] Re: "Object doesn't support this property or method" in IE

2009-09-16 Thread knox203

Thanks Ricardo, your first revised block of code took away the error
message in Internet Explorer. Doesn't look like the second block
returned any of my data. I'm in the process of learning jQuery, so
it's better that I play around with it anyways =)

 I'm still having a problem getting the data to show up in IE (with
the first revised block of code you supplied). The data fills in the
DIV's one by one in Firefox, but returns what appears to be NULL
values in IE. I can see each DIV change in IE, but it does not look
like it's filling it in with the data like Firefox does. Any ideas?

Thanks!
   - Adam

On Sep 15, 11:46 pm, Ricardo  wrote:
> Hmm. No idea why it doesn't work in IE, but here are some general
> observations:
>
> You don't need the "jQuery(function(){" part around the function.
> setTimeout(updateStatus, 2); // use the function object
> $(document).ready(updateStatus); //same here, pass the object, don't
> call the function. this can also go in the  script along with
> the rest
>
> See how that works out, here's the code:http://snipt.org/mogk
> And you could use some logic to make it less spaguetti 
> too:http://snipt.org/mogl
>
> On Sep 15, 3:08 pm, knox203  wrote:
>
> > Hello everyone, I have the following code that works great in Firefox,
> > Opera, Safari, but fails to work in IE. Can anyone take a look and
> > maybe tell me what I'm doing wrong? Thanks!
>
> > 
> > 
> > 
> >         function updateStatus(){
> >                 jQuery(function(){
> >                 $("#prov1hCount").load("source/provStats.php #prov1hCount");
> >                         $("#prov1hOntime").load("source/provStats.php 
> > #prov1hOntime");
> >                         $("#prov1hLate").load("source/provStats.php 
> > #prov1hLate");
> >                         $("#prov1hPuAverage").load("source/provStats.php
> > #prov1hPuAverage");
> >                         $("#prov1hMTDPuAverage").load("source/provStats.php
> > #prov1hMTDPuAverage");
> >                         $("#prov2hCount").load("source/provStats.php 
> > #prov2hCount");
> >                         $("#prov2hOntime").load("source/provStats.php 
> > #prov2hOntime");
> >                         $("#prov2hLate").load("source/provStats.php 
> > #prov2hLate");
> >                         $("#prov2hPuAverage").load("source/provStats.php
> > #prov2hPuAverage");
> >                         $("#prov2hDelAverage").load("source/provStats.php
> > #prov2hDelAverage");
> >                         $("#prov2hMTDPuAverage").load("source/provStats.php
> > #prov2hMTDPuAverage");
> >                  });
> >         setTimeout("updateStatus()",2);
> >   }
> > 
> > 
> > 
> > ...
> > 
> > 
> >  $(document).ready(updateStatus());
> > 


[jQuery] Quick announcement about CFJS for jQuery

2009-09-16 Thread Chris Jordan

Hi folks,

I just wanted to drop a quick note letting everyone know that I've
committed cfjs 1.1.10 to the repository on riaforge.org (http://
svn.riaforge.org/cfjs/). This new version includes HTMLCodeFormat()
and HTMLEditFormat(). I'll be working on NumberFormat() soon as well
as a short list of Array functions that have been on my to-do list for
quite a while now.

These include:
ArrayAverage()
ArrayClear()
ArrayDeleteAt()
ArrayInsertAt()
ArraySum()

You can visit the project page over at cfjs.riaforge.org, or read my
blog articles about it over at http://cjordan.us/index.cfm/CFJS

Hope folks are continuing to find this useful. :o)


[jQuery] Re: Simple Modal Height and Width

2009-09-16 Thread Eric Martin

As long as the content being used in the modal has a height and width
supplied, SimpleModal will use those values to size the dialog.

For example, using the basic demo as a base and given the following:


CSS:
#simplemodal-overlay {background-color:#000; cursor:wait;}
#simplemodal-container {color:#bbb; background-color:#333; border:4px
solid #444;}
#simplemodal-container a.modalCloseImg {background:url(../img/basic/
x.png) no-repeat; width:25px; height:29px; display:inline; z-index:
3200; position:absolute; top:-15px; right:-16px; cursor:pointer;}

JS:
$('#basic-modal-content').modal();

I get a the image with a border and the dimensions at 400x600.

Hope that helps.

-Eric




On Sep 9, 12:47 pm, Byron Matto  wrote:
> Question:
>
> Simple Modal has default height and width values of 200 and 300 pixels
> respectively.  Is there a way to the modal conform to whatever content
> is present.  In other words I want the modal to have height and width
> equal to the HxW of image modal is applied to ... automatically.
>
> Thoughts?


[jQuery] Re: [asmselect] "Remove" link links to the main page

2009-09-16 Thread Liam Byrne


You say you "click the remove link".

What is the code / href of the remove link, and do you have a "return 
false" on the jQuery code to prevent that link being followed ?


$(document).ready(function() {
  $("#removeLink").click(function() {
 // do whatever the link should do
 return false; // <== VERY IMPORTANT TO PREVENT THE BROWSER 
NAVIGATING TO "#", which would usually be to the top of the page

 });
});

Remove

odlo wrote:

Anytime when I click the remove link after selecting one or multiple
items my browser jumps to the main page.
It doesn't happen on _any_ system but only on _some_ systems.

Is there any solutiuon?

System: Vista
Browser: FF 3, FF 3.5, IE 8, Seamonkey

http://picasaweb.google.de/lh/sredir?uname=christoph.puppe&target=ALBUM&id=5379203595117546545&authkey=Gv1sRgCNLk55_C5s3RCg&feat=email

cu
oldo



No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.409 / Virus Database: 270.13.89/2359 - Release Date: 09/10/09 05:50:00


  




[jQuery] Re: $(this).css({"color" : "red"})

2009-09-16 Thread Liam Byrne


Try $(this).css({color:"#FF"});

Matt wrote:

see that code in the subj.? i'm using FF 3.5, and no matter what i
do, .css won't work!! any help?



No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.409 / Virus Database: 270.13.99/2372 - Release Date: 09/15/09 05:59:00


  




[jQuery] Re: why getJSON in firefox takes longer than in other browses?

2009-09-16 Thread Michael Geary
You have Firebug, right? And is this a fairly large JSON object?

Disable Firebug and see what happens. If it goes at more the speed you
expected, then the problem is the use of eval() in the current version of
jQuery, which slows down badly with Firebug. This is fixed in the next
release (it uses a Function constructor, which isn't slowed down by Firebug,
instead of eval).

If that's not it, post a link to a test page?

-Mike

On Wed, Sep 16, 2009 at 7:38 AM, PanMarcepan  wrote:

>
> Hello I'm using jQuery and asp.net.
> jQuery using getJSON calls specific handler, lets say MyHandler.ashx
>
> $.getJSON(/MyHandler.ashx?param1=someVal, function(data) {
> ... some code;
> }
>
> In Opera and Explorer this is executed immediately. In FireFox it
> takes over 1s before request is executed. Even when I set breakpoint
> in my handler it will be hit after 1s... could you tell me why it is
> so slow? I got latest version of firefox.
>


[jQuery] Re: SimpleModal Contact Form and Sidebar

2009-09-16 Thread Eric Martin

Trent,

I'm not quite sure what you are asking. Could you clarify your
question?

Thanks,
Eric

On Sep 12, 7:48 am, Trent <26g...@gmail.com> wrote:
> How can I embedSimpleModalContact 
> Formhttp://www.ericmmartin.com/projects/simplemodal/
> in the sidebar, whose position is fixed on the scrolling map.
> No reference as in the example from the author:
> Demo
>
> a picture button.gif
>
> Code sidebar:
>  src="images/button.gif" alt="contact" width="28" height="137" />
>
> Menu takes the following 
> form:http://www.askdev.ru/uploads/4aa/b616/4b612e/large.gif


[jQuery] Re: Conflict between Simplemodal and jquery-ui slider?

2009-09-16 Thread Eric Martin

The problem is that you are including the basic.js file from my site,
which is causing a conflict. Remove that script and use the following
code:

$(document).ready(function() {
$('#basic-modal input.basic, #basic-modal a.basic').click(function
(e) {
e.preventDefault();
$('#basic-modal-content').modal({onShow: function (d) {
$("#slider-vertical", d.container[0]).slider({
orientation: "vertical",
range: "min",
min: 50,
max: 300,
value: 100,
slide: function(event, ui) {
$("#amount").val(ui.value);
}
});
}});
});
});

-Eric

On Sep 11, 7:54 pm, folder123  wrote:
> The behavior i'm seeing is the onShow only seems to run once. On
> subsequent modal window opens the contents in onShow don't seem to
> execute.
>
> -k
>
> On Sep 11, 7:31 pm, folder123  wrote:
>
> > I'm still having issues with the code below, the slider now doesn't
> > even show up on a 2nd window open.
>
> > Any thoughts greatly appreciated, I'm sure i'm missing something
> > simple.
>
> > -k
>
> > On Sep 11, 2:52 pm, Eric Martin  wrote:
>
> > > Use the onShow callback inSimpleModalto call the slider init code:
>
> > > $('#basic-modal-content').modal({onShow: function (dialog) {
> > >     $("#slider-vertical", dialog.container[0]).slider({
> > >         orientation: "vertical",
> > >         range: "min",
> > >         min: 50,
> > >         max: 300,
> > >         value: 100,
> > >         slide: function(event, ui) {
> > >             $("#amount").val(ui.value);
> > >         }
> > >     });
>
> > > }});
>
> > > -Eric
>
> > > On Sep 10, 2:30 pm, folder123  wrote:
>
> > > > Summary - Slider does not work inSimpleModalwindow after more than
> > > > once.
>
> > > > Detail:
>
> > > > Step 1: Click to open modal window
> > > > Step 2: Observe slider working properly, with value being updated,
> > > > close
> > > > modal
> > > > Step 3: Click to open modal window
> > > > Step 4: Observe slider NOT working properly, NaN being returned
>
> > > > If you open the modal with the slider, then close the window, then re-
> > > > open
> > > > the modal and attempt to move the slider NaN errors occur. Attached is
> > > > a
> > > > simple html document that demonstrates the problem.
>
> > > > This has also been posted to theSimpleModalgoogle code group.
>
> > > > Any thoughts would be greatly appreciated, thanks for all the hard
> > > > work on jquery.
>
> > > > To replicate, please cut and paste the following into a html document.
>
> > > > http://www.w3.org/1999/xhtml";>
> > > > 
>
> > > >   > > > href="http://jqueryui.com/latest/themes/base/ui.all.css";
> > > > rel="stylesheet" />
> > > >      > > > src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js";
> > > > type="text/javascript">
> > > >      > > > src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-
> > > > ui.min.js"
> > > > type="text/javascript">
> > > >      > > > src='http://www.ericmmartin.com/simplemodal/js/jquery.simplemodal.js'
> > > > type='text/javascript'>
> > > >      > > > type='text/javascript'>
>
> > > >      > > > href='http://www.ericmmartin.com/simplemodal/css/basic.css'
> > > > rel='stylesheet' media='screen' />
>
> > > > 
> > > > $().ready(function() {
>
> > > >     $('#basic-modal input.basic, #basic-modal a.basic').click(function
> > > > (e)
> > > > {
> > > >         e.preventDefault();
> > > >         $('#basic-modal-content').modal();
> > > >     });
>
> > > >     $(function() {
> > > >         $("#slider-vertical").slider({
> > > >                                 orientation: "vertical",
> > > >                                 range: "min",
> > > >                                 min: 50,
> > > >                                 max: 300,
> > > >                                 value: 100,
> > > >                                 slide: function(event, ui) {
> > > >                                     $("#amount").val(ui.value);
> > > >                                 }
> > > >         });
> > > >     });
>
> > > > });
>
> > > > 
> > > > 
>
> > > > 
>
> > > >   
> > > >   
> > > >   
> > > >   
>
> > > >   
> > > >     Basic Modal Dialog
> > > >         
> > > >              > > > class='basic demo'/>
> > > >         
> > > >   
> > > > - Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> > - Show quoted text -


[jQuery] Re: How to wait until the DOM has been updated by a jquery "load" before executing subsequent JavaScript?

2009-09-16 Thread alexryan

That was it.
Thank you Mike.


[jQuery] jqzoom and IE

2009-09-16 Thread IfTrueElseFalse

If on this product page - 
http://www.shanghaitattoo.com/magento/jingpingshuiyi/c2001
- and you click on the second or third thumbnail, while using IE 6 or
7, the zoom function breaks. I think when you view the error in IE7
you can understand a little better what's going wrong. But to tell the
truth, I have no clue what's going wrong O_o

Again, opera, safari, chrome, ff no problemo, why


[jQuery] Re: New to JQuery

2009-09-16 Thread Ralph Whitbeck
The Learning jQuery book is also another great book.

Also take a look at http://learningjquery.com and
http://15daysofjquery.com/is a great site to get started.

Also you can post your questions to the group here and we'll help you out.

Good Luck
Ralph

On Wed, Sep 16, 2009 at 10:50 AM, Anantha Kumaran
wrote:

>  Read  jQuery in Action  to get Started
> and then read the api doc to master it
>
> On Wed, Sep 16, 2009 at 6:13 PM, Emeka  wrote:
>
>> Hello All,
>>
>> I am new here and I would need your  support in order  to get started.
>> Where can I get tutorials and wikibooks on JQuery?  Also recommend books.
>>
>> Regards,
>> Emeka
>
>
>


[jQuery] Re: How to wait until the DOM has been updated by a jquery "load" before executing subsequent JavaScript?

2009-09-16 Thread Mike McNally

You're calling the function "attachEventHandlers" instead of passing a
reference to the function.  Take the () off.


On Wed, Sep 16, 2009 at 9:55 AM, alexryan  wrote:
>
> Newbie question:
>
> I'm using JQuery's load function to update a portion of my page with
> new content.
> This works okay but I would also like to attach event handlers to the
> newly loaded content after it is loaded.
> There is probably a best practice approach to doing so but I am not
> aware of it.
> If someone could point me in the right direction it would be much
> appreciated.
>
> The approach that I am trying is not working and I'm not sure why.
>
> When showFavorites() is invoked, I want the content of a div in my
> page to be updated with a table.
> I also want to attach event handlers to the rows of the table.
> Here is my code ...
>
> function showFavorites(link){
>  alert('loading...');
>  $('div').load('/quotations/quotes2.jsp', null, attachEventHandlers
> ());
> }
>
> function attachEventHandlers() {
>  alert('number of trs ' + $('tr').size());
> }
>
> According to the jQuery documentation I expect the call to load to be
> complete b4 the callback method "attachEventHandlers()" is called.
> However, the behavior that I've observed is that it's alert box gets
> displayed even before the one in showFavorites().
>
> I'm confused by this behavior.
>



-- 
Turtle, turtle, on the ground,
Pink and shiny, turn around.


[jQuery] How to wait until the DOM has been updated by a jquery "load" before executing subsequent JavaScript?

2009-09-16 Thread alexryan

Newbie question:

I'm using JQuery's load function to update a portion of my page with
new content.
This works okay but I would also like to attach event handlers to the
newly loaded content after it is loaded.
There is probably a best practice approach to doing so but I am not
aware of it.
If someone could point me in the right direction it would be much
appreciated.

The approach that I am trying is not working and I'm not sure why.

When showFavorites() is invoked, I want the content of a div in my
page to be updated with a table.
I also want to attach event handlers to the rows of the table.
Here is my code ...

function showFavorites(link){
  alert('loading...');
  $('div').load('/quotations/quotes2.jsp', null, attachEventHandlers
());
}

function attachEventHandlers() {
  alert('number of trs ' + $('tr').size());
}

According to the jQuery documentation I expect the call to load to be
complete b4 the callback method "attachEventHandlers()" is called.
However, the behavior that I've observed is that it's alert box gets
displayed even before the one in showFavorites().

I'm confused by this behavior.


[jQuery] Re: javascript

2009-09-16 Thread Mike Alsup

> i don't know why this is not working but the later is working well
> please tell me what is wrong with this
>
> // not working
> SocialSite.Home.UserInfo =
> {
>    options : {
>        beforeSubmit: this.friendRequest,
>         success:  this.friendResponse
>    },
>     friendRequest : function(formData, jqForm, options)
>     {
>     },
>     friendResponse : function (responseText, statusText) {
>     }
> };

'this' in your options object is not referencing what you need.
Change that part to be like your example that is working.


[jQuery] Re: New to JQuery

2009-09-16 Thread Anantha Kumaran
 Read  jQuery in Action  to get Started
and then read the api doc to master it
On Wed, Sep 16, 2009 at 6:13 PM, Emeka  wrote:

> Hello All,
>
> I am new here and I would need your  support in order  to get started.
> Where can I get tutorials and wikibooks on JQuery?  Also recommend books.
>
> Regards,
> Emeka


[jQuery] javascript

2009-09-16 Thread Anantha Kumaran
hi i am new to javascript language

i written a script and it works fine and i modified it a bit
and it is not working .

i don't know why this is not working but the later is working well
please tell me what is wrong with this

// not working
SocialSite.Home.UserInfo =
{
   options : {
   beforeSubmit: this.friendRequest,
success:  this.friendResponse
   },

friendRequest : function(formData, jqForm, options)
{
},
friendResponse : function (responseText, statusText) {
}
};

$(document).ready(function() {
$('#addasfriendform').ajaxSubmit(SocialSite.Home.UserInfo.options);
};


// working
SocialSite.Home.UserInfo =
{
friendRequest : function(formData, jqForm, options)
{
},
friendResponse : function (responseText, statusText) {
}
};

$(document).ready(function() {
var  options = {
beforeSubmit: SocialSite.Home.UserInfo.friendRequest,
success:  SocialSite.Home.UserInfo.friendResponse
};
$('#addasfriendform').ajaxSubmit(options);
};


[jQuery] why getJSON in firefox takes longer than in other browses?

2009-09-16 Thread PanMarcepan

Hello I'm using jQuery and asp.net.
jQuery using getJSON calls specific handler, lets say MyHandler.ashx

$.getJSON(/MyHandler.ashx?param1=someVal, function(data) {
... some code;
}

In Opera and Explorer this is executed immediately. In FireFox it
takes over 1s before request is executed. Even when I set breakpoint
in my handler it will be hit after 1s... could you tell me why it is
so slow? I got latest version of firefox.


[jQuery] Re: JQuery Cycle Plugin Random Timeout

2009-09-16 Thread Mike Alsup

> Given that, how would you allocate a timeout for say the first 3
> slides and then have the other slides all running at the default
> timeout?

Keep a counter and reference/update it in the timeoutFn.  After 3
calls to the timeoutFn, return false thereafter.


[jQuery] Loading content from a url inside of a div to the actual div

2009-09-16 Thread Mogui

First let me explain my situation im trying to place dynamic content
into a sharepoint wiki site, which does not allow for direct
javascript to be entered in. In order to do this im seting a . I would like to use that simple format for
multiple div's eg:



What i have so far is:

http://ajax.googleapis.com/ajax/
libs/jquery/1.3.2/jquery.min.js">

$(document).ready(function(){
contentDisp();
});

function contentDisp()
{
var src = $(".content").attr("src");
$(".content").load(src);
}









The example is a standard webpage i plan to incorporate the actual .js
into the webpart once i can get the code to run off a normal page

The issue is that this seems to select the first src as the variable
and does not cycle through for each div, i have tried using (this) to
select but i couldn't get that to load properly

Any help would be much appreciated, the more i learn the more i love
it :)


[jQuery] New to JQuery

2009-09-16 Thread Emeka
Hello All,

I am new here and I would need your  support in order  to get started. Where
can I get tutorials and wikibooks on JQuery?  Also recommend books.

Regards,
Emeka


[jQuery] Re: [ajax] Form submits, success message displayed but no data seems to be passed to php file

2009-09-16 Thread HairyJim

SOLVED!

Damn it, bloomin' windows and its file based permissions. So I tried
all sorts to get this working looking at examples etc and nothing was
working. Out of complete curiosity I went to go look at the
jquery.form.js file and I couldn;t ruddy read it because I did not
have the corrcet priv's set for the internet user. Reset permissions
on the files and voila the below code works for me now!

$(document).ready(function()
{
$("#myform").validate({
submitHandler: function(myform) {
jQuery(myform).ajaxSubmit({
type: "POST",
url: "thanks.php",
success: function() {
$('#contact_form').html("");
$('#message').html("Contact Form 
Submitted!")
  .append("We will be in touch soon.")
  .hide()
  .fadeIn(1500, function() {
  $('#message').append("");
  });
}
});
}
});
});

On Sep 16, 12:38 pm, HairyJim  wrote:
> hmmm Im getting nowhere with this :/
>
> So following the code on the page you suggested and the notes made
> about .ajaxSubmit I transpose it like thus but nothing happens, it
> does not even call the referenced thanks.php.
>
> jQuery(function(){
>
>         var options = {
>                         type: "POST",
>                         url: "thanks.php",
>                         success: function() {
>                                 $('#contact_form').html(" id='message'>");
>                                 $('#message').html("Contact Form 
> Submitted!")
>                           .append("We will be in touch soon.")
>                           .hide()
>                           .fadeIn(1500, function() {
>                                   $('#message').append(" src='/images/
> check.png' />");
>                           });
>                         }
>                 };
>
>         jQuery("#myform").validate({
>                 submitHandler: function(myform) {
>                                 // inside event callbacks 'this' is the DOM 
> element so we first
>                                 // wrap it in a jQuery object and then invoke 
> ajaxSubmit
>                                 jQuery(myform).ajaxSubmit(options);
>                 }
>         });
>
> });
>
> On Sep 16, 11:52 am, Jörn Zaefferer 
> wrote:
>
> > Here is an 
> > example:http://jquery.bassistance.de/validate/demo/ajaxSubmit-intergration-de...
>
> > Jörn
>
> > On Wed, Sep 16, 2009 at 12:39 PM, HairyJim  wrote:
>
> > > Sorry, I have no idea where to use the .ajaxSubmit() option in the
> > > code. What do I need to change to pass the data over to the processing
> > > file?
>
> > > Thanks
> > > James
>
> > > On Sep 16, 10:49 am, Jörn Zaefferer 
> > > wrote:
> > >> You don't specify any data to submit in your ajax call. Use the data
> > >> option, or better yet, the form's plugin ajaxSubmit method. It will
> > >> handle the form serialization for you.
>
> > >> Jörn
>
> > >> On Wed, Sep 16, 2009 at 11:42 AM, HairyJim  wrote:
>
> > >> > Hi all,
>
> > >> > I have this Jquery code, below, which I was hpoing would pass the data
> > >> > from the form over to form processing script  but the problem I have
> > >> > is that the success is returned but the processing script does not
> > >> > seem to get the form data passed to it.
>
> > >> > I have tested the script is called by just firing a success email off.
> > >> > What am I doing wrong, I'm lost in the forest and can't see the trees!
>
> > >> > I am including jquery, jquery.validate and jquery.form
>
> > >> > $(document).ready(function()
> > >> > {
> > >> >        $("#myform").validate({
> > >> >                submitHandler: function() {
> > >> >                        $.ajax({
> > >> >                                type: "POST",
> > >> >                                url: "thanks.php",
> > >> >                                success: function() {
> > >> >                                        $('#contact_form').html(" > >> > id='message'>");
> > >> >                                        $('#message').html("Contact 
> > >> > Form Submitted!")
> > >> >                                  .append("We will be in touch 
> > >> > soon.")
> > >> >                                  .hide()
> > >> >                                  .fadeIn(1500, function() {
> > >> >                                          $('#message').append(" > >> > id='checkmark' src='/images/
> > >> > check.png' />");
> > >> >                                  });
> > >> >                                }
> > >> >                        });
> > >> >                }
> > >> >        });
> > >> > });


[jQuery] Re: Loop over all input elements in form

2009-09-16 Thread Dhruva Sagar
Alertnatively just for your reference these are also some ways to get what
you desire :
$('form').each(function(){
   $(this).children('input').each(function(){
 alert(this.name);
 alert($(this).val());
   })
});

Thanks & Regards,
Dhruva Sagar.


Samuel Goldwyn
- "I'm willing to admit that I may not always be right, but I am never
wrong."

On Wed, Sep 16, 2009 at 3:26 PM, pritisolanki  wrote:

>
> Hi All,
>
> I tried
>
>  $("form").each(function() {
>  alert(this.name);
>   alert($("input").val());
>  });
>
> in following HTML
>
>
>Form 1
>
>
>
>
>Form 2
>
>
>
>
>Form 3
>
>
>
>
> it only alert "XXX" nothing else !!! any idea about this. My journey
> till now is difficult in jquery :-( .Hope to see some answers tomorrow.
>


[jQuery] Re: Loop over all input elements in form

2009-09-16 Thread Dhruva Sagar
This should help :
$('form > input').each(function() {
alert(this.name);
alert($(this).val());
});

Thanks & Regards,
Dhruva Sagar.


Jonathan Swift
- "May you live every day of your life."

On Wed, Sep 16, 2009 at 3:26 PM, pritisolanki  wrote:

>
> Hi All,
>
> I tried
>
>  $("form").each(function() {
>  alert(this.name);
>   alert($("input").val());
>  });
>
> in following HTML
>
>
>Form 1
>
>
>
>
>Form 2
>
>
>
>
>Form 3
>
>
>
>
> it only alert "XXX" nothing else !!! any idea about this. My journey
> till now is difficult in jquery :-( .Hope to see some answers tomorrow.
>


[jQuery] Re: this.reset() doesn't work

2009-09-16 Thread Dhruva Sagar
It should be $(this).reset();
But since your using an id in the selector, that will reset only the
particular form you want.
If you wish to reset all the forms in the page you should do something
similar to this :

$('form').each(function(){
   $(this).reset();
});

You should of course put this piece of code in the document ready function.

Thanks & Regards,
Dhruva Sagar.


Pablo Picasso
- "Computers are useless. They can only give you answers."

On Wed, Sep 16, 2009 at 1:45 PM, pritisolanki  wrote:

>
> Hi,
>
> I am trying to reset all the form element but it is not working can
> someone suggest the reason.
>
>  www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
> http://www.w3.org/1999/xhtml";>
> 
> 
> jQuery Starterkit
>
>  href="screen.css" />
> 
> 
> 
> 
> 
> 
> 
>
> jQuery Starterkit
> This page contains code to test the examples. Most of it is only
> relevant for a example.
>
> Some link
> 
> 
> Hehehehe so think you can hide me :-p  p>
> 
> 
>
>Form 1
>
>
>
>
>Form 2
>
>
>
>
>Form 3
>
>
>
> 
>Reset!
>
> 
> 
>


[jQuery] Re: serializeArray() only for enabled form elements

2009-09-16 Thread Karl Swedberg

Hi there,

this is intentional. only "successful" controls, as defined by the  
W3C, are serialized.

For your reference (emphasis mine):
A successful control is "valid" for submission. Every successful  
control has its control name paired with its current value as part  
of the submitted form data set. A successful control must be defined  
within a FORM element and must have a control name.


However:

• Controls that are disabled cannot be successful.
	• If a form contains more than one submit button, only the  
activated submit button is successful.

• All "on" checkboxes may be successful.
	• For radio buttons that share the same value of the name  
attribute, only the "on" radio button may be successful.
	• For menus, the control name is provided by a SELECT element and  
values are provided by OPTION elements. Only selected options may be  
successful. When no options are selected, the control is not  
successful and neither the name nor any values are submitted to the  
server when the form is submitted.
	• The current value of a file select is a list of one or more file  
names. Upon submission of the form, the contents of each file are  
submitted with the rest of the form data. The file contents are  
packaged according to the form's content type.
	• The current value of an object control is determined by the  
object's implementation.
If a control doesn't have a current value when the form is  
submitted, user agents are not required to treat it as a successful  
control.


There are a couple other caveats that I didn't paste here. For the  
full deal, follow this link:


http://www.w3.org/TR/html401/interact/forms.html#h-17.13.2


--Karl


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




On Sep 16, 2009, at 7:31 AM, nowotny wrote:



Hello.

I noticed that serializeArray() method does only include those
elements that does not have the 'disabled' attribute... I wonder if
it's intentional or am I doing something wrong...?

--
nowotny




[jQuery] Re: How to check is element "droppable"

2009-09-16 Thread Richard D. Worth
It's not clear. Are you trying to use an element with a tag name of
'droppable'? Are you using jQuery UI Droppable?
- Richard

On Tue, Sep 15, 2009 at 2:36 PM, Boris Trivic  wrote:

>
> if question isn't clear, I can explain better :)
>
> On Sep 15, 7:33 pm, Boris Trivic  wrote:
> > Hi.
> >
> > How I can check this? I have next part of code where I must check is
> > element "tag" = droppable.
> >
> > Instead code after "// pseudo:" i must add some function that check if
> > element is droppable. If true it must write some text in that element
> > (For example: $(tag).text('bla bla') )
> >
> > // code /
> > function help(){
> > // array generated by PHP:
> > 
> > // random num. from upper array:
> > var rand = Math.floor( Math.random() * cor.length
> );
> > // Set tag
> > if(rand != 0){
> > var tag = '#p'+rand;
> > }
> > // here goes code that check if "tag" is
> > droppable...
> >/// pseudo:
> >if(tag is droppable){
> > alert('is dropable');
> >}}
> >
> >  CODE /
>


[jQuery] Re: jQuery PDF Viewer?

2009-09-16 Thread Mike McNally

On Wed, Sep 16, 2009 at 7:21 AM, Geert Baven  wrote:
>  Bumpbox works in all modern browsers

not if you're running Linux it doesn't.



-- 
Turtle, turtle, on the ground,
Pink and shiny, turn around.


[jQuery] serializeArray() only for enabled form elements

2009-09-16 Thread nowotny

Hello.

I noticed that serializeArray() method does only include those
elements that does not have the 'disabled' attribute... I wonder if
it's intentional or am I doing something wrong...?

--
nowotny


[jQuery] Loop over all input elements in form

2009-09-16 Thread pritisolanki

Hi All,

I tried

  $("form").each(function() {
  alert(this.name);
   alert($("input").val());
  });

in following HTML


Form 1




Form 2




Form 3




it only alert "XXX" nothing else !!! any idea about this. My journey
till now is difficult in jquery :-( .Hope to see some answers tomorrow.


[jQuery] JQUERY listnav: includeAll Parameter translation

2009-09-16 Thread mansoft

It would be nice, if the "includeAll" parameter could be changed or
extended to work like the "noMatchText":
Instead of true or false it should be empty or the text for the link
i.e "All", "Alle", "tous", "todos" 


[jQuery] this.reset() doesn't work

2009-09-16 Thread pritisolanki

Hi,

I am trying to reset all the form element but it is not working can
someone suggest the reason.


http://www.w3.org/1999/xhtml";>


jQuery Starterkit










jQuery Starterkit
This page contains code to test the examples. Most of it is only
relevant for a example.

Some link


Hehehehe so think you can hide me :-p 



Form 1




Form 2




Form 3




Reset!





[jQuery] Re: jQuery PDF Viewer?

2009-09-16 Thread Geert Baven
 Bumpbox works in all modern browsers. based on mootools
Here's a list in which browsers it has been successfully tested:

   - *Firefox 3 - 3.5*
   - *Internet Explorer 6 | 7 | 8*
   - *Google Chrome*
   - *Apple Safari 3 | 4*
   - *Opera 9.04*

http://www.artviper.net/bumpbox.php


2009/9/16 benji++ 

>
> I'm looking for something that can display a PDF in a way similar to a
> typical jQuery image gallery (or a desktop PDF viewer, e.g. Acrobat or
> Preview).  I tried out Mike Alsup's jQuery Media Plugin
> (www.malsup.com/jquery/media/), thinking that the "iframe player"
> might do the trick.  But of course, I still get the default browser
> behavior for a PDF, which in most cases (like Firefox) is to not
> display it at all.  Works great in Safari, though, especially with the
> AdobePDFViewer.plugin.
>
> So does anyone know of something that could enable PDFs to be
> displayed on the page?
>



-- 

 strikingconcepts


www.strikingconcepts.nl
  webdesign
06 450 860 83


[jQuery] Re: [forms] [ajax] Form submits, success message displayed but no data seems to be passed to php file

2009-09-16 Thread HairyJim

hmmm Im getting nowhere with this :/

So following the code on the page you suggested and the notes made
about .ajaxSubmit I transpose it like thus but nothing happens, it
does not even call the referenced thanks.php.

jQuery(function(){

var options = {
type: "POST",
url: "thanks.php",
success: function() {
$('#contact_form').html("");
$('#message').html("Contact Form 
Submitted!")
  .append("We will be in touch soon.")
  .hide()
  .fadeIn(1500, function() {
  $('#message').append("");
  });
}
};


jQuery("#myform").validate({
submitHandler: function(myform) {
// inside event callbacks 'this' is the DOM 
element so we first
// wrap it in a jQuery object and then invoke 
ajaxSubmit
jQuery(myform).ajaxSubmit(options);
}
});
});

On Sep 16, 11:52 am, Jörn Zaefferer 
wrote:
> Here is an 
> example:http://jquery.bassistance.de/validate/demo/ajaxSubmit-intergration-de...
>
> Jörn
>
> On Wed, Sep 16, 2009 at 12:39 PM, HairyJim  wrote:
>
> > Sorry, I have no idea where to use the .ajaxSubmit() option in the
> > code. What do I need to change to pass the data over to the processing
> > file?
>
> > Thanks
> > James
>
> > On Sep 16, 10:49 am, Jörn Zaefferer 
> > wrote:
> >> You don't specify any data to submit in your ajax call. Use the data
> >> option, or better yet, the form's plugin ajaxSubmit method. It will
> >> handle the form serialization for you.
>
> >> Jörn
>
> >> On Wed, Sep 16, 2009 at 11:42 AM, HairyJim  wrote:
>
> >> > Hi all,
>
> >> > I have this Jquery code, below, which I was hpoing would pass the data
> >> > from the form over to form processing script  but the problem I have
> >> > is that the success is returned but the processing script does not
> >> > seem to get the form data passed to it.
>
> >> > I have tested the script is called by just firing a success email off.
> >> > What am I doing wrong, I'm lost in the forest and can't see the trees!
>
> >> > I am including jquery, jquery.validate and jquery.form
>
> >> > $(document).ready(function()
> >> > {
> >> >        $("#myform").validate({
> >> >                submitHandler: function() {
> >> >                        $.ajax({
> >> >                                type: "POST",
> >> >                                url: "thanks.php",
> >> >                                success: function() {
> >> >                                        $('#contact_form').html(" >> > id='message'>");
> >> >                                        $('#message').html("Contact 
> >> > Form Submitted!")
> >> >                                  .append("We will be in touch 
> >> > soon.")
> >> >                                  .hide()
> >> >                                  .fadeIn(1500, function() {
> >> >                                          $('#message').append(" >> > id='checkmark' src='/images/
> >> > check.png' />");
> >> >                                  });
> >> >                                }
> >> >                        });
> >> >                }
> >> >        });
> >> > });


[jQuery] Re: caching result of selector in object, reusing

2009-09-16 Thread pantagruel

Never mind, it should have been obvious, the object properties weren't
in my document.ready



On Sep 16, 10:31 am, pantagruel  wrote:
> Hi,
>
> I have some selectors - an example would be $("#LinkToPreviousHit")
> all of which work fine when used directly.
>
> If I use it to toggle the class, which also works, I might do -
> $("#LinkToPreviousHit").attr({"class": "activeNavButton"});
>
> since I am using my selectors in multiple places I figured I would
> remove the multiple class to the selector and move it into an object -
> here is what I have (names will probably be changed when working)
>
> var NavDisplay = {
> NextHitB: $("#LinkToNextHit"),
> LastHitB: $("#LinkToPreviousHit"),
> ToggleNext: function(switcher){
> if(typeOf(switcher)==='undefined' || typeOf(switcher) === null){
> switcher = Boolean(!navTrack.NextHitInactive);}
>
> if(switcher){
>
>                         navTrack.NextHitInactive = true;
>                         NavDisplay.NextHitB.attr({"class": 
> "inactiveNavButton"});
>
>                         }else{
>                         navTrack.NextHitInactive = false;
>                         NavDisplay.NextHitB.attr({"class": 
> "activeNavButton"});
>                         }},
>
> ShowPrevious: function(switcher){
> if(typeOf(switcher)==='undefined' || typeOf(switcher) === null){
>
> switcher = Boolean(!navTrack.HasPrevious);}
>
> if(switcher){
>
>                         if(!navTrack.HasPrevious){
>
>                 NavDisplay.LastHitB.attr({"class": "activeNavButton"});
>
>                 navTrack.HasPrevious=true;
>                         }
>
>                         }else{
>
>                         if(navTrack.HasPrevious){
>
>                         NavDisplay.LastHitB.attr({"class": 
> "inactiveNavButton"});
>                         navTrack.HasPrevious=false;
>                         }
>                         }
>
> }
> };
>
> I have also tried using it as window.NavDisplay with no result. There
> are no errors raised and the properties of the navTrack object are
> changed correctly. However the class is never switched between
> inactiveNavButton and activeNavButton or vice versa. As soon as I use
> the selectors directly - for example as in the following:
>
> var NavDisplay = {
> NextHitB: $("#LinkToNextHit"),
> LastHitB: $("#LinkToPreviousHit"),
> NextHitInactive: function(){
>                         navTrack.NextHitInactive = true;
>                         NavDisplay.NextHitB.attr({"class": 
> "inactiveNavButton"});
>                         },
> ToggleNext: function(switcher){
> if(typeOf(switcher)==='undefined' || typeOf(switcher) === null){
> switcher = Boolean(!navTrack.NextHitInactive);}
>
> if(switcher){
>
>                         navTrack.NextHitInactive = true;
>                         $("#LinkToNextHit").attr({"class": 
> "inactiveNavButton"});
>
>                         }else{
>                         navTrack.NextHitInactive = false;
>                         $("#LinkToNextHit").attr({"class": 
> "activeNavButton"});
>                         }},
>
> ShowPrevious: function(switcher){
> if(typeOf(switcher)==='undefined' || typeOf(switcher) === null){
>
> switcher = Boolean(!navTrack.HasPrevious);}
>
> if(switcher){
>
>                         if(!navTrack.HasPrevious){
>
>                         $("#LinkToPreviousHit").attr({"class": 
> "activeNavButton"});
>
>                 navTrack.HasPrevious=true;
>                         }
>
>                         }else{
>
>                         if(navTrack.HasPrevious){
>
>                         $("#LinkToPreviousHit").attr({"class": 
> "inactiveNavButton"});
>                         navTrack.HasPrevious=false;
>                         }
>                         }
>
> }
> };
>
> then it works fine.
>
> Is there any reason why my current caching of the selector is not
> working? And is there any way you can suggest whereby I can cache my
> selector that will work?


  1   2   >