[jQuery] Re: format number

2009-10-06 Thread Jonathan Sharp
Doh...thank you Karl for saving my behind. Parse Int won't work...coffee
hadn't kicked in yet.
Cheers,
- Jonathan

On Mon, Oct 5, 2009 at 6:58 PM, Karl Swedberg  wrote:

>
> On Oct 5, 2009, at 11:43 AM, Jonathan Sharp wrote:
>
> You can run a parseint on the number: var myInt = parseInt( '15,000', 10);
> Cheers,
> - Jonathan
>
> http://jqueryminute.com
>
>
> Oops. that's not such a good idea. It'll return 15. ;-)
>
> There are probably much better ways of doing this, but one way is to use a
> regex replace:
> var someFormattedNumber = '15,000';
> +someFormattedNumber.replace(/\D/g,'')
>
>
> --Karl
>
> 
> Karl Swedberg
> www.englishrules.com
> www.learningjquery.com
>
>


[jQuery] Re: MooTools and jQuery

2009-10-06 Thread Jonathan Sharp
Hi Dennis,
We had some issues with jqModal and unfortunately only the minified source
is available so we ended up using the jQuery UI dialog component with great
success.

(Note the filesize listed on the jQuery UI page is for the entire zip file,
the library itself is much smaller)

http://jqueryui.com/demos/dialog/

Cheers,
- Jonathan


On Tue, Oct 6, 2009 at 8:29 AM, Dennis Madsen  wrote:

>
> I'm developing a site in Joomla CMS which use both MooTools and
> jQuery.
>
> I've created a small, clean page where you can see the problem:
> http://www.dennismadsen.com/uploads/mootools_jquery/
>
> You can download the source-code from this URL:
> http://www.dennismadsen.com/uploads/mootools_jquery/mootools_jquery.zip
>
> When you run the code, you'll see an error in Firefox Error Console:
> jqModal.js line 40.
> Can you help me figuring out how to run this jQuery extension when
> Mootools is active?


[jQuery] Re: How to Add A Callback Function to a plugin

2009-10-05 Thread Jonathan Sharp
$.fn.myPlugin = function(options) {options $.extend({ callback: null },
options);
// Your plugin

   if ( $.isFunction(options.callback) ) {
   options.callback.call();
   }
};

$('div').myPlugin({
callback: function() {
// Your callback code
}
});

A better approach might be to simply have your plugin do a
.trigger('pluginevent') which allows for multiple listeners to then use it:
$.fn.myPlugin = function() {
// Your plugin code
$(this).trigger('myplugindidsomething');
};

$('div')
.myPlugin()
.bind('myplugindidsomething', function() {
// Your callback code
});

Cheers,
- Jonathan

http://jqueryminute.com

On Mon, Oct 5, 2009 at 3:10 PM, bittermonkey  wrote:

>
> How do I add a callback function to a plugin so that i can execute
> another function after the plugin completes its own processes.
>
> Thanks in advance.


[jQuery] Re: textContent attribute problem with ie

2009-10-05 Thread Jonathan Sharp
What are you trying to do?

On Mon, Oct 5, 2009 at 11:37 AM, m.ugues  wrote:

>
> HAllo all.
> This piece of code works fine in FIrefox but does not work in IE.
>
> http://pastie.org/642444
>
> The problem is on textContent attribute that in IE is undefined.
>
> Any workaround?
>
> Kind regards
>
> Massimo UGues


[jQuery] Re: selectors with xml cdata, parse html string

2009-10-05 Thread Jonathan Sharp
Hi Donnie & Pirco,
You can use the .text() jQuery method to get at the CDATA.

The error though is coming from how you're selecting the ID:

Instead of:
html = $.trim($(xml).find("html").text());
   alert($("#mydiv", html).attr("id"));

Try:
// XML is already a XML Document object
var cdata = $.trim( $('html', xml).text() );
alert( $(cdata).find('#mydiv').attr('id') );

Cheers,
- Jonathan

http://jqueryminute.com



On Sun, Oct 4, 2009 at 2:49 PM, pirco pirco  wrote:

>
>
> did u ever get an answer for this?
> I'm in desperate need to pull CDATA content from my XML file as well.
>
> please let me know.
>
> thanks!
>


[jQuery] Re: Modify Dom Element using JQuery

2009-10-05 Thread Jonathan Sharp
Hi Nitin,
Something similar to the following should work:

$('div.modan > p > a').each(function() {
$(this).parent().after( $('').find('li').append( this
).end() ).remove();
});

Cheers,
- Jonathan


On Mon, Oct 5, 2009 at 10:19 AM, Nitin Gautam wrote:

>
> I have following code
>
> 
> Center
> 
> Keep a Long-Term Focus
> 
> 
>
> My requirement is I have to remove the  tag and insert  
>
> 
> Center
> 
> Keep a Long-Term Focus
> 
> 
>
> How Can I do this using JQueryAnchor link is getting generated
> dyncamically
> Tell me the way to make it wrkng in both FF and IE


[jQuery] Re: format number

2009-10-05 Thread Jonathan Sharp
You can run a parseint on the number: var myInt = parseInt( '15,000', 10);
Cheers,
- Jonathan

http://jqueryminute.com


On Sun, Oct 4, 2009 at 7:49 AM, runrunforest  wrote:

>
> cool, but that leads to another problem
>
> The computer now thinks 15,000 is just 15 instead of fifteen thousands


[jQuery] Re: Quick question on image loading

2009-10-05 Thread Jonathan Sharp
Hi Eric,
The browser will replace the image first before loading it. What you can do
to preload the image is as follows:

var newBackgroundImage = '/new/image/url.png';
$('')
.attr('src', newBackgroundImage)
.bind('load', function() {
$('div').css('background-image', 'url(' + newBackgroundImage + ')');
});

This starts by creating a new image element and setting the source of it to
the background image which will start loading it in the browser. Then we
bind to the image's load event which is triggered when the image has
finished loading. In the load callback function you can then set the css
background image of your div and the image will already be in the browser's
cache and load instantly.

Cheers,
- Jonathan

http://jqueryminute.com

On Mon, Oct 5, 2009 at 2:25 AM, Erock  wrote:

>
> My question is, if I have one image as the background of a div, and I
> set the background of that div to another image, will html load the
> new image before replacing the old one or replace the old image with
> something ugly (say just plain white) and then load it.
>
> The reason I'm asking is, because my site isn't hosted anywhere, it's
> hard to tell what will happen on a non-local connection when the
> images actually have to be loaded.
>
> Thanks
> Eric
>


[jQuery] Re: Bug in globalEval function

2009-04-07 Thread Jonathan Sharp, Out West Media
Hi Dan,

Can you post a URL to a page that includes the smallest amount of code to
reproduce this issue?

Cheers,
- Jonathan


On Tue, Apr 7, 2009 at 2:44 PM, DynamoDan  wrote:

