[jQuery] Re: [autocomplete] tab issue with autcomplete plugin

2008-07-08 Thread Anton

I too can't keep focus on the autocomplete field after hitting the tab
key in Firefox (Safari works fine - it stays in the field). I'm
running the latest version (1.0.2) as well. Let me know if there's
some way I can help bugtracking this.

cheers,

/Anton

On 18 Juni, 22:15, Carl Von Stetten [EMAIL PROTECTED] wrote:
 Jörn,

 I have made extensive use of the autocomplete plugin for my intranet
 site.  I just downloaded the updated version from the trunk (changelog
 shows it as 1.0.1, the js file lists the build as 5329).  I still have
 the tab order problem.

 Carl

 Jörn Zaefferer wrote:
  Yes, that should be fixed in the latest revision:
 http://dev.jquery.com/view/trunk/plugins/autocomplete/

  Can you assert that it actually fixes the issue? I'll create a new
  release, then.

  On Fri, Jun 13, 2008 at 7:53 PM, Priest, James (NIH/NIEHS) [C]
  [EMAIL PROTECTED] wrote:

  Jörn, have you made any progress on the TAB issue with the Autocomplete 
  plugin?

  ie: If you in that field and tab away - you loose your tab order.  I know 
  it came up in the comments on the plugin page but I haven't heard any more 
  updates on it...

  Thanks,
  Jim


[jQuery] Finding whether a tag is present in between two specified tags or not

2008-07-08 Thread Arun Kumar

Suppose I have two tags Date and Time as below:

Date
Value2008-07-07/Value
/Date
TestTag
TestTag Text Node
/TestTag
Time
Value20:15:45/Value
/Time

How can I find whether TestTag is present in between the Date and
Time tags or not?

The TestTag may present any where in the document. But I want to
know whether it is present between Date and Time tags or not?

TestTag is not the only tag that exists between Date and Time tags.


[jQuery] array find (more of a JS question) and regex (regular expression)

2008-07-08 Thread jquertil

okay i hope no one flames me for posting something thats really about
javascript, but then again my toiling is ultimately geared towards a
jquery plugin, so maybe you will forgive me...

the code sample below uses a prototype function that searches an
array. There is a sampe array, and then I am trying to test it with
the alert().

it works fine when I just search for something like 30 or
blue (uncomment the other vars below to check for yourself), but it
returns FALSE if I use a regex. The prototype seems to be commonly
known because it's the only one I keep coming across when searching
fopr this...

Anybody got any ideas on how to make the regex work? I've searched all
evening...

Thanks!

Array.prototype.find = function(searchStr) {
  var returnArray = false;
  for (i=0; ithis.length; i++) {
if (typeof(searchStr) == 'function') {
  if (searchStr.test(this[i])) {
if (!returnArray) { returnArray = [] }
returnArray.push(i);
  }
} else {
  if (this[i]===searchStr) {
if (!returnArray) { returnArray = [] }
returnArray.push(i);
  }
}
  }
  return returnArray;
}



var tmp = [5,9,12,18,56,1,10,42,'blue',30, 7,97,53,'gcycle',
30,35,27,30,'35','Ball', 'bubble'];

var regexp1=tmp.find(/^Bal/);
//var regexp1=tmp.find(/^b/);
//var regexp1=tmp.find(30);


alert(regexp1);


[jQuery] Re: $.getScript() - how to load into JSON formatted object?

2008-07-08 Thread jquertil

thanks for the answer Mike. I probably wasn't very clear.

I'm trying to make the loading happen as part of
blah.something(variable).

something kinda like this:

var blah ={
   dynaLoad : function(variable){
  $.getScript('alert.js',variable) // the script would simply
contain the line alert(variable);
   },
   somethingElse : ''
}

blah.dynaLoad('cool beans'); // this would now produce a cool beans
alertbox.


[jQuery] Execute a function within a jquery method

2008-07-08 Thread Olaf Gleba


Hi.

Probably a lack of understanding jquery/javascript.

Is it possible to append (or something simular) a excecutable  
function call within a jquery event call?
I want to execute the function AC_FL_RunContent(params) of the on top  
of page loaded AC_RunActiveContent.js to embbed Flash files depending  
of a special click event.


Urg, what a sentence. To make this a little more clear:

Example:

$(elem).click(function() {
... do some stuff...

$(elem-to-process).append(AC_RunContent(params));
});

While this above will only print clear text, i tried to wrap the  
function call within append in a script tag. I also tried to use  
document.write. Both with the result, that the flash was loaded, but  
both fully replaced the whole page which of course is not intended.  
It should injected, where the 'element-to-process' points to.


What i am doing wrong? I hope the description is understandable  
(enough).



bye, thanks in advance
Olaf

--



[jQuery] jQuery Script not working on page in RIA

2008-07-08 Thread mickbw

Hi,

Please forgive if this shows up twice.  I thought it may have bounced
because I was using pre tags.


I have a jquery script that works if the page is called directly at
http://67.199.57.74/jobsearchlog/faq.cfm or the script is added
through firebug after going to  http://67.199.57.74/jobsearchlog and
clicking F.A.Q. from the top menu item.

I am working on a FAQ page for my site which will be going live soon.
My goal would be to display a answer (dt) to a FAQ only after they
click the question (dd).  I don't receive an error when clicking the
Question but the answer doesn't display.

BTW, I am using jQuery on a few other places in the RIA application
and don't have problems like this.

Any assistance you could provide would be greatly appreciated.

The script:
$(document).ready(function(){
   $('dt').each(
  function( intIndex ){

 // Bind the onclick event to simply alert the# // iteration index
value.
$( this ).bind (
click,
function(){
$(this).next().toggle()
 }
 );
});

   //end of document.ready
   })


A piece of the page code that is to be changed.


a name=registration/a
div class=faqsection id=faq_registration
dl class=deflist id=deflist_registration

   dt class=faq_dt id=faq_1Why should I use Job Search Log?
   dd class=faq_dd id=def_1!--- todo Answer Question ---/
dd
   /dt
   dt class=faq_dt id=faq_2Do I need to register to use Job
Search
Log
   dd class=faq_dd id=def_2No, but you will not be able to
send
letters unless you have a personal profile./dd
   /dt
   dt class=faq_dt id=faq_3Are you affiliated with the State
Unemployment Department?
   dd class=faq_dd id=def_3No, Job Search Log is an
independent
venture but we endeavor to provide free services to all users of the
state uemployment system and welcome the Unemployment Departments to
link to our site./dd
   /dt
/dl
/div


[jQuery] Re: Avoiding concurrency when updating a database through AJAX

2008-07-08 Thread Luis Abreu

  This is definitely more of a general AJAX topic than a JQuery question
  per se.  What are some strategies for avoiding concurrency errors when
  updating a database through AJAX?  That is, what are some ways to
  prevent a given user from modifying the same row in a database with
  simultaneous requests (say, that he updates one column with an AJAX
  call, then immediately submits a form that updates the same row).  How

I'd say this is the same problem you have whenever you don't have a
single user application. My favourite strategy is optimistic locking,
but there are other options out there:

http://en.wikipedia.org/wiki/Optimistic_concurrency_control

btw, I tend to use a timestamp or integer version number.

  have other people solved this problem?  Is the best option to make the
  AJAX call synchronous?
never make synchronous ajax calls. even though it might take more
time, you should always design your app so that it won't use ajax sync
calls (sync calls will block the browser and nobody wants that,
right?)


-- 
Regards,
Luis Abreu
email: labreu_at_gmail.com
PT Blog: http://weblogs.pontonetpt.com/luisabreu
EN Blog:http://msmvps.com/blogs/luisabreu/default.aspx
http://www.pontonetpt.com
MVP profile: http://mvp.support.microsoft.com/profile/luis.abreu


[jQuery] Re: Database Request

2008-07-08 Thread DigiCelebs

Help me please :(


[jQuery] Re: $(something).text() doesn't preserve whitespace in IE

2008-07-08 Thread alistairholt

The problem for me is that using text() in IE 6/7 doesn't preserve
whitespace...

On 8 Jul, 04:22, Dave Methvin [EMAIL PROTECTED] wrote:
  Results are athttp://pastie.org/228916

 The code for jQuery.text has changed a lot in two years, but those
 test results still look pretty familiar... :-)


[jQuery] Fade in background image.

2008-07-08 Thread lamy


Hi there!

I'd like to create an effect like the one on the jquery Ui website. Someone
hovers over an item and is changes its background color smoothly.

This is how far I've got: 

$(.actionmenu).mouseover(function(){
if($(this).css(background-image).length = 4)
{
var obj = $(this).clone(true);

obj.insertAfter(this).hide().css({background-image:url(IMAGE),background-repeat:repeat-y});
$(this).hide();
obj.fadeIn();
}
});

$(.actionmenu).mouseout(function(){
if($(this).css(background-image).length  4)
{
$(this).hide();
$(this).prev(div).fadeIn();
}
});

It works.
The problem is, that if the user hovers too quickly, the js code can't keep
up with cloning and fading in  that div so that the item vanishes. Check
yourself: http://inaustralia.de/fcms/admin.php

user/pass:operator


Any solutions?
-- 
View this message in context: 
http://www.nabble.com/Fade-in-background-image.-tp18336552s27240p18336552.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Superfish / Firefox 3 PC / Flash issue

2008-07-08 Thread Kevin Pepperman
Get Firefox and install the Firebug Plugin.

It will let you inspect the DOM and see whatever generated code there is in
realtime.

It will also let you see the CSS applied to each element do see if you may
have any Z indexing issues or strange div spans.



On Mon, Jul 7, 2008 at 11:50 PM, Joel Birch [EMAIL PROTECTED] wrote:


 This is interesting. I wonder if you can track down the differences in
 the generated source between the two methods of embedding? That would
 be great to know.

 Thanks for the info Chad!

 Joel Birch.




-- 
Simone de Beauvoir  - To catch a husband is an art; to hold him is a job.


[jQuery] changing value of a object sub variable

2008-07-08 Thread Kevin Pepperman
I have a simple plugin working that utilizes the jquery.flash plugin.

I am using my plugin to load a flash file that has around 20 flashvars. (i
only listed a few here).

Most of the time the default flashvars are fine..but sometimes I need to
modify only certain flashvariables... but not all of them.

My question is how do I change only one of the flashvars so I dont have to
add every single flashvar to every methodcall.?

my plugin code:

 jQuery.fn.test = function(options) {
   var settings = jQuery.extend({
  src: Viewer.swf,
  menu: false,
  wmode: 'Opaque',
  width: 270,
  height: 280,
  flashvars: {
   ImagePath: /myImagePath/,
   xmlPath : /mtyXmlPath/,
   intX: 0,
  intY: 0
  // ... Plus around 16 other vars.
 }
}, options);

$(this).flash(settings,{ version: 9 });

};
-

