[jQuery] Baffling input problem

2008-09-23 Thread mdrisser

Here's the scenario. I have a series of text inputs with a class of
'online', I want to update a total everytime an input with the class
of 'online' is changed. Basically like a spreadsheet doing an auto sum
on a column.

The total is put into two places, a div and a hidden input.

Here's the code I have:
$('.adcost').blur(function() {
var total = parseInt($('#adTotalInput').val()); // Get the current
value from the hidden input

console.log('Input: ' + $('#adTotalInput').val()); // Show the
current value from the hidden input
console.log('Total: ' + total); // Show the current total, make
sure its the same as our hidden input

total += parseInt($(this).val()); // Get the value of THIS input
and add it to our total

console.log('This: ' + $(this).val()); // Show the value of THIS
input
console.log('New Total: ' + total); // Show our new total

$('#adTotalInput').val(total); // Update the hidden input
console.log('Updated Input: ' + $('#adTotalInput').val()); // Get
the value from the hiddeninput

$('#adTotal').empty().text(total);
});

The first time a value is placed in an input.online everything is
fine, here's the output from console.log():
Total: 0
This: 200
New Total: 200
Updated Input: 200

Subsequent changes to any input.online results in:
Input: undefined
Total: NaN
This: 200
New Total: NaN
Updated Input: undefined

I'm baffled as to why input#adTotalInput is suddenly undefined. Any
help will be greatly appreciated.


[jQuery] jQuery UI Tutorials

2008-05-28 Thread mdrisser

Hi all,
I just posted the second part in my jQuery UI Tutorials, this one is
on the tabs widget, let me know what you think. I value your feedback.

http://mdrisser.r1designs.net/blog


[jQuery] Re: Help learning...

2008-05-28 Thread mdrisser

Can you post a link to the page? Just taking a quick look at your code
I noticed that the extension is missing off of your call to the jQuery
library:



I realize that on Windows the extensions are hidden so try:



Notice the .js I added to the path to the jQuery library.


[jQuery] Re: jQuery UI

2008-05-20 Thread mdrisser

Thanks for the input, I'll update the existing tutorial to reflect
that new (to me) bit of knowledge, and add a link in the wiki.

I'm currently working on the next tutorial, UI Tabs. Should be ready
this week.

On May 17, 4:58 am, "Richard D. Worth" <[EMAIL PROTECTED]> wrote:
> This is a great article. Thank you for sharing, and I'm looking forward to
> more.
>
> A minor note: 1.5b2 and 1.5b4 require alpha and beta versions of jQuery
> 1.2.4. They are included in each zip file (if you download the whole thing),
> or can be grabbed here:
>
> http://dev.jquery.com/view/tags/ui/1.5b2/jquery-1.2.4a.jshttp://dev.jquery.com/view/tags/ui/1.5b4/jquery-1.2.4b.js
>
> Also, they include dimensions; it's no longer a separate plugin. Your dialog
> tutorial may not have hit any issues with using 1.2.3, but other plugins
> have some.
>
> Don't forget - the docs are a wiki, so include links to your tutorials
> there.
>
> - Richard
>
> Richard D. Worthhttp://rdworth.org/
>
> On Fri, May 16, 2008 at 11:20 AM, mdrisser <[EMAIL PROTECTED]> wrote:
>
> > I've just started playing around with the jQuery UI and while I was at
> > it I decided to put together a series of tutorials on implenting the
> > UI, I've never written any tutorials before, so it may not be the
> > best, but I hope that it will be useful to someone.
>
> > You can find it athttp://mdrisser.r1designs.net/blog
>
> > Let me know what you guys think and how I can improve the series.
>
> > Thanks in advance


[jQuery] Re: Favorite Modal Dialog?

2008-05-16 Thread mdrisser

Its funny that you should mention that, I just put together my first
tutorial, and its concerning implementing the jQuery UI's Dialog
component, which has a modal option.

You can take a look at it here: http://mdrisser.r1designs.net/blog/

On May 16, 7:57 am, A13thGuest <[EMAIL PROTECTED]> wrote:
> Hey all,
>
> I'm needing to implement a dialog that will contain an div. I need the
> rest of the page to go dark and have controls outside the dialog
> disabled.
>
> Are there any existing favorite approaches or plugins?
>
> Thanks in advance!


[jQuery] jQuery UI

2008-05-16 Thread mdrisser

