[jQuery] Re: ask jquery upload progessbar

2010-01-27 Thread Thomas
To my knowledge, that's not possible to do with Javascript alone.

You would need to employ Flash for that. I believe FancyUpload is a
Flash plugin that might suit you. There are surely more, and possibly
better ones out there but this should give you a starting place for
your research.

On Jan 26, 5:00 pm, adi sembiring  wrote:
> Hi ..., I'm trying to search jquey upload with progess bar.
>
> Could you suggest me what plugin must I use ?
>
> Thanks
>
> --
> Adi Gunanta Sembiring
> Blog:http://adisembiring.wordpress.com
> YM: adisembir...@yahoo.com
> GTalk: adi.sembir...@gmail.com
> e-mail: sembiring@gmail.com
> Facebook: sembiring@gmail.com
> HP: +62 852 6892 4259


[jQuery] Re: plugin dev help

2010-01-14 Thread Thomas
When I started writing reusable plugins at work, I've read a couple of
tutorials first, but then found this one:


http://www.learningjquery.com/2007/10/a-plugin-development-pattern


All my plugins since then are based on that pattern, and I strongly
felt I've understood every little nuance of why the pattern was like
it was. For me, it really is *the* reference on best practices for
jquery plugin patterns.

The only line that is outdated on that 2+ year old article is the one
about how to include the metadata-plugin (which I strongly recommend).


Original in the article:
var o = $.meta ? $.extend({}, opts, $this.data()) : opts;

Updated line:
var o = $.metadata ? $.extend({}, opts, $this.metadata()) : opts;



On Jan 14, 4:14 pm, Amos King  wrote:
> I want to start making parts of my code into plugins, but I'm not sure of
> the best way to approach it.  If anyone has any ideas on how to make this a
> little better that would be great.
>
> http://gist.github.com/277243
>
> Thanks,
> Amos
>
> --
> Amos Kinghttp://dirtyInformation.comhttp://github.com/Adkron
> --
> Looking for something to do? Visithttp://ImThere.com


[jQuery] Re: private listeners for global triggers

2010-01-14 Thread Thomas Danemar
You can trigger a custom event on any object with trigger(). On the
global document object, for example:

$(document).trigger("myUpdateEvent");

and listen to it like so:

$(document).bind("myUpdateEvent", someFunction);


Fiddling around with the global document object is a bit icky, though.
Better to use a dedicated object that holds your custom events. To let
elements listen to events, you could create a small plugin that takes
a function to execute when the event triggers. Something like:

var eventHolder = {};

$.fn.bindToUpdate = function(f) {
$(eventHolder).bind("updateEvent", this, function(e) { f.call
(e.data); });
};

$(function() {
$("#someDiv").bindToUpdate(function() {
$(this).html("I was updated!");
});

$(eventHolder).trigger("updateEvent");
});

Is that what you wanted to do?

On Jan 14, 8:40 am, Tina S <0vcqn5...@gmail.com> wrote:
> would it be possible to setup a global event and connect objects to
> this event?
>
> for example, i have a global "update" event. it gets asynchronously
> triggered.
>
> i would like various elements to be able to listen for this one update
> event; this may be a particular div that wants to update itself based
> on this event, etc.
>
> is this possible?


[jQuery] Re: long-term browser support strategy

2010-01-12 Thread Thomas
Here's a post from John's blog in which he touches the topic of a
general strategy for browser support: 
http://ejohn.org/blog/the-browsers-of-2009/

He also briefly writes about it in his (latest?) book: 
http://www.manning.com/resig/

Finally, John's (and thus jQuery's) testing strategy is to test
against the previous, the current, and the upcoming (nightly build)
version of supported browsers. [citation needed] :p



P.S.: When I write 'John', it's probably really the whole team behind
jQuery that worked out those approaches.


On Jan 12, 12:41 pm, RobG  wrote:
> On Jan 12, 1:24 pm, Nathan Klatt  wrote:
>
> > > IE 6 use is 3 times that of Safari (all versions) depending on whose
> > > statistics you believe. Why not drop support for Safari while you're
> > > at it? And Opera and Chrome?
>
> > Because you don't have to do anything to support Safari or Chrome or
> > Opera
>
> There are at least 5 Safari-specific quirks catered for in jQuery (I
> just searched for Safari in comments), there are likely others.
> Admittedly that's far fewer than are required for IE, but since IE 6
> is now about 10 years old, surely it's quirks are well known and
> catered for?
>
> > - they actually work. To stop supporting them you'd have to stop
> > supporting standards.
>
> Browsers will continue to evolve. If appropriate feature detection is
> already in place and effective alternatives provided to handle quirks,
> you may find that you are handling some new quirks without having to
> write a single line of code. :-)
>
> For example, while the bit in jQuery that checks if the event.target
> is a textNode is meant for Safari (pre version 3 I think), it will
> work for any browser that has such behaviour. Safari's behaviour was
> actually compliant with the spec, the far more common behaviour (i.e.
> that event.target is always a nodeType 1) is not compliant.
>
> > >> I work with several clients that do
> > >> not want to "lead the way" in this respect, and need to support IE6 as
> > >> long as it has a fair usage share, which may be for several more
> > >> years.]
>
> > > That is a sensible decision
>
> > Anyone clinging to IE6, at this point, has gone wy beyond not
> > leading the way!
>
> If w3schools' statistics are at all accurate, there are about the same
> number of people using IE 6 as either IE 7 or 8.
>
> Of course "support" might mean whether new functionality is provided
> for old browsers and whether they continue to be part of a test suite.
> New functions that aren't tested in old browsers can simply be marked
> in the documentation, or simply "features add after version x.y have
> not been tested in browser X" so users know not to use them.
>
> --
> Rob


[jQuery] Re: Jquery Datepicker UI

2009-12-19 Thread Thomas
Oh, here's the link to the doc: 
http://jqueryui.com/demos/datepicker/#event-beforeShowDay

On Dec 18, 3:13 pm, Mauricio Vargas  wrote:
> Hi,
>
> I'm using the Datepicker that comes with the jQuery UI.
> I would like to keep some dates, in this calendar, checked.
> I'm bringing some dates in the format 12-31-2009 from my mySql, and i would
> like to put those dates in the datepicker, and show them selected.
> Do someone knows how to do this? or have an idea?
> if i didnt explained too well, i will be glad to try again.
>
> Thank you,
>
> Mauricio Vargas


[jQuery] Re: Jquery Datepicker UI

2009-12-19 Thread Thomas
Hi,

I think you want to write a handler for the event 'beforeShowDay'.

>From the documentation:

"
beforeShowDay

function(date)

The function takes a date as a parameter and must return an array with
[0] equal to true/false indicating whether or not this date is
selectable, [1] equal to a CSS class name(s) or '' for the default
presentation and [2] an optional popup tooltip for this date. It is
called for each day in the datepicker before is it displayed.

"

This means you can just check whether the day is one of your special
days in your list, and if it is, you set a custom class that you can
then style via CSS.


Hope that helps,

Thomas


On Dec 18, 3:13 pm, Mauricio Vargas  wrote:
> Hi,
>
> I'm using the Datepicker that comes with the jQuery UI.
> I would like to keep some dates, in this calendar, checked.
> I'm bringing some dates in the format 12-31-2009 from my mySql, and i would
> like to put those dates in the datepicker, and show them selected.
> Do someone knows how to do this? or have an idea?
> if i didnt explained too well, i will be glad to try again.
>
> Thank you,
>
> Mauricio Vargas


[jQuery] Jquery clone, doesn't clone

2009-11-29 Thread Thomas V
I'm using a plugin contextmenu and I want to be able to copy elements
that are dynamically created, but somehow it doesn't clone, it uses
the same element when I paste.

$.post("actions.php", { action: 'getCal', from: dFrom, to: dTo },
function(data){
cals = data.split(";;");
for(var i=0;i"+cal[1]+"");
}
$(".plan").draggable({
grid: [211,1],
containment: $("#days"),
opacity: 0.35
}).resizable({
handles: 's'
}).contextMenu({ menu: 'itemMenu' },
function(action, el, pos) {
if(action=='delete'){
el.remove();
}else if(action=='copy'){
copyEl = el.clone(true);
}else if(action=='cut'){
copyEl = el.clone(true);
el.remove();
}else if(action=='edit'){

}
}
);
});

As you see I append div elements to #center. and when someone right
clicks and presses copy the variabele gets the element but not a copy.
(it did work when the elements were not dynamically created).

this is the code that is executed when someone pastes the element,
also the css styles are not executed on the dynamically created
object.

$("#days .day").contextMenu({ menu: 'calMenu' },
function(action, el, pos) {
copyEl.css('position','absolute');
copyEl.css('top',pos.y+'px');
var y;
if(el.attr('title') == 'day1'){
y = 5;
}else if(el.attr('title') == 'day2'){
y = 216;
}else if(el.attr('title') == 'day3'){
y = 427;
}
copyEl.css('left',y+'px');
$("#center").append(copyEl);
copyEl = copyEl.clone(true);
ResetItems();
}
);

I hope someone can help. (I was unable to find how to put code tags
around my code, hope you don't mind.


[jQuery] Re: jquery toggle Ie7 problem

2009-11-26 Thread Thomas
The images are there, they're just for some reason moved to the left.
If you assign a margin-left of 50px to your first image, you'll see
that they are actually visible.

Seems to be a style issue (maybe IE-related), rather than a jquery
issue.

Additionally, your page throws a handful of validation errrors. While
I doubt that the errors on your page are responsible for this effect,
there's still a slight possibility that they are. Especially the one
missing closing  tag could be a problem.

They're all easy to fix, so that should be your first approach.



On Nov 25, 1:16 pm, Gkrusemann  wrote:
> someone?
>
> --
> View this message in 
> context:http://old.nabble.com/jquery-toggle-Ie7-problem-tp26481964s27240p2651...
> Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Adding a "close" link button button at the end of Autocomplete dropdown

2009-10-15 Thread Thomas

Hi,

I am using Jquery autocomplete dropdown, could you please help to add
a "close" link button at the end of the dropdown like the google
suggest ?

I am new to jquery,

Thanks in advance
Thomas


[jQuery] Re: (validate) How to activate validation on first blur?

2009-10-07 Thread Thomas

I believe I've found an acceptable solution that doesn't require
hacking the plugin itself.

I hope I haven't overlooked any unwanted side effects now.

I've instantiated validate like this now, essentially overwriting the
onfocusout handler:

$(myform)
.validate(
onfocusout:
function(element) {
if ( !this.checkable(element) ) {
this.element(element);
}
}
);

The original handler in the actual plugin code looks like this:
onfocusout: function(element) {
if ( !this.checkable(element) && (element.name in 
this.submitted
|| !this.optional(element)) ) {
this.element(element);
}
}


As I said, it seems to behave as required by my client now, but I'm
not entirely sure I've thought of all relevant test cases.



On Oct 7, 12:49 pm, Thomas  wrote:
> Hello!
>
> I'm using the validate plugin, and I am loving it.
>
> Unfortunately, my client would like to show validation errors on form
> fields on blur events every time, as opposed to showing them only if
> the user has previously entered something in the field at least once.
>
> Before I start hacking inside the plugin, I figured I could ask if
> there is an option that I'm just not seeing to enforce this behavior.
>
> Thanks for the help!


[jQuery] (validate) How to activate validation on first blur?

2009-10-07 Thread Thomas

Hello!

I'm using the validate plugin, and I am loving it.

Unfortunately, my client would like to show validation errors on form
fields on blur events every time, as opposed to showing them only if
the user has previously entered something in the field at least once.

Before I start hacking inside the plugin, I figured I could ask if
there is an option that I'm just not seeing to enforce this behavior.

Thanks for the help!


[jQuery] Re: Convert Jquery to Mootools

2009-07-21 Thread Thomas

Addendum:

jQuery also works without problems side-by-side with MooTools in
noConflict() mode.



On Jul 20, 9:56 am, Sebastien BRUNEL  wrote:
> Hi
> I have developped this function in jquery for a website, and i have to
> use it on another site which is using mootools. I've tried to convert
> it, but no way to make it works. So i ask for your help.
> The goal of this 2 function is to have a good view of my banner,
> without the gap of one or two pixel due to the resolution of users.
>
> Thanks you and sorry for my bad english.
>
> $(function (){
>         var pos = $("#page").get(0);
>         $("body").css("background","#727271 url(squelettes/images/
> axome_fond.gif) repeat-x "+pos.offsetLeft+"px 0");
>
> });
>
> $(window).bind('resize', function() {
>         var pos = $("#page").get(0);
>         $("body").css("background","#727271 url(squelettes/images/
> axome_fond.gif) repeat-x "+pos.offsetLeft+"px 0");
>
> });


[jQuery] Re: Convert Jquery to Mootools

2009-07-21 Thread Thomas

Salut, Sebastian.

See if this works. It's an accurate replication of your code in
MooTools-speak. Personally, I'd attempt a pure CSS solution for your
problem, but of course I don't know all the details on what you want
to achieve and in which context.

As I can't really test the code, it is provided 'as is'. ;) Remaining
bugs should be minor, though. Traditionally, the .getPosition()-method
might deliver slightly different results compared to the jQuery-
equivalent. I wasn't sure if offsetLeft was a native JS-property on an
element. If it is, you can replace the method call with the previous
access to offsetLeft.


MooTools code (should work with v1.2):

$(function (){
  var pos = $("page").getFirst();
  $$("body").setStyle("background","#727271 url(squelettes/images/
axome_fond.gif) repeat-x "+pos.getPosition().x+"px 0");
});

window.addEvent('resize', function() {
  var pos = $("page").getFirst();
  $$("body").setStyle("background","#727271 url(squelettes/images/
axome_fond.gif) repeat-x "+pos.getPosition().x+"px 0");
});



On Jul 20, 9:56 am, Sebastien BRUNEL  wrote:
> Hi
> I have developped this function in jquery for a website, and i have to
> use it on another site which is using mootools. I've tried to convert
> it, but no way to make it works. So i ask for your help.
> The goal of this 2 function is to have a good view of my banner,
> without the gap of one or two pixel due to the resolution of users.
>
> Thanks you and sorry for my bad english.
>
> $(function (){
>         var pos = $("#page").get(0);
>         $("body").css("background","#727271 url(squelettes/images/
> axome_fond.gif) repeat-x "+pos.offsetLeft+"px 0");
>
> });
>
> $(window).bind('resize', function() {
>         var pos = $("#page").get(0);
>         $("body").css("background","#727271 url(squelettes/images/
> axome_fond.gif) repeat-x "+pos.offsetLeft+"px 0");
>
> });


[jQuery] $.post callback broken in safari in new window.open()

2009-07-10 Thread Thomas Bircher

hello

I'm opening a new window with window.open()
In the new window a file is loaded with the following post data
function:

function ajaxPost(url,data){
$.post(url,data,
function(data){
alert(data)
});
, "json");
}