If I use:

  $('#mydiv').test({flashvars: { ImagePath : /myImagePath/  });

It overwrites all the default flashvars.

and of course this wont work either:

   $('#mydiv').test({flashvars.ImagePath : /myImagePath/  });

There must be some way to access just one of the flashvars.

Anyone know of a way to do this?

Thanks!


[jQuery] caching AJAX data?

2008-07-08 Thread [EMAIL PROTECTED]

Hi folks,

I have a page with a photo and comments on it.  I load the replies to
the comments for this photo via an AJAX request like so (I also use
LiveQuery):

JavaScript:
/* Show Replies button action. */
$(.show_replies).livequery('click', function()
{
   var photo_id_val = $(#photo_id).val();
   var comment_id_val = $(this).attr(id);

   $.post(/show_comments, { photo_id: photo_id_val, comment_id:
comment_id_val }, function(data)
   {
   /* Update the div that holds the replies. */
   $(#replies_for_+comment_id_val).html(data);
   $(#replies_for_+comment_id_val).slideToggle();
   });
});

HTML:
span id=c4 class=show_replies title=Show the RepliesShow
Replies/span
div id=replies_for_c4/div

So everytime I click on Show Replies span, it would load up the
replies via AJAX and slide them in and out.  This works fine.

My question is the following:
Is it possible to load the replies ONCE and just slideToggle them,
instead of loading them via AJAX every time the Show Replies is
clicked?

Any ideas or help would be greatly appreciated.

Thanks,
Konstantin


[jQuery] Re: overflow:visible; during animate?

2008-07-08 Thread Manuel

I'm successfully using this way on a website i'm currently developing:

$j( '#tsContainer' ).animate
(
{
height: 410px
},
textSlider.animationDelayMs,
easeboth
).css( 'overflow', 'visible' );

Let me know if it works for you as well: fyi i'm using the v1.2.6.

//Manuel


[jQuery] Re: How to catch function call

2008-07-08 Thread Luiz Abrahao

Hi Michael,

I tried, but I've got no response. I double checked the spelling (the
iframe's id and the javascript function's name), and the function is
global.

What I did:

- I'm using jquery-1.2.6.min.js
- inside my head tag I have:

script type=text/javascript

;(function( $ ) {
   $.fn.frameHook = function( name, hook ) {
  this.each( function() {
 var win = this.contentWindow;
 var target = win[name];
 win[name] = function() {
hook.apply( win, arguments );
return target.apply( win, arguments );
 };
  });
   };
})( jQuery );

$('#course').frameHook( 'trivNextPage', function() {
   alert( 'about to call trivNextPage' );
});

/script


but nothing happens when I trigger the trivNextPage function, if I
assign a breakpoint to the line $
('#course').frameHook( 'trivNextPage', function() the the firebug
(1.2.0b4) only stops at this point when the page is refreshed. but the
function never is executed.

I don't know if I'm doing something stupid.

Many Thanks
Luiz


On Jul 4, 9:18 pm, Michael Geary [EMAIL PROTECTED] wrote:
 That's good - if it were a different domain we'd be in trouble!

 I forgot to ask, but the JavaScript function you want to intercept is a
 global function in the iframe, correct? Then you could use something like
 this plugin (untested):

     ;(function( $ ) {
         $.fn.frameHook = function( name, hook ) {
             this.each( function() {
                 var win = this.contentWindow;
                 var target = win[name];
                 win[name] = function() {
                     hook.apply( win, arguments );
                     return target.apply( win, arguments );
                 };
             });
         };
     })( jQuery );

 Given an iframe with id=myframe and a global function inside the iframe
 named 'foobar', you would do:

     $('#myframe').frameHook( 'foobar', function() {
         alert( 'about to call foobar' );
     });

 To help illustrate, here's a bare metal version without the jQuery
 boilerplate:

     function frameHook( iframe, name, hook ) {
         var win = iframe.contentWindow;
         var target = win[name];
         win[name] = function() {
             hook.apply( win, arguments );
             return target.apply( win, arguments );
         };
     }

     var iframe = $('#myframe')[0];
     frameHook( iframe, 'foobar', function() {
         alert( 'about to call foobar' );
     });

 -Mike

  From: Luiz Abrahao
  Michael, thanks for your time,

  It's loaded form the same domain.

   On Jul 3, 3:41 pm, Michael Geary [EMAIL PROTECTED] wrote:
   Is the iframe loaded from the same domain as the containing
   page, or a different domain?

From: Luiz Abrahao
I have one page with one iframe, and there are few javascript
function on the page inside the iframe. These functions are
triggered by some flash presentations.

Basically the parent page has to 'know' when the user has
requested the next page (inside the iframe) and update its content
with relevant data related with this new page inside the iframe.

I can't change the javascript functions from the pages inside the
iframe.




[jQuery] Re: Custom sort on table cell attribute value in tablesorter plugin rather than innerHTML value: help please!

2008-07-08 Thread Dan G. Switzer, II

I am using the tablesorter plugin, which I really like. However, in
several of my table cells I have oddly formatted time values that look
like the following:

1d 12h 34m 25s

Which maps to:

1 day, 12 hours, 34 mins and 25 seconds

I cannot change how these values are displayed - they have to be in
that format. However, in my code I also create an attribute to the
table cell called sorttable_customval in which I insert the raw number
format as a float:

td sorttable_customkey=dlt  sorttable_customval=65.093 1m 5s/
td

 I have tried to write my own add-on to the tablesorter source code to
get this attribute value in the confines of the tablesorter
textExtraction method:

Javascript at the top of my webpage with the table
==
(#monitor).tablesorter({
textExtraction: 'customattribute',
debug: true,
widgets:['zebra']
})

The modified part of tablesorter.js (rows 233 and 234)
=
221 function getElementText(config,node) {
222
223 if(!node) return ;
224
225 var t = ;
226
227 if(config.textExtraction == simple) {
228 if(node.childNodes[0] 
node.childNodes[0].hasChildNodes()) {
229 t = node.childNodes[0].innerHTML;
230 } else {
231 t = node.innerHTML;
232 }
233 } else if(config.textExtraction ==
customattribute) {
234 t = $(node).attr('sorttable_customval');
235 } else {
236 if(typeof(config.textExtraction) ==
function) {
237 t = config.textExtraction(node);
238 } else {
239 t = $(node).text();
240 }
241 }
242 return t;
243 }

I thought this would work, but I get the following error in Firebug:

s is undefinedjquery.tablesorter.js (line 703)
return $.trim(s.toLowerCase());

The problem with using the textExtraction (at least from my understanding)
is that it works for all columns. So, I suspect the error is coming from the
fact that the 'sorttable_customval' only existing on some columns and is
returning undefined for the other columns (thus breaking $.trim().)

You were close when you wrote a custom parser--which is the way I've solved
this problem in the past. The problem is you used the is option instead of
the function option.

Try this:

$.tablesorter.addParser({
id: 'dlt',
is: function (s){ return false },
format: function(value, table, cell){
return cell.parentNode.getAttribute('sorttable_customval');
},
type: 'numeric'
});

In the format option, the value is what's coming back from the
textExtraction method. In this case, we want to ignore this value all
together, and instead use the cell to extract the attribute.

-Dan



[jQuery] Re: jMaps and other G* functions

2008-07-08 Thread noon

I'm aware that it binds opening to the click function but I want to
open without click.

On Jul 7, 6:19 pm, Colin Guthrie [EMAIL PROTECTED] wrote:
 noon wrote:
  All jMaps functions never seen to return a handler that I can use, but
  only fire the callback if provided.  I used jMaps to add a marker and
  centered the map. On this newly created marker, how can I get to the
  other G* methods such as openInfoWindow?

 When adding a marker you can pass the option pointHTML which will
 automatically assign a openInfoWindow to the click event of your marker.

 I've said to Tane (the author) I will help him come up with some more
 features and better docs on this plugin in the coming weeks/months :)

 Col


[jQuery] Cluetip Params Not Working?

2008-07-08 Thread James Simm

Hi there,
I'm using the cluetip plugin to provide tooltips on my current
project.

I've declared my tooltips like this:
$('.ic a').cluetip({
positionBy: 'mouse',
showTitle: false,
activation: 'click',
mouseOutClose: true,
ajaxSettings: {dataType: 'html'}
});

The tooltips are appearing correctly, and activating onclick, but the
title is visible, and the tooltip doesn't close on mouse out.

There are other cluetips on the page, using different settings:
$('a.inplayLink').cluetip({
splitTitle:'|',
positionBy: 'mouse'
});

I wouldn't have thought these would have any effect on each other, but
I don't seem to be able to get the click activated ones to do what I
want

Does anyone have any idea what I'm doing wrong?

Regards,
James


[jQuery] Re: .removeClass() performance is very low on IE7

2008-07-08 Thread Joel Birch

Hi Evert,

'.someclass' is a slow selector as it has to check every single
element on the page to see if it matches class=someclass. Limiting
the search closer to the desired elements will speed up the selection
hugely. For example, choose the closest common ancestor that all
potential target elements share and that has an id (say,
#somecontainer) and also specify the type of element that the target
will be if possible (in this case, a div). Your improved code would
look like this:

// find all divs with class 'someclass' that are somewhere within
// (descendant of) an element with id 'somecontainer':

$('#somecontainer div.someclass').removeClass['someclass');

Please let us know if your code still seems slow in IE7 after this.

Joel Birch.


[jQuery] Re: Cluetip Params Not Working?

2008-07-08 Thread Karl Swedberg


Hi James,

Can you tell me which version (and date) of the plugin you're using?  
There was a problem with this sort of thing with one revision because  
I tried to be clever but ended up putting some variables in the wrong  
spot.


The showTitle issue should be resolved with latest version. Not sure  
about mouseOutClose, though. I'll have to double-check that one to see  
if the script incorrectly excludes that option when the activation is  
set to 'click'


--Karl

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




On Jul 8, 2008, at 7:40 AM, James Simm wrote:



Hi there,
I'm using the cluetip plugin to provide tooltips on my current
project.

I've declared my tooltips like this:
$('.ic a').cluetip({
   positionBy: 'mouse',
   showTitle: false,
   activation: 'click',
   mouseOutClose: true,
   ajaxSettings: {dataType: 'html'}
});

The tooltips are appearing correctly, and activating onclick, but the
title is visible, and the tooltip doesn't close on mouse out.

There are other cluetips on the page, using different settings:
$('a.inplayLink').cluetip({
   splitTitle:'|',
   positionBy: 'mouse'
});

I wouldn't have thought these would have any effect on each other, but
I don't seem to be able to get the click activated ones to do what I
want

Does anyone have any idea what I'm doing wrong?

Regards,
James




[jQuery] Re: Custom sort on table cell attribute value in tablesorter plugin rather than innerHTML value: help please!

2008-07-08 Thread tlphipps

I agree with Dan 100%.

I'd also offer an alternative solution.  Before Tablesorter 2.0, I had
a similar situation and resolved it by adding a hidden span tag
before the data that contained the 'raw' timestamp integer for sorting
purposes.  This worked really well with the old tablesorter (and still
works with 2.0).

Here's what I have:
tdspan style=display: hidden;12345/span1 day 2 hours ../
td

The table sorter parses the first bit of data it sees.

On Jul 8, 6:51 am, Dan G. Switzer, II [EMAIL PROTECTED]
wrote:
 I am using the tablesorter plugin, which I really like. However, in
 several of my table cells I have oddly formatted time values that look
 like the following:

 1d 12h 34m 25s

 Which maps to:

 1 day, 12 hours, 34 mins and 25 seconds

 I cannot change how these values are displayed - they have to be in
 that format. However, in my code I also create an attribute to the
 table cell called sorttable_customval in which I insert the raw number
 format as a float:

 td sorttable_customkey=dlt  sorttable_customval=65.093 1m 5s/
 td

  I have tried to write my own add-on to the tablesorter source code to
 get this attribute value in the confines of the tablesorter
 textExtraction method:

 Javascript at the top of my webpage with the table
 ==
 (#monitor).tablesorter({
     textExtraction: 'customattribute',
     debug: true,
     widgets:['zebra']
 })

 The modified part of tablesorter.js (rows 233 and 234)
 =
 221             function getElementText(config,node) {
 222
 223                 if(!node) return ;
 224
 225                 var t = ;
 226
 227                 if(config.textExtraction == simple) {
 228                     if(node.childNodes[0] 
 node.childNodes[0].hasChildNodes()) {
 229                         t = node.childNodes[0].innerHTML;
 230                     } else {
 231                         t = node.innerHTML;
 232                     }
 233                 } else if(config.textExtraction ==
 customattribute) {
 234                         t = $(node).attr('sorttable_customval');
 235                 } else {
 236                     if(typeof(config.textExtraction) ==
 function) {
 237                         t = config.textExtraction(node);
 238                     } else {
 239                         t = $(node).text();
 240                     }
 241                 }
 242                 return t;
 243             }

 I thought this would work, but I get the following error in Firebug:

 s is undefined    jquery.tablesorter.js (line 703)
     return $.trim(s.toLowerCase());

 The problem with using the textExtraction (at least from my understanding)
 is that it works for all columns. So, I suspect the error is coming from the
 fact that the 'sorttable_customval' only existing on some columns and is
 returning undefined for the other columns (thus breaking $.trim().)

 You were close when you wrote a custom parser--which is the way I've solved
 this problem in the past. The problem is you used the is option instead of
 the function option.

 Try this:

 $.tablesorter.addParser({
     id: 'dlt',
     is: function (s){ return false },
     format: function(value, table, cell){
         return cell.parentNode.getAttribute('sorttable_customval');
     },
     type: 'numeric'

 });

 In the format option, the value is what's coming back from the
 textExtraction method. In this case, we want to ignore this value all
 together, and instead use the cell to extract the attribute.

 -Dan


[jQuery] Re: $(...).get() order reversed between 1.2.4 and 1.2.5

2008-07-08 Thread Ariel Flesler

Just in case you want some background knowledge...

jQuery.makeArray uses a reversed loop, to improve perfomance. That's
why the indexes are set like that.

Cheers

--
Ariel Flesler
http://flesler.blogspot.com/

On 7 jul, 20:43, Michael Geary [EMAIL PROTECTED] wrote:
 The array returned by .get() does have its elements in the correct order.
 The bug is actually in your code:

          for(ai in arr) { txt.push(arr[ai].innerHTML); }

 You can't use a for...in loop on an array and expect to get consistent
 results. The order of enumeration is implementation dependent. It may be in
 numerical order, or it may be in the order the elements were added to the
 array, or anything else. You may note that you get different results in IE7
 and Firefox 3.

 A for...in loop also enumerates non-array-element properties of the array.
 For example, if any JavaScript code or library adds methods to
 Array.prototype (and many libraries do this), those methods will also be
 enumerated in your for...in loop.

 A numeric for loop would work correctly:

     for( i = 0, n = arr.length;  i  n;  ++i )
         txt.push(arr[i].innerHTML);

 The reason .each works correctly is that it does a numeric for loop like
 that.

 What changed in 1.2.6?

 The code you found in makeArray does assign the elements into the correct
 array indices but it does them backwards chronologically. IOW, makeArray is
 assigning elements in this order:

     ret[2] = array[2];
     ret[1] = array[1];
     ret[0] = array[0];

 That's perfectly valid code, of course, but a for...in loop on the ret
 array will give inconsistent results. A correct numeric for loop will not be
 bothered by that.

 In 1.2.3 the loop in makeArray ran in forward order:

     ret[0] = array[0];
     ret[1] = array[1];
     ret[2] = array[2];

 All that said, I wonder if it wise for makeArray to be running this loop in
 reverse, just because of problems like this. Would be that much less
 efficient to run the loop in forward order?

 There's some further discussion in the ticket for this code change:

 http://dev.jquery.com/ticket/2619

 -Mike



  From: joelarson

  I have just noticed that the order of elements returned by
  .get() seem to have been reversed in 1.2.5 and 1.2.6.  
  Interestingly, each seems to run in the expected order (from
  first element to last as encountered in the document).  To
  demonstrate:

  --
  script src=http://jqueryjs.googlecode.com/files/jquery-1.2.5.js;/
  script
  span1/spanspan2/spanspan3/span
  script language=JavaScript!--//
      $(function() {
          var arr=$(span).get();
          var txt=[];
          for(ai in arr) { txt.push(arr[ai].innerHTML); }
          alert(via get(): +txt.join(,));
          $(span).each(function(i,o) { alert(via each #+i
  +.html=+o.innerHTML); });
      });
  //--/script
  --

  Your first alert will show via get(): 3,2,1.  Your next 3
  alerts will show 1,2,3 in order as the innerhtml.

  This seems to come from around line 1133 of the
  jquery-1.2.5.js (around the same line in 1.2.6), where the
  way the array is filled in makeArray is:

  --
  while( i )
    ret[--i] = array[i];
  --
  (which obviously builds a backwards return array)

  whereas in jquery-1.2.4.js line 1125 is code:

  --
  for ( var i = 0, length = array.length; i  length; i++ )
    ret.push( array[ i ] );
  ---

  It seems to me that the get() must return the elements in the
  document specified order.  Even though this is not spelled
  out in the specification it seems to be the only rational behavior.

  If my assumption is correct then, the easiest way to fix is to insert:

  
  ret.reverse();
  

  at line 1141 of 1.2.6.js (or equivalent in future 1.2.7).

  I have not found any posts on this or notes anywhere, but it
  is possible I do not know every relavent area to check.  So
  don't beat me up if this is known or desired behavior-- just
  tell me where I should have looked.  Thanks!- Ocultar texto de la cita -

 - Mostrar texto de la cita -


[jQuery] Re: $(...).get() order reversed between 1.2.4 and 1.2.5

2008-07-08 Thread Ariel Flesler

Bah... you already said so... I should had read it all before
posting :P

--
Ariel Flesler
http://flesler.blogspot.com/

On 7 jul, 20:43, Michael Geary [EMAIL PROTECTED] wrote:
 The array returned by .get() does have its elements in the correct order.
 The bug is actually in your code:

          for(ai in arr) { txt.push(arr[ai].innerHTML); }

 You can't use a for...in loop on an array and expect to get consistent
 results. The order of enumeration is implementation dependent. It may be in
 numerical order, or it may be in the order the elements were added to the
 array, or anything else. You may note that you get different results in IE7
 and Firefox 3.

 A for...in loop also enumerates non-array-element properties of the array.
 For example, if any JavaScript code or library adds methods to
 Array.prototype (and many libraries do this), those methods will also be
 enumerated in your for...in loop.

 A numeric for loop would work correctly:

     for( i = 0, n = arr.length;  i  n;  ++i )
         txt.push(arr[i].innerHTML);

 The reason .each works correctly is that it does a numeric for loop like
 that.

 What changed in 1.2.6?

 The code you found in makeArray does assign the elements into the correct
 array indices but it does them backwards chronologically. IOW, makeArray is
 assigning elements in this order:

     ret[2] = array[2];
     ret[1] = array[1];
     ret[0] = array[0];

 That's perfectly valid code, of course, but a for...in loop on the ret
 array will give inconsistent results. A correct numeric for loop will not be
 bothered by that.

 In 1.2.3 the loop in makeArray ran in forward order:

     ret[0] = array[0];
     ret[1] = array[1];
     ret[2] = array[2];

 All that said, I wonder if it wise for makeArray to be running this loop in
 reverse, just because of problems like this. Would be that much less
 efficient to run the loop in forward order?

 There's some further discussion in the ticket for this code change:

 http://dev.jquery.com/ticket/2619

 -Mike



  From: joelarson

  I have just noticed that the order of elements returned by
  .get() seem to have been reversed in 1.2.5 and 1.2.6.  
  Interestingly, each seems to run in the expected order (from
  first element to last as encountered in the document).  To
  demonstrate:

  --
  script src=http://jqueryjs.googlecode.com/files/jquery-1.2.5.js;/
  script
  span1/spanspan2/spanspan3/span
  script language=JavaScript!--//
      $(function() {
          var arr=$(span).get();
          var txt=[];
          for(ai in arr) { txt.push(arr[ai].innerHTML); }
          alert(via get(): +txt.join(,));
          $(span).each(function(i,o) { alert(via each #+i
  +.html=+o.innerHTML); });
      });
  //--/script
  --

  Your first alert will show via get(): 3,2,1.  Your next 3
  alerts will show 1,2,3 in order as the innerhtml.

  This seems to come from around line 1133 of the
  jquery-1.2.5.js (around the same line in 1.2.6), where the
  way the array is filled in makeArray is:

  --
  while( i )
    ret[--i] = array[i];
  --
  (which obviously builds a backwards return array)

  whereas in jquery-1.2.4.js line 1125 is code:

  --
  for ( var i = 0, length = array.length; i  length; i++ )
    ret.push( array[ i ] );
  ---

  It seems to me that the get() must return the elements in the
  document specified order.  Even though this is not spelled
  out in the specification it seems to be the only rational behavior.

  If my assumption is correct then, the easiest way to fix is to insert:

  
  ret.reverse();
  

  at line 1141 of 1.2.6.js (or equivalent in future 1.2.7).

  I have not found any posts on this or notes anywhere, but it
  is possible I do not know every relavent area to check.  So
  don't beat me up if this is known or desired behavior-- just
  tell me where I should have looked.  Thanks!- Ocultar texto de la cita -

 - Mostrar texto de la cita -


[jQuery] Re: slideDown hidden portion/bump

2008-07-08 Thread noon

Anyone have any ideas on this one?  It's really stumping me.

On Jul 7, 9:15 am, noon [EMAIL PROTECTED] wrote:
 I don't know why it does this.  I am experiencing hidden content (the
 username label) until the animation is complete and the bump
 occurs.  See it for yourself

 http://nunyez.googlepages.com/slidedowntest

 Help appreciated


[jQuery] HTML Parsing issue

2008-07-08 Thread shruthi

Hi,

I noticed JQuery does some clean up while appending html to an
element. This is a problem for me,
because I'm trying to use a text area which gets loaded with a soap
request.

My soap request looks like this.

?xml version=1.0 encoding=UTF-8?soapenv:Envelope
xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/;
xmlns:xsd=http://www.w3.org/2001/XMLSchema; xmlns:xsi=http://
www.w3.org/2001/XMLSchema-instancesoapenv:Bodyns1:echoInteger
soapenv:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/;
xmlns:ns1=http://ws.apache.org/axis2;ns1:arg0 href=#id0//
ns1:echoIntegermultiRef id=id0 soapenc:root=0
soapenv:encodingStyle=http://schemas.xmlsoap.org/soap/encoding/;
xsi:type=soapenc:int xmlns:soapenc=http://schemas.xmlsoap.org/soap/
encoding/1/multiRef/soapenv:Body/soapenv:Envelope


JQuery is closing the tag ns1:agro as /ns1. This makes my soap
request invalid.

Is there a way to turn off this feature? Even a workaround would be
great!


[jQuery] Display (or not display) content based on url hash

2008-07-08 Thread mitchel

Hello.

Admittedly, I know very little about jQuery or javascript in general
but it seems like it should be able to do what I need it to do fairly
easily.

I am trying to create a div on a page which would display different
content based on the hash in the url. Is there a way to create several
hidden divs on a page with the content I want and have a class that
makes one visible based on the current hash in the URL? Any ideas on
how would I do this?

Thanks.


[jQuery] Re: $(something).text() doesn't preserve whitespace in IE

2008-07-08 Thread Dave Methvin

 The problem for me is that using text() in IE 6/7 doesn't preserve
 whitespace...

As a workaround, you can use an expression like this:

var pre = $(pre).get(0);

alert(pre.innerText || pre.textContent);

All the browsers seem to support one property or the other--or both.
Their text output isn't exactly the same in all cases, but at least
there's some sort of whitespace.

The additional case that jQuery's .text() has to handle is XML, where
neither of these properties are available. I guess that's why it
wasn't used.

I opened a ticket:
http://dev.jquery.com/ticket/3144


[jQuery] Re: Display (or not display) content based on url hash

2008-07-08 Thread noon

alert(document.location.toString().split('#')[1]) will get you the
hash. From there an if statement or a switch/case would serve you.

On Jul 8, 8:54 am, mitchel [EMAIL PROTECTED] wrote:
 Hello.

 Admittedly, I know very little about jQuery or javascript in general
 but it seems like it should be able to do what I need it to do fairly
 easily.

 I am trying to create a div on a page which would display different
 content based on the hash in the url. Is there a way to create several
 hidden divs on a page with the content I want and have a class that
 makes one visible based on the current hash in the URL? Any ideas on
 how would I do this?

 Thanks.


[jQuery] [validate] completely resetForm

2008-07-08 Thread caseyw

I have a hidden form, when someone clicks on another element it shows.

If you just hit submit, it validates false, and shows the proper
errors. All is well there.

I have a close button in the form, it should close the form, and
completely reset it.

What's happening is, it resets the form data, removes the error
messages but if you
reopen the form, the validation is aggressive. Right as you tab onto
an element it'll
prompt you with error messages. Field required and whatnot. I need
it to act as it
did before the initial failed submit.

I'm using a form.resetForm, as well as a normal JS reset() on the
form.

Thanks!


[jQuery] Re: temporarily hide options from a select box

2008-07-08 Thread Toby J

On Jul 7, 7:30 pm, Karl Rudd [EMAIL PROTECTED] wrote:
 It's a known problem with IE. Keeping a cloned copy of the select or
 keeping a list of the removed options (with where they were
 originally) is about the only way to do it.

Thanks for your help Karl, I was afraid of that. I'll modify it to
keep a cloned list.


[jQuery] [Announce] jQuery Session

2008-07-08 Thread Jay Salvat

Hi jQueriers  !

Please check a quick plugin which try to simulate session variables in
javascript (without ajax or cookies).

Source code.
http://code.google.com/p/jquery-session/

Demo:
http://jaysalvat.com/session/

Usage:
script type=text/javascript
$(function() {
$.sessionStart();
$.session(var1, value1);
$.session(var2, value2);
$.session(var3, value3);
$.sessionStop();
});
/script

script type=text/javascript
$(function() {
$.sessionStart();
alert( $.session(var1) );
alert( $.session(var2) );
alert( $.session(var3) );
$.sessionStop();
});
/script

This is a quick piece of code but I think it could become useful with
some improvements.
Feedbacks are welcomed.

Known issues:
The real window.name is lost.
I wanted to load and save data on body load/unload and rebuilt the
original window.name but it doesn't work in my tests.

Important :
This plugin was inspired by the window.name storage technic uses in
qUIpt by Mario Heiderich.




[jQuery] jScrollPanel not always initializing in Safari

2008-07-08 Thread hubbs

I am using jScrollPanel, and I have noticed that it does not always
get initialized when the page first loads in Safari.  If I refresh the
page, it correctly loads up jScrollPanel.

Any ideas why this might be happening?

http://www.puc.edu/

Thanks!


[jQuery] Re: Fade in background image.

2008-07-08 Thread Liam Byrne


Maybe try using hoverIntent ?

Liam

lamy wrote:

Hi there!

I'd like to create an effect like the one on the jquery Ui website. Someone
hovers over an item and is changes its background color smoothly.

This is how far I've got: 


$(.actionmenu).mouseover(function(){
if($(this).css(background-image).length = 4)
{
var obj = $(this).clone(true);

obj.insertAfter(this).hide().css({background-image:url(IMAGE),background-repeat:repeat-y});
$(this).hide();
obj.fadeIn();
}
});

$(.actionmenu).mouseout(function(){
if($(this).css(background-image).length  4)
{
$(this).hide();
$(this).prev(div).fadeIn();
}
});

It works.
The problem is, that if the user hovers too quickly, the js code can't keep
up with cloning and fading in  that div so that the item vanishes. Check
yourself: http://inaustralia.de/fcms/admin.php?site=entry

user/pass:operator


Any solutions?
  




[jQuery] Re: Fade in background image.

2008-07-08 Thread noon

I see your problem now.  What about using a z-index and have them
float on top of each other?  This way no element is kicked out of
position.  I don't know your CSS savvy but having a container for the
item with a position of relative, and then the children with absolute
positioning would have them absolutely float only inside their
container versus the entire page.

On Jul 8, 12:47 pm, Liam Byrne [EMAIL PROTECTED] wrote:
 Maybe try using hoverIntent ?

 Liam

 lamy wrote:
  Hi there!

  I'd like to create an effect like the one on the jquery Ui website. Someone
  hovers over an item and is changes its background color smoothly.

  This is how far I've got:

  $(.actionmenu).mouseover(function(){
     if($(this).css(background-image).length = 4)
     {
             var obj = $(this).clone(true);

  obj.insertAfter(this).hide().css({background-image:url(IMAGE),background-repeat:repeat-y});
             $(this).hide();
             obj.fadeIn();
     }
  });

  $(.actionmenu).mouseout(function(){
     if($(this).css(background-image).length  4)
     {
             $(this).hide();
             $(this).prev(div).fadeIn();
     }
  });

  It works.
  The problem is, that if the user hovers too quickly, the js code can't keep
  up with cloning and fading in  that div so that the item vanishes. Check
  yourself:http://inaustralia.de/fcms/admin.php?site=entry

  user/pass:operator

  Any solutions?


[jQuery] Re: jScrollPanel not always initializing in Safari

2008-07-08 Thread Sam Sherlock
i've had troubles too; I've tried $(window).ready and also tried calling it
twice.

with a bit of tweaking and tinkering I thought I found a solution - but then
lost it

2008/7/8 hubbs [EMAIL PROTECTED]:


 I am using jScrollPanel, and I have noticed that it does not always
 get initialized when the page first loads in Safari.  If I refresh the
 page, it correctly loads up jScrollPanel.

 Any ideas why this might be happening?

 http://www.puc.edu/

 Thanks!



[jQuery] Re: jScrollPanel not always initializing in Safari

2008-07-08 Thread Dan G. Switzer, II

$(document).ready() will not fire consistently in Safari (and I believe FF3)
unless you load all the external CSS stylesheets before your JS scripts.

Try moving all your link / and style / blocks above any script / tags
and see if that doesn't resolve the issue.

There's been talk about making it a requirement that in order for the jQuery
$.ready event to work properly, you must load all external CSS first.

-Dan

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Sam Sherlock
Sent: Tuesday, July 08, 2008 1:41 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: jScrollPanel not always initializing in Safari

i've had troubles too; I've tried $(window).ready and also tried calling it
twice.

with a bit of tweaking and tinkering I thought I found a solution - but
then lost it


2008/7/8 hubbs [EMAIL PROTECTED]:



   I am using jScrollPanel, and I have noticed that it does not always
   get initialized when the page first loads in Safari.  If I refresh
the
   page, it correctly loads up jScrollPanel.

   Any ideas why this might be happening?

   http://www.puc.edu/

   Thanks!






[jQuery] Re: Position cursor at end of textbox?

2008-07-08 Thread Brian J. Fink

This is the best I can come up with. I wanted to catch the onselect
event, but for some reason Safari won't respond. (Didn't want to keep
using a timeout. It's a hack, but it works.) I reduced the length of
the timeout to 0 milliseconds, and I cleaned up the call by passing
the this object as a parameter. I also changed the moveStart for IE to
a collapse instead.

$(function() {
 $(':text').focus(function() {
  if (this.setSelectionRange) /* DOM */
  {
   setTimeout(function(t) { /* hack for select delay */
t.setSelectionRange(t.value.length,t.value.length);
   },0,this);
  }
  else if (this.createTextRange) /* IE */
  {
   r=this.createTextRange();
   r.collapse(false);
   r.select();
  }
 });
});


[jQuery] Re: Position cursor at end of textbox?

2008-07-08 Thread Brian J. Fink

Please note: This discussion group is malfunctioning and you must open
quoted text in order to read the last line of the previous post. The
last tow lines should be

 });
});