I've just started playing around with the jQuery UI and while I was at
it I decided to put together a series of tutorials on implenting the
UI, I've never written any tutorials before, so it may not be the
best, but I hope that it will be useful to someone.

You can find it at http://mdrisser.r1designs.net/blog

Let me know what you guys think and how I can improve the series.

Thanks in advance


[jQuery] Re: email plugin

2008-04-17 Thread mdrisser

I don't mind your opinion at all, that's why I posted and asked for
comments :-)

I don't remember exactly why I do so much concatenation, I was
actually thinking about that last night :-) that's something I'm going
to fix.

To be honest with you, I never really gave any thought to non-JS
users, when I first wrote the plugin I was in a bit of a rush, and
should have thought about that, another thing to fix. :-)

Now, to get up on my soap-box :-) :

I agree, we do have lots of plugins that do basically the same thing,
but they don't all fit every situation, or the documentation is a bit
hard to follow. jdMenu and Superfish are two great examples, they are
both great menu systems, but they both fit slightly different
situations (from a design stand-point not an application one), in some
situations, jdMenu is easier to style to get the look you're going
for, in others Superfish is easier (at least for me).

In addition, sometimes when we're looking for plugins, what we're
looking for is categorized differently than we think it should be, we
don't find what we're looking for so we write one that does what we
want, submit it and find later that someone had already written a
plugin to do what we were after in the first place. This has gotten a
lot better with the new repository, but it still happens. (Maybe we
should come up with a set of guidelines to help with categorization,
this would benefit both plugin developers and those searching out
plugins.)

Besides the above reasons I believe there are two more, 1. Learning
and Experimenting, 2. A desire to give back.

When I first wrote SafeMail it was a combination of all of the above,
and as I continue to develop it further it continues to be a learning
and experimenting experience and a way for me to give back to the
jQuery community.

Thanks for your opinion and feedback, its one of the things that makes
this community so great.


On Apr 16, 6:06 pm, Ariel Flesler <[EMAIL PROTECTED]> wrote:
> Hi mdrisser
>
> I checked the source, it does what it should. I don't understand why
> do you do so much concatenation.
>
> For example: " Can just be: ' do Y do you recommend?"
>
> Thanks mdrisser for contributing, and I hope you don't mind (too much)
> my opinion.
>
> Cheers, keep up the good work.
>
> --
> Ariel Fleslerhttp://flesler.blogspot.com
>
> On 16 abr, 20:53, mdrisser <[EMAIL PROTECTED]> wrote:
>
> > Hi all,
> > I just released version 0.2 of my SafeMail plugin over at the jQuery
> > plugin repository. SafeMail is another plugin that allows you to
> > safely display email addresses in a web page so that spam bots can't
> > read them. Arguments are now passed as an object and I added two
> > additional options, the first allows you to add a custom class to the
> > tag and the second allows you to wrap the email address in a div
> > rather than a mailto link.
>
> >http://plugins.jquery.com/node/2277


[jQuery] Re: CSS Design consideration

2008-04-17 Thread mdrisser

Use CSS to handle the overall style of your pages, the look and feel,
and the layout and attach those styles to the HTML elements, either
through IDs or classes or both. Use jQuery to add additional
functionality to your pages, but keep as much of the styling as
possible within the CSS file(s).

This actually accomplishes two things:
1. You can easily change the look and feel and layout of your pages by
just editing the CSS (see CSS Zen Garden for examples of this)
2. Users who have JavaScript disabled, will still get a nicely styled
page, even if they do miss out on the added functionality.

On Apr 16, 2:04 pm, "JFrameworks.com" <[EMAIL PROTECTED]> wrote:
> Hi,
> I have moderate experience with CSS, HTML & JScript.
> I have task of making for HTML Pages using CSS and JQuery.  Those
> pages will be further extended, copied to full fledged system.
>
> I am thinking of two patterns for html pages
> 1. Define only class selectors in CSS and use JQuery to attach those
> class to relevant IDs & handle events?
> or
> 2. Use CSS to apply styles to html elements too and use JQuery only to
> handle events etc.
>
> What approach you guys use? Is there any blog or link to discuss on
> this topic more?
>
> I am more looking into generic pattern which can be applied to new
> pages.
>
> Thanks
> Ashish J


[jQuery] Re: HOWTO: Nested hover

2008-04-16 Thread mdrisser

Could you post an example of what you're doing?