If I call this function form within the new window everything is fine
- If I call it from the opener window the callback function is broken
- only in safari - ff works fine.

any work around for this?

1000 thanks


[jQuery] Re: Ajax Tabs with accordion content...

2009-07-08 Thread Thomas

yes, thank you for your answer
i try something with jquery live function (like livequery i think)
this is my code :

$("#accordion").live("click", function(){
  $("#accordion").accordion({ header: "h3" , autoHeight: false });
});

but this doesn't work, my accordion after a click has still no
presentation
i put this :
alert( $(this).text() );
in the function to see if my accordion is well "selected" and it is...

why does my accordion isn't "reload" ??


Charlie a écrit :
> http://docs.jquery.com/Frequently_Asked_Questions#Why_doesn.27t_an_event_work_on_a_new_element_I.27ve_created.3F
>
> Thomas wrote:
> Hello, I use a jquery tabs with ajax (for loading a tab content) it
> works very well, but when ajax have to load an accordion, it doesn't
> work well (i loose the accordion presentation) i have maybe a clue :
> ajax doesn't load well also accent if their are not code like â
> (yes, i'm french) thanks


[jQuery] Problem with accordion in ajax Tabs

2009-07-07 Thread Thomas

Hello,
I use jquery Tabs with ajax for loading data
it works well
but when data is an accordion, there is no more presentation of the
accordion (like no css, or no js)
it's maybe nothing, but ajax has also a problem when data contain an
accent who is not code with á
anyway, if somebody has any idea for accordion with ajax tabs
or maybe you have an example who woks in this case
thanks


[jQuery] Ajax Tabs with accordion content...

2009-07-07 Thread Thomas

Hello,
I use a jquery tabs with ajax (for loading a tab content)
it works very well,
but when ajax have to load an accordion, it doesn't work well (i loose
the accordion presentation)
i have maybe a clue : ajax doesn't load well also accent if their are
not code like â
(yes, i'm french)
thanks


[jQuery] Re: hover + inside elements

2009-06-05 Thread Thomas Decrick


Is it possible to check if the mouse is hovering over a parent element ?


On 05 Jun 2009, at 02:15, Thomas wrote:


Hi,

I have a layout with 4 collumn divs. When the mouse hovers over each
collumn, a simple fadein is performed on another element.
Now what happens is, when i move over another element INSIDE a collumn
div (a  for instance), the same fadein runs again... Am I doing
something wrong with the selectors ?

Here's a piece of code:

$(document).ready(function() {

 var sectionSpeed = 250;

 $("#section-c").hover(
   function() {
 $("#icon-c").fadeIn(sectionSpeed);
   },
   function() {
 $("#icon-c").fadeOut(sectionSpeed);
   }
 );

});

html structure looks like this:

main log
mobileme log
flickr log
twitter log


   
   
   
   



Thank yous.




[jQuery] hover + inside elements

2009-06-05 Thread Thomas

Hi,

I have a layout with 4 collumn divs. When the mouse hovers over each
collumn, a simple fadein is performed on another element.
Now what happens is, when i move over another element INSIDE a collumn
div (a  for instance), the same fadein runs again... Am I doing
something wrong with the selectors ?

Here's a piece of code:

$(document).ready(function() {

  var sectionSpeed = 250;

  $("#section-c").hover(
function() {
  $("#icon-c").fadeIn(sectionSpeed);
},
function() {
  $("#icon-c").fadeOut(sectionSpeed);
}
  );

});

html structure looks like this:

main log
mobileme log
flickr log
twitter log


   
   
   
   



Thank yous.


[jQuery] Re: jQuery Cycle Plugin - Prev/Nex inside loop container

2009-06-04 Thread Thomas Arie Setiawan

2009/6/3 Arie :
>
> Hello,
>
> I tried to use Cycle Plugin, and it works great. I have the "Previous
> and Next" navigation work without any problem.
>
> This is the code I have:
>
> -
> 
> $(function() {
> $('#feat-container').cycle({
> prev:   '#prev',
> next:   '#next',
> timeout: 8000,  // milliseconds between slide transitions (0 to
> disable auto advance)
> speed: 2000,  // speed of the transition (any valid fx speed value)
> delay: 0
> });
> });
> 
>
> 
>
> 
> Aenean lacinia mi et odio scelerisque at ultricies tortor mattis.
> Nullam sit amet mauris velit, a tincidunt purus.
> 
>
> 
> Nam fringilla aliquam vehicula. Vivamus ultricies, lacus eget
> interdum rhoncus, ligula metus tempor arcu, eget volutpat nibh dolor
> eget ipsum.
> 
>
> 
> Pellentesque habitant morbi tristique senectus et netus et
> malesuada fames ac turpis egestas
> 
>
> 
>
> >
> -
>
> Now, how to have the previous and next inside the container? So, on
> each item, there should be a link to "next"/"prev" item?
>
> Thank you!
>
> regards,
>
> Arie

Sorry, I think I need to update my question.

>From what I've posted, I want to have something like this in the HTML.

--




Aenean lacinia mi et odio scelerisque at ultricies tortor mattis.
Nullam sit amet mauris velit, a tincidunt purus.




Nam fringilla aliquam vehicula. Vivamus ultricies, lacus eget
interdum rhoncus, ligula metus tempor arcu, eget volutpat nibh dolor
eget ipsum.




Pellentesque habitant morbi tristique senectus et netus et
malesuada fames ac turpis egestas







So, in every item, there are navigation to next and previous page. If
there are few things to modify in the script or HTML, which one?
Thank you...

regards,

Arie


[jQuery] Re: NS_ERROR_DOM_BAD_URI with javascript bookmarklet and local path

2009-06-04 Thread Thomas Jaggi

Sorry, in Windows XP it only works when visiting local HTML files. On
"real" websites I'm having the same problem.
But why is it working using any webserver to host the script? I
thought this was cross-domain all the same...


[jQuery] NS_ERROR_DOM_BAD_URI with javascript bookmarklet and local path

2009-06-04 Thread Thomas Jaggi

I wrote a script to show a grid overlay using a javascript
bookmarklet. Now OS X throws an error (NS_ERROR_DOM_BAD_URI) when I
try to load the script from a local path (file:///xy). Windows XP (in
Parallels) doesn't have this problem.
Loading it from a webserver works on OS X, too.

Is this related to WebKit and Gecko, to OSX or to something else?

Thanks,
Thomas


[jQuery] Re: jQuery & XML

2009-05-24 Thread Thomas

Ohhh, now that I've read the code you're using to grab the attribute
value...

In your alert(), try

alert(attribute["image"].text());

instead of

alert(attribute["Image"].text());

(note the lowercase i).


But the easiest solution (if it works) would be the direct selector
approach from my first answer.



On May 21, 6:34 pm, alex  wrote:
> OK, so now I have a new method of going about things and I'm so nearly
> there, but can't get it working. I'm using this piece of Javascript
> modified from a d'bug post
>
> http://itiz.in/12u7
>
> If I remove the "medium" from the mix, I get an alert box with all
> three image URLs, no spaces. If I add "medium" (which is the size I
> need) I get no response, and Safari's Web Inspector says "TypeError:
> Result of expression 'attribute["Image"]' [undefined] is not an
> object.". I just need to grab that medium image URL, but it's proving
> very hard!


[jQuery] Re: jQuery & XML

2009-05-24 Thread Thomas

If I understood correctly, all you still want to do is to find a way
to get the text of the  node that has the attribute "size" with
a value of "medium".


The straightforward jQuery selector for that would be:
"image[size=medium]"

So you were nearly there in your second post. Try:
var mediumUrl = $(this).find("image[size=medium]").text();

I'm not entirely sure that it will work on your XML, but if it
doesn't, I'm sure there's more we can try.


On May 21, 6:34 pm, alex  wrote:
> OK, so now I have a new method of going about things and I'm so nearly
> there, but can't get it working. I'm using this piece of Javascript
> modified from a d'bug post
>
> http://itiz.in/12u7
>
> If I remove the "medium" from the mix, I get an alert box with all
> three image URLs, no spaces. If I add "medium" (which is the size I
> need) I get no response, and Safari's Web Inspector says "TypeError:
> Result of expression 'attribute["Image"]' [undefined] is not an
> object.". I just need to grab that medium image URL, but it's proving
> very hard!


[jQuery] Re: update from 1.2.6 to 1.3.2 $('select') - strange!?

2009-05-20 Thread Thomas

I'm using v1.3.2 as well, and incidentally, I also happen to be using
the same selector pattern.

I get the SELECT element, just as expected.

My guess would be that a space snuck into your selector, like this: $
('select[name^="q_select_"]')

And I'd venture further and hypothesize that your options' names start
with "q_select_".

If that's not the case, we'd indeed need a proper test case where the
selector behaves unexpectedly.


On May 19, 4:33 pm, "asrij...@googlemail.com"
 wrote:
> Hi Guys,
>
> just started to upgrade my site jquery version to the latest, now I'm
> facing some strange behaviour.
> In 1.2.6 - $('select[name^="q_select_"]') - returns the select -
> object
> In 1.3.2 - $('select[name^="q_select_"]') - returns the options of the
> select !?
>
> Some1 else facing this problem?
>
> Regards


[jQuery] Re: json syntax question (ticket vs unticked names)

2009-05-08 Thread Thomas Matthijs