If you do not copy the second }); my code will fail.



On Jul 8, 2:26 pm, Brian J. Fink [EMAIL PROTECTED] wrote:
 This is the best I can come up with. I wanted to catch the onselect
 event, but for some reason Safari won't respond. (Didn't want to keep
 using a timeout. It's a hack, but it works.) I reduced the length of
 the timeout to 0 milliseconds, and I cleaned up the call by passing
 the this object as a parameter. I also changed the moveStart for IE to
 a collapse instead.

 $(function() {
  $(':text').focus(function() {
   if (this.setSelectionRange) /* DOM */
   {
setTimeout(function(t) { /* hack for select delay */
 t.setSelectionRange(t.value.length,t.value.length);
},0,this);
   }
   else if (this.createTextRange) /* IE */
   {
r=this.createTextRange();
r.collapse(false);
r.select();
   }
  });

 });


[jQuery] Re: .removeClass() performance is very low on IE7

2008-07-08 Thread Brian J. Fink

Be sure to change that [ to a ( so it will work. :)

On Jul 8, 8:31 am, Joel Birch [EMAIL PROTECTED] wrote:
 Hi Evert,

 '.someclass' is a slow selector as it has to check every single
 element on the page to see if it matches class=someclass. Limiting
 the search closer to the desired elements will speed up the selection
 hugely. For example, choose the closest common ancestor that all
 potential target elements share and that has an id (say,
 #somecontainer) and also specify the type of element that the target
 will be if possible (in this case, a div). Your improved code would
 look like this:

 // find all divs with class 'someclass' that are somewhere within
 // (descendant of) an element with id 'somecontainer':

 $('#somecontainer div.someclass').removeClass['someclass');

 Please let us know if your code still seems slow in IE7 after this.

 Joel Birch.


[jQuery] is dimensions now part of jquery or not? (I hear different opinions)

2008-07-08 Thread jquertil

the other day was told latest jquery now includes dimensions plugin
but I was certain it does not... I still assume it does not, thus I
compile the dimensions plugin into my standard jquery deployments...

can anyone shed light on this? thanks.


[jQuery] Re: is dimensions now part of jquery or not? (I hear different opinions)

2008-07-08 Thread John Resig

Yes, Dimensions is completely a part of jQuery as of jQuery 1.2.6.

--John


On Tue, Jul 8, 2008 at 2:49 PM, jquertil [EMAIL PROTECTED] wrote:

 the other day was told latest jquery now includes dimensions plugin
 but I was certain it does not... I still assume it does not, thus I
 compile the dimensions plugin into my standard jquery deployments...

 can anyone shed light on this? thanks.



[jQuery] Re: Fade in background image.

2008-07-08 Thread lamy


Hm, good idea. I'm gonna try it tomorrow.



-- 
View this message in context: 
http://www.nabble.com/Fade-in-background-image.-tp18336552s27240p18345124.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Cycle Plugin Fade Issue

2008-07-08 Thread mnordyke

I have noticed on my website, as well as the JQuery Cycle Plugin's
Home Page, that when the fade effect is used, divs in the header
(including the text) are undergoing the fade effect not just the
slideshow.

Any thoughts?

An example is at http://malsup.com/jquery/cycle/fade-in-first.html
(Pay attention to the top navigation).  I've played around with it and
it's not just fading in the first image.  It's anytime the image is
fading.

Thanks in advance!


[jQuery] Re: jMaps and other G* functions

2008-07-08 Thread Colin Guthrie

noon wrote:
 I'm aware that it binds opening to the click function but I want to
 open without click.

I think you should modify the jmaps' addMarker function to pass the 
marker to the callback. It's probably meant to do that anyway :)

You can then just do something like:

function(marker) { GEvent.trigger(marker, click); }

as your callback.

Col



[jQuery] help needed with simplemodal

2008-07-08 Thread sree

I want to slide-in and slide-out the simplemodal. Anyone familiar with
jquery simple modal please reply. Very urgent
Thanks


[jQuery] jQuery Tabs

2008-07-08 Thread Wooty

RE: My earlier post

Never mind - problem(s) solved...

P


[jQuery] [validate] Adding rules and messages at once using the jquery validation plugin

2008-07-08 Thread Mike

I really love the validation plugin (http://docs.jquery.com/Plugins/
Validation/rules#.22add.22rules).  I am using the functionality to add
a rule for an input one one line.  See below:

$(#myinput).rules(add, {
 required: true,
 minlength: 2
});

I am wondering if there is something equivalent for messages as well.
Like

$(#myinput).messages(add, {
 required: This field is required,
 minlength: The field requires a minimum length
});

I tried that and it didnt work but I am not sure if there is something
similar possible.  If not is this something that would be useful to
others and could be added?  Maybe even a function that combines the
two like:

$(#myinput).rules(add, {
 required: {true, This field is required},
 minlength: {2, This field is need a min length of 2!}
});