On Apr 16, 9:46 am, weepy <[EMAIL PROTECTED]> wrote:
> Hi
>
> I have a div with other divs nested inside it (these may have further
> divs nested inside). I want to provide a hover effect when each is
> hovered upon.
>
> The trouble I have is that upon mouseout of a nested div - the hoveron
> event of the surrounding div is not fired.
>
> I could keep a list of divs and pop them on and off, but I wondered if
> there was a better way.
>
> Any ideas ?!
>
> weepy


[jQuery] email plugin

2008-04-16 Thread mdrisser

Hi all,
I just released version 0.2 of my SafeMail plugin over at the jQuery
plugin repository. SafeMail is another plugin that allows you to
safely display email addresses in a web page so that spam bots can't
read them. Arguments are now passed as an object and I added two
additional options, the first allows you to add a custom class to the
tag and the second allows you to wrap the email address in a div
rather than a mailto link.

http://plugins.jquery.com/node/2277


[jQuery] Re: toggle hide show function not working (code provided)

2007-11-23 Thread mdrisser

Jay,
Your code works great, but adds a couple of extra steps. Its not
necessary to empty the html first, if you call .html() with an
argument containing what you want to appear there, jQuery will clear
the exisiting html for you and then replace it with what you had
desired.

// Works, but adds an extra step
$('#myID').html('').append('Something I want to appear in myID');

// Does the same thing, but with less typing ;-)
$('#myID').html('Something I want to appear in myID');

Just a tip for those of us 'Lazy' Programmers ;-)

On Nov 21, 11:16 am, Jay Fallon <[EMAIL PROTECTED]> wrote:
> You need to clear your HTML first. remove() does nothing.
>
> 
> $(document).ready(function(){
> $('div.bang').addClass('hide');
> $('a.collapse').toggle(function(){
> $('div.bang').show();
> $('a.collapse').html("").append("(-)");
> }, function(){
> $('div.bang').hide();
> $('a.collapse').html("").append("(+)");
> });});
>
> 
>
> On Nov 21, 1:35 pm, FrankTudor <[EMAIL PROTECTED]> wrote:
>
> > 
> > $(document).ready(function(){
>
> > $('.bang').hide();
>
> > $("a.collapse").toggle(function()
> > {
> > $('.bang').show();
> > $('a.collapse').remove("(-)").append("(+)");
>
> > },function(){
>
> > $('.bang').hide();
> > $('a.collapse').remove("(+)").append("(-)");});
> > });
>
> > 
>
> > 
> > 
>
> > (-)
>
> > 
> > Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean at
> > magna nec erat tincidunt sollicitudin. Phasellus eu est. Aenean diam
> > elit, laoreet sed, suscipit eget, hendrerit vel, lorem. Suspendisse
> > nec turpis ullamcorper urna accumsan sollicitudin.
> > 
>
> > Can someone put a set of eyes on the above code...It doesn't seem to
> > work and I am not sure why.
>
> > Thanks,
> > Frank


[jQuery] Re: toggle hide show function not working (code provided)

2007-11-21 Thread mdrisser

The problem is that .remove() removes the actual element not the text
inside of it.

This works:
$("a.collapse").html("(-)");



On Nov 21, 10:35 am, FrankTudor <[EMAIL PROTECTED]> wrote:
> 
> $(document).ready(function(){
>
> $('.bang').hide();
>
> $("a.collapse").toggle(function()
> {
> $('.bang').show();
> $('a.collapse').remove("(-)").append("(+)");
>
> },function(){
>
> $('.bang').hide();
> $('a.collapse').remove("(+)").append("(-)");});
> });
>
> 
>
> 
> 
>
> (-)
>
> 
> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Aenean at
> magna nec erat tincidunt sollicitudin. Phasellus eu est. Aenean diam
> elit, laoreet sed, suscipit eget, hendrerit vel, lorem. Suspendisse
> nec turpis ullamcorper urna accumsan sollicitudin.
> 
>
> Can someone put a set of eyes on the above code...It doesn't seem to
> work and I am not sure why.
>
> Thanks,
> Frank


[jQuery] Superfish - Autotrigger Third Level

2007-11-21 Thread mdrisser

Hi all,
I have a three - tiered superfish menu that's working great as is.
What I need to do though is automatically show the third levels when
the first level is hovered over.



Main-1
 
Sub-1

Item-1
Item-2




Main-2



| Main-1 | Main-2 |
---
| Sub-1 | Sub-2 |
-
| Item-1 |
-
| Item-2 |
-