Both are valid javascript, but only one is valid json.
However many json parsers are leaniant in what they accept.

var moo = { foo: "bar" } // this is javascript, not json.
JSON.stringify(moo) should give '{ "foo": "bar" }' // this is json.

So if you are passing json to something, it needs to be quoted, if you
are providing a javascript snippet you can do whatever


[jQuery] Re: Conditional required fields

2009-05-01 Thread Thomas Allen

I fixed the problem. It was this method:

var autoHide = function() {
memberSections.find('.section').hideExtras(memberCount.val());
youngerSections.find('.section').hideExtras(youngerMemberCount.val
());
}

I changed it to:

var autoHide = function() {
if(!$('#memberless input').is(':checked')) {
memberSections.find('.section').hideExtras(memberCount.val());
}
if(!$('#younger-memberless input').is(':checked')) {
youngerSections.find('.section').hideExtras
(youngerMemberCount.val());
}
}

So that the field validators would not be added back when the
individual sections were excluded.

Thomas

On Apr 30, 2:16 pm, Thomas Allen  wrote:
> Thanks. I ended up using the classes add/remove style, and it works
> well. However, a method that should be called on every page load is
> not working properly. I am sure that it's being called (tested with
> the console), but the removeValidators() method doesn't seem to work
> properly.
>
> http://content.constructioninst.org/corporate_renewal.html
>
> On every page load, removeValidators will be called, which removes the
> "required" and "email" validation classes found within the jQuery
> object of the selector (first arg) if the caller's checkbox is
> checked. The problem is if, for example, I fill out the first section
> with its required fields, check the first box (which hides the bulk of
> the form), choose "Check" for payment, and submit. If I go back, while
> the hide/removeValidator method ("membersUnnecessary") is called and
> does indicate that the checkbox is checked (the same sections are
> hidden), I cannot re-submit the form: The validation classes are not
> removed.
>
> What can I do to fix this? I know that the code's a bit clumsy, but I
> can explain any specific parts if needed.
>
> Thanks,
> Thomas


[jQuery] Re: Conditional required fields

2009-04-30 Thread Thomas Allen

Thanks. I ended up using the classes add/remove style, and it works
well. However, a method that should be called on every page load is
not working properly. I am sure that it's being called (tested with
the console), but the removeValidators() method doesn't seem to work
properly.

http://content.constructioninst.org/corporate_renewal.html

On every page load, removeValidators will be called, which removes the
"required" and "email" validation classes found within the jQuery
object of the selector (first arg) if the caller's checkbox is
checked. The problem is if, for example, I fill out the first section
with its required fields, check the first box (which hides the bulk of
the form), choose "Check" for payment, and submit. If I go back, while
the hide/removeValidator method ("membersUnnecessary") is called and
does indicate that the checkbox is checked (the same sections are
hidden), I cannot re-submit the form: The validation classes are not
removed.

What can I do to fix this? I know that the code's a bit clumsy, but I
can explain any specific parts if needed.

Thanks,
Thomas


[jQuery] Re: Conditional required fields

2009-04-28 Thread Thomas Allen

And I'm not going out of my way to change the subject...I'm not sure
what's going on there.

Thomas

On Apr 28, 2:40 pm, Thomas Allen  wrote:
> > a custom method is used for the fields inside the Billing Address group
>
> What does this method do (or, better, what's it called so I can search
> the source)?
>
> Thanks,
> Thomas
>
> On Apr 28, 2:16 pm, Jörn Zaefferer 
> wrote:
>
> > One alternative approach can be found 
> > here:http://jquery.bassistance.de/validate/demo/marketo/step2.htm
>
> > Instead of adding and removing classes, a custom method is used for
> > the fields inside the Billing Address group. Whatever works for you...
>
> > Jörn
>
> > On Tue, Apr 28, 2009 at 7:20 PM, Thomas Allen  
> > wrote:
>
> > > I have a form with a flexible number of field sets on my form. I think
> > > it'll be easier to understand if you just fiddle around a bit here:
>
> > >http://content.constructioninst.org/corporate_renewal.html
>
> > > I want to make a handful of fields be required in each field set, but
> > > only fields in visible field sets should be required. I have a
> > > mechanism to check this; the toggler I created updates a hidden field
> > > when a set is added or removed (there is one such counter field for
> > > each expandable section, "Individual Members" and "Younger Members."
>
> > > Should I simply add the "required" class to the appropriate inputs in
> > > a field set when it's exposed, and remove them when hidden? Seems a
> > > little hackish, but maybe that's the best way.
>
> > > Also, if anybody has pointers for the script that's there, that would
> > > be nice :^) One thing that I still have to do is make the field set
> > > counts visible to the user, but that's more of a design question right
> > > now.
>
> > > Thanks,
> > > Thomas
>
>


[jQuery] Re: [validate] Conditional required fields

2009-04-28 Thread Thomas Allen

> a custom method is used for the fields inside the Billing Address group

What does this method do (or, better, what's it called so I can search
the source)?

Thanks,
Thomas

On Apr 28, 2:16 pm, Jörn Zaefferer 
wrote:
> One alternative approach can be found 
> here:http://jquery.bassistance.de/validate/demo/marketo/step2.htm
>
> Instead of adding and removing classes, a custom method is used for
> the fields inside the Billing Address group. Whatever works for you...
>
> Jörn
>
> On Tue, Apr 28, 2009 at 7:20 PM, Thomas Allen  wrote:
>
> > I have a form with a flexible number of field sets on my form. I think
> > it'll be easier to understand if you just fiddle around a bit here:
>
> >http://content.constructioninst.org/corporate_renewal.html
>
> > I want to make a handful of fields be required in each field set, but
> > only fields in visible field sets should be required. I have a
> > mechanism to check this; the toggler I created updates a hidden field
> > when a set is added or removed (there is one such counter field for
> > each expandable section, "Individual Members" and "Younger Members."
>
> > Should I simply add the "required" class to the appropriate inputs in
> > a field set when it's exposed, and remove them when hidden? Seems a
> > little hackish, but maybe that's the best way.
>
> > Also, if anybody has pointers for the script that's there, that would
> > be nice :^) One thing that I still have to do is make the field set
> > counts visible to the user, but that's more of a design question right
> > now.
>
> > Thanks,
> > Thomas
>
>


[jQuery] [validate] Conditional required fields

2009-04-28 Thread Thomas Allen

I have a form with a flexible number of field sets on my form. I think
it'll be easier to understand if you just fiddle around a bit here:

http://content.constructioninst.org/corporate_renewal.html

I want to make a handful of fields be required in each field set, but
only fields in visible field sets should be required. I have a
mechanism to check this; the toggler I created updates a hidden field
when a set is added or removed (there is one such counter field for
each expandable section, "Individual Members" and "Younger Members."

Should I simply add the "required" class to the appropriate inputs in
a field set when it's exposed, and remove them when hidden? Seems a
little hackish, but maybe that's the best way.

Also, if anybody has pointers for the script that's there, that would
be nice :^) One thing that I still have to do is make the field set
counts visible to the user, but that's more of a design question right
now.

Thanks,
Thomas


[jQuery] Re: Do object events persist in cloning? I can't get this method to work.

2009-04-27 Thread Thomas Allen

Yep, that did it, thanks. I had never heard of this before.

Thomas

On Apr 27, 10:13 am, Scott Sauyet  wrote:
> Thomas Allen wrote:
> > What I'm doing is creating a couple button objects and cloning them.
> >     $(memberSections).prepend(toggler.clone());
> >     $(youngerSections).prepend(toggler.clone());
> > });
>
> > Why is it that neither button logs to the console when clicked?
>
> You might try passing true to the clone method.  [1]  That copies event
> handlers as well.  I don't know if it will solve your problem, but it's
> worth a try.
>
> Cheers,
>
>    -- Scott
>
> [1]http://docs.jquery.com/Clone#clone.28.C2.A0bool_.29


[jQuery] Do object events persist in cloning? I can't get this method to work.

2009-04-27 Thread Thomas Allen

What I'm doing is creating a couple button objects and cloning them.
Here is my code:

$(document).ready(function() {
$.fn.addOne = function() {
return this; // This will do stuff once I get it it to be
called
}

$.fn.removeOne = function() {
return this; // as will this
}

var memberSections = $('form .member-sections');
var youngerSections = $('form .younger-sections');

var minus = $('')
.attr('href', 'javascript:;')
.addClass('minus')
.addClass('button')
.click(function() {
console.log('Hello');
// $(this).parent().parent().removeOne();
});

var plus = $('')
.attr('href', 'javascript:;')
.addClass('plus')
.addClass('button')
.click(function() {
console.log('Hello');
// $(this).parent().parent().addOne();
});

var toggler = $('')
.addClass('toggler')
.append(minus)
.append(plus);

    $(memberSections).prepend(toggler.clone());
$(youngerSections).prepend(toggler.clone());
});


Why is it that neither button logs to the console when clicked?

Thomas


[jQuery] Re: Plugin does not bind to jQuery object

2009-04-16 Thread Thomas Allen

That was it. jQuery was being loaded just before , so it was
overwriting the jQuery object loaded earlier (via the custom page). By
moving this to the top and deleting the extra script reference, I
fixed the problem. Thanks!

Thomas

On Apr 16, 12:37 am, Thomas Allen  wrote:
> This is possible, and makes sense. I'll take a look tomorrow (the main
> template for this site includes jQuery, and we include these scripts
> on forms, which is where things got mixed up).
>
> Thomas
>
> On Apr 15, 4:55 pm, Eric Garside  wrote:
>
> > Upon further inspection, I'm not quite sure what to make of your page.
> > Firebug's Net console reported the following includes in the following
> > order:
>
> > 1. jquery-1.3.2.js
> > 2. jquery.validate.min.js
> > 3. validate-common.js
> > 4. asce03.js
> > 5. validate.js
> > 6. jquery-1.2.6.js
> > 7. jquery-dropdown-menus.js
>
> > So, for one reason or another, you're including 2 different versions
> > of jQuery on the same page. I'm not sure if that's causing the issue,
> > but I can't imagine it's useful or efficient. I'd check into that as a
> > first-line of defense. Removing the older jQuery version might fix it?
>
> > On Apr 15, 4:44 pm, Thomas Allen  wrote:
>
> > > No, that's not it. The scripts are ordered:
>
> > > </
> > > script>
> > > <script src="/lib/javascript/jquery.validate.min.js" type="text/
> > > javascript">
>
> > > Which is why only one exception is thrown. If I flip the order of
> > > those two, two exceptions are thrown, one for the missing jQuery
> > > object, and another for the validate method.
>
> > > Ignore the reference to "validate.js" in the , that's not being
> > > used here.
>
> > > Thomas
>
> > > On Apr 15, 4:39 pm, Eric Garside  wrote:
>
> > > > It's the order of your includes. In the first page, you're including
> > > > the validation plugin before you're including jQuery. The result is
> > > > that, when validation attempts to enter itself into the jQuery
> > > > namespace, jQuery is "undefined", so it just dies within it's
> > > > enclosure.
>
> > > > On Apr 15, 4:30 pm, Thomas Allen  wrote:
>
> > > > > These two pages do the exact same thing: Apply some basic validation
> > > > > rules to a form. The only difference is that the first one includes
> > > > > the scripts in , not .
>
> > > > > 1.http://www.asce.org/freemembership/
> > > > > 2.http://content.asce.org/conferences/texasstudentdays/company_registra...
>
> > > > > The second one works, and the first doesn't. For some reason, the
> > > > > first site doesn't bind the validate method to jQuery.
>
> > > > > $.fn.validate()
>
> > > > > throws an exception in the console.
>
> > > > > What's going on, and how can I fix this problem? The file itself is
> > > > > definitely being loaded.
>
> > > > > Thanks,
> > > > > Thomas
>
>


[jQuery] Re: Plugin does not bind to jQuery object

2009-04-15 Thread Thomas Allen

This is possible, and makes sense. I'll take a look tomorrow (the main
template for this site includes jQuery, and we include these scripts
on forms, which is where things got mixed up).

Thomas