>
> Hi All
>
> I've used jQuery a lot over the years, mostly in the joomla CMS
> context.  I think I've found a bug in this function:
>
>// Evalulates a script in a global context
>globalEval: function( data ) {
>
> The problem is that if there is a newline inside of a string literal
> (single quoted) in `data`, then the script fails with an "unterminated
> string literal" error.  The first thing done to `data` in this
> function is this (jQuery 1.2.6):
>
>data = jQuery.trim( data );
>
> But, this trim function only removes leading and trailing whitespace
> using a regex, and not with the s modifier to include newlines
> matching the \s character class.
>
> jQuery 1.3.2 omits this call to jQuery.trim, and still exhibits the
> "unterminated string literal" error when `data` contains a newline
> inside of single quotes.
>
> I don't know what the solution should be for sure, but for my own
> purposes I've added this line to globalEval before anything is done
> with `data`:
>
>data = data.replace(/[\r\n\f]+/g, ' ');
>
> It works on data that contains carriage returns, newlines, or form
> feed characters, since these (well, at least the newline) don't work
> inside single quotes, when evaluated as a javascript.
>
> Love to hear if anyone else has had this problem.
>
>


[jQuery] Re: get reference to nested appended element

2009-04-07 Thread Jonathan Sharp, Out West Media
Another approach you can take is:

var table = $('')
 .appendTo( parent )
 .find('table');

This creates the HTML and then appends it to the parent. Since you created a
jQuery object with that fragment, calling find will locate the inner table.

Cheers,
- Jonathan


On Tue, Apr 7, 2009 at 4:38 AM, miniswi...@gmail.com
wrote:

>
> hi there, see next example:
>
> parent.append("");
> table = $("#rt0");
>
> is it possible to reference the inside table directly without using
> the id to select it?
>


[jQuery] Re: Wrap text between two divs

2009-04-06 Thread Jonathan Sharp, Out West Media
jQuery doesn't select or operate on text nodes. Here's a plugin I wrote that
will capture the text node and wrap it:

/*!
 * jQuery wrapNextTextNode Plugin v1.0
 * http://outwestmedia.com/
 */
$.fn.wrapNextTextNode = function(wrap) {
return this.each(function() {
var ns = this.nextSibling;
while ( ns ) {
if ( ns.nodeType == 3 ) {
var node = $(wrap)[0];
ns.parentNode.insertBefore(node , ns);
node.appendChild( ns );
break;
}
ns = ns.nextSibling;
}
});
};

You'd use it like this:

$('#1').wrapNextTextNode('');

Cheers,
- Jonathan


On Mon, Apr 6, 2009 at 9:56 PM, FameR  wrote:

>
> Is there way to create element that consists html between two another
> elements?
>
> for exmple:
> from this
> 
>Some st
>ra
>nge foobarded
>
>text goes here
> 
>
> to:
>
> 
>Some st
>ra
>nge foobarded
>
>text goes here
> 
>
> or:
>
> 
>Some st
>ra
>nge foobarded
>
>text goes here
> 
>
>


[jQuery] Re: Why does my website crash in IE when fading?

2009-04-06 Thread Jonathan Sharp, Out West Media
Hi Chris,

I'd recommend starting by commenting out all code until IE doesn't crash.
Then I'd start uncommenting code in smaller blocks until you isolate what
starts the IE crash.

Cheers,
- Jonathan


On Mon, Apr 6, 2009 at 8:56 PM, zeckdude  wrote:

>
>
> My site works fine in Firefox, but it crashes in IE.
>
> I am using alot of jQuery in order to fade in content. When the user clicks
> on one of the above links a few times, it will crash in IE.
>
> Here is my site:  http://www.idea-palette.com/
> http://www.idea-palette.com/
>
> I have absolutely no idea why the site crashes in IE. I don't even know
> where to begin to debug my problem. I don't have Visual Studio on my
> computer, but on my friends computer Visual Studio reads a message of "An
> unhandled win32 exception occurred in iexplore.exe[]"
>
> Does anyone have any ideas?
> --
> View this message in context:
> http://www.nabble.com/Why-does-my-website-crash-in-IE-when-fading--tp22920819s27240p22920819.html
> Sent from the jQuery General Discussion mailing list archive at Nabble.com.
>
>


[jQuery] Re: New to Jquery : Using it on dynmaically created divs

2008-10-23 Thread Jonathan Sharp, Out West Media


Hi James,

Here's one way to rewrite it using jQuery:
function divShowHide(divID, imgID) {
var d = $('#' + divID).toggle();
	$('#' + imageID).attr('src', 'Images/' + ( d.is(':visible') ?  
'down' : 'up' ) + 'arrow.png' );

}

Cheers,
-Jonathan



On Oct 23, 2008, at 8:42 AM, James2008 wrote:

Hi. At the moment I've creating 2 divs for each record in a database.
One to first give a title for that piece of information and the second
to be a show/hide div that gives furthur information upon clicking a
little arrow. I generate both divs server side on an updatepanel
refresh. I have them showing/hiding at the moment using this
function...


function divShowHide(divID, imgID){ // Hides/Shows the second div and
changes arrow appearance

 var divToChange = document.getElementById(divID);

 if(divToChange.style.display == "block") {
   divToChange.style.display = "none";
   document.getElementById(imgID).src = "Images/downarrow.png";
 }
 else {
divToChange.style.display = "block";
document.getElementById(imgID).src = "Images/uparrow.png";
 }
}


I was wandering if I could incorporate Jquery into this function to
make it do the job , or if all the divs have to be created in the head
section with jquery beforehand?? I have tried using the show/hide
commands in the above function using Jquery but they don't seem to
work. Each of my second divs have a unique ID, I just need to know if
it's possible to do it in this way?? All the examples on the site use
pre-defined names for divs but as I do not know the ammount of div
sets before so can't do that. They are all called "div2" + a unique
identifyier.

Any help would be greatly appreciated.

Thanks,
James




[jQuery] Re: how change external html AFTER load using $.load

2008-10-22 Thread Jonathan Sharp, Out West Media


Erik is correct that liveQuery will work, but you can also just change  
where you bind the click event.


What you want to do is:

function listar(id,tipo,busca){
$('#lista' + tipo + busca).remove();
$('#link' + tipo).after('');
$('#lista' + tipo + busca).load('vars.html', {}, function() {
// this is the dom element #lista + tipo + busca
// $('a', this) = find all 'a' tags that are children of 'this'
$('a', this).click(function () {
var url = $(this).attr('title');
alert(url);
});
});
$('#link' + tipo).css('border','1xp solid red');
}

Cheers,
-Jonathan


On Oct 22, 2008, at 7:36 PM, gtso86 wrote:

I create a simple test like my problem... because my real problem
hosted on blocked domain for external visits.

http://www.gabrieltadeu.com/teste/testes.html

this example above have the same problem. i need the function

$('#rapida ul a').click(function () {
var url = $(this).attr('title');
alert(url);
});


work with the loaded content.

for repeat my probleam:

click in 'MG' (this action fire the load content)

now, click in 'Belo Horizonte' (this is the load content!) first alert
dont appear. :(



On 22 out, 21:59, "Jonathan Sharp, Out West Media"  wrote:

Hi gtso86,

Do you have a URL of the page in question?

It may be that you need to call your $('#rapida ul a')... code after
$.load() is finished loading the content.

You could do this by using the callback argument:
$.load(url, [data], function() {
$('#rapida ul a')...

});

Cheers,
-Jonathan

On Oct 22, 2008, at 5:32 PM, gtso86 wrote:


Hi everybody... this morning i started a project $.load. When i load
the html using $load in the main page (default.aspx) i cant  
interacte

with using jQuery.



Simple interactives like



$('#rapida ul a').click(function () {
   var url = $(this).attr('href');
   alert(url);
   //$(this).parents().css('border','1px solid red');
});



dont work ONLY in the loaded content. i can manipulate this content?




[jQuery] Re: Cycle: Direct link from another page

2008-10-22 Thread Jonathan Sharp, Out West Media


Hi Isaac,

Do you have a link you could post? It's unclear to me exactly what the  
question is.


Cheers,
-Jonathan


On Oct 22, 2008, at 6:59 PM, isaacn wrote:

Is there a way to do a direct link to an arbitrary slide, from another
page? I saw the demo where the link was on the same page, but this
would be from somewhere that doesn't really know what slides exist (so
it doesn't know which slide is where in the index.)

For what it's worth, the slide itself has an ID -- #photo-x (where x
is the drupal node ID, not the index of the slide); can Cycle or
jQuery grab the URL that was called and match it up to the index,
allowing the slide to be directly linked to?

Thanks,

Isaac




[jQuery] Re: Question about Shadows on the jQuery Nav Bar

2008-10-22 Thread Jonathan Sharp, Out West Media


Hi Elke,

The dropShadow plugin wasn't used for this. It was accomplished with  
images and css. If you download Firefox 3 and install the excellent  
firebug extension (http://www.getfirebug.com) it allows you to inspect  
the HTML page and see what CSS styles were applied to what elements.  
Happy browsing!


Cheers,
-Jonathan


On Oct 22, 2008, at 10:46 AM, plumwd wrote:



Hi,

I am just curious if the dropShadow plugin was used to create the
shadows on the nav bar which appears on the jQuery main page at
http://www.jquery.com.  The nav bar I'm referring to is the one with
the rounded corners and has the links for Downloads, Discussion,
Documentaton, Tutorials, and the Bug Tracker.

I love that effect and would like to implement something similar in a
design I'm creating.

Thanks!

Elke




[jQuery] Re: how change external html AFTER load using $.load

2008-10-22 Thread Jonathan Sharp, Out West Media


Hi gtso86,

Do you have a URL of the page in question?

It may be that you need to call your $('#rapida ul a')... code after  
$.load() is finished loading the content.


You could do this by using the callback argument:
$.load(url, [data], function() {
$('#rapida ul a')...
});

Cheers,
-Jonathan


On Oct 22, 2008, at 5:32 PM, gtso86 wrote:

Hi everybody... this morning i started a project $.load. When i load
the html using $load in the main page (default.aspx) i cant interacte
with using jQuery.

Simple interactives like

$('#rapida ul a').click(function () {
var url = $(this).attr('href');
alert(url);
//$(this).parents().css('border','1px solid red');
});

dont work ONLY in the loaded content. i can manipulate this content?




[jQuery] Re: Clarification on the use of JSONP in $.ajax

2008-10-22 Thread Jonathan Sharp, Out West Media


Hi RWF,

You can make a cross site call if the server knows how to speak JSONP.  
Remy Sharp (no relation) had a great blog post about this a while back:

http://remysharp.com/2007/10/08/what-is-jsonp/

Cheers,
-Jonathan


On Oct 22, 2008, at 6:17 PM, RWF wrote:

in the docs: http://docs.jquery.com/Ajax/jQuery.ajax#options

it says:

As of jQuery 1.2, you can load JSON data located on another domain if
you specify a JSONP callback, which can be done like so: "myurl?
callback=?". jQuery automatically replaces the ? with the correct
method name to call, calling your specified callback. Or, if you set
the dataType to "jsonp" a callback will be automatically added to your
Ajax request.
*


Is there an example of this?  This makes it sound like I can make a
cross site request to a webservice that returns a JSON object and
jquery will handle the rest.




[jQuery] Re: Finding position among siblings

2008-07-15 Thread Jonathan Sharp
$('div').click(function() {
// Will give you the index out of just the DIV tags
var index = $(this).parent().find('> ' + this.tagName).index(this);

// Will give you the index out of all siblings
var index = $(this).parent().find('> *').index(this);
});

Cheers,
-Jonathan


On Tue, Jul 15, 2008 at 10:57 AM, ml1 <[EMAIL PROTECTED]> wrote:

>
> Is there an efficient, cross browser jquery way to find a node's
> position among it's siblings?
>
> Ie if I have ten  nodes next to each other and the user clicks on
> the third one, what's the best way to tell that it's the third one?
>
> Thanks!
>


[jQuery] Re: AJAX not working

2008-07-11 Thread Jonathan Sharp
Hi jbhat,

Can you post a URL? It's nearly impossible to debug or provide any feedback
from reading the code below.

Cheers,
-Jonathan


On Fri, Jul 11, 2008 at 2:51 PM, jbhat <[EMAIL PROTECTED]> wrote:

>
> I am having trouble with AJAX:
>
> In document ready i have:
>
> $.post("test.php", function(data){alert('Success');});
>
> and test'php is just ...the alert never comes up
>
> This is just a test... In addition to the callback not working, when
> the php file updates a mySQL database, those updates are never made.
> Why could this be?  I'll put all my js code below:
>
>id=0;
>p1uid = 0;
>p2uid = null;
>multiplayer = false;
>diff=3;
>p1=true;
>lock = false;
>intID = 0;
>cash = 500;
>hisCash = 500.5;
>turn=0;
>bid=0;
>hisBid=0;
>localturn=0;
>
>$(function() {
>if(multiplayer){
>$('input.mult').hide();
>$('select.mult').hide();
>}id = $('form').attr('id');
>$.post("test.php", function(data){alert('Success');});
>//intID = setInterval("cycle()", 5000);
>});
>
>function cycle(){
>if(!lock){
>localturn = turn;
>updateLocals();
>if(turn != localturn) play();
>if(turn > 4) clearInterval(intID);
>}
>}
>
>function play(){
>if(turn == 0 || turn == 2){
>$('input.msg').val("Enter a Bid");
>}else if(turn == 3){
>$('input.msg').val("He bid " + stringify(hisBid) +
> ".  Make a
> move!");
>}else if(turn == 1){
>$('input.msg').val("Waiting for opponent to bid.");
>}else if (turn == 4){
>$('input.msg').val("He bid " + stringify(hisBid) +
> ".  His turn");
>if(!multiplayer) compMove();
>}else{
>$('input.msg').val("Game Over!");
>}$('input.cash').val(stringify(cash));
>$('input.hisCash').val(stringify(hisCash));
>}
>
>function updateLocals(){
>lock = true;
>$.post("update.php", {id: id, player: p1}, function(data){
>cash = data["cash"];
>hisCash = data["hisCash"];
>turn = data["turn"];
>bid = data["bid"];
>hisBid = data["hisBid"];
>for(i=0; i<9; i++){
>position = "b"+i;
>$(position).val(data[position]);
>}
>}, "json");
>lock = false;
>}
>
>function clear_with(form) {
>lock = true;
>cash = 500.5;
>hisCash = 500;
>turn = 0;
>for (i=0;i<9; ++i) {
>position="b"+i;
>form[position].value=' ';
>}
>form.cash.value = "500*";
>form.hisCash.value = "500";
>form.output.value = "Enter a bid to begin";
>form.bid.value = "";
>$.post("reset.php", {id: form.id, token: true}, function(data)
> {form.id = data;});
>lock = false;
>}
>
>// change board when button is clicked
>function clear_all(form) {
>lock = true;
>hisCash = 500.5;
>cash = 500;
>turn = 0;
>for (i=0;i<9; ++i) {
>position="b"+i;
>form[position].value=' ';
>}
>form.cash.value = "500";
>form.hisCash.value = "500*";
>form.output.value = "Enter a bid to begin";
>form.bid.value = "";
>$.post("reset.php", {id: form.id, token: false},
> function(data)
> {form.id = data;});
>lock = false;
>}
>
>function stringify(num){
>if(num % 1 == 0) {return num;}
>else{return (Math.floor(num) + "*");}
>}
>
>function pickBid(form){
>lock = true;
>placeBid(form, form.chip.value == ' ' &&
> form.cash.value.indexOf('
> ') != -1);
>lock = false;
>}
>
>function setBothBids(form, tok){
>hisBid = (Math.random()/2 + 1/4)*hisCash;
>if(tok) {hisBid = Math.round(hisBid);}
>else{hisBid = Math.round(hisBid*2)/2;}
>$.get("setBothBids.php", {id: form.id, player2: hisBid,
> player1:
> bid}, function(data){
>alert(data.turn);
>turn=data.turn;
>cash=data.cash;
>   

[jQuery] Re: internship with a programmer - wanna work for free to learn

2008-07-11 Thread Jonathan Sharp
Hi Vik,

On Thu, Jul 10, 2008 at 4:41 PM, joomlafreak <[EMAIL PROTECTED]> wrote:

> ...

My impression so far had been that they really are
> not counted much compared to your experience. It is generally
> mentioned by people that increasing competition has led to companies
> using the credentials like degree as a way of scoring the candidates
> but in the end it is your experience relevant to the need that counts.


I think this is right on target but here's where I've seen it vary. In a
large corporate setting degree tends to be a check mark for eligibility for
employment. Some places take GPA into account and require transcripts (I
personally think this matters considerably less than the potential
employee's passions.)  To contrast this, smaller companies and startups
usually tend to look for the experience and care less about the degree. I
cut my teeth in a start up environment and that experience has been one of
the biggest influences in my career. Also smaller companies may tend to be
more flexable in terms of taking on an "intern" and you'll benefit from a
wide range of opportunities (such as programming to hardware systems to
networking).

Personal networking is going to be your biggest asset in this switch (hence
your post here to build your network.)  Since this career switch is delving
into an area where you don't have previous experience and contacts, this is
where the formal degree can be an asset. When you pick a school make sure
it's a research oriented program as opposed to a "general theory" program. A
highly research academic setting will give you the networking contacts that
you'd need to break into the field and potentially further in without as
much relevant experience.

A number of startups have come out of the academic settings (*cough*
google.) So even going to a university and talking with the faculty may give
you the contacts needed to find companies in the early stages that would
love to take you on.

...
>
> Why I am thinking otherwise, not going formal way which may be wrong
> completely, is that it is four years to do a degree course which is a
> big time period and my age factor creates a fear in my mind. I am
> pretty strong when I say I have taken the decision to switch my career
> but still it breaks in sometimes.


I absolutely know what you're going through and empathize! There will be
dozens upon dozens of people that will say "you can't do that!" and then
dozens more after you do it that will say "how'd you do that? Please tell
me!". I've gone/going through a similar situation in changing jobs but am
stepping into a situation in which I have lots of experience and contacts.
Still, there are those that will tell you you're crazy.

It comes down to this, you can't be afraid of things not working out and
have to determine if the risk is worth the potential payoff. I agree that
the four years seems like a long time but you have to ask yourself the
question, "in four years would I rather be an MD or working in the
technology field". There will be moments of doubt along the way (I turned in
2 weeks notice and walked out that day thinking "WHAT THE HECK HAVE I
DONE!") but you have to remind your self at that point what you're working
towards.

So good luck!

Cheers,
-Jonathan


[jQuery] Re: internship with a programmer - wanna work for free to learn

2008-07-10 Thread Jonathan Sharp
Hi Vik,

This is somewhat of a tough question to answer. I think the most important
factor in this is rather than "programming experience" it should be
"relevant experience". Having been professionally in the IT field for over
10 years, I've focused my skill set to the web development realm and more
specifically within that to a core set of languages and skills. There is
such a broad range of technologies and areas of expertise along with a
plethora of developers that I think it's going to be hard. I won't say that
you can't do a career change, but there are considerably high "sunk costs"
associated with this.

I'd suggest your goal be to gain experience with the technologies specific
to your career ("robotics related to medicine"). Unfortunately that tends to
be a more specialized position than say a "web developer". I'd honestly say
your best bet would probably be to pursue a computer science/computer
engineering degree which will give you enough of the "experience" (on top of
your MD) to break into a position which will then have a significant amount
of "on the job" training. I'd seriously look at an academic approach as
those fields tend to be heavily research based and technically intense by
means of hardware / software experience.

Cheers,
-Jonathan


On Thu, Jul 10, 2008 at 1:34 PM, joomlafreak <[EMAIL PROTECTED]> wrote:

>
> Hi
>
> I am trying to find some one to be my mentor and teach me programming
> as I work. I am a novice and dont have a formal education in
> programming but I do have some skills. I am actively reading these
> days but that leaves a void in learning. I am in new orleans right
> now. I am not sure how much time I can devote with my job I will
> ultimately leave my Job when I start to grasp things well and do it
> full time. I am MD by education and against resistance of my near dear
> one's I have decided to go into it. It would sound crazy to many but
> thats how I think. I want to do what I like and I like programming
> more than my medicine.
>
> I am 32 and dont want to go through the traditional way by going to
> college. I had developed joomlaprodigy website (if someone knows
> that), which I sold last year because I was still keeping on to my
> medicine. Over this last year I have decided to switch now. I work in
> Tulane at the moment and as soon as I get better picture of my career
> possibilities I will go into learning programming full time. I hope to
> go into robotics related to medicine especially orthopedics field,( my
> post graduation) later.  I will burn bridges on my back once I get the
> feeling that I can learn it to the extent I want to learn it.
>
> Please give me some suggestions on this and if someone can take me as
> his/her student.( I don't need any money to be paid)
>
> If someone think I am stupid for leaving a medicine career for
> programming, please dont write that. I have heard that from millions.
>
> Thanks
>
> Vik
>


[jQuery] Re: Running a loop for array numbers

2008-07-10 Thread Jonathan Sharp
Hi Johnee,

Here's one approach (untested):

var $e = $('.equipment');
$.each(['1', '2', '5', 'x'], function(i, k) {
$e.find('a.i-right' + k)
.filter(function(i) {
return ( i > 0 && i < 9 );
})
.hide()
.end();
});

Cheers,
-Jonathan


On Wed, Jul 9, 2008 at 3:55 AM, JohneeM <[EMAIL PROTECTED]> wrote:

>
> Thanks guys much appreciated.
>
> I tried the last one :
>
> $('.equipment a.i-right1').filter(function(i) {
>return ( i > 0 && i < 9 );
>
> }).hide();
>
> And it worked.
>
> For say
>
> $('.equipment a.i-right1')
> $('.equipment a.i-right2')
> $('.equipment a.i-right5')
> $('.equipment a.i-rightx')
>
> How would i put that into a loop?
>
> Thanks.
>
> On Jul 8, 10:16 pm, "Jonathan Sharp" <[EMAIL PROTECTED]> wrote:
> > Hi Johnee,
> >
> > Another approach would be:
> >
> > $('.equipment a.i-right1').each(function(i) {
> > if ( i > 0 && i < 9 ) {
> > $(this).hide();
> > }
> >
> > });
> >
> > or this would work too:
> >
> > $('.equipment a.i-right1').filter(function(i) {
> > return ( i > 0 && i < 9 );
> >
> > }).hide();
> >
> > Cheers,
> > -Jonathan
> >
> > On Tue, Jul 8, 2008 at 12:00 PM, JohneeM <[EMAIL PROTECTED]> wrote:
> >
> > > Hi guys how can i run this in a single statement without manually
> > > putting in the numbers?
> >
> > > $('.equipment a.i-right1:eq(1)').hide();
> > > $('.equipment a.i-right1:eq(2)').hide();
> > > $('.equipment a.i-right1:eq(3)').hide();
> > > $('.equipment a.i-right1:eq(4)').hide();
> > > $('.equipment a.i-right1:eq(5)').hide();
> > > $('.equipment a.i-right1:eq(6)').hide();
> > > $('.equipment a.i-right1:eq(7)').hide();
> > > $('.equipment a.i-right1:eq(8)').hide();
> >
> > > Note that im skipping the first array [0] due to wanting it to show.
> >
> > > Also this one :
> >
> > >$('.performance-parts #content-container
> > > a.lightbox:eq(8)').lightBox();
> > >$('.performance-parts #content-container
> > > a.lightbox:eq(9)').lightBox();
> >
> > > They need to be in their own array as i want to run a seperate
> > > lightbox for each image, is this possible?
> >
> > > Thanks.
>


[jQuery] Re: Running a loop for array numbers

2008-07-08 Thread Jonathan Sharp
Hi Johnee,

Another approach would be:

$('.equipment a.i-right1').each(function(i) {
if ( i > 0 && i < 9 ) {
$(this).hide();
}
});

or this would work too:

$('.equipment a.i-right1').filter(function(i) {
return ( i > 0 && i < 9 );
}).hide();

Cheers,
-Jonathan


On Tue, Jul 8, 2008 at 12:00 PM, JohneeM <[EMAIL PROTECTED]> wrote:

>
> Hi guys how can i run this in a single statement without manually
> putting in the numbers?
>
> $('.equipment a.i-right1:eq(1)').hide();
> $('.equipment a.i-right1:eq(2)').hide();
> $('.equipment a.i-right1:eq(3)').hide();
> $('.equipment a.i-right1:eq(4)').hide();
> $('.equipment a.i-right1:eq(5)').hide();
> $('.equipment a.i-right1:eq(6)').hide();
> $('.equipment a.i-right1:eq(7)').hide();
> $('.equipment a.i-right1:eq(8)').hide();
>
>
> Note that im skipping the first array [0] due to wanting it to show.
>
>
> Also this one :
>
>$('.performance-parts #content-container
> a.lightbox:eq(8)').lightBox();
>$('.performance-parts #content-container
> a.lightbox:eq(9)').lightBox();
>
> They need to be in their own array as i want to run a seperate
> lightbox for each image, is this possible?
>
>
>
> Thanks.
>


[jQuery] Re: jQuery TShirt

2008-05-09 Thread Jonathan Sharp
Isn't it more like?
alert( $('people:female').find('girlfriend').length == 0 ? 'l33t' : 'normal'
)

-js


On Fri, May 9, 2008 at 11:11 AM, Brandon Aaron <[EMAIL PROTECTED]>
wrote:

> Something like:
>
> $('people:female').find('girlfriend') => []
>
> --
> Brandon Aaron
>
>
> On Fri, May 9, 2008 at 10:33 AM, CVertex <[EMAIL PROTECTED]>
> wrote:
>
>>
>> love it.
>>
>> I'd prefer something clever with code on it than just the logo.
>>
>> just the way i eval...
>>
>> On May 9, 5:16 am, "Josh Nathanson" <[EMAIL PROTECTED]> wrote:
>> > It would be cool if said something like:
>> >
>> > $("code").less();
>> >
>> > ...in Courier typeface...and then had the jQuery logo on it.
>> >
>> > -- Josh
>> >
>> > - Original Message -
>> > From: "Mike Branski" <[EMAIL PROTECTED]>
>> > To: "jQuery (English)" 
>> > Sent: Thursday, May 08, 2008 11:36 AM
>> > Subject: [jQuery] Re: jQuery TShirt
>> >
>> > > Agreed! A darker blue with white text would look good (design
>> > > pending).
>> >
>> > > On May 8, 10:32 am, "Andy Matthews" <[EMAIL PROTECTED]> wrote:
>> > >> PLEASE PLEASE PLEASE offer colors other than just black!!
>> >
>> > >> -Original Message-
>> > >> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED]
>> On
>> >
>> > >> Behalf Of John Resig
>> > >> Sent: Thursday, May 08, 2008 10:24 AM
>> > >> To: jquery-en@googlegroups.com
>> > >> Subject: [jQuery] Re: jQuery TShirt
>> >
>> > >> There's one in the works right now - we're sending it to the producer
>> and
>> > >> will have a store to go along with it. We'll definitely make an
>> > >> announcement
>> > >> when it's ready.
>> >
>> > >> --John
>> >
>> > >> On Thu, May 8, 2008 at 8:09 AM, CVertex <[EMAIL PROTECTED]>
>> > >> wrote:
>> >
>> > >> >  I noticed captain John Resig wearing a few nice threadless.com
>> > >> > tshirts, and he mentioned a few times in a recent talk that they
>> were
>> > >> > selling jQuery tshirts in this or that place.
>> >
>> > >> >  I was wondering if anyone knew of any jQuery tshirts that were
>> around?
>> >
>> > >> >  What would you put on your jQuery T?
>> >
>> > >> >  $(body)
>> >
>> > >> >  -CV
>>
>
>


[jQuery] Re: jQuery Conference

2008-05-07 Thread Jonathan Sharp
Just throwing this out there, but I'm guessing it may be similar to the one
day jQuery Camp '07 that was in Boston, MA following The Ajax Experience
East conference (http://theajaxexperience.com). TAE is scheduled for
Sept/Oct of this year.

Cheers,
-Jonathan


On Wed, May 7, 2008 at 2:20 PM, Joe <[EMAIL PROTECTED]> wrote:

>
> Just watched John's video on What's Next for jQuery and Javascript
> ( http://vimeo.com/984675 ) and he mentioned a conference.  I will
> definitely be attending, but need to know where I'm going and when!
> Anyone have any details on this?
>


[jQuery] Re: Finding a matching class to a variable

2008-02-22 Thread Jonathan Sharp
Hi Philip,

I'm not sure if you're attempting a partial match but you may also find the
following works:

$('div.' + $i)

Cheers,
-Jonathan


On Fri, Feb 22, 2008 at 8:40 PM, Karl Swedberg <[EMAIL PROTECTED]>
wrote:

>
> Hi Philip,
>
> What you need to do in this case is concatenate the variable, so that
> it's not part of the string. Try this:
>
> $("div[class*=" + $i + "]");
>
> That is provided that $i represents the className and not a jQuery
> object or a DOM element with that className.
>
> I hope that helps.
>
>
> --Karl
> _
> Karl Swedberg
> www.englishrules.com
> www.learningjquery.com
>
>
>
> On Feb 22, 2008, at 9:00 AM, Philip wrote:
>
> >
> > Hi there,
> >
> > Here is my conundrum, im trying select a div whos class matches that
> > of a variable ($i) so that I can then apply an effect to it. The div
> > actually has two classes attached to it but only 1 matches the
> > variable (if that makes sense). I've tried such things as $
> > ("div[class*=$i]") amongst other things but haven't had any luck. I'm
> > still pretty new to jQuery but managing to get my head around the
> > basics at least.
> >
> > Any help/pointers would be greatly appreciated.
> >
> > Philip
>
>


[jQuery] Re: window resize event causes IE6 & IE7 to hang

2008-02-21 Thread Jonathan Sharp
Hi Sean,

I'm guessing what's happening is as you resize the div to the height of the
window - 270 it expands the document height which triggers another resize.
Do you have a URL to this page?

Cheers,
-Jonathan


On 2/21/08, SeanR <[EMAIL PROTECTED]> wrote:
>
>
> Hi all,
>
> I'm using $(window).resize() to adjust a div height on the fly.
>
>
> I've found that rapidly changing the window size causes IE6 & IE7 to
> hang
> - I guess because too many events are being fired for IE to cope?
>
>
> Here's my code :
>
>
> function content_resize() {
>var w = $( window );
>var H = w.height();
>$( '#content' ).css( {height: H-270} );
>}
>
> $(document).ready(function() {
>$( window ).resize( content_resize );
>content_resize();
> });
>
>
> I'm using jquery 1.2.2 and the dimensions plugin. I've also tried the
> wresize plugin which addresses duplicated resize events in IE but both
> cause
> the same hang when browser window altered quickly.
>
> Anyone else seen this? Are there any workarounds?
>
> [Apologies for repost, my first got lost in another thread]
>
> Regards
> Sean
> sean ronan
> activepixels
> office :   01245 399 499
> email :  [EMAIL PROTECTED]
> web :activepixels.co.uk
> Activepixels is a limited company registered in England and Wales.
> Registered number: 5081009.
> Registered office: Suite SF8, The Heybridge Business Centre, 110 The
> Causeway, Maldon, Essex, CM1 3TY.
>
>
>


[jQuery] Re: .is() behaviour

2008-02-21 Thread Jonathan Sharp
Hi hartshorne,

You're on the right track with event delegation as it is fundamentally
different than binding the event to each link. With event delegation you
have 1 event bound to 1 element (div), in binding to each link you have 1
event boud to two links.


jQuery('#nav').bind('click', function(evt) {
   // this is a reference to #nav so we can certify that
event.targetoccurred on one of it's children
   alert(jQuery(evt.target).is('.exit'));
   // Call this against the event passed in as the first argument (evt)
   evt.preventDefault();
});

That should do what you're looking for

Cheers,
-Jonathan


On 2/20/08, hartshorne <[EMAIL PROTECTED]> wrote:
>
>
> Hi, I'm new to jQuery, and found something unexpected. With something
> like this:
>
> 
>Exit
>Open
> 
> 
> jQuery('#nav').bind('click', function() {
>alert(jQuery(event.target).is('#nav .exit'));
>event.preventDefault();
> });
> 
>
> I expect .is('#nav .exit') to return true when the event is fired from
> the Exit link, and false otherwise. Instead it always returns true.
> What am I missing?
>
> Thanks!
>


[jQuery] Re: copy values to an array

2008-02-04 Thread Jonathan Sharp
Hi Paul,

This should do the trick:

$('li').each(function(i){
array1[ Math.floor( i / 3 ) ] = $(this).html();
});

Cheers,
-Jonathan


On 2/4/08, Paul Jones <[EMAIL PROTECTED]> wrote:
>
>
> I know the following would work if I wanted to copy the values of *each*
> 
> to a separate array element.
>
> 
> 
> 
>
> 
>
> 
> var array1 = new Array() ;
> $(document).ready(function()
> {
> $('li').each(function(i) {  array1[i] = this.innerHTML )  })
> })
> 
>
> 
>
> 
>
> 
>a
>b
>c
>
>d
>e
>f
>
>g
>h
>i
> 
>
> 
>
> 
>
> However, I would like like to copy the *concatenated* values of each group
> of
> 3 's to 1 array element.
> (eg) the 1st array element would have a value of 'abc', the 2nd array
> element would have a value of 'def', and the 3rd array element would have
> a
> value of 'ghi' etc.
>
> What is the best way to do this?
>
> TIA
>


[jQuery] Re: Another jdMenu problem... IE specific...

2008-02-04 Thread Jonathan Sharp
Gah! That doesn't sound like much fun! Get better! (I hear reading a jQuery
book or two does wonders for the recovery!)

Cheers,
-Jonathan


On 2/4/08, Chris Jordan <[EMAIL PROTECTED]> wrote:
>
> Jonathan,
>
> Thanks for the update! Sorry I didn't see it until now. I've been in the
> hospital (just had gastric bypass surgery), and I'm finally at home
> recovering. Again, thanks for the wonderful plug-in!
>
> Chris
>
> On Jan 31, 2008 11:01 AM, Jonathan Sharp <[EMAIL PROTECTED]> wrote:
>
> > Hi Chris,
> >
> > Just wanted to give you a heads up, I've released jdMenu 1.4.0 at
> > http://jdsharp.us/jQuery/plugins/jdMenu/1.4.0 (though I haven't posted
> > notice of this yet) It's been updated to work with jQuery 1.2.2 and the
> > latest dimensions plugin.
> >
> > Cheers,
> > -Jonathan
> >
> >
> >   On 1/24/08, Chris Jordan <[EMAIL PROTECTED]> wrote:
> > >
> > > Sorry, I'm just now getting back to this guys (I was sick yesterday).
> > > I appreciate all the suggestions. I'll bet it's malformed markup. I don't
> > > create it though. This is an osCommerce shopping cart. I'll see if I can
> > > find where the HTML is getting messed up.
> > >
> > > Thanks heaps!
> > > Chris
> > >
> > > On Jan 21, 2008 7:02 PM, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> > >
> > > > Hi Chris,
> > > >
> > > > Sorry, I was looking in Firefox. I see now that the problem exists
> > > > in IE only. It might have something to do with the fact that the page is
> > > > running in quirks mode and that the markup is invalid. Try running it
> > > > through an HTML validator ( e.g. 
> > > > http://validator.w3.org/)<http://validator.w3.org/%29>.
> > > > In particular, you have two extra DOCTYPE declarations throughout the 
> > > > page.
> > > > And if you want to stick with HTML 4.01 transitional, replace this
> > > > ...
> > > >
> > > >
> > > >  
> > > >
> > > >
> > > > with this ...
> > > >
> > > >
> > > >   > > >"http://www.w3.org/TR/html4/loose.dtd ">
> > > >
> > > > If cleaning up the HTML doesn't help, we can look at some other
> > > > stuff. In the meantime, I'll poke around the plugin code and the 
> > > > stylesheets
> > > > a bit to see how the positioning is being done.
> > > >
> > > >
> > > >
> > > >
> > > > --Karl
> > > > _
> > > > Karl Swedberg
> > > > www.englishrules.com
> > > > www.learningjquery.com
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >  On Jan 21, 2008, at 4:08 PM, Chris Jordan wrote:
> > > >
> > > > You said it was positioning correctly for you? What version of IE
> > > > was that in? For me, in IE6 it shows up in the top left (0,0) of the 
> > > > view
> > > > port... it's supposed to show just below the top-level menu choice.
> > > >
> > > > Also, I know there are broken images. Ignore those and look mostly
> > > > at the ones that do have images. I'm still waiting on my graphic artist 
> > > > guy
> > > > to get me the rest of the images. I also don't see anywhere (unless I'm 
> > > > just
> > > > missing it) where the sub-menus are being positioned. You can check out 
> > > > all
> > > > the css if you have the Web Developer extension for FF.
> > > >
> > > > Thanks again,
> > > > Chris
> > > >
> > > > On Jan 21, 2008 1:01 PM, Chris Jordan <[EMAIL PROTECTED]>
> > > > wrote:
> > > >
> > > > > going to lunch. I'd like to exchange emails with you about this.
> > > > > I'll be back in about an hour or so. Thanks so much Karl.
> > > > >
> > > > > Chris
> > > > >
> > > > >
> > > > > On Jan 21, 2008 12:52 PM, Karl Swedberg < [EMAIL PROTECTED]>
> > > > > wrote:
> > > > >
> > > > > > It looked to me like it was being positioned correctly. Also
> > > > > > looks like you have a broken link to a rollover image for the 
> > > > > &

[jQuery] Re: Err The Blog on jQuery

2008-02-01 Thread Jonathan Sharp
Minor typo:
$('class').bind('click', function(){//whatever});

should be .class

-js






On 2/1/08, Alexandre Plennevaux <[EMAIL PROTECTED]> wrote:
>
>
> A good read _ There was a very useful comment about a less known feature
> of jquery: namespacing events.
>
> I've updated the wiki with it:
> http://docs.jquery.com/Events_%28Guide%29#Namespacing_events
>
> thanks Klaus !
>
> -- Original Message --
> To: jQuery (English) (jquery-en@googlegroups.com)
> From: Klaus Hartl ([EMAIL PROTECTED])
> Subject: [jQuery] Err The Blog on jQuery
> Date: 1/2/2008 12:58:16
>
> Err The Blog has tried jQuery and seems to like it pretty much :-)
> http://errtheblog.com/posts/73-the-jskinny-on-jquery
>
> Gotta love that one (on using the form plugin):
>
> "respond_to and jQuery are so in love it's making me sick."
>
>
> --Klaus
>
>
>
>
>


[jQuery] Re: Another jdMenu problem... IE specific...

2008-01-31 Thread Jonathan Sharp
Hi Chris,

Just wanted to give you a heads up, I've released jdMenu 1.4.0 at
http://jdsharp.us/jQuery/plugins/jdMenu/1.4.0 (though I haven't posted
notice of this yet) It's been updated to work with jQuery 1.2.2 and the
latest dimensions plugin.

Cheers,
-Jonathan


On 1/24/08, Chris Jordan <[EMAIL PROTECTED]> wrote:
>
> Sorry, I'm just now getting back to this guys (I was sick yesterday). I
> appreciate all the suggestions. I'll bet it's malformed markup. I don't
> create it though. This is an osCommerce shopping cart. I'll see if I can
> find where the HTML is getting messed up.
>
> Thanks heaps!
> Chris
>
> On Jan 21, 2008 7:02 PM, Karl Swedberg <[EMAIL PROTECTED]> wrote:
>
> > Hi Chris,
> >
> > Sorry, I was looking in Firefox. I see now that the problem exists in IE
> > only. It might have something to do with the fact that the page is running
> > in quirks mode and that the markup is invalid. Try running it through an
> > HTML validator ( e.g. 
> > http://validator.w3.org/).
> > In particular, you have two extra DOCTYPE declarations throughout the page.
> > And if you want to stick with HTML 4.01 transitional, replace this ...
> >
> >
> >  
> >
> >
> > with this ...
> >
> >
> >   >"http://www.w3.org/TR/html4/loose.dtd ">
> >
> > If cleaning up the HTML doesn't help, we can look at some other stuff.
> > In the meantime, I'll poke around the plugin code and the stylesheets a bit
> > to see how the positioning is being done.
> >
> >
> >
> >
> > --Karl
> > _
> > Karl Swedberg
> > www.englishrules.com
> > www.learningjquery.com
> >
> >
> >
> >
> >
> >  On Jan 21, 2008, at 4:08 PM, Chris Jordan wrote:
> >
> > You said it was positioning correctly for you? What version of IE was
> > that in? For me, in IE6 it shows up in the top left (0,0) of the view
> > port... it's supposed to show just below the top-level menu choice.
> >
> > Also, I know there are broken images. Ignore those and look mostly at
> > the ones that do have images. I'm still waiting on my graphic artist guy to
> > get me the rest of the images. I also don't see anywhere (unless I'm just
> > missing it) where the sub-menus are being positioned. You can check out all
> > the css if you have the Web Developer extension for FF.
> >
> > Thanks again,
> > Chris
> >
> > On Jan 21, 2008 1:01 PM, Chris Jordan <[EMAIL PROTECTED]> wrote:
> >
> > > going to lunch. I'd like to exchange emails with you about this. I'll
> > > be back in about an hour or so. Thanks so much Karl.
> > >
> > > Chris
> > >
> > >
> > > On Jan 21, 2008 12:52 PM, Karl Swedberg < [EMAIL PROTECTED]>
> > > wrote:
> > >
> > > > It looked to me like it was being positioned correctly. Also looks
> > > > like you have a broken link to a rollover image for the top-level nav 
> > > > items.
> > > > I'm guessing that the sub-menus are using position:absolute for their
> > > > positioning, so you'll need to have a parent element given 
> > > > position:relative
> > > > in order for the submenus to be positioned relative to those parent 
> > > > elements
> > > > rather than the body element.
> > > >
> > > > Hope that helps.
> > > >
> > > >
> > > >
> > > > --Karl
> > > > _
> > > > Karl Swedberg
> > > > www.englishrules.com
> > > > www.learningjquery.com
> > > >
> > > >
> > > >
> > > >
> > > >  On Jan 21, 2008, at 1:42 PM, Chris Jordan wrote:
> > > >
> > > > Hi folks.
> > > >
> > > > I'm having another problem with the jdMenu plug-in. In IE when I
> > > > hover over the top-level menu the sub-menu appears in the absolute top 
> > > > left
> > > > of the view-port! Bah! I don't know what I've done wrong. I've used 
> > > > jdMenu
> > > > at another client of mine, and it works great in both FF and IE. This 
> > > > time
> > > > around however, I *am* customizing the css file quite a bit to better 
> > > > suit
> > > > my needs.
> > > >
> > > > The problem can be seen here
> > > > .
> > > >
> > > > This is causing me much aggravation, and more time at this one
> > > > particular client that I should really be spending.
> > > >
> > > > I would *really* appreciate anyone's help on this problem. Of
> > > > course, I'll keep working on finding a solution, but if someone knows 
> > > > what
> > > > I'm going through, or can offer suggestions, that'd be great.
> > > >
> > > > Thanks,
> > > >
> > > > Chris
> > > >
> > > >
> > > > --
> > > > http://cjordan.us
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> > >
> > >
> > > --
> > > http://cjordan.us
> >
> >
> >
> >
> > --
> > http://cjordan.us
> >
> >
> >
> >
>
>
>
> --
> http://cjordan.us


[jQuery] Re: [SITE SUBMISSION] Sapitot Creative

2008-01-30 Thread Jonathan Sharp
Love it!

On 1/30/08, motob <[EMAIL PROTECTED]> wrote:
>
>
> Sapitot Creative is a Design firm that recently redesigned their
> website. jQuery is being used to enhance page transitions and to give
> a little flair to the print and web portfolio sections. What is real
> interesting is the unconventional use of jQuery-ui.tabs plugin for the
> main navigation.
>
> Check it out: www.sapitot.com
>


[jQuery] Re: •.¸¸.•´´¯`••._.•> <((((º> How To Create Wealth????

2008-01-30 Thread Jonathan Sharp
User is banned.

-js


On 1/30/08, ++ Corn Square ++ <[EMAIL PROTECTED]> wrote:
>
>
> Most Forex traders loose money, don't be one of them
> Forex made easy is as simple as you would want it to be. ...
> Forex can be made easier for beginners to understand it and here's how:-
>
> http://tiniuri.com/c/u7
>


[jQuery] Re: Another jdMenu problem... IE specific...

2008-01-24 Thread Jonathan Sharp
Hi Chris,

I think the issue exists in that you're using jQuery 1.2.1 and the latest
dimensions plugin which have changed since the 1.3 version. The biggest
issues are $(window).innerHeight()/Width() aren't valid. I'm finishing up
the 1.4 release which will be updated for latest jQuery releases.

Cheers,
-Jonathan


On 1/24/08, Chris Jordan <[EMAIL PROTECTED]> wrote:
>
> Karl,
>
> I ran the site through the validator you linked to (thanks for that), but
> my problem still remains. I should note that there are still 43 errors, but
> they're things like "No ALT specified" and "there is no attribute X"
>
> The errors that are bothering me most right now are:
>
>1. cannot generate system identifier for general entity "osCsid"
>2. general entity "osCsid" not defined and no default entity.
>3. reference to entity "osCsid" for which no system identifier could
>be generated.
>
> I don't know how to fix these. osCommerce dynamically generates the code
> that this is complaining about.
>
> I notice now that I'm getting a javascript error in IE: "Object does not
> support this property or method" unfortunately, as has been seen no such
> error manifests itself in FF.
>
> I've been given two hours to fix this, and I've only got an hour left.
> What a pia...
>
> Anyway, if anyone can help me out. I'd love the help. I'll of course keep
> working on it from my end.
>
> Thanks so much everyone,
> Chris
>
> On Jan 24, 2008 10:54 AM, Chris Jordan <[EMAIL PROTECTED]> wrote:
>
> > Sorry, I'm just now getting back to this guys (I was sick yesterday). I
> > appreciate all the suggestions. I'll bet it's malformed markup. I don't
> > create it though. This is an osCommerce shopping cart. I'll see if I can
> > find where the HTML is getting messed up.
> >
> > Thanks heaps!
> > Chris
> >
> >
> > On Jan 21, 2008 7:02 PM, Karl Swedberg <[EMAIL PROTECTED] > wrote:
> >
> > > Hi Chris,
> > >
> > > Sorry, I was looking in Firefox. I see now that the problem exists in
> > > IE only. It might have something to do with the fact that the page is
> > > running in quirks mode and that the markup is invalid. Try running it
> > > through an HTML validator ( e.g. 
> > > http://validator.w3.org/).
> > > In particular, you have two extra DOCTYPE declarations throughout the 
> > > page.
> > > And if you want to stick with HTML 4.01 transitional, replace this ...
> > >
> > >
> > >
> > >  
> > >
> > >
> > > with this ...
> > >
> > >
> > >   > >"http://www.w3.org/TR/html4/loose.dtd ">
> > >
> > > If cleaning up the HTML doesn't help, we can look at some other stuff.
> > > In the meantime, I'll poke around the plugin code and the stylesheets a 
> > > bit
> > > to see how the positioning is being done.
> > >
> > >
> > >
> > >
> > > --Karl
> > > _
> > > Karl Swedberg
> > > www.englishrules.com
> > > www.learningjquery.com
> > >
> > >
> > >
> > >
> > >
> > >  On Jan 21, 2008, at 4:08 PM, Chris Jordan wrote:
> > >
> > > You said it was positioning correctly for you? What version of IE was
> > > that in? For me, in IE6 it shows up in the top left (0,0) of the view
> > > port... it's supposed to show just below the top-level menu choice.
> > >
> > > Also, I know there are broken images. Ignore those and look mostly at
> > > the ones that do have images. I'm still waiting on my graphic artist guy 
> > > to
> > > get me the rest of the images. I also don't see anywhere (unless I'm just
> > > missing it) where the sub-menus are being positioned. You can check out 
> > > all
> > > the css if you have the Web Developer extension for FF.
> > >
> > > Thanks again,
> > > Chris
> > >
> > > On Jan 21, 2008 1:01 PM, Chris Jordan <[EMAIL PROTECTED]>
> > > wrote:
> > >
> > > > going to lunch. I'd like to exchange emails with you about this.
> > > > I'll be back in about an hour or so. Thanks so much Karl.
> > > >
> > > > Chris
> > > >
> > > >
> > > > On Jan 21, 2008 12:52 PM, Karl Swedberg < [EMAIL PROTECTED]>
> > > > wrote:
> > > >
> > > > > It looked to me like it was being positioned correctly. Also looks
> > > > > like you have a broken link to a rollover image for the top-level nav 
> > > > > items.
> > > > > I'm guessing that the sub-menus are using position:absolute for their
> > > > > positioning, so you'll need to have a parent element given 
> > > > > position:relative
> > > > > in order for the submenus to be positioned relative to those parent 
> > > > > elements
> > > > > rather than the body element.
> > > > >
> > > > > Hope that helps.
> > > > >
> > > > >
> > > > >
> > > > > --Karl
> > > > > _
> > > > > Karl Swedberg
> > > > > www.englishrules.com
> > > > > www.learningjquery.com
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >  On Jan 21, 2008, at 1:42 PM, Chris Jordan wrote:
> > > > >
> > > > > Hi folks.
> > > > >
> > > > > I'm having another problem with the jdMenu plug-in. In IE when I
> > > > > hover over the top-level menu the sub-menu appears in the absolute 
> > > > > 

[jQuery] Re: ups shipping quotes - sometimes a 5 -10 second delay and timing out

2008-01-24 Thread Jonathan Sharp
Hi Nathan,

Is this related to jQuery?

Cheers,
-Jonathan


On 1/24/08, cfdvlpr <[EMAIL PROTECTED]> wrote:
>
>
> How do you get shipping quotes from ups? Do you ever have issues with
> ups never returning a shipping rate? If so, what did you do to
> workaround this?
>


[jQuery] Re: Feb 12 IE6 Forced Update

2008-01-24 Thread Jonathan Sharp
Do you have a link to this handy?

Cheers,
-Jonathan


On 1/23/08, cfdvlpr <[EMAIL PROTECTED]> wrote:
>
>
> Does anyone know about how many IE6 users this will affect?  After Feb
> 12, 2008 is it likely that your IE 6 users will drop much?  If you
> have an ecommerce site that currently has about 40% IE6 users, is this
> percentage likely to go much farther down?  Or, is this update not
> forced on the average IE 6 user?  I'd just love to see IE6 go away,
> but I don't want to get my hopes up if this so-called forced update is
> not really forced on many of our IE6 users.
>


[jQuery] Re: Using parent within img toggle

2008-01-24 Thread Jonathan Sharp
Hi Mang,

For your reading pleasure:
http://jqueryminute.com/blog/jquery-parent-vs-parents/

Cheers,
-Jonathan


On 1/23/08, Mang <[EMAIL PROTECTED]> wrote:
>
>
> Thanks, worked great - I can tell I've got some learnin' to do.  I
> don't understand how you knew to go from what I had to what you gave
> me!
>
> Experience i guess :)
>
> Thanks!
>
>
>
> On Jan 23, 4:29 pm, "Jonathan Sharp" <[EMAIL PROTECTED]> wrote:
> > Try: $(this).parents('tr:eq(0)').css('background-color', 'white');
> >
> > Cheers,
> > -Jonathan
> >
> > On 1/23/08, Mang <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > I have a fairly simple app:
> >
> > > 
> > > 
> > > ...
> > > 
> > > 
> > >  class="active_toggle"> > > tr>
> > >  > > tr>
> > >  > > tr>
> > > 
> > > 
> >
> > > then the following jquery toggles the src of the images back and forth
> >
> > > $("img.active_toggle").toggle(function(e){
> > >// alert('change to reactivate');
> > > $(this).attr("src","images/btnReactivate.gif")
> > > }, function(e) {
> > >// alert('change to deactivate');
> > > $(this).attr("src","images/btnDeactivate.gif")
> > >  // hide a row after acknowledgement
> >
> > > });
> >
> > > What I would like to do now is add some jquery that changes the
> > > background-color of the row containing the image that was clicked.  My
> > > thought was to use parent/parents, but nothing seems to be working:
> >
> > > $("img.active_toggle").toggle(function(e){
> > > $(this).attr("src","images/btnReactivate.gif")
> > > $(this).parent('tr').css("background-color","red")
> > >return false;
> > > }, function(e) {
> > > $(this).attr("src","images/btnDeactivate.gif")
> > > $(this).parent('tr').css("background-color","white")
> > > });
> >
> > > Clicking the image toggles the src just fine, but the tr color never
> > > changes.
> >
> > > thx!
>


[jQuery] Re: sum of table rows

2008-01-23 Thread Jonathan Sharp
Thanks, updated the entry with a link to that post!

Cheers,
-Jonathan


On 1/23/08, Dan G. Switzer, II <[EMAIL PROTECTED]> wrote:
>
>
> Jonathan,
>
> >Hey Dan,
> >
> >Great plugin! http://jqueryminute.com/blog/jquery-calculate-plugin/
>
> Thanks! I also blogged a little more information here:
>
> http://blog.pengoworks.com/index.cfm/2008/1/23/jQuery-Calculation-Plugin-Mak
> ing-calculating-easy
>
> -Dan
>
>


[jQuery] Re: Using parent within img toggle

2008-01-23 Thread Jonathan Sharp
Try: $(this).parents('tr:eq(0)').css('background-color', 'white');

Cheers,
-Jonathan


On 1/23/08, Mang <[EMAIL PROTECTED]> wrote:
>
>
> I have a fairly simple app:
>
> 
> 
> ...
> 
> 
>  tr>
>  tr>
>  tr>
> 
> 
>
> then the following jquery toggles the src of the images back and forth
>
> $("img.active_toggle").toggle(function(e){
>// alert('change to reactivate');
> $(this).attr("src","images/btnReactivate.gif")
> }, function(e) {
>// alert('change to deactivate');
> $(this).attr("src","images/btnDeactivate.gif")
>  // hide a row after acknowledgement
>
> });
>
> What I would like to do now is add some jquery that changes the
> background-color of the row containing the image that was clicked.  My
> thought was to use parent/parents, but nothing seems to be working:
>
> $("img.active_toggle").toggle(function(e){
> $(this).attr("src","images/btnReactivate.gif")
> $(this).parent('tr').css("background-color","red")
>return false;
> }, function(e) {
> $(this).attr("src","images/btnDeactivate.gif")
> $(this).parent('tr').css("background-color","white")
> });
>
> Clicking the image toggles the src just fine, but the tr color never
> changes.
>
> thx!
>


[jQuery] Re: how to make page onload quicker

2008-01-23 Thread Jonathan Sharp
You could do something along the lines of:

var rows = [];
$('#srTable > tbody').each(function(i) {
var col = $('.merchantClass', this);
var distance = $('.sortDistance', this);
// Something more
rows.push({row: this, col: col, index: i});
});

If you can change .merchantClass to the tag.class like div.merchantClass it
will be faster. If you know that .merchantClass is within a div in your row
$('> div > div.merchantClass', this) would be even faster yet.

Hope this helps!

-Jonathan


On 1/23/08, Potluri <[EMAIL PROTECTED]> wrote:
>
>
>
> Hi,
> I'm working on jquery from couple of months. I'm facing a variety problem
> which can be solved by jquery Pro's.
>
> I've a table with 6 colomns on each row. I'm looping through all of this
> rows on page load beacuse my framework requires to do that.
> I'm doing it this way for table with id="srTable"..
>
> var tbody = $('#srTable tbody')[0], trows = tbody.rows;
>
> var rows=[];
>
> for( var i = 0, n = trows.length;  i < n;  ++i )
>{
>var row = trows[i];
>var col = $(".merchantClass",row);
>var distance=$(".sortDistance",row).html();
>//doing something more
>rows.push({ row:row, col:col, index:i});
>
>
>
>}
>
> This process looping through rows and saving each rows colomn and doing
> something more is fine if number of rows are less than 200.
> If the row count is 400 the page just freezes and the whole onload is
> taking
> 8-11 secs.
>
> Can anyone of you can help me in reducing it to <3 secs.
>
> It'll be grateful.
>
> Thanks in advance.
> Vijay Potluri
> --
> View this message in context:
> http://www.nabble.com/how-to-make-page-onload-quicker-tp15051222s27240p15051222.html
> Sent from the jQuery General Discussion mailing list archive at Nabble.com
> .
>
>


[jQuery] Re: sum of table rows

2008-01-23 Thread Jonathan Sharp
Hey Dan,

Great plugin! http://jqueryminute.com/blog/jquery-calculate-plugin/

Cheers,
-Jonathan


On 1/23/08, Dan G. Switzer, II <[EMAIL PROTECTED]> wrote:
>
>
> >I just realized the description text on the page is completely wrong!
> It's
> >for another plug-in and I used that page as a template for this one. :)
>
> I just updated the Calculation Plug-in page so that the description is
> accurate. I also updated the examples so they work when the numbers are
> changed (no need to hit the "Calc" buttons.)
>
> http://www.pengoworks.com/workshop/jquery/calculation.plugin.htm
>
> -Dan
>
>


[jQuery] Re: Inserting element into jQuery object

2008-01-10 Thread Jonathan Sharp
Hi Josh,

Most likely you'll have to create a new jQuery object. Take a look at the
slice method to grab your elements:
var divs = $('selector'); // [div1, div2]
var divs = $( [ divs.slice(0, 1), newdiv, divs.slice(1, 2) ] );
// divs = [div1, newdiv, div2]

Cheers,
-Jonathan


On 1/10/08, Josh Nathanson <[EMAIL PROTECTED]> wrote:
>
>
> I'm having a devil of a time doing something that would seem to be pretty
> basic.
>
> I have a jQuery object with two elements, and I want to insert a new
> element
> in between them - not altering the DOM, but just the jQuery object.
>
> So if my original jQuery object looks like this when logged in the
> console:
> [ div1, div2 ]
>
> I want it ultimately to look like this, inserting newdiv manually:
> [ div1, newdiv, div2 ]
>
> ?
>
> -- Josh
>
>
>


[jQuery] Re: why not get value using $('#wrapper').attr('offsetHeight') in firefox?

2008-01-09 Thread Jonathan Sharp
Try $('#wrapper').height()

Also please note the difference in your ID's. With the jQuery code you're
referencing 'wrapper' and with the DOM methods you're referencing 'Wrapper'.

Cheers,
-Jonathan

On 1/9/08, nightelf <[EMAIL PROTECTED]> wrote:
>
>
> in firefox
> $('#wrapper').attr('offsetHeight') == undefined
> but
> document.getElementById('Wrapper').offsetHeight
> is ok
>


[jQuery] Re: Help With Odd ID Search

2008-01-07 Thread Jonathan Sharp
Try escaping the colon: $("#itemForm\\:standards select:last")

Cheers,
-Jonathan


On 1/7/08, npetcu <[EMAIL PROTECTED]> wrote:
>
>
> I'm updating some of the legacy software we have at my company and
> changing much of the JavaScript to jQuery.  I'm having a bit of
> trouble with a few particular id's however.
>
> I'm trying to access the last select element of a block of code and
> retrieve the id like this:
>
> $("#itemForm:standards select:last").attr("id");
>
> itemForm:standards is the id of the block I'm attempting to access,
> and I'm using select:last to get the last select element.  This
> doesn't work however.  I tried the same method, but used the class
> name rather than the id and the function worked fine.
>
> $(".standardsBlock select:last").attr("id");
>
> I may be mistaken, but I think jQuery thinks I'm attempting to apply a
> selector to the id name because of the colon in the name.  How would I
> go about searching for an id like that?  Has anyone had any trouble
> with this before?
>
> Any help would be much appreciated.
>
> -- npetcu
>


[jQuery] Re: Aspect Oriented Extension for jQuery

2008-01-07 Thread Jonathan Sharp
Also worth noting is that jQuery is not required for this library. It uses
the jQuery namespace (jQuery.aop) but this could easily be changed to work
with non-jQuery implementations.

-js


On 1/7/08, PragueExpat <[EMAIL PROTECTED]> wrote:
>
>
> Surfing dzone.com this morning, I came across this plugin for jQ:
>
> http://code.google.com/p/jquery-aop/wiki/Reference.
>
> Being unfamiliar with aspect oriented programming, I did a quick
> wikipedia lookup and quickly realized that this could be a great way
> to keep code clean.
>
> My question is this: who among us can better explain aspect oriented
> programming or provide some examples of how to use it effectively?
>
> What types of functions are best applied via this methodology?
>
> Any known drawbacks?
>
> Thanks for any info on this subject.
>


[jQuery] Re: help with addClass

2008-01-07 Thread Jonathan Sharp
The problem is that you're binding the click event to the projectLink class
on document ready but since no one has clicked the image yet the class isn't
present so there are no elements that match the class selector and thus no
events bound.

You could do something like the code below. This will allow the image's
parent link to active upon image click if the linkActive class is present.

$(".switchProject").click(function(e) {
if ( !$(this).parent().is('.linkActive') ) {
var img = $(this).attr("id");
$("#"+img).attr("src", "images/"+img+"_down.png");
$("#"+img+"_up2").attr("src", "images/"+img+"_down2.png");
$(this).parent().addClass('linkActive');
// Cancel our event so it doesn't trigger the link.
e.stopPropagation();
e.preventDefault();
return false;
}
});

Cheers,
-Jonathan



On 1/7/08, browntown <[EMAIL PROTECTED]> wrote:
>
>
> So I'm working with a client that wants to be able to click an image
> to see the rollover state...they then want to click the image again to
> be taken to a url.
>
> I'm about to suggest that we change the first click to be a
> traditional rollover as it would simplify things and make things less
> confusing but I would still like to know how I can achieve the
> following.
>
> I want to be able to to add a class to the parent link and then when I
> click the link with the new class I want to be taken to the url. I'm
> having trouble getting this to work. I can see that the class is being
> added as the presentation changes. How can I get jquery to recognize
> this new class?
>
> my html looking something like:
>  src="images/btn_projects_1_up.png" id="btn_projects_1"
> class="switchProject" alt="I smell bankin'" border="0" />
>
> 
>
> my jquery...
> 
> $(document).ready(function(){
>$(".projectLink").click(
>function()
>{
>alert('w00t');
>}
>);
> $(".switchProject").click(
>function()
>{
>var img = $(this).attr("id");
>$("#"+img).attr("src",
> "images/"+img+"_down.png");
>$("#"+img+"_up2").attr("src",
> "images/"+img+"_down2.png");
>
>
> $(this).parent().addClass("projectLink");
>}
>);
> });
> 
>


[jQuery] Re: Can't set CSS left for IE6

2007-12-20 Thread Jonathan Sharp
Hi Nathan,

It's kind of hard to debug your example without knowing the context of the
html and css. Do you have a sample url?

Cheers,
-Jonathan


On 12/19/07, cfdvlpr <[EMAIL PROTECTED]> wrote:
>
>
> if( $.browser.msie && (jQuery.browser.version < 7.) ) {
> $('div##rightShoppingCartButton').css("left","582px");
> }
>
> Can anyone see why this doesn't seem to be recognized at all by IE6?
>


[jQuery] Re: Binding "this" inside anonymous functions

2007-12-18 Thread Jonathan Sharp
It's a best practice to use var a = this to avoid the scope leak that you
mentioned.

Cheers,
-Jonathan


On 12/18/07, Joel Stein <[EMAIL PROTECTED]> wrote:
>
>
> > Also you might want to do "var a = this" so that it doesn't conflict
> with any global variables.
>
> Thanks, Josh.  That's what I suspected.  As far as the "var a =
> this"... is that because using "var" to declare the variable makes its
> scope within the function alone, or is the "var" unnecessary?
>


[jQuery] Re: [PLUGIN] JAddTo

2007-12-12 Thread Jonathan Sharp
http://www.jasons-toolbox.com/JavaScript/jquery-1.2.1.pack.js 404's..oops!

-js


On Dec 12, 2007 1:58 PM, Jason Levine <[EMAIL PROTECTED]> wrote:

>
>
> This is my first JQuery plugin in awhile.  I needed to put up a series of
> "Add To Digg"-style links on the  http://www.ShootingForACause.com/2008/
> Shooting For A Cause  website.  After collecting the images and links, I
> realized that this would make for a good JQuery plugin.  So I wrote it.
>
> I hereby present  http://www.jasons-toolbox.com/JAddTo/ JAddTo 0.1 .
>  Enjoy!
>
> And if you know of any links that should be added, let me know.  It would
> help if you included an example link and the URL of an image that could be
> included.
> --
> View this message in context:
> http://www.nabble.com/-PLUGIN--JAddTo-tp14302539s27240p14302539.html
> Sent from the jQuery General Discussion mailing list archive at Nabble.com
> .
>
>


[jQuery] Re: Share my trick to Deserialized the response of JQuery Forms

2007-12-11 Thread Jonathan Sharp
Also you may want to namespace your elements (like )
as sometimes setting attributes for elements that have attributes can cause
issues. Like setting a value attribute for a  caused issues for us in IE
6 when the value was non-numeric

-Jonathan


On Dec 11, 2007 1:03 PM, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:

>
> Mario Moura schrieb:
> > Hi All
> >
> > I am working in Jquery Forms
> > http://malsup.com/jquery/form/#getting-started
> >
> > [...]
> > So What I did is get with $(data).attr("id") the value of $id
> >
> > You can create how many itens you need in your php file and
> > deserialized the response
> >
> > $(data).attr("title")
> > $(data).attr("image")
> >
> > you can use xml, json but I think text is fast.
> I guess parsing xml or json once and is rather faster then creating a
> DOM element out of the reponse, then selecting attributes from it. Your
> approach can be useful when you lack control over the serverside, but
> otherwise I'd choose a more appropiate format.
>
> Jörn
>


[jQuery] Re: File download with jQuery.

2007-12-10 Thread Jonathan Sharp
Hi LT,

I don't think you can force a file download with an Ajax request. You may be
able to (not certain) with an embeded IFrame that has your url as it's
source.

Cheers,
-Jonathan

On Dec 10, 2007 4:06 AM, lagos.tout <[EMAIL PROTECTED]> wrote:

>
> Hi,
> Anyone know how to force the browser to treat the data returned by the
> server in response to $.get( ) as a file, not text or html or xml?
> I'm using the correct mime-type and know that the file is being
> returned when I use an href on a link, rather than jQuery.  I could
> stick with that, but I'd like to know if it's possible to use jQuery
> to return data that is treated as a file eg. jpg, pdf etc.
> Thanks.
> LT
>


[jQuery] Re: What is the best way to remove an element from a jQuery array?

2007-12-10 Thread Jonathan Sharp
$myCollection = $myCollection.not( $myElem );

Cheers,
-Jonathan

On Dec 10, 2007 12:00 PM, George <[EMAIL PROTECTED]> wrote:

>
> Bit of a brain block today, maybe I'm being daft but...
>
> How do we remove the element referenced by $myElem from a list of
> elements in $myElements ?
>
> Scenario: We have one element in a variable named $myElem (a jQuery
> array of one element).  This element may also exist in another
> variable named $myElements (a jQuery array of several elements).
>
> I cannot use $myCollection.remove(...) because that would remove the
> element from the DOM too.
>
> I can only think of using $myElements = $myElements .not("#" +
> $myElem.attr("id") ) but that seems very un-jQuery like.
>
> Many thanks,
>
> George
>


[jQuery] Re: jQuery putting logic in separate file

2007-11-30 Thread Jonathan Sharp
 is not valid. I'm
not sure if your email program did this but it should be:



Cheers,
-js

On Nov 30, 2007 10:41 AM, bludog <[EMAIL PROTECTED]> wrote:

>
> I'm new to jQuery, so please bear with me. I'm putting the jQuery
> logic in a separate file for the jQuery calendar:
>
> 
> 

[jQuery] Re: Which child am I?

2007-11-26 Thread Jonathan Sharp
*Untested*

Something similar to:

var index = $(this).parent().find('> td').index(this);

-js


On 11/26/07, badtant <[EMAIL PROTECTED]> wrote:
>
>
> Adding a psuedo attribute like "col" with an each function would work.
> I was hoping there would be some smart jquery-function for this.
> Keep suggesting =)
>
> On Nov 26, 4:46 pm, "Glen Lipka" <[EMAIL PROTECTED]> wrote:
> > You could dynamically add a psuedo attribute like "col" with an each
> > function after the page loads.
> > Other than than, I would experiment with colgroup and see if it fires
> which
> > col you are in.
> >
> > Sorry, no time for a demo. :(  Hope this helps a little.
> >
> > Glen
> >
> > On Nov 26, 2007 7:35 AM, badtant <[EMAIL PROTECTED]> wrote:
> >
> >
> >
> > > I have the following html:
> >
> > > 
> > > 
> > > 
> > > col a
> > > col b
> > > col c
> > > 
> > > 
> > > 
> > > 
> > > aaa
> > > bbb
> > > ccc
> > > 
> > > 
> > > 
> >
> > > When the user hovers the th-element I have a function. I want that
> > > function to return which of the columns that has been hovered. Let me
> > > explain... when hovering "col a" I want to get the value 1 and when
> > > hovering "col b" I want to get the value 2. Any suggestions on how can
> > > that be achieved?
> >
> > > Thanks!
> > > /Niklas
>


[jQuery] Re: Find first matching previous element relative to (this)

2007-11-05 Thread Jonathan Sharp
.find() only searches down the tree (so child elements of .btn). You may
need some combination of .parents() or .siblings().

Cheers,
-Jonathan


On 11/5/07, nemozob <[EMAIL PROTECTED]> wrote:
>
>
> Hi, I'm trying to target the closets instance of an element with a
> class name target but I'm having trouble figuring out how to do this.
>
> So given this HTML
>
> how are you?
> hello
> how are you? <-- want to target this paragraph
> I am fine
> 
>button
> 
>
> I'm trying to use something like the following to find the closest
> previous "target" element to "btn".
>
> $(".btn").click(function(){
>$(this).find(".target:first").css('color','red');
> });
>
> Any ideas?
>
>


[jQuery] Re: select text for LI

2007-11-02 Thread Jonathan Sharp
I'm sure there's a more elegant solution but you could do something like:

// Untested
var about = $( 'selector for the li' ).clone().find('>
ul').remove().end().html();

Cheers,
-Jonathan


On 11/2/07, sawmac <[EMAIL PROTECTED]> wrote:
>
>
> I'm trying to select text inside list items. I'm using
> jQuery's .text( ) method. Unfortunately, that returns the text of all
> children as well. That means for a nested list like this
>
> 
> index.html
> about
>
>  index.html
>  more.html
>
> 
> 
>
> $('li').eq(1).text() returns
> 'about
>   index.html
>   more.html'
>
> I just want to retrieve "about" not the text from the child list
> items. Any ideas on how to do that?
>
> thanks
>
>


[jQuery] Re: LiveQuery (Discuss Please)

2007-11-02 Thread Jonathan Sharp
I'd cast my vote for leaving it out of core for now. The beauty of jQuery is
the leaness of the core. I've had my eye on LiveQuery for quite some time
but haven't had a chance to put it into practice for our enterprise toolkit.
Performance is a major concern but of greater issue is the inconsistency
within our organization for jQuery code. I fear too many developers would
just use it as a replacement for bind and with the level of dom manipulation
that we do the performance hit would be too much.

Again let me state that this is not reflective of jQuery or LiveQuery but
the browser limitations and the sheer size of data we internally have
to deal with on a single page.

I would theorize that the majority of jQuery users have onReady event
binding. For those that have dom manipulation it's probably pretty light and
thus the benefit of LiveQuery isn't realized.

Cheers,
-Jonathan


On 10/31/07, Yehuda Katz <[EMAIL PROTECTED]> wrote:
>
> So as far as I'm concerned, livequery is the biggest advance in jQuery
> since its inception (no, I am not its author). I'm trying to understand why
> it's having such a slow rate of adoption.
>
> it solves this problem:
> $("div.klass").draggable();
> $("#foo").load("url", function() { $("div.klass").draggable(); });
>
>
> beautifully, as you now only need to do:
>
>
> $("div.klass").livequery(function() { $(this).draggable() });
> $("#foo").load("url");
>
>
> Obviously, that was only a simple example. The more general case, wanting
> to bind some event handler to a selector regardless of when it appears on
> the page, is extremely common. So again, I'm trying to understand why the
> rate of adoption has been so slow. Any thoughts?
>
> --
> Yehuda Katz
> Web Developer | Procore Technologies
> (ph)  718.877.1325


[jQuery] Re: googlyx.com going too boom nice webiste

2007-11-01 Thread Jonathan Sharp
SPAM -- please ignore this post, banning user...




On 11/1/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> http://googlyx.com/
>
> hi
>   i get this website and i joined here its realy cool give a look
> http://googlyx.com/
>
>


[jQuery] Re: My first plugin, criticisms please

2007-10-29 Thread Jonathan Sharp
It'd be best to post a link to the sample. Most people won't go through the
time to copy and paste the above code to execute it.

Cheers,
-js


On 10/29/07, Adrian Lynch <[EMAIL PROTECTED]> wrote:
>
>
> I hope this is ok to do. I've just done my first plugin and I thought
> I'd ask for anyone's opinions.
>
> It takes the value of one input box and assigns it to any number of
> other input boxes after being run though a formatter function.
>
> In this example the formatter strips anything that isn't an alpha-
> numeric character or a full stop (period for the yanks!).
>
> One thing I'm not sure about is the way I apply the plugin. I'm doing
> it:
>
> ELEMENT_I_WISH_TO_COPY.syncValue(ELEMENTS_TO_CHANGE)
>
> whereas it feels like it should be the other way around. Thoughts
> anyone?
>
> Here it is with test code:
>
> 
> 
>
>jQuery.fn.syncValue = function(syncElements, formatter) {
>
>var syncFormatter = formatter;
>
>if (syncFormatter == undefined) {
>syncFormatter = function(inputString) {
>return inputString;
>};
>}
>
>return this.each(function(){
>
>var element = this;
>
>syncElements.each(function(i) {
>$(this).attr("value",
> syncFormatter($(element).attr("value")));
>});
>
>});
>
>};
>
>$(function(){
>$(".oringinal").syncValue($(".syncValue"), formatter);
>});
>
>function formatter(inputString) {
>return inputString.toLowerCase().replace(/[^a-z0-9\.]/gi,
> "-");
>}
>
> 
>
> 
> 
> 
>
> Thanks all.
>
> Adrian
>
>


[jQuery] Re: jQuery does not work when included in another JS file

2007-10-29 Thread Jonathan Sharp
You're trying to include the file on an unstable DOM. Look at jQuery's
"getScript" method. Unfortunately you'd have to have jQuery loaded to use
it.

Cheers,
-js


On 10/29/07, DMS <[EMAIL PROTECTED]> wrote:
>
>
> I'm trying to include jQuery from within another javascript file,
> using this..
>
> <-- JavaScript Include -->
>
> function include_js(name) {
>
> var th = document.getElementsByTagName('head')[0];
> var s = document.createElement('script');
> s.setAttribute('type','text/javascript');
> s.setAttribute('src',name);
> th.appendChild(s);
>
> }
> include_js('jquery.js');
>
> <-- JavaScript Include -->
>
> This however, does not work.  It does not recognize jQuery... If I use
> this same method but include a js file that simply has an alert in
> it... that works  Any ideas how I can include jQuery like this?
> Thanks!
>
>


[jQuery] Re: Getting a div with scroll bar to stay scrolled down

2007-10-19 Thread Jonathan Sharp
On 10/19/07, Dave Methvin <[EMAIL PROTECTED]> wrote:
>
>
> > $('#divname').scrollTop( $('#divname')[0].scrollHeight );
>
> I think you meant:
>
> $('#divname')[0].scrollTop( $('#divname')[0].scrollHeight );


Nope, I was utilizing the scrollTop() method from dimensions.


Here's another way that avoids redundant selector expressions:
>
> $('#divname').each(function(){this.scrollTop = this.scrollHeight});
>
>


[jQuery] Re: Getting a div with scroll bar to stay scrolled down

2007-10-19 Thread Jonathan Sharp
I think that would be how prototype would do it. Here's how jQuery would:

$('#divname').scrollTop( $('#divname')[0].scrollHeight );

Cheers,
-js


On 10/16/07, Eric <[EMAIL PROTECTED]> wrote:
>
>
> Hi all,
>
> I have a div that will refresh itself and the scroll bar just won't
> stay down. The solution I've found is:
>
>var objDiv = document.getElementById("divname");
>objDiv.scrollTop = objDiv.scrollHeight;
>
> This doesn't work:
> $('#divname').scrollTop = $('#divname').scrollHeight;
>
> Therefore is there a more jquery-like way of doing it other than using
> plugins perhaps?
>
> Thanks.
>
> Eric
>
>


[jQuery] Re: changing the adressbar with javascript

2007-10-18 Thread Jonathan Sharp
You can use hashes (url.php#hash) which won't reload the page.

-js


On 10/18/07, Simpel <[EMAIL PROTECTED]> wrote:
>
>
> Hi
>
> I'm almost certain that this one is impossible but maybe someone out
> there has a solution
>
> We just released a site with a lot of ajax functions and now people
> starts asking questions about URL:s to certain parts of the site. The
> only trouble is that some of these parts are created by a series of
> user interactions and ajax calls i.e. there are now URL:s pointing to
> them since it's all ajaxified.
>
> So. here's the question, is there any way that you can change the
> address field in the browser by the use of javascript and no page
> reloads?
>
> I know you could inject the dom with history back stuff but we also
> want to update/fake the address field...
>
>


[jQuery] Re: Stopping event propagation on non-standard event types

2007-10-17 Thread Jonathan Sharp
On 10/17/07, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
>
>
> Jonathan Sharp schrieb:
> > I'll take a shot at that as I've been using some custom events in
> > components being built and it'd be a nice behavior to have. And allow
> > for a decoupling of callbacks that we have with developers currently.
> Gives me some interesting ideas for veto-based validation events. Think
> of an ajaxForm method that triggers a validation event and cancels the
> submit accordingly. Mike actually implemented something similar long ago
> in the form plugin, but I guess it lacked the decoupled model of custom
> events to get adopted.
>
> Be sure to share your implementation!


I will for sure!


-- Jörn
>


[jQuery] Re: creating drop down menus with JQuery?

2007-10-17 Thread Jonathan Sharp
Now that I think about it, the offsets only apply to sub menus. Try this
instead. I quickly tested it so I think it has a chance at working.

ul.jd_menu ul {
margin-left: -8px;
margin-top: -13px;
}

Cheers,
-js


On 10/17/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> To give you an update on this, I tried to exaggerate the effect, I put
> -100 for both offsetX and offsetY,
>
>$('ul.jd_menu').jdMenu({
>offsetX: -100,
>offsetY: -100,
>activateDelay: 20,
>hideDelay: 20
>});
>
> but it didn't seem to move the menu
>
>
> http://groups.google.com/group/jquery-en/browse_thread/thread/4793fc4e34ebb5c1
>
> - Dave
>
> On Oct 17, 1:22 pm, "Jonathan Sharp" <[EMAIL PROTECTED]> wrote:
> > Try passing in with your defaults (using either positive or negative
> > numbers) and see if that helps at all.
> > offsetX: 4,
> > offsetY: 2,
> >
> > Cheers,
> > -js
> >
> > On 10/17/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> wrote:
> >
> >
> >
> >
> >
> > > I do.  It is
> >
> > >http://elearningrd.info/portal/test.php
> >
> > > - Dave
> >
> > > On Oct 17, 10:09 am, "Jonathan Sharp" <[EMAIL PROTECTED]> wrote:
> > > > Do you have a URL of a sample page?
> >
> > > > -js
> >
> > > > On 10/17/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> > > wrote:
> >
> > > > > I tried setting all the padding attributes in the jdMenu.slate.css
> > > > > file to zero, but still no luck -- the menu appears away (to the
> > > > > bottom and right) of the graphic).  On your web site, you mention
> the
> > > > > plug-in supports relative positioning.  Is there an example
> somewhere
> > > > > on the site?  I can just model my code off the example.
> >
> > > > > Thanks for your replies, - Dave
> >
> > > > > On Oct 17, 9:29 am, "Jonathan Sharp" <[EMAIL PROTECTED]> wrote:
> > > > > > The menu positioning code uses absolute positioning. Try
> removing
> > > the
> > > > > > padding in CSS on the LI which should then make the menu appear
> > > directly
> > > > > > below the arrow.
> >
> > > > > > Cheers,
> > > > > > -js
> >
> > > > > > On 10/16/07, [EMAIL PROTECTED] <
> [EMAIL PROTECTED]>
> > > > > wrote:
> >
> > > > > > > Beautiful.  This may also be a non-jdMenu question but I'll
> throw
> > > this
> > > > > > > out there.  I want my drop-down menu to appear right beneath
> the
> > > arrow
> > > > > > > image, whereever the arrow may be positioned on the
> screen.  But
> > > when
> > > > > > > I insert the "relative" style in the  tag:
> >
> > > > > > > style="position:
> > > > > > > relative; left:
> > > > > > > 0px; top: 0px;">
> > > > > > > alt=""
> > > > > > > border="0"
> > > > > > > align="middle" height="16" width="16" />
> > > > > > >
> > > > > > > id="editTitle__ID__"
> > > > > > > title="Edit
> > > > > > > Module Title" class="editLink" href="#">Edit Module
> Title
> >
> > > > > > > id="myspace__ID__"
> > > > > > > class="myspaceLink" href="#" title="Export MySpace
> HTML">Export
> > > > > > > MySpace HTML
> > > > > > >
> > > > > > >
> > > > > > >
> >
> > > > > > > The menu actually appears quite away (to the right and bottom)
> of
> > > the
> > > > > > > arrow.  It does this for both PC IE and Firefox, although I
> can't
> > > tell
> > > > > > > if the distances are the same.  Any advice for relatively
> lining

[jQuery] Re: Stopping event propagation on non-standard event types

2007-10-17 Thread Jonathan Sharp
I'll take a shot at that as I've been using some custom events in components
being built and it'd be a nice behavior to have. And allow for a decoupling
of callbacks that we have with developers currently.

Cheers,
-js


On 10/17/07, Jörn Zaefferer <[EMAIL PROTECTED]> wrote:
>
>
> Jonathan Sharp schrieb:
> > $(window)
> >  .bind('testEvent', function(e) {
> >   alert('1');
> >   e.stopPropagation();
> >   e.preventDefault();
> >   return false;
> >  })
> >  .bind('testEvent', function() {
> >   alert('2');
> >  })
> >  .trigger('testEvent');
> >
> > The above code doesn't stop the testEvent from triggering the second
> > alert. Is the propagation prevention just for standard events such as
> > 'click', etc.?
> Yep. jQuery makes no attempt to implement any of those two for custom
> events. But its an interesting idea and not too hard to implement.
>
> If you want to give an implementation a try, you'd have to start at this
> line:
>
> data.unshift( this.fix({ type: type, target: element }) );
>
> You could provide implementations for preventDefault and stopPropagation
> here.
>
> The jQuery.event.handle method would have to be modified to check if one
> of those two was called and cancel event handling when dealing with
> triggered events.
>
> -- Jörn
>


[jQuery] Re: How do I completely overwrite an event?

2007-10-17 Thread Jonathan Sharp
If you're using jquery-1.2+ you can do the following to just wipe out your
events:

$('#BLAH').bind('click.myfn', function() { ... });
$('#BLAH').unbind('click.myfn').bind('click.myfn', function() { ... });

This will only replace your event (myfn can be whatever you want) otherwise
if you do unbind('click') it will remove all click events.

Cheers,
-js


On 10/16/07, Karl Rudd <[EMAIL PROTECTED]> wrote:
>
>
> That's correct. If you want to "overwrite" the existing event you'll
> have to "unbind" it first. To use your example:
>
> $('##BLAH').click(function(){window.status+='a';});
> $('##BLAH').unbind('click').click(function(){window.status+='b';});
>
> Karl Rudd
>
> On 10/17/07, nick <[EMAIL PROTECTED]> wrote:
> >
> > It seems that jquery is "appending" new events to any existing event
> > handler. eg:
> >
> > $('##BLAH').click(function(){window.status+='a';});
> > $('##BLAH').click(function(){window.status+='b';});
> >
> > Clicking 'BLAH' you get 'ab' on the status bar instead of 'a'??
> >
> >
>


[jQuery] Re: continuous action while mouseover

2007-10-17 Thread Jonathan Sharp
It's ok Karl, we all have our days sometimes that doesn't make sense.

You beat me to the post. Also take a look at the jdNewsScroll (
http://jdsharp.us/jQuery/plugins/jdNewsScroll/) that has code to start/stop
the scrolling of news items based upon the mouse entering/leaving. Hope this
helps some.

Cheers,
-js


On 10/17/07, Karl Swedberg <[EMAIL PROTECTED]> wrote:
>
> Yikes, you'd never be able to tell from my post below that I used to teach
> English. Sorry if it confused anyone. Here is what I meant to write (with
> corrections inside the asterisks):
>
> Jonathan Sharp created a plugin that *does* something very similar to what
> you're going for here. Maybe you can grab some ideas *from* it?
>
> --Karl
>
>  On Oct 17, 2007, at 3:38 PM, Karl Swedberg wrote:
>
> Hi Alexandre,
>
> Jonathan Sharp created a plugin that doesn't something very similar to
> what you're going for here. Maybe you can grab some ideas for it?
>
>
> http://jdsharp.us/jQuery/plugins/AutoScroll/
>
>
>
> --Karl
> _
> Karl Swedberg
> www.englishrules.com
> www.learningjquery.com
>
>
>
>
>  On Oct 17, 2007, at 12:59 PM, Alexandre Plennevaux wrote:
>
>
>
> Hi friends,
>
>
> i was wondering: how can i trigger an action while the mouse stays on a
> specific area of the screen?
>
>
> i tried the following code: it works ONCE (when the mouseover event is
> triggered) but not continuously, while the mouse i over my "active" zone.
>
>
> var centerX = $('#datascape').width()/2;
> stepX = 240;
> var $datascapeViewport = $('#ds-viewport');
> $datascapeViewport.css({position: 'relative',left: 0+'px'})
> .bind('mouseover',function(e){
> var minX = $(this).width();
> minX=-minX;
> var maxX = 0;
> var newLeft = 0;
> var Position = $(this).offset();
> if (e.pageX >= centerX) {
> newLeft = Position.left-stepX;
> } else
> {
> newLeft = parseInt(Position.left) + stepX;
> }
> //alert("\nposition.left="+Position.left
> +"\nnewLeft="+newLeft+"\nstepX="+stepX);
> newLeft = -newLeft;
> if ((newLeftminX)) {
> $(this).animate({left: newLeft+'px'},1000);
> }
> });
>
>
> just for background, i'm trying to have a very wide image scroll
> horizontally according to the mouse position on the X axis, center being no
> scroll, left position meaning scroll image right, and invertedly.
>
>
>
>
> Thanks for your insight!
>
>
> Alexandre
>
>
> Ce message Envoi est certifié sans virus connu.
> Analyse effectuée par AVG.
> Version: 7.5.488 / Base de données virus: 269.14.13/1074 - Date:
> 16/10/2007 14:14
>
>
>
>
>
>
>
>
>
>


[jQuery] Stopping event propagation on non-standard event types

2007-10-17 Thread Jonathan Sharp
$(window)
 .bind('testEvent', function(e) {
  alert('1');
  e.stopPropagation();
  e.preventDefault();
  return false;
 })
 .bind('testEvent', function() {
  alert('2');
 })
 .trigger('testEvent');

The above code doesn't stop the testEvent from triggering the second alert.
Is the propagation prevention just for standard events such as 'click',
etc.?

-js


[jQuery] Re: creating drop down menus with JQuery?

2007-10-17 Thread Jonathan Sharp
Try passing in with your defaults (using either positive or negative
numbers) and see if that helps at all.
offsetX: 4,
offsetY: 2,

Cheers,
-js


On 10/17/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> I do.  It is
>
> http://elearningrd.info/portal/test.php
>
> - Dave
>
> On Oct 17, 10:09 am, "Jonathan Sharp" <[EMAIL PROTECTED]> wrote:
> > Do you have a URL of a sample page?
> >
> > -js
> >
> > On 10/17/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> wrote:
> >
> >
> >
> >
> >
> > > I tried setting all the padding attributes in the jdMenu.slate.css
> > > file to zero, but still no luck -- the menu appears away (to the
> > > bottom and right) of the graphic).  On your web site, you mention the
> > > plug-in supports relative positioning.  Is there an example somewhere
> > > on the site?  I can just model my code off the example.
> >
> > > Thanks for your replies, - Dave
> >
> > > On Oct 17, 9:29 am, "Jonathan Sharp" <[EMAIL PROTECTED]> wrote:
> > > > The menu positioning code uses absolute positioning. Try removing
> the
> > > > padding in CSS on the LI which should then make the menu appear
> directly
> > > > below the arrow.
> >
> > > > Cheers,
> > > > -js
> >
> > > > On 10/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> > > wrote:
> >
> > > > > Beautiful.  This may also be a non-jdMenu question but I'll throw
> this
> > > > > out there.  I want my drop-down menu to appear right beneath the
> arrow
> > > > > image, whereever the arrow may be positioned on the screen.  But
> when
> > > > > I insert the "relative" style in the  tag:
> >
> > > > >
> > > > > > > > > border="0"
> > > > > align="middle" height="16" width="16" />
> > > > >
> > > > > > > > > title="Edit
> > > > > Module Title" class="editLink" href="#">Edit Module Title
> >
> > > > > > > > > class="myspaceLink" href="#" title="Export MySpace HTML">Export
> > > > > MySpace HTML
> > > > >
> > > > >
> > > > >
> >
> > > > > The menu actually appears quite away (to the right and bottom) of
> the
> > > > > arrow.  It does this for both PC IE and Firefox, although I can't
> tell
> > > > > if the distances are the same.  Any advice for relatively lining
> up
> > > > > the menu directly beneath the image?
> >
> > > > > Thanks, - Dave
> >
> > > > > On Oct 16, 3:56 pm, "Jonathan Sharp" <[EMAIL PROTECTED]> wrote:
> > > > > > I think this is less of a jdMenu specific thing but you could do
> > > > > something
> > > > > > like the following:
> >
> > > > > > Assuming:
> > > > > > 
> > > > > > Text  > > > > align="middle"
> > > > > > height="16" width="16" />...
> >
> > > > > > $('ul.jd_menu > li').hover(function() {
> > > > > > $('> img', this).attr('src', 'url-to-image.jpg');},
> >
> > > > > > function() {
> > > > > > $('> img', this).attr('src', 'url-to-other-image.jpg');
> >
> > > > > > });
> >
> > > > > > -js
> >
> > > > > > On 10/16/07, [EMAIL PROTECTED] <
> [EMAIL PROTECTED]>
> > > > > wrote:
> >
> > > > > > > Thanks for this info.  Worked great.
> >
> > > > > > > One more small question.  To trigger the appearance of a
> drop-down
> > > > > > > menu, I have an image of an arrow
> >
> > > > > > >  align="middle"
> > > > > > > height="16" width="16" />
> >
> > > > > > > but when the user rolls over the image, I'd l

[jQuery] Re: creating drop down menus with JQuery?

2007-10-17 Thread Jonathan Sharp
Do you have a URL of a sample page?

-js


On 10/17/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> I tried setting all the padding attributes in the jdMenu.slate.css
> file to zero, but still no luck -- the menu appears away (to the
> bottom and right) of the graphic).  On your web site, you mention the
> plug-in supports relative positioning.  Is there an example somewhere
> on the site?  I can just model my code off the example.
>
> Thanks for your replies, - Dave
>
> On Oct 17, 9:29 am, "Jonathan Sharp" <[EMAIL PROTECTED]> wrote:
> > The menu positioning code uses absolute positioning. Try removing the
> > padding in CSS on the LI which should then make the menu appear directly
> > below the arrow.
> >
> > Cheers,
> > -js
> >
> > On 10/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> wrote:
> >
> >
> >
> >
> >
> > > Beautiful.  This may also be a non-jdMenu question but I'll throw this
> > > out there.  I want my drop-down menu to appear right beneath the arrow
> > > image, whereever the arrow may be positioned on the screen.  But when
> > > I insert the "relative" style in the  tag:
> >
> > >
> > > > > border="0"
> > > align="middle" height="16" width="16" />
> > >
> > > > > title="Edit
> > > Module Title" class="editLink" href="#">Edit Module Title
> >
> > > > > class="myspaceLink" href="#" title="Export MySpace HTML">Export
> > > MySpace HTML
> > >    
> > >
> > >
> >
> > > The menu actually appears quite away (to the right and bottom) of the
> > > arrow.  It does this for both PC IE and Firefox, although I can't tell
> > > if the distances are the same.  Any advice for relatively lining up
> > > the menu directly beneath the image?
> >
> > > Thanks, - Dave
> >
> > > On Oct 16, 3:56 pm, "Jonathan Sharp" <[EMAIL PROTECTED]> wrote:
> > > > I think this is less of a jdMenu specific thing but you could do
> > > something
> > > > like the following:
> >
> > > > Assuming:
> > > > 
> > > > Text  > > align="middle"
> > > > height="16" width="16" />...
> >
> > > > $('ul.jd_menu > li').hover(function() {
> > > > $('> img', this).attr('src', 'url-to-image.jpg');},
> >
> > > > function() {
> > > > $('> img', this).attr('src', 'url-to-other-image.jpg');
> >
> > > > });
> >
> > > > -js
> >
> > > > On 10/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> > > wrote:
> >
> > > > > Thanks for this info.  Worked great.
> >
> > > > > One more small question.  To trigger the appearance of a drop-down
> > > > > menu, I have an image of an arrow
> >
> > > > >  > > > > height="16" width="16" />
> >
> > > > > but when the user rolls over the image, I'd like the source of the
> > > > > image to change to something else to indicate the menu is
> "active".
> > > > > How do I do this with jdMenu?
> >
> > > > > - Dave
> >
> > > > > On Oct 16, 2:28 pm, "Jonathan Sharp" <[EMAIL PROTECTED]> wrote:
> > > > > > $('ul.jd_menu').jdMenu({
> > > > > > activateDelay: 100
> >
> > > > > > });
> >
> > > > > > Should work, here are the other options:
> > > > > > showDelay: 150 hideDelay: 550
> >
> > > > > > Sorry there isn't any documentation yet.
> >
> > > > > > -js
> >
> > > > > > On 10/16/07, [EMAIL PROTECTED] <
> [EMAIL PROTECTED]>
> > > > > wrote:
> >
> > > > > > > Hey Chris, Thanks for this recommendation.  One thing I'm
> noticing
> > > > > > > when playing with this is that when I roll over the item that
> is
> > > > > > > supposed 

[jQuery] Re: creating drop down menus with JQuery?

2007-10-17 Thread Jonathan Sharp
The menu positioning code uses absolute positioning. Try removing the
padding in CSS on the LI which should then make the menu appear directly
below the arrow.

Cheers,
-js


On 10/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> Beautiful.  This may also be a non-jdMenu question but I'll throw this
> out there.  I want my drop-down menu to appear right beneath the arrow
> image, whereever the arrow may be positioned on the screen.  But when
> I insert the "relative" style in the  tag:
>
>
> border="0"
> align="middle" height="16" width="16" />
>
> title="Edit
> Module Title" class="editLink" href="#">Edit Module Title
>
> class="myspaceLink" href="#" title="Export MySpace HTML">Export
> MySpace HTML
>
>
>
>
> The menu actually appears quite away (to the right and bottom) of the
> arrow.  It does this for both PC IE and Firefox, although I can't tell
> if the distances are the same.  Any advice for relatively lining up
> the menu directly beneath the image?
>
> Thanks, - Dave
>
>
> On Oct 16, 3:56 pm, "Jonathan Sharp" <[EMAIL PROTECTED]> wrote:
> > I think this is less of a jdMenu specific thing but you could do
> something
> > like the following:
> >
> > Assuming:
> > 
> > Text  align="middle"
> > height="16" width="16" />...
> >
> > $('ul.jd_menu > li').hover(function() {
> > $('> img', this).attr('src', 'url-to-image.jpg');},
> >
> > function() {
> > $('> img', this).attr('src', 'url-to-other-image.jpg');
> >
> > });
> >
> > -js
> >
> > On 10/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> wrote:
> >
> >
> >
> >
> >
> > > Thanks for this info.  Worked great.
> >
> > > One more small question.  To trigger the appearance of a drop-down
> > > menu, I have an image of an arrow
> >
> > >  > > height="16" width="16" />
> >
> > > but when the user rolls over the image, I'd like the source of the
> > > image to change to something else to indicate the menu is "active".
> > > How do I do this with jdMenu?
> >
> > > - Dave
> >
> > > On Oct 16, 2:28 pm, "Jonathan Sharp" <[EMAIL PROTECTED]> wrote:
> > > > $('ul.jd_menu').jdMenu({
> > > > activateDelay: 100
> >
> > > > });
> >
> > > > Should work, here are the other options:
> > > > showDelay: 150 hideDelay: 550
> >
> > > > Sorry there isn't any documentation yet.
> >
> > > > -js
> >
> > > > On 10/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> > > wrote:
> >
> > > > > Hey Chris, Thanks for this recommendation.  One thing I'm noticing
> > > > > when playing with this is that when I roll over the item that is
> > > > > supposed to trigger the appearance of the drop down menu, there is
> a
> > > > > one second delay getting the menu to appear.  Is this a setting
> > > > > somewhere that can be adjusted?  I'd like it to be
> instant.  Here's my
> > > > > code:
> >
> > > > >  http://www.w3.org/
> > > > > TR/REC-html40/strict.dtd">
> > > > > 
> > > > > 
> > > > > 
> >
> > > > > > > > > type="text/css" />
> >
> > > > > > > > > src="scripts/jquery.js">
> > > > > > > > > src="scripts/lib/bgiframe.js"></
> > > > > script>
> > > > ><script type="text/javascript"
> > > > > src="scripts/lib/dimensions.js"></
> > > > > script>
> >
> > > > ><script type="text/javascript"
> > > > > src="scripts/lib/jdMenu.js">
> > > > > rel="stylesheet"
> > > > > type="text/
> > > > > css"

[jQuery] Re: creating drop down menus with JQuery?

2007-10-16 Thread Jonathan Sharp
I think this is less of a jdMenu specific thing but you could do something
like the following:

Assuming:

Text ...

$('ul.jd_menu > li').hover(function() {
$('> img', this).attr('src', 'url-to-image.jpg');
},
function() {
$('> img', this).attr('src', 'url-to-other-image.jpg');
});

-js


On 10/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
> Thanks for this info.  Worked great.
>
> One more small question.  To trigger the appearance of a drop-down
> menu, I have an image of an arrow
>
>  height="16" width="16" />
>
> but when the user rolls over the image, I'd like the source of the
> image to change to something else to indicate the menu is "active".
> How do I do this with jdMenu?
>
> - Dave
>
> On Oct 16, 2:28 pm, "Jonathan Sharp" <[EMAIL PROTECTED]> wrote:
> > $('ul.jd_menu').jdMenu({
> > activateDelay: 100
> >
> > });
> >
> > Should work, here are the other options:
> > showDelay: 150 hideDelay: 550
> >
> > Sorry there isn't any documentation yet.
> >
> > -js
> >
> > On 10/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> wrote:
> >
> >
> >
> >
> >
> > > Hey Chris, Thanks for this recommendation.  One thing I'm noticing
> > > when playing with this is that when I roll over the item that is
> > > supposed to trigger the appearance of the drop down menu, there is a
> > > one second delay getting the menu to appear.  Is this a setting
> > > somewhere that can be adjusted?  I'd like it to be instant.  Here's my
> > > code:
> >
> > > http://www.w3.org/
> > > TR/REC-html40/strict.dtd">
> > > 
> > > 
> > > 
> >
> > > > > type="text/css" />
> >
> > > > > src="scripts/jquery.js">
> > > > > src="scripts/lib/bgiframe.js"></
> > > script>
> > ><script type="text/javascript"
> > > src="scripts/lib/dimensions.js"></
> > > script>
> >
> > ><script type="text/javascript"
> > > src="scripts/lib/jdMenu.js">
> > > > > type="text/
> > > css" />
> >
> > > 
> >
> > > $(document).ready(
> > >function () {
> > >// Load up the drop-down menus
> > >$('ul.jd_menu').jdMenu();
> > >}
> > > );
> >
> > > 
> > > 
> > > 
> >
> > > 
> > >
> > >
> > > > > border="0"
> > > align="middle" height="16" width="16" />
> > >
> > > title="Edit
> > > Module
> > > Title" class="editLink" href="#">Edit Module Title
> > > > > class="myspaceLink"
> > > href="#" title="Export MySpace HTML">Export MySpace HTML
> > >
> > >
> > >
> > >
> > > 
> >
> > > 
> > > 
> >
> > > On Oct 15, 5:16 pm, "Chris Jordan" <[EMAIL PROTECTED]> wrote:
> > > > check out jdMenu <http://jdsharp.us/jQuery/plugins/jdMenu/>. It's
> pretty
> > > > cool.
> >
> > > > Chris
> >
> > > > On 10/15/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]>
> > > wrote:
> >
> > > > > Hi,
> >
> > > > > Is there a plug-in that allows for menu creatio in JQuery?
> > > > > Specifically, I'm looking for something where when you roll over
> an
> > > > > arrow graphic, a menu will pop up beneath it.  I do not need
> submenus
> > > > > to pull out over individual menu items.
> >
> > > > > Thanks for any advice, - Dave
> >
> > > > --http://cjordan.us- Hide quoted text -
> >
> > - Show quoted text -
>
>


[jQuery] Re: creating drop down menus with JQuery?

2007-10-16 Thread Jonathan Sharp
$('ul.jd_menu').jdMenu({
activateDelay: 100
});

Should work, here are the other options:
showDelay: 150 hideDelay: 550

Sorry there isn't any documentation yet.

-js


On 10/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

>
> Hey Chris, Thanks for this recommendation.  One thing I'm noticing
> when playing with this is that when I roll over the item that is
> supposed to trigger the appearance of the drop down menu, there is a
> one second delay getting the menu to appear.  Is this a setting
> somewhere that can be adjusted?  I'd like it to be instant.  Here's my
> code:
>
>
> http://www.w3.org/
> TR/REC-html40/strict.dtd">
> 
> 
> 
>
> type="text/css" />
>
> src="scripts/jquery.js">
> src="scripts/lib/bgiframe.js"> script>
>