What do you think?


[jQuery] Running a loop for array numbers

2008-07-08 Thread JohneeM

Hi guys how can i run this in a single statement without manually
putting in the numbers?

$('.equipment a.i-right1:eq(1)').hide();
$('.equipment a.i-right1:eq(2)').hide();
$('.equipment a.i-right1:eq(3)').hide();
$('.equipment a.i-right1:eq(4)').hide();
$('.equipment a.i-right1:eq(5)').hide();
$('.equipment a.i-right1:eq(6)').hide();
$('.equipment a.i-right1:eq(7)').hide();
$('.equipment a.i-right1:eq(8)').hide();


Note that im skipping the first array [0] due to wanting it to show.


Also this one :

$('.performance-parts #content-container
a.lightbox:eq(8)').lightBox();
$('.performance-parts #content-container
a.lightbox:eq(9)').lightBox();

They need to be in their own array as i want to run a seperate
lightbox for each image, is this possible?



Thanks.


[jQuery] QUER

2008-07-08 Thread sweety


Family home evening is a special time set aside each week that brings
family members together and strengthens their love for each other,
helps them draw ...


^^


http://www.freewebs.com/gypsum/



^


[jQuery] Re: Cycle Plugin Fade Issue

2008-07-08 Thread Mike Alsup

I have noticed on my website, as well as the JQuery Cycle Plugin's
 Home Page, that when the fade effect is used, divs in the header
 (including the text) are undergoing the fade effect not just the
 slideshow.

 Any thoughts?

 An example is athttp://malsup.com/jquery/cycle/fade-in-first.html
 (Pay attention to the top navigation).  I've played around with it and
 it's not just fading in the first image.  It's anytime the image is
 fading.

I'm not seeing this behavior.  What browser are you using?


[jQuery] Re: is dimensions now part of jquery or not? (I hear different opinions)

2008-07-08 Thread jquertil

excellent!

 Yes, Dimensions is completely a part of jQuery as of jQuery 1.2.6.


[jQuery] Re: Running a loop for array numbers

2008-07-08 Thread MorningZ

$('.equipment a.i-right1:eq(1)').hide();
$('.equipment a.i-right1:eq(2)').hide();
$('.equipment a.i-right1:eq(3)').hide();
$('.equipment a.i-right1:eq(4)').hide();
$('.equipment a.i-right1:eq(5)').hide();
$('.equipment a.i-right1:eq(6)').hide();
$('.equipment a.i-right1:eq(7)').hide();
$('.equipment a.i-right1:eq(8)').hide();


Could be:

$('.equipment a.i-right1:lt(9)').hide();


[jQuery] Re: Running a loop for array numbers

2008-07-08 Thread jquertil

not knowing your actual HTML I would try something like this:

$('.equipment a.i-right1:gt(0)').each(function(){
   $(this).hide();
});

loops over the colletion of your tabs or whatever it is except the one
that has index 0. read up jquery docs on each() and :gt() for details
.


[jQuery] Re: Running a loop for array numbers

2008-07-08 Thread Josh Nathanson


Try this for the first one:

$('.equipment a.i-right1').not(':eq(0)').hide();

For the second one, check out the slice() method.

-- Josh

- Original Message - 
From: JohneeM [EMAIL PROTECTED]

To: jQuery (English) jquery-en@googlegroups.com
Sent: Tuesday, July 08, 2008 10:00 AM
Subject: [jQuery] Running a loop for array numbers




Hi guys how can i run this in a single statement without manually
putting in the numbers?

$('.equipment a.i-right1:eq(1)').hide();
$('.equipment a.i-right1:eq(2)').hide();
$('.equipment a.i-right1:eq(3)').hide();
$('.equipment a.i-right1:eq(4)').hide();
$('.equipment a.i-right1:eq(5)').hide();
$('.equipment a.i-right1:eq(6)').hide();
$('.equipment a.i-right1:eq(7)').hide();
$('.equipment a.i-right1:eq(8)').hide();


Note that im skipping the first array [0] due to wanting it to show.


Also this one :

   $('.performance-parts #content-container
a.lightbox:eq(8)').lightBox();
   $('.performance-parts #content-container
a.lightbox:eq(9)').lightBox();

They need to be in their own array as i want to run a seperate
lightbox for each image, is this possible?



Thanks.


[jQuery] Re: Display (or not display) content based on url hash

2008-07-08 Thread noon

 I the if/else statement doesn't seem to be working.
You're if statement is using the equals sign as an assignment operator
(=) instead of comparison which is double equals (==).

 Also, it only
 reads the current hash on a manual refresh of the page. Here is the
 link if helps any:http://www.mitchmckenzie.com/index.php
That piece of javascript is only evaluated when the page loads.  If
you want you're changes to occur onclick you'll have to assign event
handlers to each clickable item -OR- an event handler generically to
every click and check its target.

Event handler (assuming you've added ID's to each link with the class
cross-link):
$('#cross-link1').click(function() {
  // do some javascript
});

Generic handler:
$('a').click(function() {
  // you arent sure what was clicked, so lets determine before doing
something
  var the_links_rel_property = $(this).attr('rel'); // $(this) refers
to what was clicked
  switch (the_links_rel_property) {
case 'img1':
  // do something
  break;
case 'img4':
  // do something
  break;
  }
});

Hope that helps

On Jul 8, 2:51 pm, mitchel [EMAIL PROTECTED] wrote:
 Thanks! I think that gets me started in the right direction. However,
 I am still having some issues. Here is what I have so far:

                         var current =
 (document.location.toString().split('#')[1])

                         if (current = 1) {document.write( h2Title
 1/h2br /pBody text./p ); }
                         else if (current = 2)
 {document.write( h2Title 2/h2pBody text./p ); }
                         else if (current = 3)
 {document.write( h2Title 3/h2pBody text./p ); }
                         else if (current = 4)
 {document.write( h2Title 4/h2pBody text./p ); }
                         else if (current = 5)
 {document.write( h2Title 5/h2pBody text./p ); }
                         else  {document.write( h2Title 1/h2br /

 pBody text./p ); }

 I the if/else statement doesn't seem to be working. Also, it only
 reads the current hash on a manual refresh of the page. Here is the
 link if helps any:http://www.mitchmckenzie.com/index.php

 Any further help would be greatly appreciated.

 On Jul 8, 8:00 am, noon [EMAIL PROTECTED] wrote:

  alert(document.location.toString().split('#')[1]) will get you the
  hash. From there an if statement or a switch/case would serve you.

  On Jul 8, 8:54 am, mitchel [EMAIL PROTECTED] wrote:

   Hello.

   Admittedly, I know very little about jQuery or javascript in general
   but it seems like it should be able to do what I need it to do fairly
   easily.

   I am trying to create a div on a page which would display different
   content based on the hash in the url. Is there a way to create several
   hidden divs on a page with the content I want and have a class that
   makes one visible based on the current hash in the URL? Any ideas on
   how would I do this?

   Thanks.


[jQuery] load event on opened window

2008-07-08 Thread Luc Heinrich


Hi,

I have a vague intuition of why this wouldn't work...

var win = window.open();
$(win).bind('load', function() { alert(LOADED); });
win.location = someURL;

...except that it does work, but only in Firefox (only tested with  
FF3). Safari and IE7 never show the alert.


So who's right ?

--
Luc Heinrich - [EMAIL PROTECTED]



[jQuery] 1.2.4 to 1.2.6 question

2008-07-08 Thread Shelane Enos

I just found out that this function that worked (doubled checked to confirm)
worked under 1.2.4 but isn't working under 1.2.6.  I'm not sure what.  Can
anyone see anything obvious?

bindDeleteLinks = function(who){
$(a.rembtn, '#' + who).unbind('click');
$(a.rembtn, '#' + who).click(function(){
console.log('bound and clicked ' + who);
$(('#' + this.id + 'row')).css({display:'none'});
$.get('includes/tools/runtime.lasso?task=meetingswho=' + who +
'method=removepageID=' + pageID + 'rel=' + this.id);
return false;
});
}


Under 1.2.6, the console message doesn't even show.




[jQuery] Re: jScrollPanel not always initializing in Safari

2008-07-08 Thread hubbs

Thanks Dan, I really appreciate that tip.  It looks like it did the
trick, and is something I would have never thought of!

Nic

On Jul 8, 10:53 am, Dan G. Switzer, II [EMAIL PROTECTED]
wrote:
 $(document).ready() will not fire consistently in Safari (and I believe FF3)
 unless you load all the external CSS stylesheets before your JS scripts.

 Try moving all your link / and style / blocks above any script / tags
 and see if that doesn't resolve the issue.

 There's been talk about making it a requirement that in order for the jQuery
 $.ready event to work properly, you must load all external CSS first.

 -Dan

 -Original Message-
 From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of Sam Sherlock
 Sent: Tuesday, July 08, 2008 1:41 PM
 To: jquery-en@googlegroups.com
 Subject: [jQuery] Re: jScrollPanel not always initializing in Safari

 i've had troubles too; I've tried $(window).ready and also tried calling it
 twice.

 with a bit of tweaking and tinkering I thought I found a solution - but
 then lost it

 2008/7/8 hubbs [EMAIL PROTECTED]:

     I am using jScrollPanel, and I have noticed that it does not always
     get initialized when the page first loads in Safari.  If I refresh
 the
     page, it correctly loads up jScrollPanel.

     Any ideas why this might be happening?

     http://www.puc.edu/

     Thanks!


[jQuery] Chili 2.2 supports local line numbers

2008-07-08 Thread aercolino

I've just released version 2.2 of Chili, the jQuery Code Highlighter.
(http://code.google.com/p/jquery-chili-js/)

It now supports local line numbers too, which means that you can turn
on line numbers on a PRE by PRE basis.

Apart from the necessary start from an offset other than 1, I've
implemented a feature that I call automatic segmentation.

If you add a class like ln-123-some-name to a bunch of PRE elements,
Chili will add sequential line numbers to them, meaning that the first
PRE will start from 123 and any other from 1 + the last line of the
previous PRE.

Automatic segmentation is really a handy feature, because you only
need to care about splitting your programs into the snippets that you
want to comment, and Chili will add coherent line numbers.


[jQuery] Re: Similar Plugins

2008-07-08 Thread Jörn Zaefferer

Thanks for sharing the idea.

I've mentioned it to Mike, who maintains the plugin repository, he
agreed that its a good idea. Expect to see something soon!

Jörn

On Mon, Jul 7, 2008 at 8:51 AM, Mahbub [EMAIL PROTECTED] wrote:

 I think JQUERY site should have a reporting system where users can
 post similar plugins. Like for accordion there are more than one
 plugin but users dont know that there might be a better one than the
 one s/he is visiting. So in the plugin page there should be a block or
 section where it should say similar plugins. That would be really
 great if implemented.

 Thanks.



[jQuery] UI Tabs and Mootools.js conflict, Advice Needed

2008-07-08 Thread Mike

Hello Everyone,

Thank you for taking the time to read this message. I am attempting to
use mootools with UI Tabs and I am having a conflict. Basically, only
the last one to load (closest to the /head tag) is working. I have
tried to use the tutorial here 
http://docs.jquery.com/Using_jQuery_with_Other_Libraries
but I am afraid I am all thumbs when it comes to interpreting
javascript. Here is my current script (I have removed all my attempts
to fix using the aforementioned tutorial).



link rel=stylesheet href=ui.tabs.css type=text/css
media=print, projection, screen
script src=jquery-1.2.3.pack.js type=text/javascript/script
script src=ui.tabs.pack.js type=text/javascript/script
script type=text/javascript
$(function() {
$('#container-1  ul').tabs({ fx: { opacity:
'toggle' } });
$('#container-2  ul').tabs({ fx: { opacity:
'toggle' } });
$('#container-3  ul').tabs({ fx: { opacity:
'toggle' } });

  });
/script
link href=imageMenu2.css rel=stylesheet type=text/css
script type=text/javascript src=mootools.js/script
script type=text/javascript src=imageMenu.js/script



How do I need to alter this in order for these to work properly?
Thanks very much, any advice is extremely appreciated.

Sincerely,
Mike


[jQuery] Re: returning a string of html in a matched tag

2008-07-08 Thread [EMAIL PROTECTED]

On Jul 7, 6:56 pm, Michael Geary [EMAIL PROTECTED] wrote:
 I've used the equivalent of $(summary voters a).html() for this, but I
 wonder if it's really correct and works in all browsers or not? It uses
 innerHTML.

I just tried this and got undefined return value.  The docs on the
html function say:
Get the html contents (innerHTML) of the first matched element. This
property is not available on XML documents (although it will work for
XHTML documents).

Lack of XML support here is my problem :(


[jQuery] using doc.ready in an external .js file

2008-07-08 Thread kgosser

Here's what I'm not getting about jQuery from a novice point of view.
Let's say I have this:

script type=text/javascript
$(document).ready(function() {
$(#switcherBtn).click(function(){
$(#target).toggleClass(nodisplay);
});
});
/script

I have a function to toggle the display of a certain div. This div is
on virtually all my pages, though, so instead of putting this in the
header of each page, I want to put it in a global include file, for
example main.js.

I don't understand why copying and pasting

$(document).ready(function() {
$(#switcherBtn).click(function(){
$(#target).toggleClass(nodisplay);
});
});

into main.js throws this error in Firebug:

$ is not defined
main.js()()main.js (line 1)
$(document).ready(function(){



Any input?


[jQuery] Cycle Plugin - play/pause button?

2008-07-08 Thread Eric

Hi I am using the Cycle Plugin which is great.  I know you can set
pause:1 in the function options so that you get a pause on mouse
hovering over the image.  I was wondering if there is a way to set a
play/pause function to some button in the page?


[jQuery] Re: search and replace, updating string.prototype with jquery equivalent

2008-07-08 Thread seaofclouds

huh, it looks like i did post this question. no answers yet. anyone?

On Jul 7, 12:22 pm, seaofclouds [EMAIL PROTECTED] wrote:
 i've got the following code in my jquery plugin, tweet, which pulls in
 twitter updates unobtrusively. admittedly, it's a little cumbersome,
 but it does the job. now that it works, i'd like to streamline it,
 making it more jquery friendly.

 String.prototype.linkify = function() {
   return this.replace(/[A-Za-z]+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%\?
 \/.=]+/, function(m) {
   return m.link(m);
   });};

 String.prototype.linkuser = function() {
   return this.replace(/[EMAIL PROTECTED]/, function(u) {
     var username = u.replace(@,)
     return u.link(http://twitter.com/+username);
   });};

 String.prototype.linktag = function() {
   return this.replace(/[#]+[A-Za-z0-9-_]+/, function(t) {
     var tag = t.replace(#,%23)
     return t.link(http://summize.com/search?q=+tag);
   });

 };

 you can see the full plugin at:http://tweet.seaofclouds.com/and if
 you like, contribute at:http://github.com/seaofclouds/tweet/


[jQuery] UI Tabs and Mootools conflict

2008-07-08 Thread Mike

Greetings,

Thanks for taking the time to read this!

I tried to post previously, but I am afraid the post was lost as I
cannot see it. I apologize if my previous post is already up.

I hope you can help me. I am afraid when it comes to javascript I am
all thumbs. I am attempting to get UI tabs and mootools to work
together. I tried to follow the tutorial here:http://docs.jquery.com/
Using_jQuery_with_Other_Libraries but I am afraid I just can't get it
to work.

 Here is my current script, before I altered it to try the tutorial.

link rel=stylesheet href=ui.tabs.css type=text/css
media=print, projection, screen
script src=jquery-1.2.3.pack.js type=text/javascript/script
script src=ui.tabs.pack.js type=text/javascript/script
script type=text/javascript
$(function() {
$('#container-1  ul').tabs({ fx: { opacity:
'toggle' } });
$('#container-2  ul').tabs({ fx: { opacity:
'toggle' } });
$('#container-3  ul').tabs({ fx: { opacity:
'toggle' } });

  });
/script
link href=imageMenu2.css rel=stylesheet type=text/css
script type=text/javascript src=mootools.js/script
script type=text/javascript src=imageMenu.js/script
/headbody

Can someone tell me what code I need to put in there to make it work
properly? I have tried everything, and I am at a loss. I have gotten
UI tabs and mootools to work seperately, but not together. Any help is
very much appreciated.

Sincerely,
Mike


[jQuery] Re: Cycle Plugin Fade Issue

2008-07-08 Thread mnordyke

Here's the fix that Mike provided.  I forgot to mention it turned out
to be Mac/FF2 issue:

http://snipplr.com/view/6581/jquery-firefox-mac-hack/

Thanks again Mike.

On Jul 8, 12:00 pm, Mike Alsup [EMAIL PROTECTED] wrote:
 I have noticed on my website, as well as the JQuery Cycle Plugin's
  Home Page, that when the fade effect is used, divs in the header
  (including the text) are undergoing the fade effect not just the
  slideshow.

  Any thoughts?

  An example is athttp://malsup.com/jquery/cycle/fade-in-first.html
  (Pay attention to the top navigation).  I've played around with it and
  it's not just fading in the first image.  It's anytime the image is
  fading.

 I'm not seeing this behavior.  What browser are you using?


[jQuery] passing variable from javascript to php via iframe using tableeditor

2008-07-08 Thread ktpmm5


The user starts out by clicking a link - 
[code]

tr class=hometdLocation/tdtdinput type=button
onclick=vtwo.two() value=Flexigrid/td/tr

This leads to a js file where an iframe is called to pop up a dialog box -
it is at this point that I want to pass a variable in the url:
[code]
var vtwo = {
two: function() {
var url = 'test.php?gameno=2';
$('iframe id=popup src=' + url + ' /').addClass(flora).dialog({ 
title: .,
modal: true,
overlay: {
opacity: 0.5,
background: grey
..
[code]

I've also tried passing it these ways:
var url = 'test.php?gameno=' + 5;

then in test.php the first thing I do is get the variable and print to a log
file- the url in my browser shows the variable, but I cannot get it to print
out via php:
 
[code]
session_start();
$gameno = $_GET['gameno'];
error_log(gameno is  $gameno, 0);
[/code]

Eventually, I need to pass this variable to a mysql database:
[code]
if($('.new',grid).length0){
$.ajax({
   type: POST,
   dataType: json,
   url: save.php,
   data: { firstname: $('#firstname').val(), lastname:
$('#lastname').val(), homephone: $('#homephone').val(), cellphone:
$('#cellphone').val(), email: $('#email').val(), job: $('#job').val(),
gamenumber: $gameno },
   success: function(data){
alert(Thank you for volunteering!);
$(#flex1).flexReload();
   }
. [/code]

Can anyone help??
-- 
View this message in context: 
http://www.nabble.com/passing-variable-from-javascript-to-php-via-iframe-using-tableeditor-tp18348478s27240p18348478.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] replace string.prototype functions with jquery

2008-07-08 Thread seaofclouds

i made a very simple jquery plugin that displays your twitter status.
http://tweet.seaofclouds.com/ naturally, there is much work to be done
in the way of optimizing this plugin. first off, i have a few search
and replace functions, which i would like to replace with the jquery
equivilent.

String.prototype.linktag = function() {
  return this.replace(/[#]+[A-Za-z0-9-_]+/, function(t) {
var tag = t.replace(#,%23)
return t.link(http://summize.com/search?q=+tag);
  });
};

any tips? tweet is on github if you'd like to contribute or keep up to
date. you can view the full source of the plugin at:
http://github.com/seaofclouds/tweet/tree/master%2Fjavascripts%2Fjquery.tweet.js?raw=true


[jQuery] Re: $(something).text() doesn't preserve whitespace in IE

2008-07-08 Thread alistairholt

Thanks for opening the ticket. I could use that but I don't think it
would give me what I'm looking for.. my pre is full of HTML junk
(needed for syntax highlighting) from Textmate. Have a look at
http://pastie.org/230104 for an example.

On 8 Jul, 15:55, Dave Methvin [EMAIL PROTECTED] wrote:
  The problem for me is that using text() in IE 6/7 doesn't preserve
  whitespace...

 As a workaround, you can use an expression like this:

 var pre = $(pre).get(0);

 alert(pre.innerText || pre.textContent);

 All the browsers seem to support one property or the other--or both.
 Their text output isn't exactly the same in all cases, but at least
 there's some sort of whitespace.

 The additional case that jQuery's .text() has to handle is XML, where
 neither of these properties are available. I guess that's why it
 wasn't used.

 I opened a ticket:http://dev.jquery.com/ticket/3144


[jQuery] Re: .hide() Doesn't Work Fast Enough?

2008-07-08 Thread madacc

I'm having this exact same issue and was hoping to get a resolution.
It happens for me on Opera and Safari. I am using a Mac, but I'd be
surprised if that was any cause for this issue. Anyone have any
thoughts on this?

On Jul 7, 11:41 am, Vik [EMAIL PROTECTED] wrote:
 I'm using jQuery to fade in my site logo on my home page header, to
 give the home page some animation. It works great.

 So that the page will degrade gracefully if the user doesn't have
 Javascript, the HTML has the complete logo already visible. That's
 what users without Javascript see.   If the user has javascript, I
 first hide() the logo using jQuery. Then I fade it in.

 However, many times when I load my home page, I see the logo briefly
 before jQuery can hide it.  You see the logo for a split second, and
 then it vanishes. (After that it fades in correctly). Is there a way
 to fix this?

 Here's the code:

 HTML:
         echo 'ul id=Animated_Header';
                 echo 'liimg src=/images/Logo_3.gif/li';
         echo '/ul';

 JQUERY;
 $(document).ready(function()
 {
         $('#Animated_Header').hide();

         $('#Animated_Header').html('liimg src=/images/Logo_1.gif /
 liliimg src=/images/Logo_2.gif  alt=FlavorZoom, the New Way to
 Count Calories/liliimg src=/images/Logo_3.gif /li');

         $(ul.nav).superfish();

         $('#Animated_Header').fadeIn(100).innerfade({
                                 speed: 'slow',
                                 timeout: 300,
                                 type: 'sequence',
                                 containerheight: '71px'
                         });

 });

 Thanks in advance to all for any info.

 -Vik


[jQuery] Re: Cycle Plugin Fade Issue

2008-07-08 Thread mnordyke

It's actually only on my Mac machines (FF2, FF3 and Safari).  All
windows machines seem to be displaying correctly.

Actually, I just got home to my other mac .. and everything seems
fine.  Must be my browsers at work.



On Jul 8, 12:00 pm, Mike Alsup [EMAIL PROTECTED] wrote:
 I have noticed on my website, as well as the JQuery Cycle Plugin's
  Home Page, that when the fade effect is used, divs in the header
  (including the text) are undergoing the fade effect not just the
  slideshow.

  Any thoughts?

  An example is athttp://malsup.com/jquery/cycle/fade-in-first.html
  (Pay attention to the top navigation).  I've played around with it and
  it's not just fading in the first image.  It's anytime the image is
  fading.

 I'm not seeing this behavior.  What browser are you using?


[jQuery] Re: Cycle Plugin - play/pause button?

2008-07-08 Thread Mike Alsup

 Hi I am using the Cycle Plugin which is great.  I know you can set
 pause:1 in the function options so that you get a pause on mouse
 hovering over the image.  I was wondering if there is a way to set a
 play/pause function to some button in the page?

Here's a couple demos:

http://www.malsup.com/jquery/cycle/pause.html
http://www.malsup.com/jquery/cycle/hover.html


[jQuery] Re: slideDown hidden portion/bump

2008-07-08 Thread Karl Swedberg


Try wrapping the form in a div and sliding that down. That should work.

--Karl

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




On Jul 8, 2008, at 8:31 AM, noon wrote:



Anyone have any ideas on this one?  It's really stumping me.

On Jul 7, 9:15 am, noon [EMAIL PROTECTED] wrote:

I don't know why it does this.  I am experiencing hidden content (the
username label) until the animation is complete and the bump
occurs.  See it for yourself

http://nunyez.googlepages.com/slidedowntest

Help appreciated




[jQuery] BlockUI in IE 7 does not unblock

2008-07-08 Thread DroidCommander

perhaps you can help me, I have the following code:

var waitDiv;
var selectMachineDialog;
$(document).ready(function() {
waitDiv = document.getElementById(waitDiv);
selectMachineDialog =
document.getElementById(selectMachineDialog);
$.blockUI(waitDiv, {border: '2px solid #FFC000'});
if(haul_id != null){
loadHaulRequest(haul_id);
} else {
getHaulTypes();
getHaulMachineLocations();
 
document.getElementById(customer_id).focus();
}
$.unblockUI();
});

The blockUI works exactly as desired in FF but in IE it never clears
the blocked message

Thanks
Ben


[jQuery] Re: Validation and Tabs plugins compatibility

2008-07-08 Thread peace4theapes

Diego,

Thanks for the reply. I tried this idea but it threw up another
interesting problem. I was wondering if you could throw some light on
it.

When the validation plugin adds an error class, it does not remove it
once the form is validated. Therefore when I switch to the tab with
the error class, the same tab is selected every time.

Also, do you know how I could call this small (tab changing) function
from the validate plugin? Something like form.validate({onerror:
changetabs()}

Thanks again,
-P


[jQuery] Firefox Error (bug?) with Sortable

2008-07-08 Thread PeteShaw

Hi,

I've searched around a bit and can't find any examples of someone
having the same issue, so hopefully someone out there can help. I'm
try to save sort order server side through a ajax call on sortable
stop.

I've got this to work in IE6/7 using the stop: event to call a
function i.e.:

var sortingOptions = { opacity: .5, containment: parent, items:
.item, stop: function(e) { OnSorted(e) } };
$(.toolBelt.sortable).sortable(sortingOptions);

which calls another js:
void function OnSorted(InE) {
   //On Drop of Drag Drop sort

   var ButtonList;

   ButtonList = InE.target.parentNode.parentNode.parentNode.all;
   var i;
   var query_string = ;
   //loop through and create querystring from array
   for (i = 0; i = ButtonList.length-1; i++) {
   if (ButtonList[i].id!=)
   query_string += ButtonList[i].id + ,;
   }

   $.ajax(
   {
   type: POST,
   url: /Pages/ajaxPostBack.aspx,
   data: postback=EditApp; + query_string
   });

However if I try the same operation in Firefox 3 I get the javascript
error:
OnSorted is not defined
[Break on this error] var sortingOptions = { opacity: .5, containment:
parent, items...

Anyone come across this before?

cheers

Pete


[jQuery] Re: using doc.ready in an external .js file

2008-07-08 Thread Carl Von Stetten

kgosser,

Are you loading jQuery.js after your main.js file?  If you are, try 
loading jQuery first, as it must be present before using any of its 
functions.

Carl

kgosser wrote:
 Here's what I'm not getting about jQuery from a novice point of view.
 Let's say I have this:

   script type=text/javascript
   $(document).ready(function() {
   $(#switcherBtn).click(function(){
   $(#target).toggleClass(nodisplay);
   });
   });
   /script

 I have a function to toggle the display of a certain div. This div is
 on virtually all my pages, though, so instead of putting this in the
 header of each page, I want to put it in a global include file, for
 example main.js.

 I don't understand why copying and pasting

   $(document).ready(function() {
   $(#switcherBtn).click(function(){
   $(#target).toggleClass(nodisplay);
   });
   });

 into main.js throws this error in Firebug:

 $ is not defined
 main.js()()main.js (line 1)
 $(document).ready(function(){



 Any input?


   


[jQuery] Re: using doc.ready in an external .js file

2008-07-08 Thread kgosser

Bingo, that was it. Big time duh noob moment :)

On Jul 8, 4:50 pm, Carl Von Stetten [EMAIL PROTECTED] wrote:
 kgosser,

 Are you loading jQuery.js after your main.js file?  If you are, try
 loading jQuery first, as it must be present before using any of its
 functions.

 Carl

 kgosser wrote:
  Here's what I'm not getting about jQuery from a novice point of view.
  Let's say I have this:

 script type=text/javascript
 $(document).ready(function() {
 $(#switcherBtn).click(function(){
 $(#target).toggleClass(nodisplay);
 });
 });
 /script

  I have a function to toggle the display of a certain div. This div is
  on virtually all my pages, though, so instead of putting this in the
  header of each page, I want to put it in a global include file, for
  example main.js.

  I don't understand why copying and pasting

 $(document).ready(function() {
 $(#switcherBtn).click(function(){
 $(#target).toggleClass(nodisplay);
 });
 });

  into main.js throws this error in Firebug:

  $ is not defined
  main.js()()main.js (line 1)
  $(document).ready(function(){

  Any input?


[jQuery] Re: Cycle Plugin - play/pause button?

2008-07-08 Thread Eric

Great thanks alot

 Here's a couple demos:

 http://www.malsup.com/jquery/cycle/pause.htmlhttp://www.malsup.com/jquery/cycle/hover.html


[jQuery] Re: Display (or not display) content based on url hash

2008-07-08 Thread mitchel

Thank you again. That certainly helped. But I still don't quite
understand what to do with the event handler. I gave the links ids of
cross-link1, cross-link2, etc. and tried this:

$('#cross-link1').click(function() {
location.reload(true)
});

but it doesn't really do anything.

Thanks again, you've been a giant help thus far.

On Jul 8, 12:23 pm, noon [EMAIL PROTECTED] wrote:
  I the if/else statement doesn't seem to be working.

 You're if statement is using the equals sign as an assignment operator
 (=) instead of comparison which is double equals (==).

  Also, it only
  reads the current hash on a manual refresh of the page. Here is the
  link if helps any:http://www.mitchmckenzie.com/index.php

 That piece of javascript is only evaluated when the page loads.  If
 you want you're changes to occur onclick you'll have to assign event
 handlers to each clickable item -OR- an event handler generically to
 every click and check its target.

 Event handler (assuming you've added ID's to each link with the class
 cross-link):
 $('#cross-link1').click(function() {
   // do some javascript

 });

 Generic handler:
 $('a').click(function() {
   // you arent sure what was clicked, so lets determine before doing
 something
   var the_links_rel_property = $(this).attr('rel'); // $(this) refers
 to what was clicked
   switch (the_links_rel_property) {
     case 'img1':
       // do something
       break;
     case 'img4':
       // do something
       break;
   }

 });

 Hope that helps

 On Jul 8, 2:51 pm, mitchel [EMAIL PROTECTED] wrote:

  Thanks! I think that gets me started in the right direction. However,
  I am still having some issues. Here is what I have so far:

                          var current =
  (document.location.toString().split('#')[1])

                          if (current = 1) {document.write( h2Title
  1/h2br /pBody text./p ); }
                          else if (current = 2)
  {document.write( h2Title 2/h2pBody text./p ); }
                          else if (current = 3)
  {document.write( h2Title 3/h2pBody text./p ); }
                          else if (current = 4)
  {document.write( h2Title 4/h2pBody text./p ); }
                          else if (current = 5)
  {document.write( h2Title 5/h2pBody text./p ); }
                          else  {document.write( h2Title 1/h2br /

  pBody text./p ); }

  I the if/else statement doesn't seem to be working. Also, it only
  reads the current hash on a manual refresh of the page. Here is the
  link if helps any:http://www.mitchmckenzie.com/index.php

  Any further help would be greatly appreciated.

  On Jul 8, 8:00 am, noon [EMAIL PROTECTED] wrote:

   alert(document.location.toString().split('#')[1]) will get you the
   hash. From there an if statement or a switch/case would serve you.

   On Jul 8, 8:54 am, mitchel [EMAIL PROTECTED] wrote:

Hello.

Admittedly, I know very little about jQuery or javascript in general
but it seems like it should be able to do what I need it to do fairly
easily.

I am trying to create a div on a page which would display different
content based on the hash in the url. Is there a way to create several
hidden divs on a page with the content I want and have a class that
makes one visible based on the current hash in the URL? Any ideas on
how would I do this?

Thanks.


[jQuery] Re: Draggable by proxy

2008-07-08 Thread Richard D. Worth
I would recommend the following:

1. On element.mousedown, bind document.mousemove and document.mouseup.
2. On document.mouseup, unbind mousemove and mouseup.
3. Don't worry about sending the drag events (mousemove) to the element
that's actually going to be moving, just handle the events at the document
level and move the element accordingly.

This is known as event delegation. Especially because your original element
isn't going to move, your safest element is document, to which all others
will bubble up.

You might want to take a look at the mouse plugin inside jQuery UI's core
(ui.core.js). This is how it's designed. For examples of use, see any of
jQuery UI's draggable, slider, selectable, sortable. After mousedown (on the
target element), everything else is on the document.

- Richard

Richard D. Worth
http://rdworth.org/

On Tue, Jul 8, 2008 at 4:52 PM, JohnC [EMAIL PROTECTED] wrote:


 Can I (and if so, how) drag an element without actually mouse-downing
 and -moving on the element I want to move?

 For reasons I will happily explain, the user can't actually click on
 the object I want them to drag.

 So can I get them to click on something else and then have that pass
 the dragging info to the real draggable element?

 (Just to be clear, the proxy mustn't move - I just want the events of
 mousedown/drag to be forwarded to the real draggable element).

 Many thanks.

 Regards

 John



[jQuery] Re: Firefox Error (bug?) with Sortable

2008-07-08 Thread Richard D. Worth
change

void function OnSorted(InE) {

to

function OnSorted(InE) {

- Richard

On Tue, Jul 8, 2008 at 6:25 PM, PeteShaw [EMAIL PROTECTED] wrote:


 Hi,

 I've searched around a bit and can't find any examples of someone
 having the same issue, so hopefully someone out there can help. I'm
 try to save sort order server side through a ajax call on sortable
 stop.

 I've got this to work in IE6/7 using the stop: event to call a
 function i.e.:

 var sortingOptions = { opacity: .5, containment: parent, items:
 .item, stop: function(e) { OnSorted(e) } };
 $(.toolBelt.sortable).sortable(sortingOptions);

 which calls another js:
 void function OnSorted(InE) {
   //On Drop of Drag Drop sort

   var ButtonList;

   ButtonList = InE.target.parentNode.parentNode.parentNode.all;
   var i;
   var query_string = ;
   //loop through and create querystring from array
   for (i = 0; i = ButtonList.length-1; i++) {
   if (ButtonList[i].id!=)
   query_string += ButtonList[i].id + ,;
   }

   $.ajax(
   {
   type: POST,
   url: /Pages/ajaxPostBack.aspx,
   data: postback=EditApp; + query_string
   });

 However if I try the same operation in Firefox 3 I get the javascript
 error:
 OnSorted is not defined
 [Break on this error] var sortingOptions = { opacity: .5, containment:
 parent, items...

 Anyone come across this before?

 cheers

 Pete



[jQuery] imagebox display problem - z-index issue??

2008-07-08 Thread ktpmm5


Im using the imagebox interface plugin to display 6 pictures.  However, they
display not on top of my page, but partially on top and partially behind the
rest of the page - ???   It's not complicated to use, so Im wondering if
others have this problem.  I'm using it with jquery 1.2.6-

Here is how I'm setting it up-

{
loaderSRC: 'img/loading.gif',
closeHTML: ' img/close.png ',
border: '25'
}
);
-- 
View this message in context: 
http://www.nabble.com/imagebox-display-problem---z-index-issue---tp18352658s27240p18352658.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Cross domain problems

2008-07-08 Thread Erik Beeson

Add this somewhere in your javascript:

document.domain = 'site.com';

Google document domain

--Erik


On 7/8/08, flycast [EMAIL PROTECTED] wrote:

  Simple problem (I think)...

  I am new to JS and ajax.

  I am building an ajax capability on a clients site. I am running into
  cross domain problems. If I get the page using the url form 
 http://www.site.com
  but I do a load using the url form http://site.com; (www vs. no www
  in the url) I get nothing but a js error.

  What is the best way to handle making sure that if the person is at
  the site with OR without the www in the url that the .load will
  still work?



[jQuery] Re: caching AJAX data?

2008-07-08 Thread [EMAIL PROTECTED]

What I ended up doing was setting a variable and testing for it.  If
it's set, then I just toggle the display instead of grabbing the data
via AJAX.

On Jul 8, 1:19 am, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
 Hi folks,

 I have a page with a photo and comments on it.  I load the replies to
 the comments for this photo via an AJAX request like so (I also use
 LiveQuery):

 JavaScript:
 /* Show Replies button action. */
 $(.show_replies).livequery('click', function()
 {
    var photo_id_val = $(#photo_id).val();
    var comment_id_val = $(this).attr(id);

    $.post(/show_comments, { photo_id: photo_id_val, comment_id:
 comment_id_val }, function(data)
    {
        /* Update the div that holds the replies. */
        $(#replies_for_+comment_id_val).html(data);
        $(#replies_for_+comment_id_val).slideToggle();
    });

 });

 HTML:
 span id=c4 class=show_replies title=Show the RepliesShow
 Replies/span
 div id=replies_for_c4/div

 So everytime I click on Show Replies span, it would load up the
 replies via AJAX and slide them in and out.  This works fine.

 My question is the following:
 Is it possible to load the replies ONCE and just slideToggle them,
 instead of loading them via AJAX every time the Show Replies is
 clicked?

 Any ideas or help would be greatly appreciated.

 Thanks,
 Konstantin


[jQuery] Re: 1.2.4 to 1.2.6 question

2008-07-08 Thread Karl Swedberg

Hi Shelane,

I just had major issues today adding some jQuery (1.2.6) to an old  
site that has legacy Prototype code. This has come up a few times  
before on the list, but I totally forgot about that while I was in the  
midst of my agony. If I recall correctly, the conflict only occurs  
with certain versions of Prototype.


I got around my particular issue by calling the same function  
separately on two IDs instead of calling it just once with both IDs in  
a single selector. Maybe Prototype is doing something funky to the  
arrays that jQuery selectors build? I don't know.


I wonder if Ariel's suggestion from a previous post on the dev list --  
If you upgrade Scriptaculous to 1.8.1, it should work well  -- would  
apply here as well.


pause/ search/

Aha! Michael Geary explains it here: [1]

Your page is loading script.aculo.us effects.js v1.7.1_beta3. This  
file

defines Array.prototype.call as a function.

That causes massive confusion inside jQuery 1.2.6, but not in 1.2.3.  
The
reason is the change that was made to jQuery's makeArray() function  
in 1.2.6

- if the code is passed an array that has a call method, it mistakenly
thinks it is not an array and does the wrong thing - line 1135 of
jquery-1.2.6.js is the pertinent code here. (The correct fix isn't
immediately obvious, but I'll file a ticket on this.)

As it happens, the current version of script.aculo.us effects.js,  
v1.8.1, no

longer defines Array.prototype.call.


[1] 
http://groups.google.com/group/jquery-en/browse_thread/thread/5a83b3b23e38a6a7/5a91e47087a1555e?hl#msg_c63cabcb38ffcb8b

Anyway, thanks for jogging my memory with your post. Maybe I'll  
revisit my code in the morning and see if I can upgrade prototype and  
get a less hacky solution going.


--Karl

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




On Jul 8, 2008, at 5:27 PM, Shelane wrote:



It looks like the problem has to do with me still having prototype on
the page.  It's the first jQuery site I ever did and the autocomplete
plugin wasn't far enough along for me to use at that point.  I've
pointed to an older version of jQuery until I get around to rewriting
that page to use the jQuery autocomplete.

On Jul 8, 1:39 pm, Shelane Enos [EMAIL PROTECTED] wrote:
I just found out that this function that worked (doubled checked to  
confirm)
worked under 1.2.4 but isn't working under 1.2.6.  I'm not sure  
what.  Can

anyone see anything obvious?

bindDeleteLinks = function(who){
   $(a.rembtn, '#' + who).unbind('click');
   $(a.rembtn, '#' + who).click(function(){
   console.log('bound and clicked ' + who);
   $(('#' + this.id + 'row')).css({display:'none'});
   $.get('includes/tools/runtime.lasso?task=meetingswho='  
+ who +

'method=removepageID=' + pageID + 'rel=' + this.id);
   return false;
   });
   }

Under 1.2.6, the console message doesn't even show.