On Apr 15, 4:55 pm, Eric Garside  wrote:
> Upon further inspection, I'm not quite sure what to make of your page.
> Firebug's Net console reported the following includes in the following
> order:
>
> 1. jquery-1.3.2.js
> 2. jquery.validate.min.js
> 3. validate-common.js
> 4. asce03.js
> 5. validate.js
> 6. jquery-1.2.6.js
> 7. jquery-dropdown-menus.js
>
> So, for one reason or another, you're including 2 different versions
> of jQuery on the same page. I'm not sure if that's causing the issue,
> but I can't imagine it's useful or efficient. I'd check into that as a
> first-line of defense. Removing the older jQuery version might fix it?
>
> On Apr 15, 4:44 pm, Thomas Allen  wrote:
>
> > No, that's not it. The scripts are ordered:
>
> > </
> > script>
> > <script src="/lib/javascript/jquery.validate.min.js" type="text/
> > javascript">
>
> > Which is why only one exception is thrown. If I flip the order of
> > those two, two exceptions are thrown, one for the missing jQuery
> > object, and another for the validate method.
>
> > Ignore the reference to "validate.js" in the , that's not being
> > used here.
>
> > Thomas
>
> > On Apr 15, 4:39 pm, Eric Garside  wrote:
>
> > > It's the order of your includes. In the first page, you're including
> > > the validation plugin before you're including jQuery. The result is
> > > that, when validation attempts to enter itself into the jQuery
> > > namespace, jQuery is "undefined", so it just dies within it's
> > > enclosure.
>
> > > On Apr 15, 4:30 pm, Thomas Allen  wrote:
>
> > > > These two pages do the exact same thing: Apply some basic validation
> > > > rules to a form. The only difference is that the first one includes
> > > > the scripts in , not .
>
> > > > 1.http://www.asce.org/freemembership/
> > > > 2.http://content.asce.org/conferences/texasstudentdays/company_registra...
>
> > > > The second one works, and the first doesn't. For some reason, the
> > > > first site doesn't bind the validate method to jQuery.
>
> > > > $.fn.validate()
>
> > > > throws an exception in the console.
>
> > > > What's going on, and how can I fix this problem? The file itself is
> > > > definitely being loaded.
>
> > > > Thanks,
> > > > Thomas


[jQuery] Re: Plugin does not bind to jQuery object

2009-04-15 Thread Thomas Allen

No, that's not it. The scripts are ordered:




Which is why only one exception is thrown. If I flip the order of
those two, two exceptions are thrown, one for the missing jQuery
object, and another for the validate method.

Ignore the reference to "validate.js" in the , that's not being
used here.

Thomas

On Apr 15, 4:39 pm, Eric Garside  wrote:
> It's the order of your includes. In the first page, you're including
> the validation plugin before you're including jQuery. The result is
> that, when validation attempts to enter itself into the jQuery
> namespace, jQuery is "undefined", so it just dies within it's
> enclosure.
>
> On Apr 15, 4:30 pm, Thomas Allen  wrote:
>
> > These two pages do the exact same thing: Apply some basic validation
> > rules to a form. The only difference is that the first one includes
> > the scripts in , not .
>
> > 1.http://www.asce.org/freemembership/
> > 2.http://content.asce.org/conferences/texasstudentdays/company_registra...
>
> > The second one works, and the first doesn't. For some reason, the
> > first site doesn't bind the validate method to jQuery.
>
> > $.fn.validate()
>
> > throws an exception in the console.
>
> > What's going on, and how can I fix this problem? The file itself is
> > definitely being loaded.
>
> > Thanks,
> > Thomas
>
>


[jQuery] Plugin does not bind to jQuery object

2009-04-15 Thread Thomas Allen

These two pages do the exact same thing: Apply some basic validation
rules to a form. The only difference is that the first one includes
the scripts in , not .

1. http://www.asce.org/freemembership/
2. 
http://content.asce.org/conferences/texasstudentdays/company_registration.html

The second one works, and the first doesn't. For some reason, the
first site doesn't bind the validate method to jQuery.

$.fn.validate()

throws an exception in the console.

What's going on, and how can I fix this problem? The file itself is
definitely being loaded.

Thanks,
Thomas


[jQuery] Re: Getting index of clicked table cell

2009-04-14 Thread Thomas

Wow, you had me stumped for a couple of minutes there. :)

I think the .index() method doesn't do what you want it to do.

As I understand it, you use that method on a selection of elements,
pass it an element, and it will search for the element in that
selection.


So if you did

alert($('td', this).index(e.target));

it should return the index you're looking for.



On Apr 13, 8:16 pm, MorningZ  wrote:
> For the life of me i cannot figure out why this gives me "-1" (not
> found)
>
> $("#Table1 tr.SUM").click(function(e) {
>       alert($(this).index(e.target));
>
> });
>
> With "this" being the row, and "e.target" being the cell, shouldn't
> that work?


[jQuery] Re: jQuery SL - jQuery Silverlight Plugin Feedback

2009-04-11 Thread Thomas Creutz
Thomas Creutz schrieb:
> Jordon Bedwell schrieb:
>> I suggest you check out http://www.smoothhd.com/ before you start dogging
>> Silverlight.  Learn a little about things before you dogg them please.
> 
> haha, its not possible, I use Linux ... and Moonlight is not the right
> solution.

because: I have Moonlight installed and also cannot open the side - why
ppl not use java or flash? Its OFFICIAL supported on Win, Mac and Linux too.

Moonlight is not official, so u will have every time problems!

Thomas



signature.asc
Description: OpenPGP digital signature


[jQuery] Re: jQuery SL - jQuery Silverlight Plugin Feedback

2009-04-11 Thread Thomas Creutz
Jordon Bedwell schrieb:
> I suggest you check out http://www.smoothhd.com/ before you start dogging
> Silverlight.  Learn a little about things before you dogg them please.

haha, its not possible, I use Linux ... and Moonlight is not the right
solution.

> 
> -Original Message-
> From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
> Behalf Of Koistya `Navin
> Sent: Saturday, April 11, 2009 2:04 AM
> To: jQuery (English)
> Subject: [jQuery] Re: jQuery SL - jQuery Silverlight Plugin Feedback
> 
> 
> On 10 апр, 23:30, Thomas Creutz  wrote:
>> sorry, but who is using Silverlight? It is limited to Windows, and so it
>> cuts down more than 10 % of our visitors. Its again a good thing from M$
>> to get a monopoly..




signature.asc
Description: OpenPGP digital signature


[jQuery] Re: jQuery SL - jQuery Silverlight Plugin Feedback

2009-04-10 Thread Thomas Creutz

Koistya `Navin schrieb:
> I am working on "jQuery SL" plugin:
> Which helps with embedding Silverlight files into web pages and also

my 2 cent:

sorry, but who is using Silverlight? It is limited to Windows, and so it
cuts down more than 10 % of our visitors. Its again a good thing from M$
to get a monopoly..

Thomas



[jQuery] Re: Firefox bug on height

2009-04-10 Thread Thomas Creutz
Thomas Creutz schrieb:
> Main store schrieb:
>> You'll see the bottom of my page is too long.
>> I have tried to modify the CSS with some Height measurements but
>> nothing happen..
> 
> hi.. just remove the height from the body definition ;-)

oh.. Nathan is right.. the clear:both in ".footer .legality" is the
right solution - sorry

Thomas



signature.asc
Description: OpenPGP digital signature


[jQuery] Re: jQuery function to click a link on the page

2009-04-09 Thread Thomas Creutz
Thomas Creutz schrieb:
> CaptainABrad schrieb:
>> Stated simply, is there a way to either:
>> 1) Click a link on a page with jQuery, or
>> 2) Open a link in a new tab.
> 
> 2: window.open and target "_new" should work
> 
> http://www.mydigitallife.info/2006/10/08/launch-and-open-links-in-new-window-or-tab-with-_blank-or-_new-as-target-in-html-and-their-difference/
> 

some more docs about it ;-)

http://www.w3.org/TR/2004/WD-css3-hyperlinks-20040224/#the-target-new
http://www.w3schools.com/htmldom/met_win_open.asp

Thomas



signature.asc
Description: OpenPGP digital signature


[jQuery] Re: jQuery function to click a link on the page

2009-04-09 Thread Thomas Creutz
CaptainABrad schrieb:
> Stated simply, is there a way to either:
> 1) Click a link on a page with jQuery, or
> 2) Open a link in a new tab.

2: window.open and target "_new" should work

http://www.mydigitallife.info/2006/10/08/launch-and-open-links-in-new-window-or-tab-with-_blank-or-_new-as-target-in-html-and-their-difference/

Thomas





signature.asc
Description: OpenPGP digital signature


[jQuery] Re: Firefox bug on height

2009-04-09 Thread Thomas Creutz
Main store schrieb:

> I have a bug only on Firefox (IE and Safari OK),
> the carousel is here http://www.main-store.fr .
> 
> You'll see the bottom of my page is too long.
> I have tried to modify the CSS with some Height measurements but
> nothing happen..

hi.. just remove the height from the body definition ;-)

Thomas



signature.asc
Description: OpenPGP digital signature


[jQuery] Re: Is jquery safe ?

2009-04-09 Thread Thomas Allen

Oh, it gives you a virus...the virus of a clean API for the DOM.

Some people in comp.lang.javascript would argue that jQuery itself is
a virus, but they're a bit off-kilter.

Thomas

On Apr 9, 6:22 am, Devesh  wrote:
> Hi,
>
> I am using the latest version of jquery. I want to confirm that is
> there any type virus or trozan with the latest version of jquery. I
> have searched it on google a lot, but not able to find any exact
> answer. Please confirm me.
>
> Thanks
> Devesh M


[jQuery] Re: IE display issue

2009-04-09 Thread Thomas Allen

On Apr 9, 8:16 am, Tim  wrote:
> i am setting reducing a tbody height when the user clicks a row and
> then showing content below the table.  in IE7 when i show() or set
> display to block for the content below the table, IE resets the tbody
> height to the original size such that it overlaps my content.  i've
> put the code in to reset the height again, but it doesn't do anything
> at that point.  any ideas?

Can we see your code?

Thomas


[jQuery] Re: why i getting Error: form.ajaxSubmit is not a function

2009-04-09 Thread Thomas Allen

On Apr 9, 2:26 am, Hellofrom  wrote:
> I try to use Form plug in with Validaiton plug in
> i get the following error if firefox
> Error: form.ajaxSubmit is not a function
>
> can someone help me please

I'd like to. Could you please post your code that produces this error?

Thomas


[jQuery] Re: jQuery appendTo() in IE7 before ready() [qTip|BlockUI]

2009-04-09 Thread Thomas Creutz

Thomas Creutz schrieb:
I have strange problems with IE7 (older/newer version not tested, but I think, it is also 
present in IE6) and some plugins, that do a appendTo().



The Webpage stops loading and I get a warning which says:

Die Internetsite http://mypage.de/ kann nicht geöffnet werden.
Vorgang abgebrochen

Translated something like:
The Website http://mypage.de/ cannot be opened.
process canceled


no, the English translation is "Operation aborted"



And than I get not my Webpage displayed.. no I get a IE intern website, which tells me, 
that the page cannot be displayed.




I found more about this topic:

http://www.clientcide.com/code-snippets/manipulating-the-dom/ie-and-operation-aborted/
http://support.microsoft.com/default.aspx/kb/927917

They speak on the MS KB also from innerHTML. On IE8 the Bug is gone.. so a 
jQuery.support.NeedReadyDOM or something else is very useful..


Firefox and all other Browsers (Opera, Safari, Chrome, IE8) which I tested yesterday had 
no Problem with it.


greetings,
Thomas



signature.asc
Description: OpenPGP digital signature


[jQuery] Re: Terrible print styles in the docs

2009-04-08 Thread Thomas Allen

Sure, I'll do that.

Thomas