For example, if I where to hover over "Main-1" above, not only would
"Sub-1" and "Sub-2" be shown, but also "Item-1" and "Item-2" similar
in appearance to the menu system on http://www.tampabay.com

I'm not entirely sure what the best way to do this would be. Something
like $("ul.nav li").mouseover(function().
or something else entirely.





[jQuery] Re: Help with book example - alternating row colors

2007-07-30 Thread mdrisser

It really depends upon how you're going about trying to add the bottom
border. The best way would be to either put the bottom border in
#chemTable tr { border-bottom: 1px solid #000;} or add a bottom border
to your add and even classes. (i.e. .odd, .even {border-bottom: 1px
solid #000;}  That is assuming that each 'set' represented above is in
a single row.

If not then try something like:
if(rowIndex %3 == 0) {
$(this).addClass('bottom-border-class);
}



On Jul 30, 8:16 am, "Priest, James (NIH/NIEHS) [C]"
<[EMAIL PROTECTED]> wrote:
> In the book - there is an example for alternating row colors in a table,
> and an expanded version for alternating triplets.
>
> I've got that working - I have a table with two rows of chemical data:
>
> CHEMICAL NAME: BA (GROWTH STIMULANT)
> AMOUNT: 1   UNITS: FL.OZ.   ISOTOPE:ACTIVITY:
> ACTIVITY/UNITS:
> 
> CHEMICAL NAME: GADOLINIUM(III)CHLORIDE HEXAHYDRATE
> AMOUNT: 1   UNITS: FL.OZ.   ISOTOPE:ACTIVITY:
> ACTIVITY/UNITS:
> 
>
> Using the book code - I've got the background striped every other row:
>
> $(document).ready(
> function() {
> // $('table#chemtable tr:odd').addClass('odd');
> // $("#chemtable tr:even").addClass("even");
> var rowClass = "even";
> var rowIndex = 0;
> $('table#chemtable tr').each(function(index) {
>
> if (rowIndex %2==0){
> rowClass = (rowClass == "even" ? "odd" :
> "even");
> };
>
> $(this).addClass(rowClass);
> rowIndex++;
> });
> });
>
> But now I'd like to add a bottom border to each 'set' (like the txt
> example above) but so far my attempts haven't worked... I either get the
> bottom border correct - or my striping on each 'set' gets thrown off..
>
> I'm thinking I need to setup up another index to loop over within the
> main loop?
>
> Thanks,
> Jim



[jQuery] Re: Problem accessing current element from plugin

2007-07-11 Thread mdrisser

I just figured it out :) Following the code in SeViR's Google Maps
plugin, I did this:

jQuery.fn.ymap = function(settings) {
return this.each(function() {
new jQuery.ymap(this, settings);
});
}

jQuery.ymap = function(obj, settings) {
// Function Code
}

Which works beautifully. Hopefully this will be a help to someone
else



[jQuery] Re: TableSorter question

2007-06-04 Thread mdrisser


Try using something similar to the following:
// TableSorter
$('.reportTable').tableSorter({
sortColumn: 'date', // Integer or String of 
the name of the column to
sort by.
sortDir: 2,   // Change the 
default sort direction to 2
(descending)
sortClassAsc: 'headerSortUp',   // Class name for ascending 
sorting action
to header
sortClassDesc: 'headerSortDown',// Class name for descending sorting
action to header
headerClass: 'header',  // Class name for headers 
(th's)
stripingRowClass: ['even','odd'],// Class names for striping 
supplyed as
a array.
stripeRowsOnStartUp: true,  // Strip rows on tableSorter 
init.
});

Notice the sortColumn and sortDir values. sortColumn takes a value based on
the text between a  and . sortDir is defaulted to 0, and is used in
a  trinary operator to determine the default sort direction based on 'dir %
2', which basically says take the number 'dir' divide it by 2 and if 1,
'true' is the remainder then sort ascending, otherwise sort descending.
Setting it to 2 reseults in a remainder of 0, 'false' so the default sort
direction is now descending.

I hope this helps.

-- Michael


Chris W. Parker wrote:
> 
> 
> I want my table to be sorted in the opposite direction that it's
> currently being sorted in when TableSorter does its first sort. I can't
> find a switch to do that but perhaps I'm not seeing it. Anyone know what
> it's called or should I just add my own?
> 
> 

-- 
View this message in context: 
http://www.nabble.com/TableSorter-question-tf3548948s15494.html#a10953966
Sent from the JQuery mailing list archive at Nabble.com.