[jQuery] Re: how do I stop a further event will be ahppened again if current event has not yet finished

2008-08-19 Thread andrea varnier

On 19 Ago, 04:29, jack [EMAIL PROTECTED] wrote:
 If an event hasn't finished how do I prevent the same event being
 triggered again? Thank you in advance!

you could just unbind() the action from the element that triggers it,
and then re-bind it once the event has completed :)


[jQuery] Question about variable declaration

2008-08-19 Thread andrea varnier

Hi :)
in your plugins (I'm studying from the best here :))) I often find
variable assignments like this:

options = $.extend({
url:  this.attr('action') || window.location.toString(),
type: this.attr('method') || 'GET'
}, options || {});

it's like url = this OR that. right?
then I try, for example:

var $sel = $('.left_selected') || $('.right_selected');

meaning $sel = $('.left_selected') but if you don't find any element
with that class, $sel = $('.right_selected').
but this WON'T work :|
where is my mistake? at first I thought those declarations were just a
matter of true or false, but the example I reported above (taken from
alsup's form plugin) is clearly something more interesting!
can anyone help me please?
thank you
andrea


[jQuery] Combining jQuery with document.querySelector

2008-08-19 Thread Riddle

Hi,

I’m working on some project with WebKit nightly being the one and only
target.

I want to use jQuery for its clarity and speed, but I know that
selector engine is using regular expressions and some other magic
stuff. Whereas I have document.querySelector/querySelectorAll at my
fingertips. Can you suggest how I could combine those two?

I’m also seeking a way to optimize jQuery – throw off every IE hack,
work-around for browser X, etc. It’s not a project for web so I can
afford that.


[jQuery] Re: Questions about Flexigrid

2008-08-19 Thread Jens Grochtdreis

Hi,

auto-height seems possible. just write:

height: 'auto'

The same seems not possible for width. But ususally you know the width
of the div the table is placed in, so it shouldn't be a big problem
with the width.

My biggest problem seems to be mow the reload after deleting an item.
It doesn't work.

Greetings,

Jens Grochtdreis


[jQuery] Re: Hiding elements that have a dynamic ID

2008-08-19 Thread Christopher TS

I have to apologise cause I sort of explained it wrongly. My
bad...sorry about that.

This element in my web page has its ID dynamically assigned. However,
this assignment is done so upon form load. Meaning that the ID of the
element is assigned upon form load and it is named according to what
is found in the textbox.

So any ideas?

Regards,
Christopher

On Aug 15, 10:18 pm, erroneousBolock [EMAIL PROTECTED]
wrote:
 Or you could bind a handler to the textbox (or submit), intercept
 the new ID, and get thatelementdirectly by it's new ID.

 -David.



 Christopher TS wrote:
  Hi there,

  There is a particular ID in my web page that changes dynamically
  according the input given in one of my text boxes. It's generic name
  is called '_MISendFormShortcutfalse'. Then the input in one of the
  textboxes is put at the end of the ID name. That is to say if 'Test
  Example Shortcut' was the input in the textbox, it would result with
  the ID name '_MISendFormShortcutfalseTestExampleShortcut'.

  From the above there are two issues:

  1) The name of the ID changes dynamically.
  2) The given input, that is put behind the generic name, will have all
  the spaces inbetween removed.

  These are my current codes to overcome the issue:

  //The dynamically changing name and method to remove the spaces for
  concatenation to the
  //generic name
  var tempFalseHolder = $(#new_name).val();]
  while(tempFalseHolder.match( ))
  {
       tempFalseHolder = tempFalseHolder.replace( , );
  }

  //Concatenation of ID names
  var idFalseHolder = #_MISendFormShortcutfalse + tempFalseHolder;

  //Hidingthe dynamically changing IDelement
  $(idFalseHolder).hide();

  Thus, am wanting to check with any of you out there, who can lend me
  your expertise in using other methods made avaliable in jQuery to do
  the abovementioned.

  Thanks!

  Regards,
  Christopher TS- Hide quoted text -

 - Show quoted text -


[jQuery] jquery.form set field value beforeSubmit

2008-08-19 Thread Boersnoes

Hi,

I'm trying to set a hidden field's value to true before submitting.
First I bind the form:
 $(.advancedSearchForm).ajaxForm(
{
target: '.colorList',
beforeSubmit: ShowRequest,
success: ShowResponse
}
);
Then in the before submit I set the field value to true
function ShowRequest(formData, jqForm, options){
  $('#isAjax').val(true);
//var elements = jqForm[0].elements;
//elements[19].value = true;
$('.colorList').fadeOut('slow');
return true;
}
A quick alert($('#isAjax').val()) shows me it is indeed true.
But at the server side (asp.net) the field still has the old value
if (Request.Form[isAjax] == true) is false

It seems the before submit is not really before submit. Any ideas?


[jQuery] Create Classes using jQuery

2008-08-19 Thread Stefan Sturm

Hello,

I used Prototype so long. But I switched to jQuery. But now I have a
Question about creating classes.
With prototype I can use Class.create to create a new Class.
Is there a way in jQuery to do this? Or do I need the old JavaScript
syntax to create my classes?

Thanks for your help,
Stefan Sturm


[jQuery] Re: Question about variable declaration

2008-08-19 Thread Nicola Rizzo

$('.left_selected') returns always true, because if there's not a
matching element, $('.left_selected') is an array (not null) with
length = 0.
hth,
Nicola
On Tue, Aug 19, 2008 at 10:34 AM, andrea varnier
[EMAIL PROTECTED] wrote:

 Hi :)
 in your plugins (I'm studying from the best here :))) I often find
 variable assignments like this:

options = $.extend({
url:  this.attr('action') || window.location.toString(),
type: this.attr('method') || 'GET'
}, options || {});

 it's like url = this OR that. right?
 then I try, for example:

var $sel = $('.left_selected') || $('.right_selected');

 meaning $sel = $('.left_selected') but if you don't find any element
 with that class, $sel = $('.right_selected').
 but this WON'T work :|
 where is my mistake? at first I thought those declarations were just a
 matter of true or false, but the example I reported above (taken from
 alsup's form plugin) is clearly something more interesting!
 can anyone help me please?
 thank you
 andrea



[jQuery] Superfish Question

2008-08-19 Thread Willie Krause
Hi All

I use Superfish on a project as a menu system (and love it). I am a Java
developer though and usually end up breaking ajax/javascript libraries when
I try to make a customisation. My question is how easy / difficult would it
be to make superfish *not* activate the drop-down part of the menu with a
mouse event that hovers over it (default behaviour), but instead that it
requires a mouse click? If it can be attempted by a non javascript coder
(but who has done some js hacks in the past), could you please guide me in
the right direction where to do this.

Many thanks

W


[jQuery] [TreeView] - How to collapse/expand with a link?

2008-08-19 Thread [EMAIL PROTECTED]

I have a UL list which i apply the treeview plugin. So far so good.

The treeview control works like it should, but I need to be able to
assign a link to collapse the tree. Any link without being inside a
treecontrol div. The treecontrol assigns actions according to order of
appearing links.
First link expands, next collapses and the third and last one toggles.

I need to be able to assign the collapse action to a link without
using treecontrol.

I imagine it would go something like this...

$(a.collapse).click(function() {
  $(#tree).doWhatever I need to do to collapse the tree.
});

I've looked at the demos, the code, the documentation (I can see the
properties which I can set when i apply the treeview to the list, but
can't see how I can call an action), tried searching.

I'm a beginner, so I can't figure out how or if it's possible.

Here's the plugin: http://bassistance.de/jquery-plugins/jquery-plugin-treeview/

Regards, Victor


[jQuery] tabs pluggin how to load tab with external domain data

2008-08-19 Thread roundcrisis

hi there

I would like to load a tab with external domain data , something
http://www.google.com is this posible and how
Thanks



[jQuery] Re: removing html comments from the dom

2008-08-19 Thread James

Hi,

Thanks both for your suggestions - I think you're right about the fact
that this approach probably wouldn't solve my problem, even moreso
since the offending html comment appears before the DOCTYPE and is
probably therefore not even part of the DOM (?). Altering the server
architecture is unfortunately out of the question as we are at the
mercy of our corporate parent.The IE jQuery jerkiness problem is here:
www.ceridian.co.uk/amp (click on the green question marks in IE).


[jQuery] Re: JQuery UI Date Picker and Thickbox wont work

2008-08-19 Thread Sbudah

Hi Rob,

Simply change the CSS [#ui-datepicker-div] z-index to anything above
105 as thickbox's z-index goes up to 103 (default for datepicker is
100, meaning it is behind the modal)

Hope that helps.

Sbudah


[jQuery] Re: mootools and jquery

2008-08-19 Thread Karen Chan
Thanks Adwin - your jquery.noConflict() suggestion is certainly a quick
solution for it, thanks :)

However, I have development team on my back and they've made a decision to
not to use any javascript frame work other then jQuery - so I cannot enter
their realms... :(


On Tue, Aug 19, 2008 at 4:34 AM, Adwin Wijaya [EMAIL PROTECTED]wrote:


 btw, may i know why you need to convert from mootools to jquery ?
 you can use jquery.noConflict() so it can work with mootools (beware,
 some jquery plugins are not working with it)



 On Aug 18, 6:24 pm, Hoi [EMAIL PROTECTED] wrote:
  I'm completely new to jquery (and not technical...) and I've been
  asked to estimate how mush would it would take to convert a
  html +xml+mootools written mini web page into jquery, the current
  mootools written mini web page has the following:
 
  * 2 dynamic menus, content of these menus are defined in 2
  different .xmls (both click through and html to display)
  * When clicked on the menus, it import individual htmls to a div
  within the main template
  * a small animtaion (like slideDown(); in jquery) within the menu
  *  966 lines of .js
  * drop cookie function (unfortunately with my very poor knowledge, I
  do not know what this is for...)
 
  My questions are...
  1. How much work is it to convert what this from mootools to jquery?
   1.1. What's the quickest way to do it?
   1.2. Is it a complete re-write (.html, .js, .xml) ?
   1.3. Is it doable by re-writing the .js only + pointing the pages to
  jquery.js?
 
  2. How long would it take - for someone who's basic jquery knowledge
  to complete it (it  answer to 1. above...)?
 
  Very very very much appreciated for anyone' input in advance...



[jQuery] Re: Question about variable declaration

2008-08-19 Thread Ryura

The problem here is that neither of your expressions can EVER evaluate
to false. Even if no actual DOM element is selected, you still get an
empty (jQuery)array.

On Aug 19, 4:34 am, andrea varnier [EMAIL PROTECTED] wrote:
 Hi :)
 in your plugins (I'm studying from the best here :))) I often find
 variable assignments like this:

     options = $.extend({
         url:  this.attr('action') || window.location.toString(),
         type: this.attr('method') || 'GET'
     }, options || {});

 it's like url = this OR that. right?
 then I try, for example:

     var $sel = $('.left_selected') || $('.right_selected');

 meaning $sel = $('.left_selected') but if you don't find any element
 with that class, $sel = $('.right_selected').
 but this WON'T work :|
 where is my mistake? at first I thought those declarations were just a
 matter of true or false, but the example I reported above (taken from
 alsup's form plugin) is clearly something more interesting!
 can anyone help me please?
 thank you
 andrea


[jQuery] Re: Remove an element ONLY if exists

2008-08-19 Thread besh

Karl is completely right. But if you REALLY have a reason to check for
its existence you can do this:

if ($('#myId').length) {
  $('myId').remove();
} else {
  alert('ooops! there's no myID to remove...');
}

--
Bohdan Ganicky

On Aug 18, 10:11 pm, Gewton Jhames [EMAIL PROTECTED] wrote:
 There's a way to remove a element by his id, but first check if it exists?

 thanks.


[jQuery] Re: mootools and jquery

2008-08-19 Thread Karen Chan
Thanks for the respond Glen :) Unfortunately the page is not public so I
can't show much more - I know it's ridiculous to ask the question I've asked
when I can't give much more information :(

I'll take your advise to go through the plugins and see if I get lucky :)

Many thanks


On Tue, Aug 19, 2008 at 1:46 AM, Glen Lipka [EMAIL PROTECTED] wrote:

 Is this page public?  Seeing it would help.

 There are often plugins that can do a bunch of stuff for you with little
 code.  (Im not that technical either, which is why I love plugins)

 Glen


 On Mon, Aug 18, 2008 at 4:24 AM, Hoi [EMAIL PROTECTED] wrote:


 I'm completely new to jquery (and not technical...) and I've been
 asked to estimate how mush would it would take to convert a
 html +xml+mootools written mini web page into jquery, the current
 mootools written mini web page has the following:

 * 2 dynamic menus, content of these menus are defined in 2
 different .xmls (both click through and html to display)
 * When clicked on the menus, it import individual htmls to a div
 within the main template
 * a small animtaion (like slideDown(); in jquery) within the menu
 *  966 lines of .js
 * drop cookie function (unfortunately with my very poor knowledge, I
 do not know what this is for...)

 My questions are...
 1. How much work is it to convert what this from mootools to jquery?
  1.1. What's the quickest way to do it?
  1.2. Is it a complete re-write (.html, .js, .xml) ?
  1.3. Is it doable by re-writing the .js only + pointing the pages to
 jquery.js?

 2. How long would it take - for someone who's basic jquery knowledge
 to complete it (it  answer to 1. above...)?

 Very very very much appreciated for anyone' input in advance...






[jQuery] Re: Question about variable declaration

2008-08-19 Thread besh

Hi Andrea,

it's really a matter of true or false. The attr() method returns a
string and so if it returns an empty one, it's evaluated as false and
the part after the || operator is then taken. You use jQuery wrapper
on both sides of the || operator and jQuery wrapper always returns
something (itself) and is never evaluated as false. If you still want
do this assignment on one line, try using the conditional operator:

var $sel = $('.left_selected').length ? $('.left_selected') : $
('.right_selected');

--
Bohdan Ganicky
(excuse my english please)

On Aug 19, 10:34 am, andrea varnier [EMAIL PROTECTED] wrote:
 Hi :)
 in your plugins (I'm studying from the best here :))) I often find
 variable assignments like this:

     options = $.extend({
         url:  this.attr('action') || window.location.toString(),
         type: this.attr('method') || 'GET'
     }, options || {});

 it's like url = this OR that. right?
 then I try, for example:

     var $sel = $('.left_selected') || $('.right_selected');

 meaning $sel = $('.left_selected') but if you don't find any element
 with that class, $sel = $('.right_selected').
 but this WON'T work :|
 where is my mistake? at first I thought those declarations were just a
 matter of true or false, but the example I reported above (taken from
 alsup's form plugin) is clearly something more interesting!
 can anyone help me please?
 thank you
 andrea


[jQuery] Regarding jquery auto complete results

2008-08-19 Thread babu A

iam facing a problem in increasing the width of the autocomplete
results, i tried in changing the css also but i can't change that
and also I would like to change the structure of the autocomplete
results is this possible









[jQuery] Re: Question about variable declaration

2008-08-19 Thread RobG



On Aug 19, 6:34 pm, andrea varnier [EMAIL PROTECTED] wrote:
 Hi :)
 in your plugins (I'm studying from the best here :))) I often find
 variable assignments like this:

     options = $.extend({
         url:  this.attr('action') || window.location.toString(),
         type: this.attr('method') || 'GET'
     }, options || {});

 it's like url = this OR that. right?
 then I try, for example:

     var $sel = $('.left_selected') || $('.right_selected');

 meaning $sel = $('.left_selected') but if you don't find any element
 with that class, $sel = $('.right_selected').
 but this WON'T work :|
 where is my mistake?

In a logical OR expression, each expression, start from the left, is
evaluated, then its value determined. The value is then converted to a
boolean and if it's true, the value is returned (i.e. the value before
it was converted to a boolean) and that's it.  Otherwise, the next
expression is evaluated.  For the last expression is reached, it is
evaluated and its value returned unconditionally.

See ECMA-262 sections 9.2 ToBoolean and 11.11 Logical Binary
Operators.

The result of calling $(selector) is always the jQuery object,
regardless of whether any elements matched the selector.  Use the
rules in 9.2 to see how that is treated in your expression.


--
Rob


[jQuery] Re: [TreeView] - How to collapse/expand with a link?

2008-08-19 Thread Jörn Zaefferer
Hi Victor,

the treecontrol feature doesn't provide lots of flexibility, and so
far that worked well enough. I'm avoiding adding more features to it
as long as possible.

In this case, have you tried adding the necessary additional links the
treecontrol expects, while hiding all of them but the collapse link?
That way you should get just the one you need (visible).

Let me know if that doesn't work. At some point I'm going to add
programmatic tree controls anyway.

Jörn

On Tue, Aug 19, 2008 at 12:14 PM, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:

 I have a UL list which i apply the treeview plugin. So far so good.

 The treeview control works like it should, but I need to be able to
 assign a link to collapse the tree. Any link without being inside a
 treecontrol div. The treecontrol assigns actions according to order of
 appearing links.
 First link expands, next collapses and the third and last one toggles.

 I need to be able to assign the collapse action to a link without
 using treecontrol.

 I imagine it would go something like this...

 $(a.collapse).click(function() {
  $(#tree).doWhatever I need to do to collapse the tree.
 });

 I've looked at the demos, the code, the documentation (I can see the
 properties which I can set when i apply the treeview to the list, but
 can't see how I can call an action), tried searching.

 I'm a beginner, so I can't figure out how or if it's possible.

 Here's the plugin: 
 http://bassistance.de/jquery-plugins/jquery-plugin-treeview/

 Regards, Victor



[jQuery] Re: jQuery Listen plugin help

2008-08-19 Thread Ariel Flesler

The problem is that the clicked element is always the image, not the
span.

$.listen( 'click', 'img.reflect', function() {
  alert(Click!);
});

Cheers

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

On Aug 18, 3:54 pm, Brian Schilt [EMAIL PROTECTED] wrote:
 try applying 'Listen' to the images container and adding the click
 listener to the 'thumbs' class.

 $('#images-container').listen('click', '.thumbs', function(){
   alert('click');

 });

 Brian

 On Aug 18, 11:50 am, sergeh [EMAIL PROTECTED] wrote:

  I was easily able to make the plugin work where I needed to add things
  dynamically via jquery.
  But now I can't get it work on another page where I need to add a few
  div via ajax

  When I click on a li I fetch some images via ajax and they get
  displayed inside of a container. My problem is that I need to be able
  to hover and click on those images so a normal jQuery selector isn't
  working and when I try the listen plugin it isn't working either...

  this is what I have

  div id=images-container
  !-- images are loaded via ajax in here like so --
    div class=thumbs
      span class=clickableimg src=.. width=81 class=reflect
  rheight20 //span
    /div
  /div

  and this is how I try to capture a click

  $.listen( 'click', '.clickable', function() {
    alert(Click!)

  });

  but it won't even fire any ideas why?


[jQuery] Selectable library problem

2008-08-19 Thread AnaLoop

I used selectable library to select items in my list but when my list
become bigger than 20 item, the selection process was very slow and
the time required to load the page was very long.
can any body help me with this issue?
If there is an update to this library or there is another library
better that this one.


[jQuery] Re: tabs pluggin how to load tab with external domain data

2008-08-19 Thread roundcrisis

Hi I found in UI.Jquery google groups that you can use an iframe to do
this
however i cant get to make it work

for a start i m sure i m adding the frame in the wrong place (just
after  $(#tabs   ul).tabs())
and i just append an iframe to the first tab (this doesnt look to
goood)

then i m trying to bind on click

$(a, thetabs).bind(click, function(event){
var currentTabNumber = $
(thetabs).data('selected.tabs');
document.getElementById('maincontent').src =
event.target.href;

});

here hte event.target.href is completely empty
however i can get the currentTabNumber any ideas?


also here while this is happening the title changes to loading wich is
wrong

Thanks for yr help
On Aug 19, 12:11 pm, roundcrisis [EMAIL PROTECTED] wrote:
 hi there

 I would like to load a tab with external domain data , 
 somethinghttp://www.google.comis this posible and how
 Thanks


[jQuery] cascade plugin targeted to $(this)

2008-08-19 Thread pervak

Hi all!

 I've tried to use cascade plugin from Mike Nichols and everything
goes fine until i need to adjust it for the several dropdowns.

[code]
td class=tdg id=a_g_s

div class=all_geo_select
div id=country_sel
Countrybr /
select name=country_id[]
option value=0Select the country/option
option value=1Austria/option
option value=2Bali/option
/select
/div

div id=resort_select
Resortbr /
select name=resort_id[]
option value=0Select resort/option
option value=4Bad Blumau/option
/select
/div

/div  !-- all geo 1 --

 div class=all_geo_select
div id=country_sel
Countrybr /
select name=country_id[]
option value=0Select the country/option
option value=1Austria/option
option value=2Bali/option
/select
/div

div id=resort_select
Resortbr /
select name=resort_id[]
option value=0Select resort/option
option value=4Bad Blumau/option
/select
/div

/div  !-- all geo 2 --
/td
[/code]

I need that each Country drop down affects only on it's Resort drop
down.

I write this code:

jQuery(document).ready(function() {
jQuery(td#a_g_s div.all_geo_select).each(function(i){

jQuery(div#kurort_select select,this).cascade(div#country_sel
select,{
ajax: {
url: 
'countries_ajax.js',
data: { 
myotherdata: jQuery(#ajax_header).html() }
},
template: 
commonTemplate,
match: commonMatch
});

}); // each
});

When I change the first div's Country it affects on both Resort drop
downs (but changing the second div's Country affects nothing!).

If I write

jQuery(div#kurort_select select,this).cascade(this,div#country_sel
select,{

It affects on each drop down but the options become empty.

Help please to say THIS to cascade plugin.


Thanks in advance, Alexander.


[jQuery] Event does not trigger after $(divasdfasdf/div).insertBefore($(this).parent());

2008-08-19 Thread Tahir

i have this problem when i call a function onClick after
insertBefore();

when i click a button it insert TEXT AREA, SEND BUTTON at right place.
and then at that i apply some functionality like ALERT(ABC);  at
that inserted BUTTON and it does not work.
Help me out of this ... plz soon.

* Code is OK if i does not put it in this snario. Only when i
dynamically insert some tage and apply an event to those it does not
work 


--  OK (it inserts at relevant position)
--

$(div#sec_news_comments_stats).click(function () {

$(div id='sec_news_comments'textarea name='comments' rows='7'
cols='70'/textareadiv id='add_comments'Save Comments/div/
div).insertBefore($(this).parent()).hide();
$(div#sec_news_comments).slideDown(slow);

}

- Problem ()   ---

$(div#add_comments).click(function(){
alert(Hello add_comments);// Some functionality but it 
did not
even gave alert.
});


[jQuery] Ajax request does not insert data after semi-colon...for CGI script,

2008-08-19 Thread SH

Hi there,

I m using latest jQuery 1.2.6 and when I try to use ; in my input
and  it does not read values/text after semi-colon.
e.g. I enter abcd;xyz in to input box and I do following:

var  VER = $.trim($(#boxing1).val());

alert(VER);
alert shows correct value

and when i send it through:
  $.ajax({
type: POST,
url: /cgi-bin/test.cgi,
data: validu=+VER,
 cache: false,
 timeout:1,


it gives me abcd thats all.

Looks like ajax is sending out semi colon less ur or something ...

Let me now if I confused anyone...!!

Tha


[jQuery] Problem in Handling Events after insertBefore()

2008-08-19 Thread Tahir

Hey guyes i have this problem when i call a function onClick after
insertBefore();

when i click a button it insert TEXT AREA, SEND BUTTON at right place.
and then at that i apply some functionality like ALERT(ABC);  at
that inserted BUTTON and it does not work.
Help me out of this ... plz soon.

* Code is OK if i does not put it in this snario. Only when i
dynamically insert some tage and apply an event to those it does not
work *


  OK (it inserts at
relevant position) 

$(div#sec_news_comments_stats).click(function () {

$(div id='sec_news_comments'textarea name='comments' rows='7'
cols='70'/textareainput type='hidden' id='newsid'
name='commentid_0[value=|id-|' value='' /div id='add_comments'Save
Comments/div/div).insertBefore($(this).parent()).hide();
$(div#sec_news_comments).slideDown(slow);

}

--
Problem ()  --

$(div#add_comments).click(function(){
alert(Hello add_comments);// Some functionality but it 
did not
even gave alert.
});


[jQuery] Re: Superfish Question

2008-08-19 Thread matheus

Hello Willie!!

I never used a superfish plugin, but I believe that is not so hard to
make a superfish *not* activate the drop-down,
You need to take a look in  the code javascript and the css of the
plugin...Delete or change part of the code...
Instead of hover use something like onclick...



On 19 ago, 02:24, Willie Krause [EMAIL PROTECTED] wrote:
 Hi All

 I use Superfish on a project as a menu system (and love it). I am a Java
 developer though and usually end up breaking ajax/javascript libraries when
 I try to make a customisation. My question is how easy / difficult would it
 be to make superfish *not* activate the drop-down part of the menu with a
 mouse event that hovers over it (default behaviour), but instead that it
 requires a mouse click? If it can be attempted by a non javascript coder
 (but who has done some js hacks in the past), could you please guide me in
 the right direction where to do this.

 Many thanks

 W


[jQuery] Re: An easy question: Selecting DOM nodes that doesn't have class active

2008-08-19 Thread Karl Swedberg


On Aug 19, 2008, at 8:09 AM, Giovanni Battista Lenoci wrote:



Hi, I have this code:

ul
li
 ul class=menu
 li.../li
/li
li
 ul class=menu active
 li.../li
/li
li
 ul class=menu
 li.../li
/li
/ul

I want to set css property display:none to all the elements that are
not active.

I'm looking at the doc on :not selector, I've tried:

$(':not(.active)').css({'display:none'});

But doesn't works... Where I'm doing wrong?



The selector looks fine. The .css() method is where you're having a  
problem. Try this instead:

$(':not(.active)').css({display: 'none'});

Note the use of quotation marks around the value only ('none'). You  
can put a separate set around the key ('display') as well, but you  
can't have a single set wrapping both key and value.


--Karl

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



[jQuery] Re: An easy question: Selecting DOM nodes that doesn't have class active

2008-08-19 Thread Giovanni Battista Lenoci


Karl Swedberg ha scritto:
The selector looks fine. The .css() method is where you're having a 
problem.


What a stupid error... I was focusing on the not selector and I didn't 
saw the css error.


Thank you :-)



--
gianiaz.net - web solutions
p.le bertacchi 66, 23100 sondrio (so) - italy
+39 347 7196482 



[jQuery] Re: Event does not trigger after $(divasdfasdf/div).insertBefore($(this).parent());

2008-08-19 Thread Olivier Percebois-Garve


have look at 
http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_Ajax_request.3F


Probably your code runs first $(div#add_comments).click( ... then it 
insert the new html. So when $(div#add_comments).click runs, there is 
nothing to be bound.

Then the new html is inserted and is not modified.

Olivier

Tahir wrote:

i have this problem when i call a function onClick after
insertBefore();

when i click a button it insert TEXT AREA, SEND BUTTON at right place.
and then at that i apply some functionality like ALERT(ABC);  at
that inserted BUTTON and it does not work.
Help me out of this ... plz soon.

* Code is OK if i does not put it in this snario. Only when i
dynamically insert some tage and apply an event to those it does not
work 


--  OK (it inserts at relevant position)
--

$(div#sec_news_comments_stats).click(function () {

$(div id='sec_news_comments'textarea name='comments' rows='7'
cols='70'/textareadiv id='add_comments'Save Comments/div/
div).insertBefore($(this).parent()).hide();
$(div#sec_news_comments).slideDown(slow);

}

- Problem ()   ---

$(div#add_comments).click(function(){
alert(Hello add_comments);// Some functionality but it 
did not
even gave alert.
});

  




[jQuery] [Validate] How to specify location for error message ?!

2008-08-19 Thread PanPan

Hi everyone, i'm having trouble with the jQuery Validate plugin. I
easily find how to validate my form, but i would like to specify
location for every error message the validate plug-in send. But i
don't find, i think it's withe the option errorPlacement but i don't
know how to use it exactly.

Here is my code :

$(document).ready(function(){
   $(#News).validate({
rules:
  {
TitleNews: {required: 
true,minLength:
10},
IntroNews: {required: 
false,minLength:
150},
ContentNews: {required:
true,minLength: 200},
TagsNews: {required: 
false,minLength: 5}
},
messages:
  {
TitleNews:
{   required: img src=\style/imgs/
action_stop.gif\ alt=\\ /Merci de rentrer un titreimg src=\style/
imgs/action_stop.gif\ alt=\\ /,
minlength: Votre titre 
doit contenir au
moins 10 caractères !
},
IntroNews: {minlength: L'intro 
doit
contenir au moins 150 caractères !},
ContentNews:
{ required: Merci de rentrer le
contenu de votre news !,
minlength: Le contenu 
de votre news
doit être au moins de 200 caractères !
},
TagsNews: {minlength: Le 
contenu des
tags doit être d'au moins 5 caractères !}
}
});
  });

And the HTML :

form action=toto.php method=POST name=News id=News
label for=TitleNewsTitre de la news*/label
input name=TitleNews class=required minlength=5 /
div id=TitleError/div
br /
labelBBCodebr /iPour l'intro./i/label
div class=BoxToolbar
div id=hautdroit/div
  div id=hautgauche/div
div id=contenu
?php AfficheToolbarBBCode(IntroNews) ;?
/div
br /
/div
label for=IntroNewsIntro de la news/label
textarea name=IntroNews id=IntroNews style=height:
150px;/textarea
div id=IntroErrorimg src=style/imgs/action_stop.gif
alt= /Intro Error !! img src=style/imgs/action_stop.gif alt= /
/div
br /
labelBBCodebr /iPour le contenu./i/label
div class=BoxToolbar
div id=hautdroit/div
  div id=hautgauche/div
div id=contenu
?php AfficheToolbarBBCode(ContentNews) ;?
/div
br /
/div
label for=ContentNewsContenu / suite de la news*/label
textarea name=ContentNews id=ContentNews/textarea
div id=ContentErrorimg src=style/imgs/action_stop.gif
alt= /Contenu Error !! img src=style/imgs/action_stop.gif
alt= //div
br /
label for=TagsTags/label
input name=TagsNews
div id=TagsErrorimg src=style/imgs/action_stop.gif
alt= /Tags Error !! img src=style/imgs/action_stop.gif alt= /
/div
Entrer un ou plusieurs tags, separé par une virgule. iLes
tags sont des mots-clés utilisés pour décrire votre news.
 Par exemple, si votre news contient des photos de plages
bretonnes, vous pouvez indiquer les tags suivants :
 photo, plage, Bretagne./i
br /
br /
div class=buttons
  a href=#img src=style/imgs/sauvegarde.jpg alt= /
Sauvegarder/a
/div
div class=LastSave
  Derniere sauvegarde le 11 Novembre 2008 à 18h30.
/div
br /
br /
div class=buttons
  button type=submit
img src=style/imgs/send.jpg alt= /Envoyer
  /button
/div
div class=buttons
  a href=#apercu onclick=Apercu();img src=style/imgs/
preview.jpg alt= /Apercu/a
/div
br /br /br /
  /form

Thanks 


[jQuery] Changing $ to other symbol

2008-08-19 Thread jbetts80

Good Morning, I am developing an application that use $ symbol. I have
tried to implement jQuery in my app and there are conflicts because
jQuery also use $. Can I change $ symbol in jQuery.

Thanks


[jQuery] Re: PNG support in IE7 while animating

2008-08-19 Thread Adam

Thanks for the info Karl. I continue to marvel at how much more simple
being a developer would be if we had only one browser to be concerned
with. (adds please download firefox link to site) :)

:::

On Aug 18, 5:15 pm, Karl Rudd [EMAIL PROTECTED] wrote:
 And just to follow up. Here's a previous post about it with a link to
 some more details:

  http://groups.google.com/group/jquery-dev/browse_thread/thread/1f693c...

 Karl Rudd

 On Tue, Aug 19, 2008 at 9:08 AM, Karl Rudd [EMAIL PROTECTED] wrote:
  From what I've heard it's a known problem with IE. You can have PNGs
  with alpha transparency in them, and you can have images that you use
  a filter (opacity in this case) on, but not both at the same time.

  Karl Rudd

  On Tue, Aug 19, 2008 at 1:17 AM, Adam [EMAIL PROTECTED] wrote:

  I have a current implementation of Jqueryfordesigners.com's tutorial
  on how to accomplish Panic's Coda site popup bubble. The background of
  the div that animates position and opacity from 0 to 1 is a PNG with
  alpha. Despite its support for PNG, the effect doesnt work in IE7- the
  full transparency is never loaded. The workaround was to load an
  alternative transparent GIF for IE 6 and 7, but Ive taken that out on
  this test link for sake of viewing the phenom. A poster on another
  board suggested that the animating function never stops processing, so
  that IE7 never loads the final alpha channel. Anyone have any ideas?

 http://viewwestaspen.com/test.html


[jQuery] JQuery form plugin not uploading files

2008-08-19 Thread [EMAIL PROTECTED]

Hello, this may be a stupid question, but im trying to make an upload
from a form with the form plugin (excelent btw), the form data is sent
to a DB through a php script. Here is the form:

form action=upload_contrib.php method=post enctype=multipart/
form-data id=form_contribs
div style=height:60px/div
span class=txtNombre de la imagen:/spanbr /
input name=img_uploader type=text class=large
id=img_uploader /
div id=separador10/div
span class=txtDescripcioacute;n:/spanbr /
textarea name=img_coment cols= rows=
id=img_coment/textarea
div id=separador10/div
div
  span class=txt style=float:left; width:100pxTu
nick:/span
  span class=txt style=float:left; width:100px;
padding-left:5pxTu correo:/span
div style=clear:both/div
input name=img_nick type=text class=short
id=img_nick /
input name=img_mail type=text class=short
id=img_mail style=padding-left:5px /
/div
div id=separador10/div
span class=txtBuscar imagen:/span
input name=img_name type=file /
input name=img_ip type=hidden id=img_ip
value=?php echo $ip; ? /
input name=img_host type=hidden id=img_host 
value=?
php echo $servidor; ? /
input name=img_gal type=hidden id=img_gal
value=?php echo $contribs_tipo; ? /
input name=uploadResponseType type=hidden
id=uploadResponseType value=html /
input type=hidden name=MAX_FILE_SIZE
value=10 /
div id=separador30/div
input name=enviar type=submit class=button
id=enviar_formcontribs value= /
/form

The php script that sends the data (upload_contrib.php):

cargar_contrib($_POST[img_uploader],$_POST[img_nick],
$_POST[img_coment],$_POST[img_mail],$_POST[img_gal],
$_POST[img_ip],$_POST[img_host]);
echo si;

The jquery script to process the form:

$('#form_contribs').ajaxForm({
beforeSubmit: function(a,f,o) {
o.dataType = $('#uploadResponseType')[0].value;
$('#uploadOutput').html('Submitting...');
},
success: function(data) {
var $out = $('#uploadOutput');
$out.html('Form success handler received: strong' +
typeof data + '/strong');
if (typeof data == 'object'  data.nodeType)
data = elementToString(data.documentElement, true);
else if (typeof data == 'object')
data = objToString(data);
$out.append('divpre'+ data +'/pre/div');
alert(data);
}
});

I'm sorrybut nothing happens, when I submit the form, the response
div shows this:

insert into x
(img_name,img_uploader,img_nick,img_coment,img_mail,img_gal,img_date_up,img_time_up,img_ip,img_host)
values ('','nombreq','nick','asdfa
afafaf','correo','2',NOW(),NOW(),'','')

but nothing from the file field, and of course, the data is writen to
the DB, but no file uploaded.

Please advise. Thanks.


[jQuery] Hide a drop down menu.

2008-08-19 Thread alex.cheshev

Hello.
I have a page. The page contains a link. When a user clicks the link a
drop-down menu showes. I want to hide the drop down menu when the user
clickes wherever else on the page. It has to work like select/. The
drop down menu is ul/. So I can not use blur event.
PS
It has to work the same as Gmail-Contacts-Groups (control element
working like select/).


[jQuery] modal window and framesets

2008-08-19 Thread ethodaddy

hi all,

does anyone know of a modal window that works across a frameset? just
tried thickbox and it doesn't seem to work. i dont get any errors
either which is strange so its difficult to try modify it.

thanks -- etho


[jQuery] Re: Event does not trigger after $(divasdfasdf/div).insertBefore($(this).parent());

2008-08-19 Thread Tahir

Thanks for your help and Interest.
I think it is not problem like time controlling.
because $(div#add_comments).click does not care of loading of
insertBefore();.
Actually I am clicking on a button which is inserted by insertBefore()
and then it perform onClick.
if you see this url: 
http://www.learningjquery.com/2008/03/working-with-events-part-1
you see the first example that once alert(); is performed ok.
and then it does not work but later in this tutorial the author
switch to another example and that
does not fall in my understanding... there are two ways of solving
this problem

1- Event Delegation
2-  Re-binding

How these two  will work  that i don't understand.
Any how you really help me to further explore these two.

Thx... if u can explain how to related any one with my setuation that
would be very nice
thx again ...


On Aug 19, 8:48 pm, Olivier Percebois-Garve [EMAIL PROTECTED]
wrote:
 have look 
 athttp://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_st...

 Probably your code runs first $(div#add_comments).click( ... then it
 insert the new html. So when $(div#add_comments).click runs, there is
 nothing to be bound.
 Then the new html is inserted and is not modified.

 Olivier

 Tahir wrote:
  i have this problem when i call a function onClick after
  insertBefore();

  when i click a button it insert TEXT AREA, SEND BUTTON at right place.
  and then at that i apply some functionality like ALERT(ABC);  at
  that inserted BUTTON and it does not work.
  Help me out of this ... plz soon.

  * Code is OK if i does not put it in this snario. Only when i
  dynamically insert some tage and apply an event to those it does not
  work 

  --  OK (it inserts at relevant position)
  --

  $(div#sec_news_comments_stats).click(function () {

 $(div id='sec_news_comments'textarea name='comments' rows='7'
  cols='70'/textareadiv id='add_comments'Save Comments/div/
  div).insertBefore($(this).parent()).hide();
 $(div#sec_news_comments).slideDown(slow);

 }

  - Problem ()   ---

  $(div#add_comments).click(function(){
 alert(Hello add_comments);// Some functionality but it did 
  not
  even gave alert.
 });


[jQuery] Problems with Form Plugin

2008-08-19 Thread Jim Davis
I have a form page here:

http://jimdavis.org/test/form1.php

and the page for the form post here:

http://jimdavis.org/test/comment.php

Data from the form is not getting written to the comment.php file.

At the moment comment.php is a completely empty file, no html head
body, etc. Tried it with all the tags but no change.

Also, comment.php is set to read and write on the server.

I'm using jQuery 1.2.6.

Any suggestions?

Jim
www.jimdavis.org


[jQuery] Re: eval to register jquery selector

2008-08-19 Thread [EMAIL PROTECTED]

hi mike,

it took really long to see my post. nearly 4hours...
you're totally right, with your assumption and i'm lovin your
approach.
i wanted to prevent using json thats why i used the two arrays. but
i'll change that.
the each function is exactly what i was looking for.

thank you very much 

On 19 Aug., 01:42, Michael Geary [EMAIL PROTECTED] wrote:
 Both your posts made it through. Sometimes there is a delay in posting them
 - I've seen it with my own messages too.

 You left out the definition of repShowIdH2. I assume it is another array
 that contains the IDs that you want to call .toggle() on, in a 1-to-1
 correspondence with the strings in repSelectorH2, is that right?

 Here's a cleaner way to do it.

 Never use parallel arrays: they are a nuisance to maintain and to code with.

 Instead, create a single array of objects, where each object has all the
 pieces of data that relate to each other.

 Suppose your two arrays are:

     var repSelectorH2 = [ 'firstText', 'secondText', 'thirdText' ];

     var repShowIdH2 = [ 'firstId', 'secondId', 'thirdId' ];

 Change that to:

     var targets = [
         { select:'firstText', show:'firstId' },
         { select:'secondText', show:'secondId' },
         { select:'thirdText', show:'thirdId' }
     ];

 Now, the code becomes very straightforward:

     function shortenToggle( selector, targets ) {
         $.each( targets, function( i, target ) {
             $( selector + '(' + target.select + ')' ).click( function() {
                 $( '#' + target.show ).toggle('fast');
             });
         });
     }

     $(function(){
         shortenToggle( 'h2:contains', targets );
     });

 -Mike



  From: [EMAIL PROTECTED]

  strange to say, i dont see my reply. if this reply is shown
  twice i appologize.

  i have to show you my modification, which describes my
  problem closely.

  repSelectorH2 = new Array(test, usage, Technical, individual);

  function shortenToggle(jSelector,Selector,showId){
     if (Selector.length != showId.length) {
             alert('numer not equal\n' + Selector.length +
  \n + showId.length);
     } else {
             for (var i=0; iSelector.length; i++) {
                     eval('\$(' + jSelector + '(\'' +  
  Selector[i] + '\')).click(function () { \$(' + showId[i] +
  ').toggle(fast); });')
                     }}}

  $(document).ready(function(){
  shortenToggle('h2:contains',repSelectorH2,repShowIdH2);
  });

  this code is working fine but smells a bit. here u can see
  how i iterate about the different divs.

  i look forwad to see your approaches,
   kind regards- Zitierten Text ausblenden -

 - Zitierten Text anzeigen -


[jQuery] Advanced DOM traversing using each() then group by same attribute.

2008-08-19 Thread amdman

 Start XML-

LINKSLIST
LINK Attribute=001|007
ID001/ID
CATEGORYID007/CATEGORYID
URLhttp://www.yahoo.com/URL
SHORTDESCRIPTIONThis is an external link to yahoo./
SHORTDESCRIPTION
DETAILS
LINK Attribute=EXTERNALExternal Links Category/LINK
LINK Attribute=SHOWTRUE/LINK
/DETAILS
/LINK
LINK Attribute=002|007
ID002/ID
CATEGORYID007/CATEGORYID
URLhttp://www.google.com/URL
SHORTDESCRIPTIONThis is an external link to google./
SHORTDESCRIPTION
DETAILS
LINK Attribute=EXTERNALExternal Links Category/LINK
LINK Attribute=SHOWTRUE/LINK
/DETAILS
/LINK
LINK Attribute=045|099
ID045/ID
CATEGORYID099/CATEGORYID
URLhttp://www.homepage.com/URL
SHORTDESCRIPTIONThis is an Internal link to our site./
SHORTDESCRIPTION
DETAILS
LINK Attribute=InternalInternal Links Category/LINK
LINK Attribute=SHOWTRUE/LINK
/DETAILS
/LINK
LINK Attribute=003|007
ID003/ID
CATEGORYID007/CATEGORYID
URLhttp://www.ask.com/URL
SHORTDESCRIPTIONThis is an external link to Ask.com./
SHORTDESCRIPTION
DETAILS
LINK Attribute=EXTERNALExternal Links Category/LINK
LINK Attribute=SHOWTRUE/LINK
/DETAILS
/LINK
/LINKSLIST

 End XML-

I am trying to perform some advanced DOM traversal by going into each
LINK (which will yield (4) results, 3 being external and 1 being
internal links) without any luck. I can get this with XSLT, but am
having an extremely difficult time with DOM and jQuery getting it
correctly, all categories come back repeated. Any help would be
greatly appreciated.

Anticipated results:

External Links Category
* http://www.yahoo.com - This is an external link to yahoo.
* http://www.google.com - This is an external link to google.
* http://www.ask.com – This is an external link to Ask.com.

Internal Links
* http://www.homepage.com - This is an Internal link to our site.


[jQuery] Re: An easy question: Selecting DOM nodes that doesn't have class active

2008-08-19 Thread Ryura

Also, .hide() does the same as setting the CSS to display:none.

On Aug 19, 10:24 am, Karl Swedberg [EMAIL PROTECTED] wrote:
 On Aug 19, 2008, at 8:09 AM, Giovanni Battista Lenoci wrote:





  Hi, I have this code:

  ul
  li
   ul class=menu
   li.../li
  /li
  li
   ul class=menu active
   li.../li
  /li
  li
   ul class=menu
   li.../li
  /li
  /ul

  I want to set css property display:none to all the elements that are
  not active.

  I'm looking at the doc on :not selector, I've tried:

  $(':not(.active)').css({'display:none'});

  But doesn't works... Where I'm doing wrong?

 The selector looks fine. The .css() method is where you're having a  
 problem. Try this instead:
 $(':not(.active)').css({display: 'none'});

 Note the use of quotation marks around the value only ('none'). You  
 can put a separate set around the key ('display') as well, but you  
 can't have a single set wrapping both key and value.

 --Karl
 
 Karl Swedbergwww.englishrules.comwww.learningjquery.com


[jQuery] Re: setTimeout($('#content').unblock(), 5000);

2008-08-19 Thread taotao

thanks a lot

On 8月16日, 下午8时11分, Karl Rudd [EMAIL PROTECTED] wrote:
 You want:

 setTimeout( function() { $('#content').unblock() }, 5000);

 See the following for a bit more about what is happening:

  http://docs.jquery.com/How_jQuery_Works#Callback_with_arguments

 Karl Rudd

 On Sat, Aug 16, 2008 at 4:48 PM, taotao [EMAIL PROTECTED] wrote:

  blockUI v2.08

  when I user :
  $('#content').block({
 message: 'h4span class=loading / wait.../h4',
 css: { border: '1px solid #816A3B',width:'80%'}
 });

  setTimeout($('#content').unblock(), 5000);

  firefox3.01 have a error : missing ] after element list

  what's the mistanke with my  code above?


[jQuery] Re: how to insert javascript code instead of text with .before() or anything else jQuery has?

2008-08-19 Thread Ryura

That should've worked. Can you provide a test-case page?

On Aug 19, 12:02 am, Cormac [EMAIL PROTECTED] wrote:
 Could you please tell me how to do it properly? I tried writing \/
 script, but it didn't work.

 Thanks!

 On Aug 19, 4:38 am,Ryura[EMAIL PROTECTED] wrote:

  .before('google code here')

  You'll want to escape any /script's.

  On Aug 18, 6:49 pm, Cormac [EMAIL PROTECTED] wrote:

   Hello everyone,

   I'm new to jQuery (and to programming, as a matter of fact). Still, I
   have this task: find a certain element on an html page and insert a
   google ad before it (or just anywhere nearby). I have no problems
   finding the necessary element, but I just cannot understand how to
   insert any piece of code nearby it. All I can insert is usual text.

   For a few hours I tried using .before(), getScript(/script.js),
   before ( eval(google code here) ), .before(!--#include virtual='/
   script.js' --) and just everything I could understand more or less.
   Unfortunately, it doesn't work.

   I would be very grateful, if anyone could tell me how to do this. I
   tried searching this group, but to no avail.
   Thanks in advance!


[jQuery] Re: load css dynamically

2008-08-19 Thread Eugene

In a perfect world: yes.

My situation is as follows: only about 1% of my sites visitors would
use a feature that requires thickbox, so i load it's js and css only
on demand.


On Aug 11, 4:46 pm, Andy Horsman [EMAIL PROTECTED] wrote:
 Honestly I think a cleaner way of doing this is have the CSS styles outside
 the javascript code and then use addClass

 On Mon, Aug 11, 2008 at 9:58 AM, Mike Alsup [EMAIL PROTECTED] wrote:

   I am trying to load css dynamically to the document by jquery.
   It works in firefox fine, but not in IE.
   any idea?

   code:

   $(link).attr({rel:stylesheet,type:text/
   css,href:css_href,
   media:screen}).appendTo(document.getElementsByTagName(head)[0]);

  var head = document.getElementsByTagName('head')[0];
  $(document.createElement('link'))
     .attr({type: 'text/css', href: css_href, rel: 'stylesheet, media:
  'screen''})
     .appendTo(head);

  Note that this code assumes the presence of a head element.  Ideally
  you'd make this a bit more defensive and create that element if it
  doesn't exist.


[jQuery] Re: cascade plugin targeted to $(this)

2008-08-19 Thread Mike Nichols

what is div#kurort_select ?
I can't find that in your markup.


On Aug 19, 5:58 am, pervak [EMAIL PROTECTED] wrote:
 Hi all!

  I've tried to use cascade plugin from Mike Nichols and everything
 goes fine until i need to adjust it for the several dropdowns.

 [code]
 td class=tdg id=a_g_s

         div class=all_geo_select
             div id=country_sel
             Countrybr /
 select name=country_id[]
 option value=0Select the country/option
 option value=1Austria/option
 option value=2Bali/option
 /select
             /div

             div id=resort_select
             Resortbr /
 select name=resort_id[]
 option value=0Select resort/option
 option value=4Bad Blumau/option
 /select
                 /div

         /div    !-- all geo 1 --

  div class=all_geo_select
             div id=country_sel
             Countrybr /
 select name=country_id[]
 option value=0Select the country/option
 option value=1Austria/option
 option value=2Bali/option
 /select
             /div

             div id=resort_select
             Resortbr /
 select name=resort_id[]
 option value=0Select resort/option
 option value=4Bad Blumau/option
 /select
                 /div

         /div    !-- all geo 2 --
 /td
 [/code]

 I need that each Country drop down affects only on it's Resort drop
 down.

 I write this code:

 jQuery(document).ready(function() {
         jQuery(td#a_g_s div.all_geo_select).each(function(i){

         jQuery(div#kurort_select select,this).cascade(div#country_sel
 select,{
                                                         ajax: {
                                                                 url: 
 'countries_ajax.js',
                                                                 data: { 
 myotherdata: jQuery(#ajax_header).html() }
                                                         },
                                                         template: 
 commonTemplate,
                                                         match: commonMatch
                 });

     }); // each

 });

 When I change the first div's Country it affects on both Resort drop
 downs (but changing the second div's Country affects nothing!).

 If I write

 jQuery(div#kurort_select select,this).cascade(this,div#country_sel
 select,{

 It affects on each drop down but the options become empty.

 Help please to say THIS to cascade plugin.

 Thanks in advance, Alexander.


[jQuery] Show loading gif onclick, hide when iframe is loaded

2008-08-19 Thread hubbs

I know how to show a loading gif when a link is clicked, but is it
possible to know when the page is finished loading inside of an
iframe, so that I can then hide the loading gif?


[jQuery] jScrollPane plugin, how to keep it working with a link? HELP! :-)

2008-08-19 Thread ejpusa

hi,

A great plugin (jScrollPane), but I can't get one piece of it to work
- if I click on a link in the text, and want to jump within the div -
it just blows away the scroll bar.

example here:
http://www.utopiaparkway.com/scroll.html

(click on FOO, u jump to the correct place in the html, but the scroll
bar is gone), it's refresh issue for sure, but I just don't know how
to tackle it. Scollbar should match up with my position in the text.

http://www.utopiaparkway.com/scroll.html

PLUG IN docs:
http://www.kelvinluck.com/assets/jquery/jScrollPane/jScrollPane.html

thanks, ed p.  :-)



[jQuery] Re: tablesorter and parsers not defined error

2008-08-19 Thread Gregory Foster

I ran into this error when attempting to apply the tablesorter plugin
to an empty table, also with multiple tables on the page.  In my case,
I was able to work around this error by testing for the existence of
rows in the table before deciding whether or not to apply tablesorter
using jQuery's :has content filter
http://docs.jquery.com/Selectors/has#selector

$('#my_table_id:has(tbody tr)').tablesorter({
  widgetZebra: { css: ['custom_even', 'odd'] },
  sortList: [ [1, 1] ],
});

gf


[jQuery] [Announcement] Chain.js - Data Binding for jQuery

2008-08-19 Thread raid_ox

I am proud to release my recent work - Chain.js. It has been rewritten
several times, and now it has a very simple but powerful api.

Chain.js is a jQuery plugin, providing data-binding capability that
allows you to generate web contents automatically by binding your data
to html. Unlike other data-binding frameworks and library, it uses
pure DOM, instead of string-based innerHTML approach, so event binding
won’t gone during rendering. This library can also be very helpful if
you strictly separate your data from your HTML, e.g. developing using
MVC-Pattern. Although simple, it is actually powerful and can be very
useful for various projects.

For more information please visit the wiki here: 
http://github.com/raid-ox/chain.js/wikis

There are also some demos:http://github.com/raid-ox/chain.js/wikis/
demos

Article in my blog: 
http://rizqi.namaku.de/2008/08/data-binding-solution-for-jquery/

Any feedback and critics welcomed!

I hope it will be useful

Rizqi


[jQuery] event delegation in jQuery - delegate vs listen vs ?

2008-08-19 Thread rolfsf

I'm trying to get my head around the concept of event delegation, and
have been reading about jquery.listen and jquery.delegate and LowPro
for jQuery... and I'm a little confused as to the strengths and
weaknesses, or scope,  of each approach.

Can anyone offer some wise words on this topic?

How does one integrate a plugin like jqModal with one of these event
delegation plugins?

any thoughts are appreciated!




[jQuery] web mashups

2008-08-19 Thread Angel Marquez
could you recommend any good ones?


[jQuery] how to toggle text

2008-08-19 Thread elz64

Hello,


I begin  with jQuery so

looks like one toggle function is missing : how can be accomplished
the change of a text in a link , (and it's title or a alt text)
between to possible states :

ie:
I use this to hide/display a content div a linl and  this :

 $(#toggle-content).click(function(){
  $(#contenu).toggle();
  $(#toggle-content).toggleClass(ouvert);

this will add a class to the link #toggle-content to make it  when
closed (default) or .ouvert when opened.

BUT the link remains the same, and it's actually not very cool or
accessible to display something like read more when it's already
opened, and the text  should be now  click here to hide

Of course, dealing with toggleClass, it's possible to use a full
graphic background-image that tells the right stuff, but the title AND
the alt of the link must be change anyway.

any one had already done this ?
Thank you.


[jQuery] Get a request inside $.ajax()

2008-08-19 Thread Gewton Jhames
I with to open a page in the same browser window.
But it's only when a POST request return an error, link the sample below:
$.ajax({
type: POST,
url: /url/,
dataType: json,
data: data,
success: function() {
},
error: function() {
  $.get(www.google.com)
}
});

If an error happen, I don't want to load the response of www.google.com, I
want to really open in the browser's window.


[jQuery] slideToggle(speed) not working correctly in IE7 (7.0.6000.16711) on Vista

2008-08-19 Thread Ritz

Hi,

I am using the following script to slide toggle multiple div elements
in a page. It works fine in FF2 but behaves little strange in IE 7
version mentioned above.

Here is the script
script$('div[id^=upgradeConfigItem_]').each(function(i){$
(this).click(
function()
{$('#upgradeConfigItemToggleContent_' +
i).slideToggle('slow');
$('#upgradeConfigItem_' + i).toggleClass('expand');
$('#upgradeConfigItem_' + i).toggleClass('collapse');});
});/script


Here is corresponding HTML

.
form action=?wicket:interface=:
17:configTabbedPanel:tabs:content:panel0:upgradesForm::IFormSubmitListener::
method=post id=upgradesFormb4div style=display:noneinput
type=hidden name=upgradesFormb4_hf_0 id=upgradesFormb4_hf_0 //
div
input value=2207.0 type=hidden name=basePrice/
div
div class=headingCustomize collapse
id=upgradeConfigItem_0h4Epygi IP PBX Accessories upgrade/h4/
div

table width=100% cellpadding=0
class=TableHorizontalSmall marginBottom cellspacing=0
id=upgradeConfigItemToggleContent_0
tr
th width=4%/th
th width=78% class=alignLeft/th

th width=6%Qty/th
th width=12%Unit price/th
/tr
tr
tdinput value=radio17 type=radio
class=checkbox checked=checked name=upgradeConfigItem:
0:upgradeConfigOptionRadioGroup//td
td
a href=product/9205//?
wicket:pageMapName=popupPageMap target=popupPageMap onclick=var w
= window.open(href, 'popupPageMap',
'scrollbars=yes,location=no,menuBar=no,resizable=yes,status=no,toolbar=no,width=500,height=500');
if(w.blur) w.focus(); return false;
SanDisk Cruzer Micro - USB flash drive
- 128 MB
/a

/td
td align=right width=30
input value=25.0 type=hidden
name=upgradeConfigItem:
0:upgradeConfigOptionRadioGroup:upgradeConfigItemToggleContent:upgradeConfigOptionRow:
0:hUpgradeConfigOptionPrice id=optionPrice_16258/
/td
td nowrap=nowrap align=right$25.00/td
/trtr
tdinput value=radio18 type=radio
class=checkbox checked=checked name=upgradeConfigItem:
0:upgradeConfigOptionRadioGroup//td
td

a href=product/9206//?
wicket:pageMapName=popupPageMap target=popupPageMap onclick=var w
= window.open(href, 'popupPageMap',
'scrollbars=yes,location=no,menuBar=no,resizable=yes,status=no,toolbar=no,width=500,height=500');
if(w.blur) w.focus(); return false;
SanDisk Cruzer Micro - USB flash drive
- 256 MB
/a
/td
td align=right width=30
input value=39.0 type=hidden
name=upgradeConfigItem:
0:upgradeConfigOptionRadioGroup:upgradeConfigItemToggleContent:upgradeConfigOptionRow:
1:hUpgradeConfigOptionPrice id=optionPrice_16259/
/td
td nowrap=nowrap align=right$39.00/td
/trtr

tdinput value=radio19 type=radio
class=checkbox checked=checked name=upgradeConfigItem:
0:upgradeConfigOptionRadioGroup//td
td
a href=product/9207//?
wicket:pageMapName=popupPageMap target=popupPageMap onclick=var w
= window.open(href, 'popupPageMap',
'scrollbars=yes,location=no,menuBar=no,resizable=yes,status=no,toolbar=no,width=500,height=500');
if(w.blur) w.focus(); return false;
SanDisk Cruzer Micro - USB flash drive
- 512 MB
/a
/td
td align=right width=30
input value=59.0 type=hidden
name=upgradeConfigItem:
0:upgradeConfigOptionRadioGroup:upgradeConfigItemToggleContent:upgradeConfigOptionRow:
2:hUpgradeConfigOptionPrice id=optionPrice_16260/
/td

td nowrap=nowrap align=right$59.00/td
/trtr
tdinput value=radio20 type=radio
class=checkbox checked=checked name=upgradeConfigItem:
0:upgradeConfigOptionRadioGroup//td
td
a href=product/9208//?
wicket:pageMapName=popupPageMap target=popupPageMap onclick=var w
= window.open(href, 'popupPageMap',
'scrollbars=yes,location=no,menuBar=no,resizable=yes,status=no,toolbar=no,width=500,height=500');
if(w.blur) w.focus(); return false;
SanDisk Cruzer Micro - USB flash drive
- 1024 MB
/a
/td
td align=right width=30

input 

[jQuery] Selecting unusual CSS identifiers

2008-08-19 Thread Keith Hughitt

Hey all,

Does anyone know if it possible to select elements with id's or
classname's that include colons or other similar characters? So far I
haven't found any evidence that :: is not valid as part of a CSS
identifier, but have been unable to select elements with a class
first::second.

Any ideas?

Thanks,
Keith


[jQuery] Re: Selecting unusual CSS identifiers

2008-08-19 Thread Michael Geary

Use two backslashes before each special character.

A backslash in a jQuery selector escapes the next character. But you need
two of them because backslash is also the escape character for JavaScript
strings. The first backslash escapes the second one, giving you one actual
backslash in your string - which then escapes the next character for jQuery.

$('.first\\:\\:second')

The rules for jQuery may be slightly different than CSS, but the double
backslash should do the trick.

-Mike

 From: Keith Hughitt
 
 Does anyone know if it possible to select elements with id's 
 or classname's that include colons or other similar 
 characters? So far I haven't found any evidence that :: is 
 not valid as part of a CSS identifier, but have been unable 
 to select elements with a class first::second.
 
 Any ideas?
 
 Thanks,
 Keith



[jQuery] Re: Get a request inside $.ajax()

2008-08-19 Thread Michael Geary
You don't need jQuery for that, you can use 1995-style JavaScript!
 
error: function() {
window.location = 'http://www.google.com/';
}
 
Be sure to use the full URL including http:// as shown here.
 
-Mike


  _  

From: Gewton Jhames

I with to open a page in the same browser window.
But it's only when a POST request return an error, link the sample below:
$.ajax({
type: POST,
url: /url/,
dataType: json,
data: data,
success: function() {
},
error: function() {
  $.get(www.google.com)
}
});

If an error happen, I don't want to load the response of www.google.com, I
want to really open in the browser's window.




[jQuery] Re: event delegation in jQuery - delegate vs listen vs ?

2008-08-19 Thread Michael Geary

If you really want to understand event delegation, you may want to just look
at the raw code to implement it instead of a plugin. That way you can see
how it actually works.

It's really quite simple: You attach an event handler to some common parent
element, and then check event.target on the incoming events to decide what
to do with them.

Here's an example. Suppose you have a thousand a elements on your page,
and you want to intercept all clicks on them. You also want to intercept
clicks on any other elements that have a clickme class and do something
different with them - and you have a thousand of these too.

You could do that easily with this jQuery code:

$(function() {
$('a').click( function() {
alert( 'Clicked A' );
return false;  // suppress standard click behavior
});
$('.clickme').click( function() {
alert( 'Clicked CLICKME' );
});
});

That's short and simple... But behind the scenes it will install two
thousand event handlers!

Instead of that, you can do this:

$(function() {
$('body').click( function( event ) {
var $target = $(event.target);
if( $target.is('a') ) {
alert( 'Clicked A' );
return false;  // suppress standard click behavior
}
if( $target.is('.clickme') ) {
alert( 'Clicked CLICKME' );
}
});
});

Now you're only installing *one* event handler instead of two thousand.

That's really all there is to event delegation. You don't have to use
$target.is(...) - you can write any code you wish to distinguish among the
different elements. The DOM element that triggered the event is in
event.target.

The event delegation plugins make it even simpler to write this code, of
course.

-Mike

 I'm trying to get my head around the concept of event 
 delegation, and have been reading about jquery.listen and 
 jquery.delegate and LowPro for jQuery... and I'm a little 
 confused as to the strengths and weaknesses, or scope,  of 
 each approach.
 
 Can anyone offer some wise words on this topic?
 
 How does one integrate a plugin like jqModal with one of 
 these event delegation plugins?
 
 any thoughts are appreciated!



[jQuery] Re: event delegation in jQuery - delegate vs listen vs ?

2008-08-19 Thread rolfsf

Thanks Mike,

I guess what I'm wrestling with, is what advantages the plugins offer
(I'm not that adept at javascript, but I'm hoping to 'sell' the
concept to others who are more adept at it). We have some big data
tables with lots of clicks, sometimes expanding rows, sometimes hovers
or clueTips, and sometimes the clicks will trigger a jqModal-
controlled window (hence my interest in how to work with jqModal in
this event delegation scenario).

I agree - the concept is brilliantly simple - and maybe that's what
makes me nervous :-)





On Aug 19, 2:10 pm, Michael Geary [EMAIL PROTECTED] wrote:
 If you really want to understand event delegation, you may want to just look
 at the raw code to implement it instead of a plugin. That way you can see
 how it actually works.

 It's really quite simple: You attach an event handler to some common parent
 element, and then check event.target on the incoming events to decide what
 to do with them.

 Here's an example. Suppose you have a thousand a elements on your page,
 and you want to intercept all clicks on them. You also want to intercept
 clicks on any other elements that have a clickme class and do something
 different with them - and you have a thousand of these too.

 You could do that easily with this jQuery code:

     $(function() {
         $('a').click( function() {
             alert( 'Clicked A' );
             return false;  // suppress standard click behavior
         });
         $('.clickme').click( function() {
             alert( 'Clicked CLICKME' );
         });
     });

 That's short and simple... But behind the scenes it will install two
 thousand event handlers!

 Instead of that, you can do this:

     $(function() {
         $('body').click( function( event ) {
             var $target = $(event.target);
             if( $target.is('a') ) {
                 alert( 'Clicked A' );
                 return false;  // suppress standard click behavior
             }
             if( $target.is('.clickme') ) {
                 alert( 'Clicked CLICKME' );
             }
         });
     });

 Now you're only installing *one* event handler instead of two thousand.

 That's really all there is to event delegation. You don't have to use
 $target.is(...) - you can write any code you wish to distinguish among the
 different elements. The DOM element that triggered the event is in
 event.target.

 The event delegation plugins make it even simpler to write this code, of
 course.

 -Mike

  I'm trying to get my head around the concept of event
  delegation, and have been reading about jquery.listen and
  jquery.delegate and LowPro for jQuery... and I'm a little
  confused as to the strengths and weaknesses, or scope,  of
  each approach.

  Can anyone offer some wise words on this topic?

  How does one integrate a plugin like jqModal with one of
  these event delegation plugins?

  any thoughts are appreciated!


[jQuery] Re: event delegation in jQuery - delegate vs listen vs ?

2008-08-19 Thread Michael Geary

There's really nothing to integrate if you want to use code like this with
jqModal.

Suppose you have a conventional .click() handler that wants to show a
jqModal dialog. You might do that with:

$('#dialog').jqmShow();

That same code will work in *any* event handler, or in any JavaScript at
all. It makes no difference if you got into the event handler with a
conventional event handler, or with event delegation, or even with an
onclick=... in the HTML code. They are all the same for these purposes:
you are just running JavaScript code and can do whatever you want in it.
Wherever you see an alert() in the sample code below, that could be your
.jqmShow().

That part of the code would also be identical if you use one of the event
delegation plugin. It all works the same regardless.

-Mike

 From: rolfsf
 
 Thanks Mike,
 
 I guess what I'm wrestling with, is what advantages the 
 plugins offer (I'm not that adept at javascript, but I'm 
 hoping to 'sell' the concept to others who are more adept at 
 it). We have some big data tables with lots of clicks, 
 sometimes expanding rows, sometimes hovers or clueTips, and 
 sometimes the clicks will trigger a jqModal- controlled 
 window (hence my interest in how to work with jqModal in this 
 event delegation scenario).
 
 I agree - the concept is brilliantly simple - and maybe 
 that's what makes me nervous :-)

 On Aug 19, 2:10 pm, Michael Geary [EMAIL PROTECTED] wrote:
  If you really want to understand event delegation, you may want to 
  just look at the raw code to implement it instead of a plugin. That 
  way you can see how it actually works.
 
  It's really quite simple: You attach an event handler to 
  some common 
  parent element, and then check event.target on the incoming 
  events to 
  decide what to do with them.
 
  Here's an example. Suppose you have a thousand a elements on your 
  page, and you want to intercept all clicks on them. You 
  also want to 
  intercept clicks on any other elements that have a 
  clickme class and 
  do something different with them - and you have a thousand 
  of these too.
 
  You could do that easily with this jQuery code:
 
      $(function() {
          $('a').click( function() {
              alert( 'Clicked A' );
              return false;  // suppress standard click behavior
          });
          $('.clickme').click( function() {
              alert( 'Clicked CLICKME' );
          });
      });
 
  That's short and simple... But behind the scenes it will 
  install two thousand event handlers!
 
  Instead of that, you can do this:
 
      $(function() {
          $('body').click( function( event ) {
              var $target = $(event.target);
              if( $target.is('a') ) {
                  alert( 'Clicked A' );
                  return false;  // suppress standard click behavior
              }
              if( $target.is('.clickme') ) {
                  alert( 'Clicked CLICKME' );
              }
          });
      });
 
  Now you're only installing *one* event handler instead of 
  two thousand.
 
  That's really all there is to event delegation. You don't 
  have to use
  $target.is(...) - you can write any code you wish to 
  distinguish among 
  the different elements. The DOM element that triggered the 
  event is in event.target.
 
  The event delegation plugins make it even simpler to write 
  this code, of course.
 
  -Mike
 
   I'm trying to get my head around the concept of event delegation, 
   and have been reading about jquery.listen and jquery.delegate and 
   LowPro for jQuery... and I'm a little confused as to the 
 strengths 
   and weaknesses, or scope,  of each approach.
 
   Can anyone offer some wise words on this topic?
 
   How does one integrate a plugin like jqModal with one of 
 these event 
   delegation plugins?
 
   any thoughts are appreciated!
 



[jQuery] Re: Create Classes using jQuery

2008-08-19 Thread Karl Rudd

The jQuery library isn't class based (not in the C++/Java/etc style
at least), so it doesn't provide class construction functions. From
my experience, most of the time classes are not needed in JavaScript.

That doesn't stop you using your favourite classes for JavaScript
library. If you don't know of any you might take a look at
http://dean.edwards.name/weblog/2007/12/base2-intro/

Karl Rudd

On Tue, Aug 19, 2008 at 7:00 PM, Stefan Sturm
[EMAIL PROTECTED] wrote:

 Hello,

 I used Prototype so long. But I switched to jQuery. But now I have a
 Question about creating classes.
 With prototype I can use Class.create to create a new Class.
 Is there a way in jQuery to do this? Or do I need the old JavaScript
 syntax to create my classes?

 Thanks for your help,
 Stefan Sturm



[jQuery] Adding text with Images in Jcarousel

2008-08-19 Thread Nizar

I am trying to add text underneath an image so they are both
scrollable and was wondering if that is even possible and if so can
someone provide help on this.

eg.

pic pic
[txt]   [txt]


[jQuery] Re: Regarding jquery auto complete results

2008-08-19 Thread mmzaman

Hi,

Could you have a look at this for me please?

http://groups.google.com.au/group/jquery-en/browse_thread/thread/7d78bb3f9c667b3f/858f514d566cc5e1?lnk=gstq=autocomplete#858f514d566cc5e1

Cheers,
Moin

On Aug 19, 11:55 pm, Jörn Zaefferer [EMAIL PROTECTED]
wrote:
 Documentation forautocompleteoptions are here, including the width
 option:http://docs.jquery.com/Plugins/Autocomplete/autocomplete#toptions

 Jörn

 On Tue, Aug 19, 2008 at 12:44 PM, babu A [EMAIL PROTECTED] wrote:

  iam facing a problem in increasing the width of theautocomplete
  results, i tried in changing the css also but i can't change that
  and also I would like to change the structure of theautocomplete
  results is this possible


[jQuery] Easy typewriter plugin, need some help with scope

2008-08-19 Thread DanDan

Here's my code.  The plugin should take the text from a container,
erase the container, then print out the text one character at a time
in a typewriter fashion.  The problem is that setInterval() seems to
think that addText() is undefined, because setInterval() runs at the
'window' scope level.  I had this function running fine as a normal
program, but I'm unclear on how to convert it over to the plugin
format and solve the scope issue.  thanks in advance.

jQuery.fn.typewriter = function(speed) {
return this.each(function(){

var contents = jQuery(this).html();
var count = 1;

if(contents){
jQuery(this).html();

var interval = setInterval(addText(), speed);
}

function addText(){

jQuery(this).html(contents.substr(0, count));

count++;

if(count  contents.length){
clearInterval(interval);
}
}

});
};


[jQuery] Seat reservation using jquery

2008-08-19 Thread Pankaj

Hi,

I am working on an application where I need to book online seats. For
that i need to first populate my page with the seat info (ie: how many
seats are vacant, how many are booked, how many are at special
prices). This needs to be done dynamically as it will change on the
fly according to the database.

can someone please help me with this??

Its very urgent. Will be really grateful.. Thanks :)


[jQuery] Can I have multiple $(document).ready() calls in a single page?

2008-08-19 Thread Matt Wilson

I've got a bunch of form widgets (these are server-side widgets) and a
lot of them depend on some various jQuery javascript tricks.

I would like to be able to do something like this:

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

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

Is this dangerous?  It will make my server-side much simpler.


[jQuery] order of arguments reversed on $.map callback function

2008-08-19 Thread moester

The argument order of the $.map  callback function seems to be
reversed depending on how $.map is used.

 arr = ['a','b','c']
[a, b, c]

 $.map(arr,function(n,i){return [n,i]})
[a, 0, b, 1, c, 2]--
according to docs

 $(arr).map(function(n,i){return [n,i]}).get()
[0, a, 1, b, 2, c]--
reverse of docs!!


I realize in the second case one could use 'this' to get the value and
just use one argument for the index, which is more consistent with
other chainable functions.  Perhaps this could be made clear in the
docs or with an example.


[jQuery] Tabs3, jumping to anchor within tab?

2008-08-19 Thread Micky Hulse

Hi,

Is it possible, and/or easy to anchor to an ID within a tab?

For example, let's say I have two tabs:

1. Entry (#entry-tab)
2. Comments (#comments-tab)

Using my browser, I can link to the comment page like so:

http://www.site.com/#comments-tab

How would I anchor to an ID/anchor within the comments tab?

Thanks!


[jQuery] GeTTing time and inserting Database

2008-08-19 Thread santral

hi,
there is a jquery plugin:
http://www.2meter3.de/jqPuzzle/jqPuzzle.zip

when you finished puzzle timer stops.
I want to get this time and insert into my database.

but How?


[jQuery] Re: how to toggle text

2008-08-19 Thread FrenchiINLA

have you tried just $(#toggle-content).toggle(); it shows and hide
toggle-content div. otherwise for more option you can use
$(#toggle-content).toggle(function1(){},function2(){}); where
function1 will run when first clicked and function2 the second time.

On Aug 19, 10:44 am, elz64 [EMAIL PROTECTED] wrote:
 Hello,

 I begin  with jQuery so

 looks like one toggle function is missing : how can be accomplished
 the change of a text in a link , (and it's title or a alt text)
 between to possible states :

 ie:
 I use this to hide/display a content div a linl and  this :

  $(#toggle-content).click(function(){
               $(#contenu).toggle();
               $(#toggle-content).toggleClass(ouvert);

 this will add a class to the link #toggle-content to make it  when
 closed (default) or .ouvert when opened.

 BUT the link remains the same, and it's actually not very cool or
 accessible to display something like read more when it's already
 opened, and the text  should be now  click here to hide

 Of course, dealing with toggleClass, it's possible to use a full
 graphic background-image that tells the right stuff, but the title AND
 the alt of the link must be change anyway.

 any one had already done this ?
 Thank you.


[jQuery] Re: how to toggle text

2008-08-19 Thread DanDan

I think this is what you're looking for:  http://docs.jquery.com/Attributes/attr

you can stick something like this in the toggle function:

$(#morelink).attr({
href: www.google.com,
alt: Link to Google
});


On Aug 19, 12:44 pm, elz64 [EMAIL PROTECTED] wrote:
 Hello,

 I begin  with jQuery so

 looks like one toggle function is missing : how can be accomplished
 the change of a text in a link , (and it's title or a alt text)
 between to possible states :

 ie:
 I use this to hide/display a content div a linl and  this :

  $(#toggle-content).click(function(){
               $(#contenu).toggle();
               $(#toggle-content).toggleClass(ouvert);

 this will add a class to the link #toggle-content to make it  when
 closed (default) or .ouvert when opened.

 BUT the link remains the same, and it's actually not very cool or
 accessible to display something like read more when it's already
 opened, and the text  should be now  click here to hide

 Of course, dealing with toggleClass, it's possible to use a full
 graphic background-image that tells the right stuff, but the title AND
 the alt of the link must be change anyway.

 any one had already done this ?
 Thank you.


[jQuery] Re: Can I have multiple $(document).ready() calls in a single page?

2008-08-19 Thread Karl Rudd

It's not dangerous at all.

Karl Rudd

On Wed, Aug 20, 2008 at 11:58 AM, Matt Wilson [EMAIL PROTECTED] wrote:

 I've got a bunch of form widgets (these are server-side widgets) and a
 lot of them depend on some various jQuery javascript tricks.

 I would like to be able to do something like this:

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

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

 Is this dangerous?  It will make my server-side much simpler.



[jQuery] loading image for blockui on form submit

2008-08-19 Thread xxkylexx

Hey guys,
I am trying to use the blockui plugin in order to block a div that
contains my file uploader while the file is in the process of
uploading (form is being submitted).

I have successfully achieved this, however, I want to display a cool
little animated loading .gif in the blockui message, but am having
issues getting it to load, and animate in some browsers (ff and ie6).

I think the problem is that the image isn't getting enough time to
load or something before the submit begins. I am using a javascript
submit() to handle submitting the form, and then trigger the blockui.

You can see this working in action here (as well as view my source):
http://new.imagenerd.com/ . Just upload an image to see the issue I am
describing.

Thanks for any help.

-Kyle


[jQuery] loading image for blockui on form submit

2008-08-19 Thread xxkylexx

Hey guys,
I am trying to use the blockui plugin in order to block a div that
contains my file uploader while the file is in the process of
uploading (form is being submitted).

I have successfully achieved this, however, I want to display a cool
little animated loading .gif in the blockui message, but am having
issues getting it to load, and animate in some browsers (ff and ie6).

I think the problem is that the image isn't getting enough time to
load or something before the submit begins. I am using a javascript
submit() to handle submitting the form, and then trigger the blockui.

You can see this working in action here (as well as view my source):
http://new.imagenerd.com/ . Just upload an image to see the issue I am
describing.

Thanks for any help.

-Kyle


[jQuery] Re: order of arguments reversed on $.map callback function

2008-08-19 Thread Ariel Flesler

You have both jQuery.fn.map
   http://docs.jquery.com/Traversing/map

And jQuery.map
   http://docs.jquery.com/Utilities/jQuery.map

Both documented correctly.

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

On Aug 19, 5:51 pm, moester [EMAIL PROTECTED] wrote:
 The argument order of the $.map  callback function seems to be
 reversed depending on how $.map is used.

  arr = ['a','b','c']

 [a, b, c]

  $.map(arr,function(n,i){return [n,i]})

 [a, 0, b, 1, c, 2]                                    --
 according to docs

  $(arr).map(function(n,i){return [n,i]}).get()

 [0, a, 1, b, 2, c]                                    --
 reverse of docs!!

 I realize in the second case one could use 'this' to get the value and
 just use one argument for the index, which is more consistent with
 other chainable functions.  Perhaps this could be made clear in the
 docs or with an example.


[jQuery] Re: Easy typewriter plugin, need some help with scope

2008-08-19 Thread Karl Rudd

Scope in JavaScript can be a little unexpected. Variables (defined
using var) are scoped/exist within the functions they are defined in,
and any functions that are defined within that function. Since you're
using this functionality in other spots I think you understand that.

The setInterval (and setTimeout) functions can take a string, but as
you saw it it runs in the global window context, so you should
just pass in the function you want to run.

So you should write something like (untested):

jQuery.fn.typewriter = function(speed) {
   return this.each(function(){

   var elem = jQuery.this;
   var contents = elem.html();
   var count = 1;

   if(contents.length){
   elem.html();

   var interval = setInterval(addText, speed);
   }

   function addText(){

   elem.html(contents.substr(0, count));

   count++;

   if(count  contents.length){
   clearInterval(interval);
   }
   }

   });
};

Karl Rudd

On Wed, Aug 20, 2008 at 7:09 AM, DanDan [EMAIL PROTECTED] wrote:

 Here's my code.  The plugin should take the text from a container,
 erase the container, then print out the text one character at a time
 in a typewriter fashion.  The problem is that setInterval() seems to
 think that addText() is undefined, because setInterval() runs at the
 'window' scope level.  I had this function running fine as a normal
 program, but I'm unclear on how to convert it over to the plugin
 format and solve the scope issue.  thanks in advance.

 jQuery.fn.typewriter = function(speed) {
return this.each(function(){

var contents = jQuery(this).html();
var count = 1;

if(contents){
jQuery(this).html();

var interval = setInterval(addText(), speed);
}

function addText(){

jQuery(this).html(contents.substr(0, count));

count++;

if(count  contents.length){
clearInterval(interval);
}
}

});
 };



[jQuery] Re: order of arguments reversed on $.map callback function

2008-08-19 Thread Michael Geary

And one heck of an inconsistency, don't you think?

jQuery.each() and jQuery.map() don't pass the arguments to their callbacks
in the same order?! That's definitely a mistake.

Actually, the original order chosen for the arguments to the $(...).each()
and $.each() callbacks was unfortunate. callback(index,element) is
backwards. It's rare that you need the array index; what you want in almost
every situation is the array *element*.

The (new) native JavaScript [].forEach() and [].map() methods got it right:
their callbacks receive the arguments in this order:
callback(element,index,array).

The reason we ended up with callback(index,element) was simply that the
original jQuery code didn't have either of those arguments. It was simply
callback() with no arguments, and the array element in this. The index
argument got added later, and the element argument was added after that. The
order of arguments is simply a historical accident: it's the chronological
order in which the arguments were added to the code!

Why does it matter? Consider the following array:

var array = [
[ 'a', 'b' ],
[ 'c', 'd' ]
];

Now iterate over its elements (in both dimensions) using .forEach() and
$.each():

array.forEach( function( outer ) {
outer.forEach( function( inner ) {
console.log( inner );
});
});

$.each( array, function( i, outer ) {
$.each( outer, function( j, inner ) {
console.log( inner );
});
});

The $.each() version requires placeholder i and j arguments which the
.forEach() version does not require.

It's a small thing, but if you want to (wisely!) write jQuery quote that
uses explicit callback arguments instead of overusing this, you have to
throw in those extra arguments every time.

Moot point now, though, it's a done deal.

And given that it's a done deal, $.map() should have been consistent with
the other jQuery callbacks.

Oops... :-)

-Mike

 From: Ariel Flesler
 
 You have both jQuery.fn.map
http://docs.jquery.com/Traversing/map
 
 And jQuery.map
http://docs.jquery.com/Utilities/jQuery.map
 
 Both documented correctly.

 On Aug 19, 5:51 pm, moester [EMAIL PROTECTED] wrote:
  The argument order of the $.map  callback function seems to be 
  reversed depending on how $.map is used.
 
   arr = ['a','b','c']
 
  [a, b, c]
 
   $.map(arr,function(n,i){return [n,i]})
 
  [a, 0, b, 1, c, 2]                                    -- 
  according to docs
 
   $(arr).map(function(n,i){return [n,i]}).get()
 
  [0, a, 1, b, 2, c]                                    -- 
  reverse of docs!!
 
  I realize in the second case one could use 'this' to get 
  the value and just use one argument for the index,
  which is more consistent with other chainable functions.
  Perhaps this could be made clear in the docs or with an
  example.