On Apr 8, 2:02 pm, Ralph Whitbeck  wrote:
> Thomas,
>
> You could submit a bug and if you want to help submit a patch to the bug and
> I am sure the team will consider it.
>
> Thanks,
> Ralph
>
> On Wed, Apr 8, 2009 at 1:50 PM, Thomas Allen  wrote:
>
> > Printed documentation includes many superfluous elements and cuts off
> > the right side of the page in certain browsers. I know CSS like the
> > back of my hand; is there something I can do to correct this? I'd be
> > happy to.
>
> >http://docs.jquery.com/skins/common/commonPrint.css- Missing quite a
> > bit
>
> > Thomas


[jQuery] Terrible print styles in the docs

2009-04-08 Thread Thomas Allen

Printed documentation includes many superfluous elements and cuts off
the right side of the page in certain browsers. I know CSS like the
back of my hand; is there something I can do to correct this? I'd be
happy to.

http://docs.jquery.com/skins/common/commonPrint.css - Missing quite a
bit

Thomas


[jQuery] jQuery appendTo() in IE7 before ready() [qTip|BlockUI]

2009-04-08 Thread Thomas Creutz
Hi..

I have strange problems with IE7 (older/newer version not tested, but I think, 
it is also 
present in IE6) and some plugins, that do a appendTo().


The Webpage stops loading and I get a warning which says:

Die Internetsite http://mypage.de/ kann nicht geöffnet werden.
Vorgang abgebrochen

Translated something like:
The Website http://mypage.de/ cannot be opened.
process canceled

And than I get not my Webpage displayed.. no I get a IE intern website, which 
tells me, 
that the page cannot be displayed.

So I made some checks, and see, that this bug occurs when the appendTo() 
command is 
executed. So I made a attempt and made a function which made all the stuff 
which I do 
normal at load and assign them to the $(document).ready() event - so the error 
message is 
gone.

Does somebody now more about it? Can we make a jQuery.support.appendtoBug.

My output html displays rooms in boxes and every box have button, but the 
bottons are 
driven from a javascript which polls every second the status for this room. 
Dependent on 
the room-status react this button. So I write a code like this:

{roomrow.ROOM_BUTTON_TEXT}

// <![CDATA[
  addRoom({id: {roomrow.ROOM_ID}, bclass: 4})
// ]]>


in the addRoom function, I want to block the the button until the vars are 
loaded over 
AJAX, which works fine with the BlockUI plugin 
(http://www.malsup.com/jquery/block/) on 
Firefox. So the user see, that this room is current loading and the input is 
blocked.

In IE I get the described bug... and the ready() solutions is not exactly what 
I wont..

Also the qTip Plugin (http://craigsworks.com/projects/qtip/), which I append in 
addRoom to 
the Button trips in this bug.


The final question is, who should fix this? the plugin author? Or is there any 
other solution?

regards,
Thomas



signature.asc
Description: OpenPGP digital signature


[jQuery] Re: Reusing script

2009-03-24 Thread Thomas

I would add one common class to to all your .step1, ..., .step10
elements in your mark-up, and then do this:


// say the common class is "step"

$(document).ready(function() {
  var $steps = $('.step');
  $steps
.addClass('hiddenStep')
.click(
  function() {
$steps.addClass('hiddenStep');
$(this).removeClass('hiddenStep');
  }
);
}

On Mar 24, 10:47 am, phelyer  wrote:
> Hi,
>
> I am using JQuery to show and hide sections of text within my page.
> The page has 10 sections of thext and 10 links.
>
> I want to initially hide all 10 sections of text, and then show
> section 3 when the link for section 3 is clicked, but make sure any
> previously shown sections are then hidden.
>
> Here is what I have used so far which dies wxactly what I want but
> seems very long winded.
>
> $(document).ready(function hideAll() {
>         //$('.stepText').hide();
>         $('.step1').addClass('hiddenstep');
>         $('.step2').addClass('hiddenstep');
>         $('.step3').addClass('hiddenstep');
>         $('.step4').addClass('hiddenstep');
>         $('.step5').addClass('hiddenstep');
>         $('.step6').addClass('hiddenstep');
>         $('.step7').addClass('hiddenstep');
>         $('.step8').addClass('hiddenstep');
>         $('.step9').addClass('hiddenstep');
>         $('.step10').addClass('hiddenstep');
>
>         $('.step1').click(function(){
>                 $('.step1').removeClass('hiddenstep');
>                 $('.step2').addClass('hiddenstep');
>                 $('.step3').addClass('hiddenstep');
>                 $('.step4').addClass('hiddenstep');
>                 $('.step5').addClass('hiddenstep');
>                 $('.step6').addClass('hiddenstep');
>                 $('.step7').addClass('hiddenstep');
>                 $('.step8').addClass('hiddenstep');
>                 $('.step9').addClass('hiddenstep');
>                 $('.step10').addClass('hiddenstep');
>         });
>
>         $('.step2').click(function(){
>                 $('.step1').addClass('hiddenstep');
>                 $('.step2').removeClass('hiddenstep');
>                 $('.step3').addClass('hiddenstep');
>                 $('.step4').addClass('hiddenstep');
>                 $('.step5').addClass('hiddenstep');
>                 $('.step6').addClass('hiddenstep');
>                 $('.step7').addClass('hiddenstep');
>                 $('.step8').addClass('hiddenstep');
>                 $('.step9').addClass('hiddenstep');
>                 $('.step10').addClass('hiddenstep');
>         });
>
>         $('.step3').click(function(){
>                 $('.step1').addClass('hiddenstep');
>                 $('.step2').addClass('hiddenstep');
>                 $('.step3').removeClass('hiddenstep');
>                 $('.step4').addClass('hiddenstep');
>                 $('.step5').addClass('hiddenstep');
>                 $('.step6').addClass('hiddenstep');
>                 $('.step7').addClass('hiddenstep');
>                 $('.step8').addClass('hiddenstep');
>                 $('.step9').addClass('hiddenstep');
>                 $('.step10').addClass('hiddenstep');
>         });
>
>         $('.step4').click(function(){
>                 $('.step1').addClass('hiddenstep');
>                 $('.step2').addClass('hiddenstep');
>                 $('.step3').addClass('hiddenstep');
>                 $('.step4').removeClass('hiddenstep');
>                 $('.step5').addClass('hiddenstep');
>                 $('.step6').addClass('hiddenstep');
>                 $('.step7').addClass('hiddenstep');
>                 $('.step8').addClass('hiddenstep');
>                 $('.step9').addClass('hiddenstep');
>                 $('.step10').addClass('hiddenstep');
>         });
>
>         $('.step5').click(function(){
>                 $('.step1').addClass('hiddenstep');
>                 $('.step2').addClass('hiddenstep');
>                 $('.step3').addClass('hiddenstep');
>                 $('.step4').addClass('hiddenstep');
>                 $('.step5').removeClass('hiddenstep');
>                 $('.step6').addClass('hiddenstep');
>                 $('.step7').addClass('hiddenstep');
>                 $('.step8').addClass('hiddenstep');
>                 $('.step9').addClass('hiddenstep');
>                 $('.step10').addClass('hiddenstep');
>         });
>
>         $('.step6').click(function(){
>                 $('.step1').addClass('hiddenstep');
>                 $('.step2').addClass('hiddenstep');
>                 $('.step3').addClass('hiddenstep');
>                 $('.step4').addClass('hiddenstep');
>                 $('.step5').addClass('hiddenstep');
>                 $('.step6').removeClass('hiddenstep');
>                 $('.step7').addClass('hiddenstep');
>                 $('.step8').addClass('hiddenstep');
>                 $('.step9').addClass('hiddenstep');
>                 $('.step10').addClass('hiddenstep');
>         });
>
>         $('.step7').click(function(){

[jQuery] Re: A simple jQuery script that throws errors and fails in IE6-7. Thoughts?

2009-03-09 Thread Thomas Allen

Oh, I thought that was a recommended practice to reduce bugs when
changing the number of items in an object. Thanks!

Thomas

On Mar 9, 9:58 am, pete higgins  wrote:
> >            .css({
> >                'display': 'block',
> >                'text-align': 'right',
> >            })
>
> stray comma, after 'right'
>
> http://jslint.com
>
> Regards,
> Peter


[jQuery] A simple jQuery script that throws errors and fails in IE6-7. Thoughts?

2009-03-09 Thread Thomas Allen

What am I doing wrong here? I get an "expected identifier" sort of
error with the following code:

(function($) {
$('.calendarInfo').hide();

$('#calendar-frontpage').prepend(
$('')
.html('Show Calendar List')
.attr('href', 'javascript:;');
.css({
'display': 'block',
'text-align': 'right',
})
.click(function() {
if($(this).html()[0] == 'S') { // I know, this is
grimy, but it works.
$('.calendarInfo').show();
$(this).html('Hide Calendar List');
} else {
$('.calendarInfo').hide();
$(this).html('Show Calendar List');
}
});
);
}) (jQuery);


Thanks,
Thomas Allen


[jQuery] Re: alternate color row starting from a point

2009-02-27 Thread Thomas Jaggi

Sorry, that's above my abilities...

Anyone else?


[jQuery] Re: alternate color row starting from a point

2009-02-27 Thread Thomas Jaggi

This should do it:
$('tr:not(.className)').css({'background':'red'});


[jQuery] Re: Loop through JSON data and check for each option specified

2009-02-25 Thread Thomas Jaggi

Well, it looks like indexOf() (or probably better search()) is ok
since I just have to check a string for another one (e.g. is "2008"
contained in the date value).


[jQuery] Re: Positioning inside div

2009-02-22 Thread Thomas Jaggi

They should have "position:absolute" instead if "position:relative".

Relative means relative to the "normal" position. In this case you
would have to set negative values for top/left to achieve an
overlapping.




Petar schrieb:
> I'm trying to create and place several  elements inside an empty
> . Images should have specific coordinates inside a div and should
> be overlapping. I tried this:
>
> $('').appendTo("#myDiv").css( { position:
> 'relative', left: '10px', top: '10px' } );
> $('').appendTo("#myDiv").css( { position:
> 'relative', left: '30px', top: '30px' } );
> $('').appendTo("#myDiv").css( { position:
> 'relative', left: '50px', top: '50px' } );
>
> but images are detached horizontally, although they should overlap.
> Vertical positions are OK.
> Is there a "right way" to accomplish this?
>
> Petar


[jQuery] Re: Loop through JSON data and check for each option specified

2009-02-22 Thread Thomas Jaggi

(I didn't write the filter stuff yet...)


[jQuery] Re: Loop through JSON data and check for each option specified

2009-02-22 Thread Thomas Jaggi

Hi Nicolas, I will definitely look into this, thank yout!



On 22 Feb., 13:34, Nicolas R  wrote:
> Hey Thomas,
> from what you're saying it seems that we're trying to tackle the same
> issue. Have a look at this it may be 
> helpful:http://groups.google.com/group/comp.lang.javascript/browse_thread/thr...
>
> What's your solution?
>
> On Feb 21, 4:24 pm, Thomas Jaggi  wrote:
>
> > Great, that's it. Thanks a lot!
>
> > The indexOf is just an example. The options are actually some kind of
> > filters and I want to check each item against each filter. Depending
> > on the filter It could be indexOf.
>
> > On 21 Feb., 14:44, Mike  wrote:
>
> > > > What is "key"?  That's not in either one of your data structs.
>
> > > Oops, sorry, didn't look closely enough.  But you can't use 'key' that
> > > way.  Try this:
>
> > > if (item[key].indexOf(options[key]) != -1)
>
> > > Not sure what you're after with the indexOf though.


[jQuery] Re: Stringing functions within a click event

2009-02-21 Thread Thomas Jaggi

But It would probably be better changing the class instead of the id.



On 21 Feb., 15:42, "paul.mac"  wrote:
> Thanks - would it not be easier to set up a loop that is executed
> after all the animations have been finished? As I have 8 numbered form
> 0 to 8, will there not be a conflict when you end up with 2 objects
> with id1?
>
> Thanks
>
> paul
>
> On Feb 21, 2:29 pm, Thomas Jaggi  wrote:
>
> > You could use the callback function (http://docs.jquery.com/Effects/
> > animate#paramsdurationeasingcallback).
>
> > $("#right").click(function(){
> >     $("#i1").animate({width: '98px', "left": "+=86px"}, 1500, function
> > (){
> >         var id = $(this).attr('id').split('i')[1];
> >         id = id -1;
> >         $(this).attr('id',id)
> >     });
>
> > })
>
> > On 21 Feb., 15:15, "paul.mac"  wrote:
>
> > > Hi,
>
> > > I have a group of animations, which once they are finished I would
> > > like to change all the image ids and then the src attribute. My code
> > > is as follows:
>
> > >    $("#right").click(function(){
> > >       $("#i0").fadeIn(1500);
> > >       $("#i1").animate({width: '98px', "left": "+=86px"}, 1500);
> > >       ...
> > >       $("#i6").animate({width: "75px", left: "+=110px"}, 1500);
> > >       $("#i7").fadeOut(1500);
> > >     })
>
> > > I don't know how to string a function to this above one so that it
> > > executes after all the animations have finished. Basically I want to
> > > take the existing ids ( i1, i2 ... and change and change them to i0,
> > > i1 etc.
>
> > > Thanks in advance
>
> > > paul


[jQuery] Re: Stringing functions within a click event

2009-02-21 Thread Thomas Jaggi

I'm not sure if this is a problem since all the animations are
executed at the same time (as far as I know).


On 21 Feb., 15:42, "paul.mac"  wrote:
> Thanks - would it not be easier to set up a loop that is executed
> after all the animations have been finished? As I have 8 numbered form
> 0 to 8, will there not be a conflict when you end up with 2 objects
> with id1?
>
> Thanks
>
> paul
>
> On Feb 21, 2:29 pm, Thomas Jaggi  wrote:
>
> > You could use the callback function (http://docs.jquery.com/Effects/
> > animate#paramsdurationeasingcallback).
>
> > $("#right").click(function(){
> >     $("#i1").animate({width: '98px', "left": "+=86px"}, 1500, function
> > (){
> >         var id = $(this).attr('id').split('i')[1];
> >         id = id -1;
> >         $(this).attr('id',id)
> >     });
>
> > })
>
> > On 21 Feb., 15:15, "paul.mac"  wrote:
>
> > > Hi,
>
> > > I have a group of animations, which once they are finished I would
> > > like to change all the image ids and then the src attribute. My code
> > > is as follows:
>
> > >    $("#right").click(function(){
> > >       $("#i0").fadeIn(1500);
> > >       $("#i1").animate({width: '98px', "left": "+=86px"}, 1500);
> > >       ...
> > >       $("#i6").animate({width: "75px", left: "+=110px"}, 1500);
> > >       $("#i7").fadeOut(1500);
> > >     })
>
> > > I don't know how to string a function to this above one so that it
> > > executes after all the animations have finished. Basically I want to
> > > take the existing ids ( i1, i2 ... and change and change them to i0,
> > > i1 etc.
>
> > > Thanks in advance
>
> > > paul


[jQuery] Re: Ajax tabs in non JavaScript browsers

2009-02-21 Thread Thomas Jaggi

You have to solve this on the server side. If you put a normal link on
the tab you can deliver an appropriate site on reloading.



On 21 Feb., 13:26, Playtime  wrote:
> Dear all,
>
> I'm new to jquery and am just started to use the Ajax tabs in a site I
> am building. However I do notice that if I disable javascript the tabs
> just open the pages normally, which is no good as then inserted pages
> don't contain any navigation or other elements.
>
> Is there a way to get the tabs to still work without javascript, I
> have seen some sites that still manage to do this and am unsure of
> how?
>
> Thanks,
>
> Phil


[jQuery] Re: Stringing functions within a click event

2009-02-21 Thread Thomas Jaggi

You could use the callback function (http://docs.jquery.com/Effects/
animate#paramsdurationeasingcallback).

$("#right").click(function(){
$("#i1").animate({width: '98px', "left": "+=86px"}, 1500, function
(){
var id = $(this).attr('id').split('i')[1];
id = id -1;
$(this).attr('id',id)
});
})



On 21 Feb., 15:15, "paul.mac"  wrote:
> Hi,
>
> I have a group of animations, which once they are finished I would
> like to change all the image ids and then the src attribute. My code
> is as follows:
>
>    $("#right").click(function(){
>       $("#i0").fadeIn(1500);
>       $("#i1").animate({width: '98px', "left": "+=86px"}, 1500);
>       ...
>       $("#i6").animate({width: "75px", left: "+=110px"}, 1500);
>       $("#i7").fadeOut(1500);
>     })
>
> I don't know how to string a function to this above one so that it
> executes after all the animations have finished. Basically I want to
> take the existing ids ( i1, i2 ... and change and change them to i0,
> i1 etc.
>
> Thanks in advance
>
> paul


[jQuery] Re: Loop through JSON data and check for each option specified

2009-02-21 Thread Thomas Jaggi

Great, that's it. Thanks a lot!

The indexOf is just an example. The options are actually some kind of
filters and I want to check each item against each filter. Depending
on the filter It could be indexOf.



On 21 Feb., 14:44, Mike  wrote:
> > What is "key"?  That's not in either one of your data structs.
>
> Oops, sorry, didn't look closely enough.  But you can't use 'key' that
> way.  Try this:
>
> if (item[key].indexOf(options[key]) != -1)
>
> Not sure what you're after with the indexOf though.


[jQuery] Re: Loop through JSON data and check for each option specified

2009-02-21 Thread Thomas Jaggi

Sorry, I mean "if (item.key.indexOf(val) != -1) {".

But anyway, any ideas? I know my approach probably makes no sense at
all...


[jQuery] Loop through JSON data and check for each option specified

2009-02-21 Thread Thomas Jaggi

Let's say I have on object with my options:
options = jQuery.extend({
title: 'xy',
date: 'xy'
}, opts);

And some JSON data:
({ "items": [
{
"title": "IMGP3817",
"date": "2008-10-18T10:35:17-08:00"
},
{
"title": "IMGP3826",
"date": "2008-10-18T11:18:19-08:00"
}
] })

Now I want to loop through each item and check for each option (e.g.
with indexOf). How to do this?

This doesn't work:
$.getJSON("wheremydatais", function(data){
$.each(data.items, function(i,item){
$.each(options, function(key,val){
if (item.key.indexOf(options.key) != -1) {
console.log('everything ok');
}
});
});
});


[jQuery] Re: How to loop through JSON data

2009-02-21 Thread Thomas Jaggi

Your Loop should probably look like this:

$.each(results, function(key,val) {
event += '' + val.title + ' ' + val.style +  '<\/div>';
});




On 21 Feb., 12:51, newkid85  wrote:
> If I have JSON data like this:
>
> { "9": { "title": "Event 1", "style": "rock" }, "11": { "title":
> "Event 2", "style": "pop" }, "15": { "title": "Event 3", "style":
> "house" }, "16": { "title": "Event 4", "style": "metal"} }
>
> How can I loop through each item grabbing each key/value pair for
> outputting? Is this possible with $.each?
> I tried the following:
>
> var event = '';
> $.each(results, function(title, style) {
>                event += '' + title + ' ' + style +  '<\/div>';});
>
> $('#events').html(event);
>
> But it returned
>
> 9 [object Object]
> 11 [object Object]
> 15 [object Object]
> 16 [object Object]
>
> I'm guessing my syntax is wrong or I am misusing the function. Any
> help appreciated.


[jQuery] XML link tag problem

2009-02-13 Thread Thomas

Hi!

Here is a part of a given xml file:


https://pluto.solar.go"; xmlns:dc="http://
purl.org/dc/elements/1.1/">

 akarmi
 https://pluto.solar.go
 we are small planet but strong
 plut


I would like to use the content of the first link tag but i can't!
There is an example!

vlm1 = $(xml).find("title").eq(0).text(); // success
vlm2 = $(xml).find("link").eq(0).text(); // fail

I did not made the xml file and i can't edit it. How could i assign
the content of this link tag ?

Ty,
Thomas


[jQuery] Re: The order of these conditions should not matter

2009-02-10 Thread Thomas Allen

Good call; thanks! I've been working with the Validate plugin, and the
"depends" guards appear to be creeping into my other code :^)

Thomas

On Feb 10, 2:41 pm, Ricardo Tomasi  wrote:
> Doh. I'm blind.
>
> $("#pay_cc:checked") will always be 'true'. even if the element is not
> found an object will be returned. You have to check for .length or size
> ()
>
> if($("#pay_cc:checked").length) showCC();
> if($("#pay_check:checked").length) showCheck();
>
> cheers,
> - ricardo
>
> On Feb 10, 5:29 pm, Thomas Allen  wrote:
>
> > It works fine for the focus event. The purpose of the conditionals is
> > to ensure that the correct payment field pops up if the page is
> > reloaded/revisited. For whatever reason, on a page reload, showCheck()
> > always fires, even line 1's condition returns true and line 2's
> > returns false (I've tested this in Firebug's console, and the
> > conditionals work fine when entered individually).
>
> > if($("#pay_cc:checked")) showCC();
> > if($("#pay_check:checked")) showCheck();
>
> > This is very problematic. If I remove the second line, the first line
> > works as expected, and I observe the same behavior when I try these
> > conditionals reverse order (Check first, causing CC to always override
> > it).
>
> > Thomas
>
> > On Feb 10, 2:23 pm, Ricardo Tomasi  wrote:
>
> > > What do you mean by overriden? Just copied your code over and it seems
> > > to work fine.
>
> > >http://jsbin.com/efejehttp://jsbin.com/efeje/edit
>
> > > - ricardo
>
> > > On Feb 10, 3:07 pm, Thomas Allen  wrote:
>
> > > > Here's my JS:http://pastebin.com/m6091a365
> > > > And the accompanying HTML:http://pastebin.com/m30c57ea6
>
> > > > For some reason, the if($("pay_..." condition that comes first gets
> > > > overridden by the one that follows it. The :checked states you see in
> > > > the JS are mutually exclusive because they are a part of the same
> > > > radio group (as seen in the HTML). The showCC and showCheck functions
> > > > work perfectly in the focus() context (they switch normally).
>
> > > > The reason that I'm setting this up this way is so that a user will
> > > > only see the payment region that they need to see.
>
> > > > Thanks,
> > > > Thomas Allen
>
>


[jQuery] Re: The order of these conditions should not matter

2009-02-10 Thread Thomas Allen

It works fine for the focus event. The purpose of the conditionals is
to ensure that the correct payment field pops up if the page is
reloaded/revisited. For whatever reason, on a page reload, showCheck()
always fires, even line 1's condition returns true and line 2's
returns false (I've tested this in Firebug's console, and the
conditionals work fine when entered individually).

if($("#pay_cc:checked")) showCC();
if($("#pay_check:checked")) showCheck();

This is very problematic. If I remove the second line, the first line
works as expected, and I observe the same behavior when I try these
conditionals reverse order (Check first, causing CC to always override
it).

Thomas

On Feb 10, 2:23 pm, Ricardo Tomasi  wrote:
> What do you mean by overriden? Just copied your code over and it seems
> to work fine.
>
> http://jsbin.com/efejehttp://jsbin.com/efeje/edit
>
> - ricardo
>
> On Feb 10, 3:07 pm, Thomas Allen  wrote:
>
> > Here's my JS:http://pastebin.com/m6091a365
> > And the accompanying HTML:http://pastebin.com/m30c57ea6
>
> > For some reason, the if($("pay_..." condition that comes first gets
> > overridden by the one that follows it. The :checked states you see in
> > the JS are mutually exclusive because they are a part of the same
> > radio group (as seen in the HTML). The showCC and showCheck functions
> > work perfectly in the focus() context (they switch normally).
>
> > The reason that I'm setting this up this way is so that a user will
> > only see the payment region that they need to see.
>
> > Thanks,
> > Thomas Allen
>
>


[jQuery] The order of these conditions should not matter

2009-02-10 Thread Thomas Allen

Here's my JS: http://pastebin.com/m6091a365
And the accompanying HTML: http://pastebin.com/m30c57ea6

For some reason, the if($("pay_..." condition that comes first gets
overridden by the one that follows it. The :checked states you see in
the JS are mutually exclusive because they are a part of the same
radio group (as seen in the HTML). The showCC and showCheck functions
work perfectly in the focus() context (they switch normally).

The reason that I'm setting this up this way is so that a user will
only see the payment region that they need to see.

Thanks,
Thomas Allen


[jQuery] Re: How to get the CSS definitions of a class not existing in the DOM

2009-02-10 Thread Thomas Jaggi

Sorry, I just found this thread:
http://groups.google.com/group/jquery-en/browse_thread/thread/7cbc9fb45f7dc133/578d5407199aaf31


[jQuery] How to get the CSS definitions of a class not existing in the DOM

2009-02-10 Thread Thomas Jaggi

Let's say I have a CSS class for each of two possible states of an
element. Now I want to animate from state X (".state-x {width:100%}")
to state Y "(.state-y {width:50%}").

Is it possible to get the CSS definitions of ".state-y"?
I suppose "$('.state-y').css('width')" doesn't work when there is no
element in the DOM with this class.

Of course I could define the CSS of these classes in a javascript
variable but I need them in the CSS anyway (nonscript version) and I
don't want to have to change it in both the CSS and JS if needed...


[jQuery] Re: [validate] dynamic message

2009-01-30 Thread thomas

Jörn,

many thanks - this has worked wonderfully!

The only remaining question I have is as follows:

messages generated by specified validation methods clear automatically
after the form field gets updated:

so in the chain of required,digits,minlength,maxlength each message
comes and goes as needed. This seems not be the case with the solution
you have suggested. Once specified the this.settings.messages
[element.name] sticks and does not clear.

How to reset it back to nothing and re-launch validation chain when
the form value changes?

With kind regards,
Thomas


On Jan 26, 11:18 am, Jörn Zaefferer 
wrote:
> Try this workaround - update validator.settings.messages[element.name]
> with the appropiate value inside your validation method:
>
> $.validator.addMethod("dynamic_check", function(value, element, param) {
>       if(incorrect(value, param)){
>         this.settings.messages[element.name] = "some dynamic message"
> + dynamicValue;
>         return false;
>       }
>
> }, "whatever"));
> On Sun, Jan 25, 2009 at 10:33 PM, thomas  wrote:
>
> > Thanks Jörn,
>
> > but is there a way to change param dynamically during JS runtime?
>
> > As example in your custom-methods-demo.html I'd like 11 to be a
> > function of value ...
> > math: {equal: 11}
>
> > In my barcoding example, I'd like not only tell user that barcode
> > number is wrong, but also what the check digit should be for what he
> > has typed. In order to pass it into template "Entered number is wrong
> > the check digit must be {0}" I need to be able to alter param
> > somehow ...
>
> > Regards,
> > Thomas
>
> > On Jan 25, 2:29 pm, Jörn Zaefferer 
> > wrote:
> >> You can use $.format to create dynamic messages, but that works only
> >> when the dynamic part is specified as a parameter.
>
> >> $.validator.addMethod("dynamic_check", function(value, element, param) {
> >>        if(incorrect(value, param)){
> >>        return false;}
>
> >> }, $.format('dynamic message goes here with param {0}'));
>
> >> Jörn
>
> >> On Sat, Jan 24, 2009 at 10:54 AM, thomas  wrote:
>
> >> > Hello group!
>
> >> > Very happy to have deployed validation plugin ( I mostly need to check
> >> > validity of EAN/UPC numbers for barcode generation). You can see it in
> >> > action here:http://www.barcoderobot.com/ean-13.html
>
> >> > The question I am struggling with though is howto return a
> >> > 'dynamically generated' message. Say, '13 digits are required, you
> >> > have XX'?
>
> >> > $.validator.addMethod("dynamic_check", function(value) {
> >> >        if(_value is incorrect_){
> >> >        return False;}
> >> > }, 'dynamic message goes here');


[jQuery] Re: [validate] dynamic message

2009-01-25 Thread thomas

Thanks Jörn,

but is there a way to change param dynamically during JS runtime?

As example in your custom-methods-demo.html I'd like 11 to be a
function of value ...
math: {equal: 11}

In my barcoding example, I'd like not only tell user that barcode
number is wrong, but also what the check digit should be for what he
has typed. In order to pass it into template "Entered number is wrong
the check digit must be {0}" I need to be able to alter param
somehow ...

Regards,
Thomas


On Jan 25, 2:29 pm, Jörn Zaefferer 
wrote:
> You can use $.format to create dynamic messages, but that works only
> when the dynamic part is specified as a parameter.
>
> $.validator.addMethod("dynamic_check", function(value, element, param) {
>if(incorrect(value, param)){
>return false;}
>
> }, $.format('dynamic message goes here with param {0}'));
>
> Jörn
>
> On Sat, Jan 24, 2009 at 10:54 AM, thomas  wrote:
>
> > Hello group!
>
> > Very happy to have deployed validation plugin ( I mostly need to check
> > validity of EAN/UPC numbers for barcode generation). You can see it in
> > action here:http://www.barcoderobot.com/ean-13.html
>
> > The question I am struggling with though is howto return a
> > 'dynamically generated' message. Say, '13 digits are required, you
> > have XX'?
>
> > $.validator.addMethod("dynamic_check", function(value) {
> >if(_value is incorrect_){
> >return False;}
> > }, 'dynamic message goes here');


[jQuery] [validate] dynamic message

2009-01-24 Thread thomas

Hello group!

Very happy to have deployed validation plugin ( I mostly need to check
validity of EAN/UPC numbers for barcode generation). You can see it in
action here: http://www.barcoderobot.com/ean-13.html

The question I am struggling with though is howto return a
'dynamically generated' message. Say, '13 digits are required, you
have XX'?

$.validator.addMethod("dynamic_check", function(value) {
if(_value is incorrect_){
return False;}
}, 'dynamic message goes here');


[jQuery] "No element found" when firing $.post()

2009-01-14 Thread Thomas

Hello together,

just a short question: by firing a request via POST to the server side
Firefox shows an "No element found" (in German "Kein Element
gefunden") in its Error console (Firebug displays nothing). Example:

$.post("/Portal/ReorderPortlets", { portlets: $("#portal").sortable
("toArray") });

I am a bit confused, could anyone bring some light into this?

Thanks :)

Thomas


[jQuery] Re: IE8.

2009-01-11 Thread Thomas Kahn


simonferra...@gmail.com wrote:

Our friends at Microsoft have a lot of work to do until their new born
browser IE8 (Still in Beta 2) actually works the way it should.

It seems that there is a major event triggering issue.  Lots of jQuery
core functionalities depends of events.


Is there more info on jQuery combined with Internet Explorer 8 that I 
could read?


I have a situation where a client wants me to do "bugfixes" for IE8 beta 
2 on a site using a lot of jQuery. The site works fine in all other 
browsers so I would prefer to wait until IE8 comes out of the beta stage.


An open question to other jQuery developers: are you checking your sites 
for IE8 compatibility now or are you waiting until IE8 is out of the 
beta stage?


I'm thinking it's not a very good idea to look for and try to fix bugs 
right now since it's hard to determine if the errors are caused by my 
code, Microsofts code, jQuery+IE8 compatibility issues or a combination 
of all of this.


Thanks in advance!

/Thomas Kahn


[jQuery] Re: mouseout problem

2009-01-07 Thread Thomas

Hi saiful!

You have several syntax errors in your code, but I assume they're just
typos (for once, you have "isPopUp" in your one selector, instead of
"#isPopUp").

Your problem likely stems from misinterpreting the mouseout event,
though. That event fires *every time the cursor leaves a child of the
element that's listening to the event*. So, since you have some 
elements in your #isPopUp element, the event will fire as soon as you
mouseout of any of the s.

You probably want to use *mouseleave* instead.

Here's code that works, even with the typos ironed out. ;)




mouseout problem




$(document).ready(
function() {
$("#text_span")
.mouseover(
function () {

$("#isPopUp").show("slow");
}
);
$("#isPopUp")
.bind(
"mouseleave",
function () {

$("#isPopUp").hide("slow");
}
);
}
);




one
two
tree
four


show the div






On Jan 7, 6:10 am, "saiful.ha...@gmail.com" 
wrote:
> hi all,
>
> i has a litle problem when using $(IdElement).shie("slow"); this my
> code
>
> my JQuery
> $(document).ready(function() {
> $("#text_span").mouseover(function(){ $("isPopUp").show("slow");});
> $("#isPopUp").mouseover(function(){$("#isPopUp").css("display",
> "block");});
> $("#isPopUp").mouseout(function(){$("#isPopUp").hide("slow");});
>
> }
>
> My HTML
>
> 
> 
> 
> one
> two
> tree
> four
> 
> 
>
> show the div
>
> when my cursor over in text_span, the div showed and that is true.
> But, the problem when my cursor over the image the div just gone, hide
> with slow.
>
> Where is my incorrect sintax?
>
> When i change the hide("slow") to hide() only, all be fine :(
>
> thang's for help


[jQuery] Re: IE Problem

2009-01-07 Thread Thomas

It would be interesting to see './files/v-winter.txt' as well,
specifically how it's being served.

Total shot in the dark, but I remember having had a similar problem
(IE-only) when I started playing with XML files many moons ago.

Maybe it would help if you served that file with an 'content-type:
application/json' header? That was the problem I had with the XML
file.


On Jan 6, 9:24�pm, jhm  wrote:
> > I'd suggest downloading and installing "Fiddler" 
> > (http://www.fiddlertool.com)
>
> That's a great tool, thanks! Unfortunately, it doesn't help my
> problem. I figure I must be doing something fundamentally wrong, since
> jquery is widely thought of as browser agnostic.
>
> So, I put together a small sample file that has everything in it (and
> still exhibits the problem). If anyone can see something I'm doing
> wrong, please point it out. Here's the html file:
>
> ===
> 
> � 
>
> � jquery problem
>
> � 
>
> � 
> � 
> � 
>
> 
>
> 
> � 
> � � 
> � � � row one
> � � � row two
> � � � row three
> � � 
> � 
>
> 
> ===


[jQuery] Re: image caching problem

2009-01-07 Thread Thomas

Ok, thanks! I accept it! :)

On jan. 7, 16:00, MorningZ  wrote:
> try to append the time (something unique from the last) on the URL
>
> so if you had:
>
> 
>
> then setting the src to something like
>
> $("#somethin").attr("src", "user1.jpg?x=" + new Date());
>
> should do the trick
>
> .
> On Jan 7, 9:41 am, Thomas  wrote:
>
> > Hi folks!
> > I have a simple profile image upload script. The problem is that I
> > can't change the actual image with jQuery, because is cahed ( i
> > suppose ).
> > Only one picture allowed per users so I renamed their files to
> > user1.jpg, user2.jpg, etc.
>
> > I tried to use $('#somethin').attr("src", "userN.jpg"); but it has no
> > effect, because it was the same src before so the picture wont change.
>
> > How could I make it reload these pictures correctly ?


[jQuery] image caching problem

2009-01-07 Thread Thomas

Hi folks!
I have a simple profile image upload script. The problem is that I
can't change the actual image with jQuery, because is cahed ( i
suppose ).
Only one picture allowed per users so I renamed their files to
user1.jpg, user2.jpg, etc.

I tried to use $('#somethin').attr("src", "userN.jpg"); but it has no
effect, because it was the same src before so the picture wont change.

How could I make it reload these pictures correctly ?


[jQuery] Shadowbox rel-links and AJAX?

2008-11-30 Thread Thomas Kahn


Hi!

I'm currently working on a project that loads content (linked images) on 
a page using AJAX. A click on a link is supposed to open up a 
corresponding slideshow (flash) using Shadowbox. (Shadowbox is similar 
to Lightbox, but can serve all kinds of media - not just images. 
http://www.mjijackson.com/shadowbox/).


Now to the problem at hand:
Shadowbox uses the rel-attribute of the a-tag to make the slideshow load 
in a shadowbox and not like a regular href-tag. But since the content is 
loaded dynamically using AJAX, it's not certain that Shadowbox has 
identified the links and turned them into Shadowbox-links. They are not 
present when the page first loads - user interaction on the page loads 
the links using jQuery/AJAX.


A link that is supposed to open up in Shadowbox looks like this:

href="/flash/MySavvySlideshowViewer.swf?galleryXMLPath=path/to/the/gallery/XML/that/flash/uses.xml" 
rel="shadowbox;height=600;width=800;">




The testing I've done so far indicates that the problem is one of 
timing. Since I add new content to the page (using AJAX) I will also 
have to redo the Shadowbox setup (not the init, just the setup using 
"Shadowbox.setup"). I do this after the dynamic content has finished 
loading.


BUT if the user is too quick, it seems like the setup doesn't have time 
to finish and the raw href (flash) is loaded in the browser window 
instead of the nice Shadowbox link. At first I thought the problem was 
related to Internet Explorer since it didn't seem to appear in Firefox, 
but it turned out that I COULD reproduce this behavior in Firefox too, I 
just had to be much faster. My guess it that the fast execution of 
JavaScript compared to the slow execution in Internet Explorer threw me off.


And now I'm kind of stuck. Any pointers, tips and suggestions are most 
welcome. Can I block the links somehow, making them clickable only when 
I'm sure that they will open in Shadowbox? Can I somehow use Live Query?


Regards,
Thomas Kahn
Web Developer, Stockholm, Sweden


[jQuery] Issues in JCarousel scroller

2008-11-27 Thread Thomas

Hi there

We are facing an issue with JCarousel scroller while loading dynamic
data. The scenario is like we have a set of images loaded on to the
scroller initially.

Later upon a click event on one of the links on the page, we are
loading a fresh set of images (via AJAX) to the scroller.

We referred the following example to achieve the same.http://
sorgalla.com/projects/jcarousel/examples/dynamic_ajax.html

To an extent we achieved what was required. i.e. loading the dynamic
data to the scroller. But the issue is say the first set had 5 images
and the new set had only 2 images, the remaining 3 from the first set
of images were still there on the scroller.

Can any one suggest a workaround for this?

Regards
Thomas



[jQuery] Re: Simple Ajax question

2008-11-04 Thread Thomas

I found it!

The problem was that I used the "complete" and I should "success" !
After this repair I easily access the response with $(xml).


[jQuery] Simple Ajax question

2008-11-03 Thread Thomas

Hi!
I have a basic question with jQueryed ajax. How can I reach elements
by tag name ?

I have this js:
$.ajax({
url:"some.xml",
type:   "POST",
dataType: ($.browser.msie) ? "text" : "xml",
processData: false,
complete: function(data) {
var xml;
if (typeof data == "string") {
xml = new ActiveXObject("Microsoft.XMLDOM");
xml.async = false;
xml.loadXML(data);
} else {
xml = data;
}
alert(xml.responseText);
}
});

and I have this "some.xml":


apple
banana



So the problem is, that I don't know how reach "item"s. The old method
(firstChild.text) doesn't works, of course, or does it ?


[jQuery] Re: New plugin: jquery.smoothDivScroll-0.5.js

2008-11-01 Thread Thomas Kahn


Thanks a million Mike!
This is EXACTLY the kind of tips'n'tricks that I need to learn. I will 
address all the things you point out as soon as I have the time!


/Thomas

Mike Alsup wrote:

All improvements and suggestions are welcome!


Some quick comments on the code itself, not the implementation, just
the technical bits:

1.)  Your plugin is not chainable.  The plugin function should 'return
this' to honor jQuery's chaining model.  For example, this will fail:
$('div').smoothDivScroll().parent().show();

2.)  Your plugin code is written with the assumption that a single
element has been selected.  But in reality your $mom variable could
represent a set of elements if I call your plugin like this:  $
('div').smoothDivScroll();
Based on what I see in the code I'm pretty sure this will not work as
expected.  What you need inside the plugin is an iteration loop so
that you can loop over each selected element:
this.each(function() {
   // treat each item in here as a 'mom'
}

3.)  There are several places in the code where you use a document-
ready handler - $(function(... -  but it's safe to assume that your
plugin is invoked within a document-ready handler, and so these
functions you defined will execute immediately.  In other words, you
can just run those bits of code w/o the 'ready'.

Nice work on the demo and the write-up.  The results look rather nice.

More plugin tips can be found here:
http://docs.jquery.com/Plugins/Authoring
http://www.learningjquery.com/2007/10/a-plugin-development-pattern
http://malsup.com/jquery/conf08/

Cheers!

Mike





[jQuery] Re: New plugin: jquery.smoothDivScroll-0.5.js

2008-11-01 Thread Thomas Kahn


Sam Sherlock wrote:
Nice stuff there.  I have been playing around with it I would like to be 
able to click on the arrows and advance more rapidly through the 
scrollablearea.  Guess this might be going against what your trying to do.


Adding a click event that makes the scrolling go faster is a great idea! 
I will add it to the list of things to implement.


Perhaps also some class should be added so that certain styling is 
applied where js is able to run


I'm not sure I understand? Could you elaborate on this?

if some extra options could be specificed when initializing - in some 
cases it would be nice to be able display the items in sets of 4 
(configurable rows  columns) perhaps also being able to initialze to a 
position (like scrollable plugin see flowplayer example site)


Yes, more options should be added. One thing I've been thinking of is 
that the user shouldn't have to add the hotspots manually in the 
HTML/CSS-code. The script should be able to generate default hotspots.


I'm not sure which options the users would like or find handy though? 
Many settings can be done in the CSS but I'm not sure if that is the 
best way to configure the plugin?


I'm not sure that I want this plugin to scroll in sets. There are 
already several plugins that do that, but that was not the functionality 
 I was looking. Smooth scrolling is what I'm after. :-)


Would be interesting to be able to use this with lazyloading images 
(preloading two adhead)


That is my plan!
I will be using ten or more of the scrolling DIV's on a single page so 
loading all the content at once would be heavy.


Thanks for your feedback!

/Thomas


2008/11/1 tkahn <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>>


Hi!

My name is Thomas Kahn and this is my first post to this list. I'm a
web developer working in Stockholm Sweden and I've just started
developing my my first plugin for jQuery; in fact jQuery is a totally
new experience for me - I started from scratch a week ago.  :-)

All the info, a demo and the current source code can be found here:

http://www.maaki.com/thomas/SmoothDivScrolling/

All the scrolling plugins that I found on the jQuery website where
scrolling in "element steps" and I wanted a plugin that would scroll
smoothly. Since I couldn't find one, I decided to code one myself.

Now I'm releasing somehing that is really a Beta with a big "B". It
wasn't intended to be released in public in the first place, but when
I saw that I would save time by developing a plugin for the project
that I'm currently involved in, I tought I'd share the code hoping
someone else will find it useful.

All improvements and suggestions are welcome!

/Thomas Kahn
Web Developer
Kärnhuset, Sweden






[jQuery] Re: reading values from HTML tables

2008-10-30 Thread Thomas

It seems you not using jQuery...
Give an ID for the table and use jQuery! It will be easyer! ;)


[jQuery] $(this) question

2008-10-30 Thread Thomas

Hi!

I have this in html:
add

and this in js:
function addSubject() {
alert( $(this).attr("href") );
}
/* expected output:
 *
 *javascript:addSubject();
 *
 */

I tried some alternate method but those not works neither... What is
the problem ?

Thomas


[jQuery] Re: Simple page navigation problem

2008-10-30 Thread Thomas

Try something like this:

$('.palettebtn').click(function() {
 $(this).removeAttr("href");
 $('#mainDiv').load("Palette.html");
});

Your bowser send you top of the page because the '#'.

You should try these method in linking:
this link do not mutch
else
and do a 'thisIsASuperFunction()' function.
I think is a better way...

Good luck,
Thomas


[jQuery] Re: Basic AJAX Q: how to replace current with XHR-fetched page?

2008-10-03 Thread Thomas Danemar

The easiest way to fetch another page and insert it into the DOM is by
using load():

$('body').load('page.htm');

injects the contents of page.htm into . You can also use
selectors in the url if you only want to fetch parts of the page:

$('body').load('page.html #someelement')

injects only the element with id 'somelement' from page.htm. Check out
the jquery documentation for load() here:
http://docs.jquery.com/Ajax/load#urldatacallback

Did that answer your question?


On Oct 2, 8:41 pm, "Kynn Jones" <[EMAIL PROTECTED]> wrote:
> This is the most basic AJAX question.  Suppose my script fetches a new page
> using $.( 'http://some/url', ... ).  I'd now like to replace the currently
> displayed page with the newly fetched one.  I suppose that I need to make a
> new DOM subtree from the downloaded content and replace the subtree
> corresponding to the current page with this newly generated subtree...  But
> I'm not sure of how one does this.
> Could someone show me how to do this?  (Or point me to an example?)
>
> TIA!
>
> Kynn


[jQuery] Re: Click function only invoked after second click in IE6 & IE7

2008-09-25 Thread thomas peklak

Your document contains multiple same ids (info, info_link). This is
not valid (http://validator.w3.org/check?verbose=1&uri=http://
dev.dreimorgen.com/test.html). Please correct this first (use classes
instead) and try again.

For me this is working.

Thomas


[jQuery] Cycle-Plugin: Add list-item after enabling cycle

2008-06-23 Thread Thomas Jaggi

Does anybody know how to enable the Cycle again after adding a list-
item ("$('hello<\/li>').appendTo('#cycle');")?
When just enabling it again like "jQuery('#cycle').cycle({...});" the
new item and the first one are set to "display:list-item" at the same
time...


[jQuery] Re: JQuery bigginer

2008-04-06 Thread thomas chen

 $(document).ready(function(){

$('#dayOfBirth').bind('focus',function(){
   $(this).val('');
}); 
 });

- Original Message - 
From: "Raghu" <[EMAIL PROTECTED]>
To: "jQuery (English)" 
Sent: Saturday, April 05, 2008 12:55 AM
Subject: [jQuery] JQuery bigginer


> 
> Hi I am learning JQuery and Javascript so asking this simple question.
> 
> I have a text field which has default value as Day. I want when user
> focus on this text field then it become empty. How can I do this using
> JQuery?
> 
>  value="Day" required="true" maxlength="3"/>
>

[jQuery] Re: Sticky (scrolling) element

2008-04-06 Thread Thomas Jaggi

Hi spectrus

Here you can see what I mean: 
http://view-source.de/ext/larepublique/slider-final/
Seems to work now.

There is just a problem in IE6: As soon as there are any background-
images, it's not really smooth any more... But same problem with the
initial version. Probably that's because of the ui.slider.


[jQuery] how to bind click event to div element created dynamic

2008-04-06 Thread thomas chen
I'm newbie to jquery.i bind click event to div element which is created 
dynamiclly.
but it can't work.

Anyone could help me? 

Thank a lot

thomas.chen

The following is my code!




 JQuery
 
 
 



   
  
  JQuery
   
   
  
  
  
  
   
   

$(document).ready(function(){
$.ajax({url:'jquery/menu.xml'
   ,type: 'GET'
   ,dataType: 'xml'
   ,timeout: 1000
   ,error:function(){
$('#menu').text('Menu Loading Error !');
}
   ,success:function(xml){
var _menu = $('#menu');
$(xml).find('menus').each(function(){
var _ul = $(document.createElement('ul'));
var _li = $(document.createElement('li'));
_li.css('font-weight','bold');
_li.html($(this).attr('name'));
_li.appendTo(_ul);
$(this).find('menu').each(function(){
   var __li = $(document.createElement('li'));
   __li.css('padding-left','25px');
   __li.html('
'+$(this).attr('name')+'
'); __li.appendTo(_ul); }); _ul.appendTo(_menu); }); } }); $('#menu div').bind('click',function(){ }); });

[jQuery] Sticky (scrolling) element

2008-04-05 Thread Thomas Jaggi

Hi there

I have a scrolling box here: http://backflip.info/test/

Everything works fine except for two things:
- I'd like the box to start scrolling not until "arriving" at the top
of the page. Now there is always the initial margin. Is this possible
with the ui.slider I'm using?
- When the box is higher than the screen (click "expand") there is an
unwanted effect when scrolling to the bottom of the page. How can I
define a minimal margin to the bottom?

Thanks a lot,
Thomas


  1   2   >