[jQuery] Re: XML Parsing Question...

2008-10-08 Thread Michael Geary

Well... Really, it doesn't work *at all*. You're not using an XML parser.
It's an HTML parser. Sure, it will do some kind of passable job of parsing
some kinds of XML, sort of, in some browsers.

Why not use a real XML parser?

function parseXML( xml ) {
if( window.ActiveXObject && window.GetObject ) {
var dom = new ActiveXObject( 'Microsoft.XMLDOM' );
dom.loadXML( xml );
return dom;
}
if( window.DOMParser )
return new DOMParser().parseFromString( xml, 'text/xml' );
throw new Error( 'No XML parser available' );
}

A quick test:

var dom = parseXML('howdy');
var $dom = $(dom);
console.log( $dom.find('foo').attr('what') );  // "isit"
console.log( $dom.find('bar').text() );  // "howdy"

You could make it a plugin:

jQuery.parseXML = function( xml ) {
return jQuery( parseXML(xml) );
};

And then you can replace the first two lines of the test code above with:

var $dom = $.parseXML('howdy');

-Mike

> From: KenLG
> 
> It may not be supported but it works great...usually.
> 
> As far as find being case-sensitive, the weird thing is that 
> it doesn't necessarily seem true. I could lcase the tags in 
> the XML but still do the find against the mixed case element 
> name and it still works. I had this suspicion that jquery is 
> doing that find in a case- insensitive way.
> 
> Actually, something I forgot to try: FireFox 3 works just 
> fine with the mixed case XML. Weird. I guess I'll just have 
> to deal until FF2 gets phased out.
> 
> Thanks,
> 
> kn
> 
> On Oct 6, 2:42 am, "Erik Beeson" <[EMAIL PROTECTED]> wrote:
> > To my knowledge, XML parsing via the jQuery constructor 
> isn't supported.
> >
> > See here:http://dev.jquery.com/ticket/3143
> >
> > --Erik
> >
> >
> >
> > On Sat, Oct 4, 2008 at 12:29 PM, KenLG <[EMAIL PROTECTED]> wrote:
> >
> > > For much of my app, I'm doing an Ajax hit to the server 
> to grab XML.
> > > That works great.
> >
> > > But, in some cases, I've got too many pieces of data (unrelated) 
> > > that I need to pull so I'm trying to do a simple passthrough from 
> > > the server side (I'm using ASP.Net). So, I'll either 
> output from SQL 
> > > Server or hand-stitch some XML and write it to the page.
> >
> > > Whenever I do this passthrough (whether it comes from SQL 
> Server or 
> > > from my own efforts), the XML doesn't get parsed by Jquery.
> >
> > > For example:
> >
> > > var sTestXML = '\r 
> > > \nHello > > EventContactData>\r\n';
> >
> > > var test = $(sTestXML);
> >
> > > alert(test.find("EventContact").length);
> >
> > > will result in the alert showing zero.
> >
> > > Now, if I lower case some of the tags (and this will vary 
> from XML 
> > > doc to XML doc but usually it's the root and object-level tags), 
> > > it'll work. What's going on here?- Hide quoted text -
> >
> > - Show quoted text -
> 



[jQuery] Re: Variable Scope

2008-10-08 Thread Michael Geary

A loop doesn't "print out" the code.

A function call *does*, in a manner of speaking.

I didn't look at the rest of your code in any detail, but if you want the
loop to work more the way you're expecting, where it saves the individual
loop values for "i" and the other variables you set up inside the loop,
simply change the loop code to:

for(var i = 1; i <= 5; i++)
addPopup( i );

And then add the function:

function addPopup( i ) {
// all the code in the body of the existing for loop goes here
}

Figure out why that makes a difference and you will understand closures. :-)

-Mike

> From: QuickScriptz
> 
> So, you're saying that basically, each time it runs through 
> the for loop it doesn't actually like "print out" the code 
> and replace the variables with their values, but it just 
> cycles through the code X number of times and the variables 
> only become actual values when the function (mouseover) is called?



[jQuery] Re: .after not really after

2008-10-08 Thread Johanm

you're right. thats whats going on.
I didnt have any table tags in the initial load image but only in the
resultset i get from the ajax call (sloppy coding).
This made the call end up in an ugly place and THEN add the table tags
which then was of no good.

thank you!
Johan

On Oct 8, 7:59 pm, Dave Methvin <[EMAIL PROTECTED]> wrote:
> > i was under the impression that .after should be after the  and
> > not after the  which is an append to me.
>
> If "this" is the clicked row,
>
> $(this).append("hi")  puts a new td inside the tr, at the
> end.
>
> $(this).after("hi");  puts a new tr after this one.
>
> >       $(this).after("
> You're putting a div there? Inside or outside the tr, that seems
> wrong. Did you want to put it in one of the td elements in the clicked
> row?
>
> >                 if ($("#mytripinfoblock").length > 0) {
> >                         $("#mytripinfoblock").fadeOut("slow");
> >                         $("#mytripinfoblock").remove();
> >                 }
>
> Try this instead. If there is no element the rest of the chain doesn't
> execute so you don't need to use an if. However, you do want to wait
> for the fade to complete before removing the element.
>
> $("#mytripinfoblock").fadeOut("slow", function(){
>    $(this).remove();
>
> });


[jQuery] Re: Variable Scope

2008-10-08 Thread QuickScriptz

Sorry about that MorningZ. My original question actually had to do
with whether somehow the value of the variable was being lost because
of the fact that when I went to actually use the variable it was
nested inside some other code blocks but what Dave said answers my
question.

> The closure is working as it should, but there is only one nowPopup
> variable and by the time any of the mouseover/mouseout events fire it
> is the same value for all the elements you've attached it to.

So, you're saying that basically, each time it runs through the for
loop it doesn't actually like "print out" the code and replace the
variables with their values, but it just cycles through the code X
number of times and the variables only become actual values when the
function (mouseover) is called?

I see what you're saying but if that was in fact the case then
shouldn't it be that the icons don't fade either?

And I will look into the tooltip plugins.


[jQuery] Re: Variable Scope

2008-10-08 Thread Dave Methvin

> I have a row of icons and the idea is when you mouseover, a popup
>  () appears below it and then when you mouseout, it fades again.

There are a lot of plugins that do this, like tooltip, cluetip and
jtip. Did you want to do something special?

>   $(nowPopup).css({left: leftPxS});

The closure is working as it should, but there is only one nowPopup
variable and by the time any of the mouseover/mouseout events fire it
is the same value for all the elements you've attached it to.

Definitely take a look at one of the tip plugins.


[jQuery] Re: .after not really after

2008-10-08 Thread Dave Methvin

> i was under the impression that .after should be after the  and
> not after the  which is an append to me.

If "this" is the clicked row,

$(this).append("hi")  puts a new td inside the tr, at the
end.

$(this).after("hi");  puts a new tr after this one.

>   $(this).after("                 if ($("#mytripinfoblock").length > 0) {
>                         $("#mytripinfoblock").fadeOut("slow");
>                         $("#mytripinfoblock").remove();
>                 }

Try this instead. If there is no element the rest of the chain doesn't
execute so you don't need to use an if. However, you do want to wait
for the fade to complete before removing the element.

$("#mytripinfoblock").fadeOut("slow", function(){
   $(this).remove();
});


[jQuery] Re: Variable Scope

2008-10-08 Thread MorningZ

So what exactly is the question/problem with "variable scope"?

Are you losing the scope somewhere?
Are you asking if there's a better way?

it's not clear at all


On Oct 8, 10:00 pm, QuickScriptz <[EMAIL PROTECTED]> wrote:
> So I've been over my code again and again and I've scoured through the
> Wiki and Help Documentation but I still cannot seem to make it work. I
> have a row of icons and the idea is when you mouseover, a popup ()
> appears below it and then when you mouseout, it fades again.
>
> I've found the best way to do it is that start with all the popups to
> the side of the icons (so you can still hover over the icons and the
> popups don't just block your way) and the popups begin as hidden
> (opacity: 0). When you mouseover the icons, it sets the "top" and
> "left" attribute of the popup to just below the icon and then it
> slowly fades the popup from 0 to .7 and then vice versa when mouseout.
>
> So, here is my code. You can view the product at the site below. Any
> suggestions?http://dev.quickscriptz.ca/v4/index.php
>
>  //         $(document).ready(function(){
>                 // PNG transparency fix
>                 $(document).pngFix();
>
>                 // Basic variables
>                 var outSpeed = "medium";
>                 var outOpacity = .7;
>                 var inSpeed = "fast";
>                 var inOpacity = 1;
>
>                 // Variables for icons & popups
>                 var nowIcon, nowPopup, topPx, leftPx, topPxH, leftPxH, topPxS,
> leftPxS;
>
>                 // Loop it five times
>                 for(var i = 1; i <= 5; i++){
>
>                         // Variable for icon id
>                         nowIcon = "#icon" + i;
>                         nowPopup = "#popup" + i;
>
>                         // Height from top of icon
>                         topPx = $(nowIcon).css("top");
>                         leftPx = $(nowIcon).css("left");
>
>                         // Popup hidden position
>                         topPxH = topPx - 10;
>                         leftPxH = leftPx - 150;
>
>                         // Popup showing position
>                         topPxS = topPx + 100;
>                         leftPxS = leftPx - 50;
>
>                         // Start by hiding popups
>                         $(nowPopup).css({top: topPxH});
>                         $(nowPopup).css({left: leftPxH});
>
>                         // Set opacity to zero (invisible)
>                         //$(nowPopup).animate({opacity: 0});
>
>                         // Mouse over event
>                         $(nowIcon).mouseover(function(){
>                                 $(this).fadeTo(outSpeed, outOpacity);
>                                 $(nowPopup).css({top: topPxS});
>                                 $(nowPopup).css({left: leftPxS});
>                                 $(nowPopup).fadeTo(outSpeed, outOpacity);
>                         })
>
>                         // Mouse out event
>                         $(nowIcon).mouseout(function(){
>                                 $(this).fadeTo(inSpeed, inOpacity);
>                                 $(nowPopup).fadeTo(inSpeed, 0);
>                         })
>
>                 }
>
>         })
> //]]>


[jQuery] Variable Scope

2008-10-08 Thread QuickScriptz

So I've been over my code again and again and I've scoured through the
Wiki and Help Documentation but I still cannot seem to make it work. I
have a row of icons and the idea is when you mouseover, a popup ()
appears below it and then when you mouseout, it fades again.

I've found the best way to do it is that start with all the popups to
the side of the icons (so you can still hover over the icons and the
popups don't just block your way) and the popups begin as hidden
(opacity: 0). When you mouseover the icons, it sets the "top" and
"left" attribute of the popup to just below the icon and then it
slowly fades the popup from 0 to .7 and then vice versa when mouseout.

So, here is my code. You can view the product at the site below. Any
suggestions?
http://dev.quickscriptz.ca/v4/index.php

 //


[jQuery] Jcarousel - Changing the starting position of the carousel according to the last page visited.

2008-10-08 Thread Jose P. Carballo
Hi,

As the title says, i want to set the starting position of the jcarousel
according to the last page visited.

What I've done so far is to decompose the last url with*
document.referrer*and then process this String in order to set a value
of a variable named
*startingPosition*. Finally, in the *start* property of the configuration
hash i set start: startingPosition.

The problem is that this is somehow a "slow" solution, since when I load the
page where the carousel is, it starts by default in position 1, and then
after the client does the algorithm of calculating the new position it then
sets the starting point of the carousel where it should be. It's less than a
second, but it does look bad, enough for not implementing it if I don't find
a faster solution without jumps.

Please send me any ideas or suggestions. Don't consider me a pro with
Javascript or Jquery please.

Thanks.

PS: I add the code I'm using right now (I'm adding it in the
jquery.jcarousel.js file):

   // Splits document.referrer
var reference = document.referrer.split('/');

// Initialize startingPosition to 1
var startingPosition = 1;

// Array with test I'm looking for in the referrer to select the
starting position of the carousel
var listOfStringsImLookinFor = new Array();
listOfStringsImLookinFor[0] = "text1";
listOfStringsImLookinFor[1] = "text2";
listOfStringsImLookinFor[2] = "text3";
listOfStringsImLookinFor[3] = "text4";

// Calculates starting position
for(var i = 0; i < listOfStringsImLookinFor.length; i++)
for(var j = 0; j < reference.length; j++)
if(reference[j] == listOfStringsImLookinFor[i])
startingPosition = i + 1;

and then down in the carousel configuration: (hash defaults)

 start: startingPosition,


-- Forwarded message --
From: Jose P. Carballo <[EMAIL PROTECTED]>
Date: 2008/10/5
Subject: About JCarousel
To: [EMAIL PROTECTED]


Hello, first of all thanks for this software and all documentation etc. Good
job.

I have a small question, how could I change the image displaying in the
carrousel with html internal links or something.

My carrousel displays one image at a time, let's say I move until image 8,
and then i click on it and i go to another link in my site. When returnin to
the page where the carousel is in, I would want the carousel to be
positioned back on the image 8. So that if I want to check image 9 i dont
have to scroll 8 times.

Thanks!

-- 
Jose Pablo Carballo



-- 
Jose Pablo Carballo


[jQuery] .after not really after

2008-10-08 Thread Johanm

I'm having an issue where i have a table full of records,
when the user clicks on an entry i want it to slide down. he problem
is that it slides down
after right after the  pushing out everything else.
i was under the impression that .after should be after the  and
not after the  which is an append to me.

As its not working I'm of course sure im wrong.

any inputs on this would be much appreciated
two screenshots of what im trying to say can be find here

http://www.konstructive.com/table1.png
http://www.konstructive.com/table2.png

thanks,
Johan


San Francisco
Mountain View
None

None
48


$(".mytriptableitem").click(function(){
//$("#map_canvas").remove();
if ($("#mytripinfoblock").length > 0) {
$("#mytripinfoblock").fadeOut("slow");
$("#mytripinfoblock").remove();

}
if ($(this).attr("clicked") == 1){
$(this).attr("clicked","0");
$(this).fadeTo("slow", 1);
}
else {
url = "/myTripFootprint/trip_query/mytripsmap?id="+$
(this).attr("id");
$(this).after(" ").fadeIn(); //nice little ajax load image
$("#mytripinfoblock").load(url,0,function(){ //loads 
the dropdown
var from = $("#mapfrom").attr("value");
var to = $("#mapto").attr("value");
initialize(from, to, 'mymap_canvas'); 
//initalizes the google map
var directions = setDirections(from, to, 
"en_US"); //loads the
googlemap
}).hide();
$("#mytripinfoblock").fadeIn();
$(this).attr("clicked","1");
 //$(this).css({ backgroundColor:"white"});
$(this).fadeTo("slow", 0.33);

}
});


[jQuery] Re: Starting animation at different points

2008-10-08 Thread ricardobeat

If you absolutely/relatively position the DIV with bottom and left you
should be able to do it with animate().


On Oct 8, 7:15 pm, brennenws <[EMAIL PROTECTED]> wrote:
> I am fairly new to jquery and I have a question on animation. I want
> to be able to have a div animate in a different direction rather than
> the default. Right now I have a div that is 29px by 41px. When I hover
> over it it animates to a div that is 80px by 100px. As of now it is
> animates from the top-left corner  down and to the bottom-right.
> However, I would like it to animate from bottom-left to the top-right.
> Is there any way of doing this. Please let me know.


[jQuery] Re: XML Parsing Question...

2008-10-08 Thread KenLG

It may not be supported but it works great...usually.

As far as find being case-sensitive, the weird thing is that it
doesn't necessarily seem true. I could lcase the tags in the XML but
still do the find against the mixed case element name and it still
works. I had this suspicion that jquery is doing that find in a case-
insensitive way.

Actually, something I forgot to try: FireFox 3 works just fine with
the mixed case XML. Weird. I guess I'll just have to deal until FF2
gets phased out.

Thanks,

kn

On Oct 6, 2:42 am, "Erik Beeson" <[EMAIL PROTECTED]> wrote:
> To my knowledge, XML parsing via the jQuery constructor isn't supported.
>
> See here:http://dev.jquery.com/ticket/3143
>
> --Erik
>
>
>
> On Sat, Oct 4, 2008 at 12:29 PM, KenLG <[EMAIL PROTECTED]> wrote:
>
> > For much of my app, I'm doing an Ajax hit to the server to grab XML.
> > That works great.
>
> > But, in some cases, I've got too many pieces of data (unrelated) that
> > I need to pull so I'm trying to do a simple passthrough from the
> > server side (I'm using ASP.Net). So, I'll either output from SQL
> > Server or hand-stitch some XML and write it to the page.
>
> > Whenever I do this passthrough (whether it comes from SQL Server or
> > from my own efforts), the XML doesn't get parsed by Jquery.
>
> > For example:
>
> > var sTestXML = '\r
> > \nHello > EventContactData>\r\n';
>
> > var test = $(sTestXML);
>
> > alert(test.find("EventContact").length);
>
> > will result in the alert showing zero.
>
> > Now, if I lower case some of the tags (and this will vary from XML doc
> > to XML doc but usually it's the root and object-level tags), it'll
> > work. What's going on here?- Hide quoted text -
>
> - Show quoted text -


[jQuery] [validate] Trouble using rules( "add", rules ) as well as setting attribute for range validations

2008-10-08 Thread BobS

I'm working on a server-side component that will generate all of my
jQuery validation rules from xml metadata, so I'm trying to
dynamically add rules one at a time.

My first attempt was to use the rules( "add", rules ) syntax, but I'm
getting an error on page load:

jQuery.data(element.form, "validator") is undefined

Here's the syntax I'm using:

$("#VerifyPassword").rules('add',{equalTo: '#UserPass'});  which seems
to be correct according to the docs.

So, I decided to try setting attributes instead, which works fine for
the equalTo. For example, this works:

$("#VerifyPassword").attr('equalTo','#UserPass');

But when trying to use attr to set a range I cannot figure out what to
pass in for the range.

I've tried:
$("#UserPass").attr('rangelength','[5,10]'); -> yeilds the message
"Please enter a value between NaN and 5 characters long."
$("#UserPass").attr('rangelength',[5,10]);  -->  yields the message
"Please enter a value between 5 and NaN characters long."
var theRange = [5,10]; $("#UserPass").attr('rangelength',theRange);  --
>  yields the message "Please enter a value between 5 and NaN
characters long."

So, I really have 2 questions:

1. How can I a rule using the rules( "add", rules ) syntax, which
would be my preferred approach?
2. If I need to add a validation using attr, what format do I use to
pass in the value of the rangelength attribute?

Thanks in advance for any help anyone can provide,
Bob


[jQuery] using an png with shadow and fadeTo...

2008-10-08 Thread Olivier Bolender

Hi,

When I use a png with a shadow in a div with a opacity of .5 (less or
more) using the fadeTo function, the border of shadow is white under
ff/chrome or black under ie:

How do I fix it ?


[jQuery] Re: Unbind not unbinding

2008-10-08 Thread Okie

Hmmm  I posted a second time after my first post (at 1:45 didn't
seem to go through).  My first post came in later than my second post,
and turned into a reply.  Was there a moderation process that I went
through?

I'm not worried about it.  Now I've got two explanations of my
problem.

On Oct 8, 1:45 pm, Okie <[EMAIL PROTECTED]> wrote:
> I've got the following:
>
>         var existingCodes = new Array(' $existingCodes); ?>');
>
>         var form = document.newSpecificLeadSourceForm;
>
>         $('#suggestCode').click(function() {
>                 $(this).css('display', 'none');
>                 $(form.source).bind('keyup', function() {
>                         var code = 
> $(this).attr('value').replace(/[^A-Z0-9\-]/ig, '');
>                         if (existingCodes.indexOf(code) == -1)
>                                 $(form.code).attr('value', code);
>                 }).keyup();
>         }).click();
>
>         $(form.code).focus(function() {
>                 $(form.source).unbind('keyup');
>                 $('#suggestCode').css('display', 'inline');
>         });
>
> On the page, I have a form with two text fields (source, code) and a
> link (suggestCode).  The script will create in the "code" field, a
> stripped down version of the text in the "source" field on every
> keypress.  When the "code" field is focuses it [should] deactivate
> this behavior and allow for the user to create their own code.  (It
> also displays the suggestCode link to reactivate the behavior.)
>
> My problem is the unbind is not working.  Everything else works fine,
> but after entering in text into the "code" field (which should
> deactivate auto code suggestion), and typing in the "source" field
> again, the suggestion is still turned on.
>
> I could work around the issue with a "suggestionOn" boolean, but that
> would be admitting defeat.  Why isn't unbind behaving?


[jQuery] Unbind not unbinding

2008-10-08 Thread Okie

I've got the following:

var existingCodes = new Array('');

var form = document.newSpecificLeadSourceForm;

$('#suggestCode').click(function() {
$(this).css('display', 'none');
$(form.source).bind('keyup', function() {
var code = 
$(this).attr('value').replace(/[^A-Z0-9\-]/ig, '');
if (existingCodes.indexOf(code) == -1)
$(form.code).attr('value', code);
}).keyup();
}).click();

$(form.code).focus(function() {
$(form.source).unbind('keyup');
$('#suggestCode').css('display', 'inline');
});


On the page, I have a form with two text fields (source, code) and a
link (suggestCode).  The script will create in the "code" field, a
stripped down version of the text in the "source" field on every
keypress.  When the "code" field is focuses it [should] deactivate
this behavior and allow for the user to create their own code.  (It
also displays the suggestCode link to reactivate the behavior.)

My problem is the unbind is not working.  Everything else works fine,
but after entering in text into the "code" field (which should
deactivate auto code suggestion), and typing in the "source" field
again, the suggestion is still turned on.

I could work around the issue with a "suggestionOn" boolean, but that
would be admitting defeat.  Why isn't unbind behaving?


[jQuery] ie7 opacity effects with positioned elements

2008-10-08 Thread Nick Harris

Hey,

I'm having trouble with opacity effects in ie7; It appears that if an
element with any effect that involves opacity (slideDown(), show(),
hide() etc...) has any child that is positioned either relatively, or
absolutely, then the positioned element's opacity doesn't animate...
it simply moves and then disappears... has anyone else come across
this? and know a fix?

Cheers for any help
n


[jQuery] Form Serialization

2008-10-08 Thread Rajanikanth

Hi Guys,

I have a requirement i need to achieve auto save on a page where i
have huge form which is having hundred's of child forms.

Right now i have achieved the functionality using jQuery form
serialization but its freezing the page when it is doing form
serialization for about 15secs on a normal system which has a 1GG Ram
and 1.6GHZ.

Can anybody suggest me a good solution.

I m using Struts 1.2.

Thanks in Advance.

Cheers,
Rajanikanth R
Sony Pictures


[jQuery] unit testing adding rows to table

2008-10-08 Thread john teague

I'm running a test with qUnit that shows i am appending rows to a
table correctly.  At this point I just want to show I'm getting the
right rows back.  But it doesn't look like the dom isn't picking up
the newly added rows.

I'm seeing the rows, so my call is working, I would just like to
verify this in the unit test.  Am I missing something or is this
expected behavior since I'm adding to the dom.

Here is my test:
test("should load the rows in the grid",function(){
stop();
loadNotesGrid(opportunityID,0,5,'OppNotes');
start();
var actual = $('#OppNotes tbody tr').length;
equals(actual, 5, "should have 5 rows");
});

thanks,
john


[jQuery] Re: Problem with slideUp() in IE7

2008-10-08 Thread Chris

That did it. Thank you so much. That actually fixed another issue that
I thought was a problem with the line-height. Beautiful!!!

On Oct 5, 11:04 am, Julle <[EMAIL PROTECTED]> wrote:
> Chris,
>
> On Aug 28, 10:04 pm, Chris <[EMAIL PROTECTED]> wrote:
>
> > oddly enough, this works great in IE6 (and every other browser I could
> > find), just not IE7...
>
> > Any ideas???
>
> First thanks for nailing this bug down to what it actually is, I had a
> similar problem and couldn't have solved without your clean code
> example.
>
> It turned out to be a variant of the good old peek-a-boo bug, that MS
> have been kind enough to make sure is also part of IE7
>
> For me the solution was to set max-width: 0; on the sliding box. 
> Seehttp://www.brownbatterystudios.com/sixthings/2007/01/06/css-first-aid...
>
> Christian Julhttp://mocsystems.com


[jQuery] Re: What is crashing Safari 2?

2008-10-08 Thread Louis

I've had a similar problem with Safari.

I found that if I don't wrap the HTML in a tag, then safari will
crash...

s, something like:
$("#element").html("some text");
will crash safari

but the following will not:
$("#element").html("some text");

Hope this helps :)

On Sep 13, 3:55 am, PED <[EMAIL PROTECTED]> wrote:
> I commented out and stepped through the code to find the problem:
>
> This line crashes Safari 2.0.4
> $('#main_image .caption').html(caption).fadeIn();
>
> This does not.
> $('#main_image .caption').text(caption).fadeIn();


[jQuery] using draggable from within a container with over-flow:hidden.

2008-10-08 Thread jason

I'm using jcarousel to display a list of images that I want the user
to be able to drag to certain drop targets.

The code looks like:

...children('img').addClass('flashCatalogPage').draggable({ helper:
'clone', opacity: .5 });

The problem is, the container for the jcarousel uses the css attribute
over-flow:hidden to hide elements further down in the list.

I tried playing with the container attribute but that doesn't seem to
work. Does anyone have any suggestions?


[jQuery] Unbind not unbinding

2008-10-08 Thread Okie




suggest code



...

var existingCodes = new Array('');

var form = document.newSpecificLeadSourceForm;

$('#suggestCode').click(function() {
$(this).css('display', 'none');
$(form.source).bind('keyup', function() {
var code = $(this).attr('value').replace(/[^A-Z0-9\-]/ig, '');
if (existingCodes.indexOf(code) == -1)
$(form.code).attr('value', code);
}).keyup();
}).click();

$(form.code).focus(function() {
$(form.source).unbind('keyup');
$('#suggestCode').css('display', 'inline');
});


__

Intended behavior:
On every keypress within the "source" field, a striped-down version is
suggested within the "code" field.  If the user clicks on the "code"
field, suggestion is turned off, and a "suggest code" link appears.
If the "suggest code" link is clicked, suggestion is turned back on,
and a code is suggested.

Currently, everything is working fine, except for the "suggestion is
turned off" part:
$(form.source).unbind('keyup');

I click into the "code" field (the "suggest code" link successfully
shows up), and enter a code.  I then go to change the "source" field
*prior to pressing "suggest code"*, and it seems suggestion is still
on.  I do not want suggestion to reappear until the user decides to
press "suggest code".

I've tried:

$(form.source).unbind();
$(form.source).unbind('keyup');

I eventually did a work around involving a "suggestionOn" boolean.
But using that method would be accepting defeat.

Any help?  Am I using unbind incorrectly?


[jQuery] Starting animation at different points

2008-10-08 Thread brennenws

I am fairly new to jquery and I have a question on animation. I want
to be able to have a div animate in a different direction rather than
the default. Right now I have a div that is 29px by 41px. When I hover
over it it animates to a div that is 80px by 100px. As of now it is
animates from the top-left corner  down and to the bottom-right.
However, I would like it to animate from bottom-left to the top-right.
Is there any way of doing this. Please let me know.


[jQuery] Help writing function for sending a serialized post for updating a UL order

2008-10-08 Thread Chuck Cheeze

I have a UL:


One
Two
Three


I have a function:

$(document).ready(function() {

//sortables
$("#child_list").sortable({
opacity: 0.7,
revert: true,
scroll: true,
handle: $(".handle"),
change: function(sorted){
$.post("/admin/ajax/orderChildren.asp", { 
item_order_str: $
('#child_list').sortable("serialize") });
});

I am switching this over from scriptaculous, and I need to know if the
above is written correctly, and also, what would the data posted to
the orderChildren.asp page look like, and how would I access the
variable on that page?


[jQuery] Re: AJAX Success Callback referring to $(this)

2008-10-08 Thread Josh Nathanson


I guess I'm not understanding what you're trying to do.  The code I provided 
is the standard way of referencing "this" when you want to reference the 
original context in an inner function.


-- Josh

- Original Message - 
From: "Wayne" <[EMAIL PROTECTED]>

To: "jQuery (English)" 
Sent: Wednesday, October 08, 2008 2:18 PM
Subject: [jQuery] Re: AJAX Success Callback referring to $(this)



Right, but that trigger doesn't work in the context of the anonymous
function. Unless, I'm missing something you changed.

-Wayne

On Oct 8, 3:43 pm, "Josh Nathanson" <[EMAIL PROTECTED]> wrote:

Ok, I think I see what's happening -- you have something like this:

$("whatever").click(function() {
$.ajax({ blah blah..

So you just need to do this:

$("whatever").click(function() {
var trigger = this;
$.ajax({
success: function() {
// do whatever with 'trigger'
}
});

});

-- Josh

- Original Message -
From: "Wayne" <[EMAIL PROTECTED]>
To: "jQuery (English)" 
Sent: Wednesday, October 08, 2008 12:15 PM
Subject: [jQuery] Re: AJAX Success Callback referring to $(this)

OK. I haven't tried this yet, but how is this any different? Even
though you're moving the ajax call inside of another function, aren't
you abstracting the same logic out by calling the anonymous function
inside of success? Maybe I'm not understanding what "trigger" and
"trigger condition" are supposed to represent, but I assumed that was
related to my isNaN(r) logic.

Thanks,
-Wayne

On Oct 8, 12:36 pm, "Josh Nathanson" <[EMAIL PROTECTED]> wrote:
> "this" referenced in the success callback will refer to the jQuery 
> object

> when you do an ajax call.

> You might want to put the ajax call within another function that can 
> also

> receive information about the triggering element:

> doAjax: function( trigger ) {
> jQuery.ajax({
> // etc.
> success: function() {
> if ( trigger condition ) {
> // do stuff
> }
> }
> });

> }

> $("triggeringelement").click(function() {
> doAjax( this );

> });

> -- Josh

> - Original Message -
> From: "Wayne" <[EMAIL PROTECTED]>
> To: "jQuery (English)" 
> Sent: Wednesday, October 08, 2008 7:49 AM
> Subject: [jQuery] AJAX Success Callback referring to $(this)

> > I've been looking for this quite a bit, today, and haven't quite found
> > what I'm looking for, so maybe someone can point me in the right
> > direction.

> > I'm performing an AJAX request, and I pass an anonymous function as
> > the success callback, upon which I will want to do some DOM
> > modification to the element that triggered the AJAX event. Ordinarily,
> > $(this) would work fine for doing this, but it seems that $(this)
> > points instead to something besides a DOM element.

> > First, what does $(this) point to when you're inside the AJAX Success
> > callback.

> > Second, what is considered the best practice for accessing the
> > triggering element after a successful AJAX query?

> > Any help is appreciated,
> > Wayne






[jQuery] Re: AJAX Success Callback referring to $(this)

2008-10-08 Thread MorningZ

There's no reason why Josh's code wouldn't work  (closure = good!)

I suggest just trying it   :-)



On Oct 8, 5:18 pm, Wayne <[EMAIL PROTECTED]> wrote:
> Right, but that trigger doesn't work in the context of the anonymous
> function. Unless, I'm missing something you changed.
>
> -Wayne
>
> On Oct 8, 3:43 pm, "Josh Nathanson" <[EMAIL PROTECTED]> wrote:
>
> > Ok, I think I see what's happening -- you have something like this:
>
> > $("whatever").click(function() {
> >     $.ajax({ blah blah..
>
> > So you just need to do this:
>
> > $("whatever").click(function() {
> >     var trigger = this;
> >     $.ajax({
> >         success: function() {
> >             // do whatever with 'trigger'
> >         }
> >     });
>
> > });
>
> > -- Josh
>
> > - Original Message -
> > From: "Wayne" <[EMAIL PROTECTED]>
> > To: "jQuery (English)" 
> > Sent: Wednesday, October 08, 2008 12:15 PM
> > Subject: [jQuery] Re: AJAX Success Callback referring to $(this)
>
> > OK. I haven't tried this yet, but how is this any different? Even
> > though you're moving the ajax call inside of another function, aren't
> > you abstracting the same logic out by calling the anonymous function
> > inside of success? Maybe I'm not understanding what "trigger" and
> > "trigger condition" are supposed to represent, but I assumed that was
> > related to my isNaN(r) logic.
>
> > Thanks,
> > -Wayne
>
> > On Oct 8, 12:36 pm, "Josh Nathanson" <[EMAIL PROTECTED]> wrote:
> > > "this" referenced in the success callback will refer to the jQuery object
> > > when you do an ajax call.
>
> > > You might want to put the ajax call within another function that can also
> > > receive information about the triggering element:
>
> > > doAjax: function( trigger ) {
> > > jQuery.ajax({
> > > // etc.
> > > success: function() {
> > > if ( trigger condition ) {
> > > // do stuff
> > > }
> > > }
> > > });
>
> > > }
>
> > > $("triggeringelement").click(function() {
> > > doAjax( this );
>
> > > });
>
> > > -- Josh
>
> > > - Original Message -
> > > From: "Wayne" <[EMAIL PROTECTED]>
> > > To: "jQuery (English)" 
> > > Sent: Wednesday, October 08, 2008 7:49 AM
> > > Subject: [jQuery] AJAX Success Callback referring to $(this)
>
> > > > I've been looking for this quite a bit, today, and haven't quite found
> > > > what I'm looking for, so maybe someone can point me in the right
> > > > direction.
>
> > > > I'm performing an AJAX request, and I pass an anonymous function as
> > > > the success callback, upon which I will want to do some DOM
> > > > modification to the element that triggered the AJAX event. Ordinarily,
> > > > $(this) would work fine for doing this, but it seems that $(this)
> > > > points instead to something besides a DOM element.
>
> > > > First, what does $(this) point to when you're inside the AJAX Success
> > > > callback.
>
> > > > Second, what is considered the best practice for accessing the
> > > > triggering element after a successful AJAX query?
>
> > > > Any help is appreciated,
> > > > Wayne


[jQuery] Re: AJAX Success Callback referring to $(this)

2008-10-08 Thread Wayne

Right, but that trigger doesn't work in the context of the anonymous
function. Unless, I'm missing something you changed.

-Wayne

On Oct 8, 3:43 pm, "Josh Nathanson" <[EMAIL PROTECTED]> wrote:
> Ok, I think I see what's happening -- you have something like this:
>
> $("whatever").click(function() {
>     $.ajax({ blah blah..
>
> So you just need to do this:
>
> $("whatever").click(function() {
>     var trigger = this;
>     $.ajax({
>         success: function() {
>             // do whatever with 'trigger'
>         }
>     });
>
> });
>
> -- Josh
>
> - Original Message -
> From: "Wayne" <[EMAIL PROTECTED]>
> To: "jQuery (English)" 
> Sent: Wednesday, October 08, 2008 12:15 PM
> Subject: [jQuery] Re: AJAX Success Callback referring to $(this)
>
> OK. I haven't tried this yet, but how is this any different? Even
> though you're moving the ajax call inside of another function, aren't
> you abstracting the same logic out by calling the anonymous function
> inside of success? Maybe I'm not understanding what "trigger" and
> "trigger condition" are supposed to represent, but I assumed that was
> related to my isNaN(r) logic.
>
> Thanks,
> -Wayne
>
> On Oct 8, 12:36 pm, "Josh Nathanson" <[EMAIL PROTECTED]> wrote:
> > "this" referenced in the success callback will refer to the jQuery object
> > when you do an ajax call.
>
> > You might want to put the ajax call within another function that can also
> > receive information about the triggering element:
>
> > doAjax: function( trigger ) {
> > jQuery.ajax({
> > // etc.
> > success: function() {
> > if ( trigger condition ) {
> > // do stuff
> > }
> > }
> > });
>
> > }
>
> > $("triggeringelement").click(function() {
> > doAjax( this );
>
> > });
>
> > -- Josh
>
> > - Original Message -
> > From: "Wayne" <[EMAIL PROTECTED]>
> > To: "jQuery (English)" 
> > Sent: Wednesday, October 08, 2008 7:49 AM
> > Subject: [jQuery] AJAX Success Callback referring to $(this)
>
> > > I've been looking for this quite a bit, today, and haven't quite found
> > > what I'm looking for, so maybe someone can point me in the right
> > > direction.
>
> > > I'm performing an AJAX request, and I pass an anonymous function as
> > > the success callback, upon which I will want to do some DOM
> > > modification to the element that triggered the AJAX event. Ordinarily,
> > > $(this) would work fine for doing this, but it seems that $(this)
> > > points instead to something besides a DOM element.
>
> > > First, what does $(this) point to when you're inside the AJAX Success
> > > callback.
>
> > > Second, what is considered the best practice for accessing the
> > > triggering element after a successful AJAX query?
>
> > > Any help is appreciated,
> > > Wayne
>
>


[jQuery] Re: Nubee - concatenating & code help

2008-10-08 Thread MorningZ

http://docs.jquery.com/Selectors/multiple#selector1selector2selectorN

$(".closerbutton, .editbutton").show("slow");





On Oct 8, 4:42 pm, ivframes <[EMAIL PROTECTED]> wrote:
> First of all, is it possible to concatenate events with similar (the
> same) functions?
>
> For example:
>
> $(".closerbutton").show("slow");
> $(".editbutton").show("slow");
>
> ...would be like $(".editbutton", ".closerbutton")... I know that's
> not possible, but is there another way?
>
> I also need help with a script.
>
> $(function() {
>         $(".portfolio").click(function() {
>                 $(".jq").load("/portfolio/", function() {
>                 $(this).slideDown("slow"); });
>                 $(".closerbutton").show("slow").attr("title", "close");
>                 $(".editbutton").show("slow").attr("title", "edit");
>
>                 $(".editbutton").click(function() {
>                 $(".jq").load("edit.php?edit=portfolio", function() {
>                 $(this).slideDown("slow");
>                         });
>                 });
>         });
>
> });
>
> So when someone clicks on .portfolio this will happen:
>
> - load the page & slidedown
> - show both close & edit buttons
> - if someone click on the edit button it will load the particular edit
> page for portfolio.
>
> This works only when there's no  link.
> If I provide the link in HTML, it'll load instead of this jQuery
> script. If I put "return false" before .editbutton click function, it
> will work, but editbutton won't be attached to ".portfolio" and will
> be generic. For every page I want one edit button that will alter just
> that particular page.
>
> I hope I was clear enough for someone to understand! :D Thanks!!


[jQuery] Nubee - concatenating & code help

2008-10-08 Thread ivframes

First of all, is it possible to concatenate events with similar (the
same) functions?

For example:

$(".closerbutton").show("slow");
$(".editbutton").show("slow");

...would be like $(".editbutton", ".closerbutton")... I know that's
not possible, but is there another way?


I also need help with a script.

$(function() {
$(".portfolio").click(function() {
$(".jq").load("/portfolio/", function() {
$(this).slideDown("slow"); });
$(".closerbutton").show("slow").attr("title", "close");
$(".editbutton").show("slow").attr("title", "edit");

$(".editbutton").click(function() {
$(".jq").load("edit.php?edit=portfolio", function() {
$(this).slideDown("slow");
});
});
});
});

So when someone clicks on .portfolio this will happen:

- load the page & slidedown
- show both close & edit buttons
- if someone click on the edit button it will load the particular edit
page for portfolio.

This works only when there's no  link.
If I provide the link in HTML, it'll load instead of this jQuery
script. If I put "return false" before .editbutton click function, it
will work, but editbutton won't be attached to ".portfolio" and will
be generic. For every page I want one edit button that will alter just
that particular page.

I hope I was clear enough for someone to understand! :D Thanks!!


[jQuery] jQuery Cycle, Multiple Items

2008-10-08 Thread alexp206

Hi, I've been playing around with the jQuery Cycle plugin, it's
great.  I do have a question though, is it possible to show multiple
items simultaneously?

An example would be, if you have 5 items:
1 2,
2 3,
3 4,
4 5,
5 1 (loop)

In this particular instance I'm working with single line divs, but I
assume the code would be the same if it were pictures or what have
you.

Thanks for a great tool!


[jQuery] Re: Whats best for js compression, packer, jsminify, YUI?

2008-10-08 Thread Bil Corry

JimD wrote on 10/8/2008 2:21 PM: 
> I know this has probably been discussed before but I with all the
> options available, I was wondering what method seems to work best
> overall for compressing js files. I want to put all my jquery plugins
> into one file and compress for performance but I'm worried about
> breaking things.

Minimize, don't pack.  And the other half of it if you're concerned about 
performance is set the Expires header to 1 year from now when you serve the 
file:

http://developer.yahoo.com/performance/rules.html#expires

That will cause the user to download your JavaScript once, and then load it 
locally for the next year (provided their cache isn't cleared).


- Bil
 



[jQuery] Re: jQuery Cycle, Multiple Items

2008-10-08 Thread Mike Alsup

Sorry, no.  Cycle treats each item as a slide and shows them one by
one.  However you could have two slideshows side by side to simulate
this effect.

Mike

On Oct 8, 3:38 pm, alexp206 <[EMAIL PROTECTED]> wrote:
> Hi, I've been playing around with the jQuery Cycle plugin, it's
> great.  I do have a question though, is it possible to show multiple
> items simultaneously?
>
> An example would be, if you have 5 items:
> 1 2,
> 2 3,
> 3 4,
> 4 5,
> 5 1 (loop)
>
> In this particular instance I'm working with single line divs, but I
> assume the code would be the same if it were pictures or what have
> you.
>
> Thanks for a great tool!


[jQuery] can't return focus

2008-10-08 Thread robing

i am putting together a basic text editor and to reduce pasting styled
content in to the editor i open up a div with a textarea that content
can be pasted in to and then i can innerHTML that content back to the
editor where the cursor previously was.

the problem i am having is after the div opens and the content has
been pasted in i can't gain focus where my cursor was on the original
page, is there any way around this?

Regards

Robin


[jQuery] Re: UI Instance Options

2008-10-08 Thread greenteam003


Wow, thanks Richard.  I would have never figured that one out on my own and
from my searching is not readily available in jQuery docs.

Cheers,
Chris


Richard D. Worth-2 wrote:
> 
> Getter:
> 
> var minHeight = $('#example_div').data("minHeight.resizable");
> 
> Setter:
> 
> $('#example_div').data("minWidth.resizable", 200);
> 
> - Richard
> 
> On Wed, Oct 8, 2008 at 2:11 PM, greenteam003 <[EMAIL PROTECTED]> wrote:
> 
>>
>>
>> Hi all,
>>
>> This may be a dumb question, but I can not find an example in the
>> archives
>> or in the jQuery docs.  Is it possible to access a ui widget's options
>> from
>> a global function?  For example, if I set up the following div to be
>> resizable...
>>
>>
>> $('#example_div').resizable({minHeight:200,minWidth:200});
>>
>>
>> How could I read the "minHeight" and "minWidth" options used to init the
>> ui
>> object instance from the selector $('#example_div') ?
>> I can't see anything attached to the actual dom element in firebug and
>> don't
>> know where else to look.
>>
>> Thanks,
>> Chris
>> --
>> View this message in context:
>> http://www.nabble.com/UI-Instance-Options-tp19884303s27240p19884303.html
>> Sent from the jQuery General Discussion mailing list archive at
>> Nabble.com.
>>
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/UI-Instance-Options-tp19884303s27240p19886226.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: ANNOUNCE: ui.timepickr.js plugin

2008-10-08 Thread h3

I've already some ideas on how I'll achieve it. If you check on the
todo list you'll see that internationalization is in my plans

max

On Oct 8, 3:37 pm, "Weyert de Boer" <[EMAIL PROTECTED]> wrote:
> I think the plugin design will get problematic if you try to use it in
> Europe where don't use the am/pm system but just the 24hours clock
> instead. This would probably make the widget huge.
>
> On Wed, Oct 8, 2008 at 9:33 PM, h3 <[EMAIL PROTECTED]> wrote:
>
> > For the past two days I've been working on a experimental plugin which
> > aims to enhance user experience when it comes to input time in a form.
>
> > I've made a first "unofficial" announcement on my blog:
>
> >http://haineault.com/blog/71/
>
> > Considering the constant flow of positive feedbacks I got since I
> > posted it (which successfully crashed my hosting server), I'm proud to
> > announce that I'll make my best to create an official jQuery plugin
> > with it.
>
> > There is still a *lot* of work, polish, documentation and test to do
> > in before the first release, so if there is some charitable souls who
> > wish to participate I'll be glad to collaborate with you guys.
>
> > Ideas and comments are also welcome
>
> > Best regards
>
> > ~ Maxime Haineault


[jQuery] Re: Whats best for js compression, packer, jsminify, YUI?

2008-10-08 Thread Rene Veerman


I like and use phpjso (http://www.cortex-creations.com/software/phpjso). 
It can also obfusicate, but if you do that then be sure to use the 'fast 
decompression' option otherwise you have a initialization lag of up to a 
full second for +-40Kb of script.


JimD wrote:

Hi all,

I know this has probably been discussed before but I with all the
options available, I was wondering what method seems to work best
overall for compressing js files. I want to put all my jquery plugins
into one file and compress for performance but I'm worried about
breaking things.

I know there is packer, jsmin etc. Any recommendations.

  




[jQuery] Re: ANNOUNCE: ui.timepickr.js plugin

2008-10-08 Thread MorningZ

Very cool.. i totally dig the concept of it

I would suggest doing some testing on the most used browser on the
internet, yes, our friend IE because this plugin simply doesn't
work at all (IE7 on Win2003 here)




On Oct 8, 3:33 pm, h3 <[EMAIL PROTECTED]> wrote:
> For the past two days I've been working on a experimental plugin which
> aims to enhance user experience when it comes to input time in a form.
>
> I've made a first "unofficial" announcement on my blog:
>
> http://haineault.com/blog/71/
>
> Considering the constant flow of positive feedbacks I got since I
> posted it (which successfully crashed my hosting server), I'm proud to
> announce that I'll make my best to create an official jQuery plugin
> with it.
>
> There is still a *lot* of work, polish, documentation and test to do
> in before the first release, so if there is some charitable souls who
> wish to participate I'll be glad to collaborate with you guys.
>
> Ideas and comments are also welcome
>
> Best regards
>
> ~ Maxime Haineault


[jQuery] Re: ANNOUNCE: ui.timepickr.js plugin

2008-10-08 Thread h3

Yeah I know, it started as an experiment so I don't really tested it
on IE yet.
Obviously it will have to work at least on IE7 before the first
release.

max

On Oct 8, 3:38 pm, MorningZ <[EMAIL PROTECTED]> wrote:
> Very cool.. i totally dig the concept of it
>
> I would suggest doing some testing on the most used browser on the
> internet, yes, our friend IE because this plugin simply doesn't
> work at all (IE7 on Win2003 here)
>
> On Oct 8, 3:33 pm, h3 <[EMAIL PROTECTED]> wrote:
>
> > For the past two days I've been working on a experimental plugin which
> > aims to enhance user experience when it comes to input time in a form.
>
> > I've made a first "unofficial" announcement on my blog:
>
> >http://haineault.com/blog/71/
>
> > Considering the constant flow of positive feedbacks I got since I
> > posted it (which successfully crashed my hosting server), I'm proud to
> > announce that I'll make my best to create an official jQuery plugin
> > with it.
>
> > There is still a *lot* of work, polish, documentation and test to do
> > in before the first release, so if there is some charitable souls who
> > wish to participate I'll be glad to collaborate with you guys.
>
> > Ideas and comments are also welcome
>
> > Best regards
>
> > ~ Maxime Haineault


[jQuery] Re: AJAX Success Callback referring to $(this)

2008-10-08 Thread Josh Nathanson


Ok, I think I see what's happening -- you have something like this:

$("whatever").click(function() {
   $.ajax({ blah blah..

So you just need to do this:

$("whatever").click(function() {
   var trigger = this;
   $.ajax({ 
   success: function() {

   // do whatever with 'trigger'
   }
   });
});

-- Josh



- Original Message - 
From: "Wayne" <[EMAIL PROTECTED]>

To: "jQuery (English)" 
Sent: Wednesday, October 08, 2008 12:15 PM
Subject: [jQuery] Re: AJAX Success Callback referring to $(this)



OK. I haven't tried this yet, but how is this any different? Even
though you're moving the ajax call inside of another function, aren't
you abstracting the same logic out by calling the anonymous function
inside of success? Maybe I'm not understanding what "trigger" and
"trigger condition" are supposed to represent, but I assumed that was
related to my isNaN(r) logic.

Thanks,
-Wayne

On Oct 8, 12:36 pm, "Josh Nathanson" <[EMAIL PROTECTED]> wrote:

"this" referenced in the success callback will refer to the jQuery object
when you do an ajax call.

You might want to put the ajax call within another function that can also
receive information about the triggering element:

doAjax: function( trigger ) {
jQuery.ajax({
// etc.
success: function() {
if ( trigger condition ) {
// do stuff
}
}
});

}

$("triggeringelement").click(function() {
doAjax( this );

});

-- Josh

- Original Message -
From: "Wayne" <[EMAIL PROTECTED]>
To: "jQuery (English)" 
Sent: Wednesday, October 08, 2008 7:49 AM
Subject: [jQuery] AJAX Success Callback referring to $(this)

> I've been looking for this quite a bit, today, and haven't quite found
> what I'm looking for, so maybe someone can point me in the right
> direction.

> I'm performing an AJAX request, and I pass an anonymous function as
> the success callback, upon which I will want to do some DOM
> modification to the element that triggered the AJAX event. Ordinarily,
> $(this) would work fine for doing this, but it seems that $(this)
> points instead to something besides a DOM element.

> First, what does $(this) point to when you're inside the AJAX Success
> callback.

> Second, what is considered the best practice for accessing the
> triggering element after a successful AJAX query?

> Any help is appreciated,
> Wayne




[jQuery] Re: Need solution to cycle through images and display a caption

2008-10-08 Thread deronsizemore


That you very much Karl for chiming in here! I feel like an idiot now though
as that was so simple. I can't believe I didn't even think of that. I guess
I was thinking that the fade effect would only do images for some reason so
adding a caption wrapped in a paragraph tag never entered my mind.

I have it working now at: http://www.kentuckygolfing.com

I do have a couple more questions though.

1. How do you go about changing the opacity of the caption background color
as well as making that whole caption slide up from the bottom on the example
site you supplied earlier? I tried to dissect your code but couldn't find
this anywhere. I tried to duplicate it myself but my limited knowledge just
won't allow it yet.

2. It seems that on my site, when you refresh the page there is a slight
flicker where it shows the second image caption first but then quickly
switches back to the first caption, which is the right one. I noticed that
yours doesn't do this. Any ideas? Initially on my site too, both images in
the  were being shown above one another until the script loaded fully. I
got around this by adding overflow: hidden to the containing  but can't
figure out the caption flicker issue.

3. Last, if you watch on my site closely, when the caption appears, the text
goes from normal (with no Anti-Alias) to smooth (with Anti-Alias). I noticed
that your example does not. Is there something I'm doing wrong there too?

Thanks for your help on this. I'm much farther along that I ever have been
before. I'm really looking forward to your book Learning jQuery too.
Hopefully I wont' have to ask these beginner questions in future. ;)

Deron



Karl Swedberg-2 wrote:
> 
> The cycle plugin is excellent. It can have anything you want for each  
> item -- image, caption, whatever. You apply the method to a container  
> element, and the child elements are cycled. So, you could have this,  
> for example:
> 
> jQuery:
> ...
>   $('#mycontainer').cycle();
> ...
> 
> HTML:
> ...
> 
>   
>foo.jpg 
>   I'm a caption.
>   
>   
>bar.jpg 
>   I'm another caption.
>   
> 
> 
> ...
> 
> 
> If you'd like to see an example of this in the wild, I used the cycle  
> plugin here:
> 
> http://www.canons-regular.org/
> 
> 
> --Karl
> 
> 
> Karl Swedberg
> www.englishrules.com
> www.learningjquery.com
> 
> 
> 
> 
> On Oct 8, 2008, at 11:03 AM, deronsizemore wrote:
> 
>>
>>
>> Thank you very much. I did see it the other day but I didn't notice  
>> anything
>> where it allowed you to add in a caption. I'm going back to take a  
>> second
>> look.
>>
>> I'm currently trying to read through the Learning jQuery book, so  
>> hopefully
>> if Cycle doesn't have captions built in, I'll be able to add that
>> functionality myself soon.
>>
>>
>>
>> Paul Mills-12 wrote:
>>>
>>>
>>> Hi,
>>> You could try the cycle plugin:
>>> http://plugins.jquery.com/project/cycle
>>>
>>> The documentation is very good with lots of examples.
>>> You can use the before and after callback functions to show/hide the
>>> caption
>>> and CSS to position the caption on top of the image.
>>>
>>> Paul
>>>
>>> On Oct 6, 12:44 am, deronsizemore <[EMAIL PROTECTED]> wrote:
 Hi,

 I'm looking for plugin that will allow cycling through images and  
 display
 a
 caption for each image. What I'm looking for is exactly like this
 example:http://www.woothemes.com/demo/?t=3

 The image on the top left cycles through different images and  
 displays a
 unique caption for each image. Is there anything out there like  
 this for
 jQuery? I believe the example above used this mootools plugin I
 believe:http://smoothgallery.jondesign.net/getting-started/gallery-set-howto/

 Currently, I'm using jQuery Innerfade tocyclethrough images, but I'm
 having to manually insert captions via Photoshop and it's just  
 getting to
 be
 a bit tedious.

 Thanks
 --
 View this message in
 context:http://www.nabble.com/Need-solution-to-cycle-through-images-and-displ
  
 ...
 Sent from the jQuery General Discussion mailing list archive at
 Nabble.com.
>>>
>>>
>>
>> -- 
>> View this message in context:
>> http://www.nabble.com/Need-solution-to-cycle-through-images-and-display-a-caption-tp19830233s27240p19880671.html
>> Sent from the jQuery General Discussion mailing list archive at  
>> Nabble.com.
>>
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Need-solution-to-cycle-through-images-and-display-a-caption-tp19830233s27240p19885126.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: ANNOUNCE: ui.timepickr.js plugin

2008-10-08 Thread Weyert de Boer

I think the plugin design will get problematic if you try to use it in
Europe where don't use the am/pm system but just the 24hours clock
instead. This would probably make the widget huge.

On Wed, Oct 8, 2008 at 9:33 PM, h3 <[EMAIL PROTECTED]> wrote:
>
> For the past two days I've been working on a experimental plugin which
> aims to enhance user experience when it comes to input time in a form.
>
> I've made a first "unofficial" announcement on my blog:
>
> http://haineault.com/blog/71/
>
> Considering the constant flow of positive feedbacks I got since I
> posted it (which successfully crashed my hosting server), I'm proud to
> announce that I'll make my best to create an official jQuery plugin
> with it.
>
> There is still a *lot* of work, polish, documentation and test to do
> in before the first release, so if there is some charitable souls who
> wish to participate I'll be glad to collaborate with you guys.
>
> Ideas and comments are also welcome
>
> Best regards
>
> ~ Maxime Haineault
>


[jQuery] ANNOUNCE: ui.timepickr.js plugin

2008-10-08 Thread h3

For the past two days I've been working on a experimental plugin which
aims to enhance user experience when it comes to input time in a form.

I've made a first "unofficial" announcement on my blog:

http://haineault.com/blog/71/

Considering the constant flow of positive feedbacks I got since I
posted it (which successfully crashed my hosting server), I'm proud to
announce that I'll make my best to create an official jQuery plugin
with it.

There is still a *lot* of work, polish, documentation and test to do
in before the first release, so if there is some charitable souls who
wish to participate I'll be glad to collaborate with you guys.

Ideas and comments are also welcome

Best regards

~ Maxime Haineault


[jQuery] Re: Whats best for js compression, packer, jsminify, YUI?

2008-10-08 Thread MorningZ

"I know this has probably been discussed before"

it has been (including explanations and benchmarks)... all you need to
do is a search in the group




On Oct 8, 3:21 pm, JimD <[EMAIL PROTECTED]> wrote:
> Hi all,
>
> I know this has probably been discussed before but I with all the
> options available, I was wondering what method seems to work best
> overall for compressing js files. I want to put all my jquery plugins
> into one file and compress for performance but I'm worried about
> breaking things.
>
> I know there is packer, jsmin etc. Any recommendations.


[jQuery] Re: Whats best for js compression, packer, jsminify, YUI?

2008-10-08 Thread JimD

Sorry Morningz Im being a bit lazy about it.  I'll search around. It
looks like jsmin is used to minify jquery so I'll give that a try.

On Oct 8, 12:23 pm, MorningZ <[EMAIL PROTECTED]> wrote:
> "I know this has probably been discussed before"
>
> it has been (including explanations and benchmarks)... all you need to
> do is a search in the group
>
> On Oct 8, 3:21 pm, JimD <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi all,
>
> > I know this has probably been discussed before but I with all the
> > options available, I was wondering what method seems to work best
> > overall for compressing js files. I want to put all my jquery plugins
> > into one file and compress for performance but I'm worried about
> > breaking things.
>
> > I know there is packer, jsmin etc. Any recommendations.- Hide quoted text -
>
> - Show quoted text -


[jQuery] [off-topic] Jyte Users Unite!

2008-10-08 Thread Alex Weber

theres a jquery community on jyte and some of the usual js library
bashing and arguments going on... just inviting you all to join the
cause!

(no urls on purpose in not trying to spam or anything!)


[jQuery] Whats best for js compression, packer, jsminify, YUI?

2008-10-08 Thread JimD

Hi all,

I know this has probably been discussed before but I with all the
options available, I was wondering what method seems to work best
overall for compressing js files. I want to put all my jquery plugins
into one file and compress for performance but I'm worried about
breaking things.

I know there is packer, jsmin etc. Any recommendations.


[jQuery] Re: AJAX Success Callback referring to $(this)

2008-10-08 Thread Wayne

OK. I haven't tried this yet, but how is this any different? Even
though you're moving the ajax call inside of another function, aren't
you abstracting the same logic out by calling the anonymous function
inside of success? Maybe I'm not understanding what "trigger" and
"trigger condition" are supposed to represent, but I assumed that was
related to my isNaN(r) logic.

Thanks,
-Wayne

On Oct 8, 12:36 pm, "Josh Nathanson" <[EMAIL PROTECTED]> wrote:
> "this" referenced in the success callback will refer to the jQuery object
> when you do an ajax call.
>
> You might want to put the ajax call within another function that can also
> receive information about the triggering element:
>
> doAjax: function( trigger ) {
>         jQuery.ajax({
>             // etc.
>             success: function() {
>                 if ( trigger condition ) {
>                     // do stuff
>                 }
>             }
>     });
>
> }
>
> $("triggeringelement").click(function() {
>         doAjax( this );
>
> });
>
> -- Josh
>
> - Original Message -
> From: "Wayne" <[EMAIL PROTECTED]>
> To: "jQuery (English)" 
> Sent: Wednesday, October 08, 2008 7:49 AM
> Subject: [jQuery] AJAX Success Callback referring to $(this)
>
> > I've been looking for this quite a bit, today, and haven't quite found
> > what I'm looking for, so maybe someone can point me in the right
> > direction.
>
> > I'm performing an AJAX request, and I pass an anonymous function as
> > the success callback, upon which I will want to do some DOM
> > modification to the element that triggered the AJAX event. Ordinarily,
> > $(this) would work fine for doing this, but it seems that $(this)
> > points instead to something besides a DOM element.
>
> > First, what does $(this) point to when you're inside the AJAX Success
> > callback.
>
> > Second, what is considered the best practice for accessing the
> > triggering element after a successful AJAX query?
>
> > Any help is appreciated,
> > Wayne
>
>


[jQuery] Re: UI Instance Options

2008-10-08 Thread Richard D. Worth
Getter:

var minHeight = $('#example_div').data("minHeight.resizable");

Setter:

$('#example_div').data("minWidth.resizable", 200);

- Richard

On Wed, Oct 8, 2008 at 2:11 PM, greenteam003 <[EMAIL PROTECTED]> wrote:

>
>
> Hi all,
>
> This may be a dumb question, but I can not find an example in the archives
> or in the jQuery docs.  Is it possible to access a ui widget's options from
> a global function?  For example, if I set up the following div to be
> resizable...
>
>
> $('#example_div').resizable({minHeight:200,minWidth:200});
>
>
> How could I read the "minHeight" and "minWidth" options used to init the ui
> object instance from the selector $('#example_div') ?
> I can't see anything attached to the actual dom element in firebug and
> don't
> know where else to look.
>
> Thanks,
> Chris
> --
> View this message in context:
> http://www.nabble.com/UI-Instance-Options-tp19884303s27240p19884303.html
> Sent from the jQuery General Discussion mailing list archive at Nabble.com.
>
>


[jQuery] Re: LiveQuery won't allow explicit onchange firing?

2008-10-08 Thread Brandon Aaron
So this is an interesting use case. Typically you use Live Query to bind
events to elements that don't yet exist in the DOM. Granted it binds to
elements that already exist in the DOM as well. However, there is a
miniscule delay in the actual binding and the trigger is happening before
the event is actually bound. One way you can overcome this is like this:
function change(event) { alert( $(this).is(':checked') ); };

$('input')
.bind('change', change).trigger('change')
.livequery('change', change);

I'd say that this is a bug. I'm not sure when I can find the time to fix it
... but in the mean time you can use the above code to work around it.

--
Brandon Aaron

On Wed, Oct 8, 2008 at 11:04 AM, Jake McGraw <[EMAIL PROTECTED]> wrote:

>
> Using livequery for a project when I ran across an issue using the
> following code:
>
> $("input").livequery( "change", function(){
>
>  if ($(this).is(":checked")) {
>alert("checked!");
>  } else {
>alert("not checked!");
>  }
>
> }).change();
>
> My problem is the chained "change" function call. It looks like
> livequery doesn't like when I directly call events from within jQuery,
> custom events don't work either:
>
> $("input"),livequery("demo.change", function(){
>
>  if ($(this).is(":checked")) {
>alert("checked!");
>  } else {
>alert("not checked!");
>  }
>
> }).change(function(){
>
>  $(this).trigger("demo.change");
>
> }).change();
>
> This does work, but doesn't utilize livequery:
>
> $("input").change(function(){
>
>  if ($(this).is(":checked")) {
>alert("checked!");
>  } else {
>alert("not checked!");
>  }
>
> }).change();
>
> So, my question is, how do I trigger livequery events within JavaScript?
>
> - jake
>


[jQuery] Re: Poor Performing jQuery .each()

2008-10-08 Thread Coryt

Sorry for the last question, I realize what is happening now.
It seems to be a quirk of the .html() which only ouputs the inner
html, so it's not a problem with the clone like I originally thought.


[jQuery] Re: append mailto link to orphan plain text email address

2008-10-08 Thread ricardobeat

Here's a quick short function that will do the job:

$('#deadcat').each(function(){
var lnk = $(this).html().replace(/([\w-]+@([\w-]+\.)+[\w-]+)/, 'mailto:$1";>$1');
$(this).html(lnk);
});

hope that helps,
- ricardo

On Oct 7, 3:06 am, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote:
> What about using a regular expression match/replace? Seems like an  
> obvious candidate.
>
> On 7 Oct 2008, at 04:38, skankster wrote:
>
>
>
> > No one?
>
> > On 2 Okt., 14:45, skankster <[EMAIL PROTECTED]> wrote:
> >> Hi,
>
> >> I have a div that contains simple text data with line breaks. I want
> >> to append a mailto link to the email address but so far I have not
> >> been able to select the email.
>
> >> The container looks something like this:
>
> >> 
> >>         Username: Johnny
> >>         Email: [EMAIL PROTECTED]
> >> 
>
> >> With the help of jQuery it should look like this:
>
> >> 
> >>         Username: Johnny
> >>         Email: mailto:";>[EMAIL PROTECTED]
> >> 
>
> >> My first intention was to use a filter like:
>
> >> $('#myId').contents().filter(':contains("@")');
>
> >> but I found out that I couldn't apply it since the container had no
> >> children. So I used a function first to wrap the elements into span
> >> tags and then applied 'find':
>
> >>   $.fn.orphans = function(){
> >>         var ret = [];
> >>         this.each(function(){$.each(this.childNodes, function() {if
> >>                 (this.nodeType == 3 &! $.nodeName(this, "br") )  
> >> ret.push(this)})});
> >>         return $(ret);
> >>    }
>
> >>  $(document).ready(function() {
> >>         $('#myId').orphans().wrap('');
> >>         $('#myId').find(':contains("@")').wrap('mailto:"/
> >> >');
>
> >>  });
>
> >> I'm still at a loss as to how to select just the email address  
> >> without
> >> the preceeding 'Email:' and am wondering if I'm not heading in a
> >> totally wrong direction with the orphan wrapping function.
>
> >> I gladly appreciate any assistance offered concerning this issue!


[jQuery] Re: Poor Performing jQuery .each()

2008-10-08 Thread Coryt

I noticed something else that is a little weird when cloning.
If I execute the following snippet, I see the table tags and all the
inner html:

var $template = $("#LineItemsTableTemplate").clone()
alert($template.html());




Item Code
Price Level
Description
Qty
Subtotal
Tax
Total




, however if I execute the following snippet, I only see the tr tags.
Why is that? I would expect to clone the entire matched element, not
just the inner html of the matched element.

var $template = $("#LineItemsTableTemplate").clone()
alert($template.html());




Item Code
Price Level
Description
Qty
Subtotal
Tax
Total





[jQuery] Re: link click send user back to top of page .toggle

2008-10-08 Thread Mauricio (Maujor) Samy Silva


Probably you are using a dead link like: class="click-here">link.


Try:
event.preventDefault
it acts as
return false;


$('.click-here')function(event) {
event.preventDefaul();
// more stuff
});



-Mensagem Original- 
De: "John D." <[EMAIL PROTECTED]>

Para: "jQuery (English)" 
Enviada em: quarta-feira, 8 de outubro de 2008 15:16
Assunto: [jQuery] link click send user back to top of page .toggle




Hi,

I have a page which requires vertical scrolling. In order to
consolidate content on page load I'm placing a heading link above each
div on the page and hiding the divs with jQuery. When the user clicks
on a given heading link the .toggle run and the div shows.

The problem I am running into is that each time a link is clicked it
returns the user back to the top of the page. Which becomes a major
annoyance if the user has scrolled down to access content further down
the page.

Any thoughts?

Thanks,

John 




[jQuery] a more general rule?

2008-10-08 Thread Syler

i have a form and a bunch of inputs.

How do i make it so that all my input apply the same validation rule
without having to put in the name attr. in the rules?

so I have class="numOnly" in my 
this won't work,
 $(document).ready(function(){
$(".numOnly").validate({
rules: {
required: true,
range:[0,100]
}
});

   }

this only works if i put in the name attr like:

 $(document).ready(function(){
$(".numOnly").validate({
rules: {
  blah: {
 required: true,
  range:[0,100]
}
}
});

   }

since my input field only require these condition i need a better way
then having a large loop listing all the name attributes withing the
"rules" prototype.


[jQuery] Selecting multiple table rows with jQuery and Tablesorter

2008-10-08 Thread shakerdesigns


I've been looking around, but have yet to find the right jquery solution for
selecting table rows using jQuery and the Tablesorter plugin. I've created a
widget to toggle css classes and highlight each selected row, but I'm
looking for more functionality than that. I've also seen other plugins like
Ingrid and Grid, but they don't have the control I need.

Specifically, I'm looking to use 'click' to select a row, 'ctrl+click' to
select multiple rows, keyboard shortcuts to select all rows ('ctrl+a') and
the ability to navigate thru the table with the arrow keys. Similar to the
functionality found in a desktop spreadsheet program like Numbers or Excel.

Does anyone know of a solution or could provide some feedback as to how I
might make one?

-- 
View this message in context: 
http://www.nabble.com/Selecting-multiple-table-rows-with-jQuery-and-Tablesorter-tp19884393s27240p19884393.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: OT : javascript editor (with code formatting)

2008-10-08 Thread dean

I use scite its really light weight and powerful at the same time if
you have ever used TextMate on the Mac then it will be familiar.
Might be worth a look anyway.

< href="http://www.scintilla.org/";>http://www.scintilla.org/


[jQuery] Change mask onclick, how do it ?

2008-10-08 Thread Luciano

Hi,

I have the problem when go change de mask, i`m using maskedinput
http://digitalbush.com/projects/masked-input-plugin/

my code:
Jurídica
Física

$("#tip_j").click(function(){
$("#masked").val("");
$("#masked").mask("999.999.999/-99");
});

$("#tip_f").click(function(){
$("#masked").val("");
$("#masked").mask("999.999.999-99");
});

the mask change, but not function and is a problem..


[jQuery] Change mask onclick, how do ?

2008-10-08 Thread Luciano Mazzetto
Hi guys

I have the problem when go change de mask, i`m using maskedinput
http://digitalbush.com/projects/masked-input-plugin/

my code:
Jurídica
Física

$("#tip_j").click(function(){
$("#masked").val("");
$("#masked").mask("999.999.999/-99");
});

$("#tip_f").click(function(){
$("#masked").val("");
$("#masked").mask("999.999.999-99");
});

the mask change, but not function and is a problem..


[jQuery] [Validation] Splitting rules and messages across multiple pages

2008-10-08 Thread dl

I saw a post about someone trying to spread rules across multiple
pages.  The person was told to add rules dynamically, but there's no
way to add messages dynamically.  I'm wondering what you guys think
about this approach.

I had a situation where I wanted to reuse part of a form.  I think
this is a common enough pattern.  When a user registers for the first
time you want them to give you a username, a password and some
additional info.  Later the user might want to edit that additional
info so you present those fields again but now you don't have to
include the username and password field because you already know who
it is.

I broke out the "additional info" into its own file and included it
(through smarty in this case) into the form with the username and
password.  Of course I want the validation rules to be separate for
each piece and to live with the section it validates.

Unfortunately you cannot call jQuery("#MyForm").validate(options) more
than once and expect the rules to be combined.  You can add more rules
dynamically but you can't add messages that way.

Here's how got I around that.

In the subsection code (the "additional info" code) I put the
validation options into an object.  Then I check for the existence of
a javascript function that should be implemented in the enclosing
page.  If the function exists, I call it.  If the function doesn't
exist, I just call the normal validation code.

Here's the code from the included page:



jQuery().ready(function() {

var options = {
   rules: {
 address: "required",
 city: "required",
 state: "required",
 zip_code: "required",
 phone: "required",
   },
   messages: {
 company_name: "Please enter your [Company Name]",
 address: "Please enter your [Address]",
 city: "Please enter your [City]",
 state: "Please enter your [State]",
 zip_code: "Please enter your [Zip Code]",
 phone: "Please enter your [Phone]",
   }
 };

 if (parent_validation_init){
parent_validation_init(options);
 } else {
jQuery("#MyForm").validate(options);
 }

}



Now in the parent html file, I implement
parent_validation_init(options) which takes the options object, adds
the new rules to the options object, and THEN call
jQuery("#MyForm").validate(options);

Here's what that code looks like:




function parent_validation_init(options){
 options.rules["password_check"] = {equalTo: "#password"};
 options.messages["password_check"] = "Passwords must match";
 jQuery("#companyFormStepOne").validate(options);
}

jQuery().ready(function() {
 jQuery("#nextBtn").click(function() {
jQuery("#companyFormStepOne").submit();
 });
});



Seems to work for me.  Any gurus see an issue with this?


[jQuery] link click send user back to top of page .toggle

2008-10-08 Thread John D.

Hi,

I have a page which requires vertical scrolling. In order to
consolidate content on page load I'm placing a heading link above each
div on the page and hiding the divs with jQuery. When the user clicks
on a given heading link the .toggle run and the div shows.

The problem I am running into is that each time a link is clicked it
returns the user back to the top of the page. Which becomes a major
annoyance if the user has scrolled down to access content further down
the page.

Any thoughts?

Thanks,

John


[jQuery] Re: Poor Performing jQuery .each()

2008-10-08 Thread Coryt

Dave, missed your last question, yes, because of the initial
performance issue I was having, I was limiting my SQL resultset to be
exactly 100 and if there were more rows available, I appended a blank
row making 101 rows all the time. Therefore I could always tell that
if I had 101 rows, more records were available in the db and I would
then show the MoreRowTemplate.

My next step would be to post back to the page, and get all the rows
or the next 100, depending on which link they click.

Hope that makes sense.



[jQuery] UI Instance Options

2008-10-08 Thread greenteam003


Hi all,

This may be a dumb question, but I can not find an example in the archives
or in the jQuery docs.  Is it possible to access a ui widget's options from
a global function?  For example, if I set up the following div to be
resizable...


 $('#example_div').resizable({minHeight:200,minWidth:200});


How could I read the "minHeight" and "minWidth" options used to init the ui
object instance from the selector $('#example_div') ?  
I can't see anything attached to the actual dom element in firebug and don't
know where else to look.

Thanks,
Chris
-- 
View this message in context: 
http://www.nabble.com/UI-Instance-Options-tp19884303s27240p19884303.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Why is this not working?

2008-10-08 Thread Weyert de Boer

Thanks! That's it! Now it's working. I totally missed the hash. Thanks again!
Now it's working.

Only strange that it will only do the client-side validation when the
action-attribute of the form is empty or  working internet location.
Otherwise hops to the value of the action-attribute directly without
the validation process.

> http://www.dustyfrog.nl/jquery/js/calendar.js
>
> gives a 404


[jQuery] Re: Poor Performing jQuery .each()

2008-10-08 Thread Coryt

Thanks for all the tips Michael and Dave, very much appreciated.

Michael, to answer your questions, there is a way to get the .Net
generated prefix, and I did mean to use insertAfter. It rendered
correctly in IE but not in FF so I didn't notice it immediately.

I have been busy with a few other things but I am working on a revised
version with all your suggestions.
>From the changes I've made so far it is def faster.

I will post again shortly.

Thanks again!
Cory


[jQuery] Re: Why is this not working?

2008-10-08 Thread MorningZ

Oh wait.. here's the issue

you have

$("form_identifier").validate

you forgot the "#"

$("#form_identifier").validate

also:

http://www.dustyfrog.nl/jquery/js/calendar.js

gives a 404



On Oct 8, 1:10 pm, "Weyert de Boer" <[EMAIL PROTECTED]> wrote:
> Hello!
>
> I have been working on my form. Only somehow it doesn't want to 
> work:http://www.dustyfrog.nl/jquery/
>
> What could be wrong? I am not getting any errors in Firefox's Error Console :(
>
> Thanks in advance!
>
> Yours,
> Weyert


[jQuery] Re: Why is this not working?

2008-10-08 Thread MorningZ

Not sure if it's related, but your  tag is malformed




that "s" at the end *could* create an issue





On Oct 8, 1:10 pm, "Weyert de Boer" <[EMAIL PROTECTED]> wrote:
> Hello!
>
> I have been working on my form. Only somehow it doesn't want to 
> work:http://www.dustyfrog.nl/jquery/
>
> What could be wrong? I am not getting any errors in Firefox's Error Console :(
>
> Thanks in advance!
>
> Yours,
> Weyert


[jQuery] [validate] Why is this not working?

2008-10-08 Thread Weyert de Boer

Hello!

I have been working on my form. Only somehow it doesn't want to work:
http://www.dustyfrog.nl/jquery/

What could be wrong? I am not getting any errors in Firefox's Error Console :(

Thanks in advance!

Yours,
Weyert


[jQuery] Re: Intercept "Back" button click on browser

2008-10-08 Thread Leanan

The duplication is something else.

However the fix you made works.


[jQuery] Re: AJAX Success Callback referring to $(this)

2008-10-08 Thread Josh Nathanson


"this" referenced in the success callback will refer to the jQuery object 
when you do an ajax call.


You might want to put the ajax call within another function that can also 
receive information about the triggering element:


doAjax: function( trigger ) {
   jQuery.ajax({
   // etc.
   success: function() {
   if ( trigger condition ) {
   // do stuff
   }
   }
   });
}

$("triggeringelement").click(function() {
   doAjax( this );
});

-- Josh


- Original Message - 
From: "Wayne" <[EMAIL PROTECTED]>

To: "jQuery (English)" 
Sent: Wednesday, October 08, 2008 7:49 AM
Subject: [jQuery] AJAX Success Callback referring to $(this)




I've been looking for this quite a bit, today, and haven't quite found
what I'm looking for, so maybe someone can point me in the right
direction.

I'm performing an AJAX request, and I pass an anonymous function as
the success callback, upon which I will want to do some DOM
modification to the element that triggered the AJAX event. Ordinarily,
$(this) would work fine for doing this, but it seems that $(this)
points instead to something besides a DOM element.

First, what does $(this) point to when you're inside the AJAX Success
callback.

Second, what is considered the best practice for accessing the
triggering element after a successful AJAX query?

Any help is appreciated,
Wayne 




[jQuery] Re: Need solution to cycle through images and display a caption

2008-10-08 Thread Karl Swedberg
The cycle plugin is excellent. It can have anything you want for each  
item -- image, caption, whatever. You apply the method to a container  
element, and the child elements are cycled. So, you could have this,  
for example:


jQuery:
...
$('#mycontainer').cycle();
...

HTML:
...



I'm a caption.



I'm another caption.



...


If you'd like to see an example of this in the wild, I used the cycle  
plugin here:


http://www.canons-regular.org/


--Karl


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




On Oct 8, 2008, at 11:03 AM, deronsizemore wrote:




Thank you very much. I did see it the other day but I didn't notice  
anything
where it allowed you to add in a caption. I'm going back to take a  
second

look.

I'm currently trying to read through the Learning jQuery book, so  
hopefully

if Cycle doesn't have captions built in, I'll be able to add that
functionality myself soon.



Paul Mills-12 wrote:



Hi,
You could try the cycle plugin:
http://plugins.jquery.com/project/cycle

The documentation is very good with lots of examples.
You can use the before and after callback functions to show/hide the
caption
and CSS to position the caption on top of the image.

Paul

On Oct 6, 12:44 am, deronsizemore <[EMAIL PROTECTED]> wrote:

Hi,

I'm looking for plugin that will allow cycling through images and  
display

a
caption for each image. What I'm looking for is exactly like this
example:http://www.woothemes.com/demo/?t=3

The image on the top left cycles through different images and  
displays a
unique caption for each image. Is there anything out there like  
this for

jQuery? I believe the example above used this mootools plugin I
believe:http://smoothgallery.jondesign.net/getting-started/gallery-set-howto/

Currently, I'm using jQuery Innerfade tocyclethrough images, but I'm
having to manually insert captions via Photoshop and it's just  
getting to

be
a bit tedious.

Thanks
--
View this message in
context:http://www.nabble.com/Need-solution-to-cycle-through-images-and-displ 
...

Sent from the jQuery General Discussion mailing list archive at
Nabble.com.





--
View this message in context: 
http://www.nabble.com/Need-solution-to-cycle-through-images-and-display-a-caption-tp19830233s27240p19880671.html
Sent from the jQuery General Discussion mailing list archive at  
Nabble.com.






[jQuery] Re: Match the filename to highlight current link on page

2008-10-08 Thread suntrop

Hi Adrian,

thanks for your help but I can't follow you. I have no directories to
split - but if, this is a good solution.

I think the problem occurs here:
$('#navigation [EMAIL PROTECTED]"' + path + '"]')

The @href finds all elements which contains the path (filename). And
if filename 1 is potatoes.html and another one is fried-potatoes.html
it makes both red, because both have potatoes in it.

How can I find just the hrefs which are exact the same like path?

In the past I had this script, that works. But I want to do it with
jquery ;)
for(i=0;i-1 &&
document.links[i].parentNode.nodeName=="LI" && strTest!
="http://www.domain.tld/";){
document.links[i].style.color="#c03";
}
}


[jQuery] Re: ANNOUNCE: jQuery listnav plugin

2008-10-08 Thread Jack Killpatrick


Hi Craig,

Glad to hear that fix worked, thanks for letting me know about the 
issue. RE: the counts... have you noticed a pattern or can you show me a 
couple examples? I'm wondering if maybe it has to do with your overall 
list having some items that start with numbers instead of letters. ?


- Jack

craig.kaminsky wrote:

Hi, Jack,

Wasn't sure if my reply via Gmail would show up here, so wanted to
post (sorry if duplicated):
Thank you, again, for the plugin and the quick fix, so to speak. I
uploaded the 1.0.1 version to the site and it's working very, very
well right now. The overall count (under all) is off by 1-3 here and
there (this isn't an issue for me, just thought I'd let you know) but
it's all working wonderfully.

Thanks, again,
Craig

  





[jQuery] LiveQuery won't allow explicit onchange firing?

2008-10-08 Thread Jake McGraw

Using livequery for a project when I ran across an issue using the
following code:

$("input").livequery( "change", function(){

  if ($(this).is(":checked")) {
alert("checked!");
  } else {
alert("not checked!");
  }

}).change();

My problem is the chained "change" function call. It looks like
livequery doesn't like when I directly call events from within jQuery,
custom events don't work either:

$("input"),livequery("demo.change", function(){

  if ($(this).is(":checked")) {
alert("checked!");
  } else {
alert("not checked!");
  }

}).change(function(){

  $(this).trigger("demo.change");

}).change();

This does work, but doesn't utilize livequery:

$("input").change(function(){

  if ($(this).is(":checked")) {
alert("checked!");
  } else {
alert("not checked!");
  }

}).change();

So, my question is, how do I trigger livequery events within JavaScript?

- jake


[jQuery] Re: Match the filename to highlight current link on page

2008-10-08 Thread suntrop

Hi Adrian,

thanks for your help but I can't follow you. I have no directories to
split - but if, this is a good solution.

I think the problem occurs here:
$('#navigation [EMAIL PROTECTED]"' + path + '"]')

The @href finds all elements which contains the path (filename). And
if filename 1 is potatoes.html and another one is fried-potatoes.html
it makes both red, because both have potatoes in it.

How can I find just the hrefs which are exact the same like path?

In the past I had this script, that works. But I want to do it with
jquery ;)
for(i=0;i-1 && document.links[i].parentNode.nodeName=="LI" && 
strTest!
="http://www.amikron.de/";){
document.links[i].style.color="#c03";
}
}


[jQuery] Re: OT : javascript editor (with code formatting)

2008-10-08 Thread fabiomcosta

i saw a video with netbeans in action (its there in the site) and it
looked nice, with code completition for jQuery functionalities.

On Oct 7, 1:13 pm, "Alexandre Plennevaux" <[EMAIL PROTECTED]>
wrote:
> Friends,
>
> aptana studio, albeit a nice editor, is recently crashing all the time and
> now doesn't even want to restart. I'm looking for a good alternative, that
> has a code formatting (auto indenting) functionality.
>
> Any suggestion ? I'm on Windows XP SP3...
>
> Thank you,
>
> Alexandre


[jQuery] Re: Un-minify?

2008-10-08 Thread jeremyBass

may-be CS4 but not CS3... at least you can't do that to a js file... I
do wish thou ;-)

On Oct 7, 1:54 pm, ricardobeat <[EMAIL PROTECTED]> wrote:
> Dreamweaver (CS3 at least) has an 'apply source formatting' option
> that does the job well (for minified, not packed files).
>
> - ricardo
>
> On Oct 7, 3:51 pm, jeremyBass <[EMAIL PROTECTED]> wrote:
>
>
>
> > That looks cool... funny thing is everything is truning into a fine
> > tuned system... I'm loving it lol... thanks for the help... Any one
> > else?  I think yours Eric seems the best solution so far... :-)
>
> > On Oct 7, 9:02 am, Eric <[EMAIL PROTECTED]> wrote:
>
> > > I'll throw in a plug for Git (http://git-scm.com/).  Easily
> > > installed on Linux, Windows and OS X 10.5, it can be a great safety
> > > net that takes literally 10 seconds to set up for a new project (once
> > > the program is on your comp).
>
> > > Nothing puts a smile on my face like erasing a huge chunk of spaghetti
> > > code, knowing I've got a safe backup in Git should I need it.  :-D
>
> > > On Oct 6, 11:24 pm, jeremyBass <[EMAIL PROTECTED]> wrote:
>
> > > > Oh I have the source at my office... but yu know late night ideas...
> > > > anyways thanks for the help... I did find a nice 
> > > > Beautifier...http://elfz.laacz.lv/beautify/
>
> > > > I was just woundering what anyone else thought was a good one or
> > > > way... Have a great one
> > > > jeremyBass
> > > > On Oct 6, 7:49 pm, MorningZ <[EMAIL PROTECTED]> wrote:
>
> > > > > Well, depending on what you used to minify, this is going to be a next
> > > > > to impossible task
>
> > > > > for instance, many will remove whitespace (not that big a deal) and
> > > > > rename variables from meaningful to super-space-saving-simple
>
> > > > > so depending on your options used to pack with totally determine your
> > > > > ability to revert
>
> > > > > And maybe take this as a lesson:
>
> > > > > Source control is your friend!! even for small personal projects
>
> > > > > On Oct 6, 10:45 pm, jeremyBass <[EMAIL PROTECTED]> wrote:
>
> > > > > > Hello, like a dumby in a rush I saved over my non-minfied file... 
> > > > > > any
> > > > > > sugestions on a good "un-minifyer"  thanks for the help...
> > > > > > jeremyBass- Hide quoted text -
>
> > > > > - Show quoted text -- Hide quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -


[jQuery] Re: AJAX Success Callback referring to $(this)

2008-10-08 Thread Wayne

Here's a context of when it would be useful:

   jQuery.ajax({
 data: inputs.join('&'),
 url: "delete_bline.php",
 timeout: 5000,
 error: function() {
   alert("Sorry, deleting the baseline could not be completed
at this time. Please try again, later.");
 },
 success: function(r) {

   delete_failed = ( isNaN(r) );

if( !delete_failed ) {
   var original_item = $(this).parents("li");

   // hide this element
   original_item.hide("slide", { direction: "up" });

   // remove the matching node in the remeasures list
   $( "#ri" +
original_item.attr("id").substr(2) ).remove();

   // remove this node
   original_item.remove();

}

Thanks,
-Wayne

On Oct 8, 10:57 am, MorningZ <[EMAIL PROTECTED]> wrote:
> How about posting what you have?  that would give a good basis to
> start to explain it
>
> To hope to help though, since the Ajax request is made asynchronously,
> it loses the context of "this"
>
> On Oct 8, 10:49 am, Wayne <[EMAIL PROTECTED]> wrote:
>
> > I've been looking for this quite a bit, today, and haven't quite found
> > what I'm looking for, so maybe someone can point me in the right
> > direction.
>
> > I'm performing an AJAX request, and I pass an anonymous function as
> > the success callback, upon which I will want to do some DOM
> > modification to the element that triggered the AJAX event. Ordinarily,
> > $(this) would work fine for doing this, but it seems that $(this)
> > points instead to something besides a DOM element.
>
> > First, what does $(this) point to when you're inside the AJAX Success
> > callback.
>
> > Second, what is considered the best practice for accessing the
> > triggering element after a successful AJAX query?
>
> > Any help is appreciated,
> > Wayne
>
>


[jQuery] Re: jCarousel Lite problem

2008-10-08 Thread BroOf

No Ideas?


[jQuery] Re: Need solution to cycle through images and display a caption

2008-10-08 Thread deronsizemore


Thank you very much. I did see it the other day but I didn't notice anything
where it allowed you to add in a caption. I'm going back to take a second
look. 

I'm currently trying to read through the Learning jQuery book, so hopefully
if Cycle doesn't have captions built in, I'll be able to add that
functionality myself soon.



Paul Mills-12 wrote:
> 
> 
> Hi,
> You could try the cycle plugin:
> http://plugins.jquery.com/project/cycle
> 
> The documentation is very good with lots of examples.
> You can use the before and after callback functions to show/hide the
> caption
> and CSS to position the caption on top of the image.
> 
> Paul
> 
> On Oct 6, 12:44 am, deronsizemore <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> I'm looking for plugin that will allow cycling through images and display
>> a
>> caption for each image. What I'm looking for is exactly like this
>> example:http://www.woothemes.com/demo/?t=3
>>
>> The image on the top left cycles through different images and displays a
>> unique caption for each image. Is there anything out there like this for
>> jQuery? I believe the example above used this mootools plugin I
>> believe:http://smoothgallery.jondesign.net/getting-started/gallery-set-howto/
>>
>> Currently, I'm using jQuery Innerfade tocyclethrough images, but I'm
>> having to manually insert captions via Photoshop and it's just getting to
>> be
>> a bit tedious.
>>
>> Thanks
>> --
>> View this message in
>> context:http://www.nabble.com/Need-solution-to-cycle-through-images-and-displ...
>> Sent from the jQuery General Discussion mailing list archive at
>> Nabble.com.
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Need-solution-to-cycle-through-images-and-display-a-caption-tp19830233s27240p19880671.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: AJAX Success Callback referring to $(this)

2008-10-08 Thread MorningZ

How about posting what you have?  that would give a good basis to
start to explain it

To hope to help though, since the Ajax request is made asynchronously,
it loses the context of "this"



On Oct 8, 10:49 am, Wayne <[EMAIL PROTECTED]> wrote:
> I've been looking for this quite a bit, today, and haven't quite found
> what I'm looking for, so maybe someone can point me in the right
> direction.
>
> I'm performing an AJAX request, and I pass an anonymous function as
> the success callback, upon which I will want to do some DOM
> modification to the element that triggered the AJAX event. Ordinarily,
> $(this) would work fine for doing this, but it seems that $(this)
> points instead to something besides a DOM element.
>
> First, what does $(this) point to when you're inside the AJAX Success
> callback.
>
> Second, what is considered the best practice for accessing the
> triggering element after a successful AJAX query?
>
> Any help is appreciated,
> Wayne


[jQuery] AJAX Success Callback referring to $(this)

2008-10-08 Thread Wayne

I've been looking for this quite a bit, today, and haven't quite found
what I'm looking for, so maybe someone can point me in the right
direction.

I'm performing an AJAX request, and I pass an anonymous function as
the success callback, upon which I will want to do some DOM
modification to the element that triggered the AJAX event. Ordinarily,
$(this) would work fine for doing this, but it seems that $(this)
points instead to something besides a DOM element.

First, what does $(this) point to when you're inside the AJAX Success
callback.

Second, what is considered the best practice for accessing the
triggering element after a successful AJAX query?

Any help is appreciated,
Wayne


[jQuery] Re: Is it possible to avoid jumpy / disappearing content

2008-10-08 Thread Alex Weber

Thanks Karl!

Unfortunately I havan't yet become a huge adopter of "progressive
enhancement"/"graceful degrading" :)
i just assume that users have js (and cookies for that matter)
enabled... lol it works most of the time and i haven't really had to
do any mission critical stuff yet :)

thx for the link!

Alex

On Oct 8, 10:19 am, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> On Oct 8, 9:14 am, Karl Swedberg <[EMAIL PROTECTED]> wrote:
>
> > Hi Alex,
>
> > Often, if you're hiding information on page load, you'll want to have  
> > that information available upon some user interaction. Hiding that  
> > information with CSS would make the information unavailable to anyone  
> > who has JS off but CSS on. Probably not a huge percentage of users,  
> > but it's nice to let everyone see the content. Hiding the content with  
> > JavaScript follows the principle of Progressive Enhancement™ . Nice  
> > article -- the first in a series -- about that on 
> > alistapart.com:http://www.alistapart.com/comments/understandingprogressiveenhancement/
>
> Oops. wrong URL. Try this one:
>
> http://www.alistapart.com/articles/understandingprogressiveenhancement
>
> --Karl


[jQuery] Re: [validate] Modify the position of the validation message

2008-10-08 Thread Weyert de Boer

Thanks now the radio buttons bit are working. Only when I am using the
follow settings in the validator-object:

errorContainer: "#errors",
errorPlacement: function(error,element) {
error.appendTo( element.parents("div") );
},

Now I had thought that this would add that label-tag near the form
field and the same validation message to the #error container element.
No luck. Do I need to clone it somehow in the errorPlacement-method?

On Wed, Oct 8, 2008 at 4:13 PM, Jörn Zaefferer
<[EMAIL PROTECTED]> wrote:
> Take a look at the errorContainer and errorLabelContainer options:
> http://docs.jquery.com/Plugins/Validation/validate#toptions
>
> Jörn
>
> On Wed, Oct 8, 2008 at 4:10 PM, Weyert de Boer <[EMAIL PROTECTED]> wrote:
>>
>> Would it also be possible to show all the same errors in a > id="errors">-container and also near the form field itself?
>>
>> On Wed, Oct 8, 2008 at 4:10 PM, Weyert de Boer <[EMAIL PROTECTED]> wrote:
>>> Hello
>>>
>>> I am currently trying to implement jQuery.validate in my code
>>> generator for creating forms. Only I am having some questions about
>>> how to update the position where the validation message element are
>>> getting created. I am having problems with it when a validation
>>> message has to be shown for a list of radio or check boxes. I am using
>>> the following html for such lists:
>>>
>>>
>>>  Question #13 >> class="required">*
>>>  
>>>  
>>>  >> name="question_13"/>Option #1
>>>  >> name="question_13"/>Option #2
>>>  >> name="question_13"/>Option #3
>>>  
>>>  
>>>
>>>
>>> The ideal place for the error message to be shown would be after the
>>> DIV element. Only I am not sure how I can change it. I understand you
>>> would need to modify the errorPlacement parameter of the validator.
>>> Only I am not sure how to do this. How would I be able to get the
>>> DIV-element so I can add the error message after this (div) element?
>>>
>>> Thanks.
>>>
>>> Yours,
>>> Weyert de Boer
>>>
>>
>


[jQuery] Re: Code execution order

2008-10-08 Thread Rene Veerman




function UpdateList()
{
// Open the xml file
$.get("locations.xml",{},function(xml){
// Run the function for each name tag in the XML file
$('location',xml).each(function(i) {
alert($(this).find("name").text());

});
alert("Test");

});

}

  

you just needed to put the last alert inside the $.get callback func


[jQuery] Re: ANNOUNCE: jQuery listnav plugin

2008-10-08 Thread craig.kaminsky

Hi, Jack,

Wasn't sure if my reply via Gmail would show up here, so wanted to
post (sorry if duplicated):
Thank you, again, for the plugin and the quick fix, so to speak. I
uploaded the 1.0.1 version to the site and it's working very, very
well right now. The overall count (under all) is off by 1-3 here and
there (this isn't an issue for me, just thought I'd let you know) but
it's all working wonderfully.

Thanks, again,
Craig


[jQuery] [validate] Modify the position of the validation message

2008-10-08 Thread Weyert de Boer

Hello

I am currently trying to implement jQuery.validate in my code
generator for creating forms. Only I am having some questions about
how to update the position where the validation message element are
getting created. I am having problems with it when a validation
message has to be shown for a list of radio or check boxes. I am using
the following html for such lists:


  Question #13 *
  
  
  Option #1
  Option #2
  Option #3
  
  


The ideal place for the error message to be shown would be after the
DIV element. Only I am not sure how I can change it. I understand you
would need to modify the errorPlacement parameter of the validator.
Only I am not sure how to do this. How would I be able to get the
DIV-element so I can add the error message after this (div) element?

Thanks.

Yours,
Weyert de Boer


[jQuery] Re: [validate] Modify the position of the validation message

2008-10-08 Thread Jörn Zaefferer
Take a look at the errorContainer and errorLabelContainer options:
http://docs.jquery.com/Plugins/Validation/validate#toptions

Jörn

On Wed, Oct 8, 2008 at 4:10 PM, Weyert de Boer <[EMAIL PROTECTED]> wrote:
>
> Would it also be possible to show all the same errors in a  id="errors">-container and also near the form field itself?
>
> On Wed, Oct 8, 2008 at 4:10 PM, Weyert de Boer <[EMAIL PROTECTED]> wrote:
>> Hello
>>
>> I am currently trying to implement jQuery.validate in my code
>> generator for creating forms. Only I am having some questions about
>> how to update the position where the validation message element are
>> getting created. I am having problems with it when a validation
>> message has to be shown for a list of radio or check boxes. I am using
>> the following html for such lists:
>>
>>
>>  Question #13 > class="required">*
>>  
>>  
>>  > name="question_13"/>Option #1
>>  > name="question_13"/>Option #2
>>  > name="question_13"/>Option #3
>>  
>>  
>>
>>
>> The ideal place for the error message to be shown would be after the
>> DIV element. Only I am not sure how I can change it. I understand you
>> would need to modify the errorPlacement parameter of the validator.
>> Only I am not sure how to do this. How would I be able to get the
>> DIV-element so I can add the error message after this (div) element?
>>
>> Thanks.
>>
>> Yours,
>> Weyert de Boer
>>
>


[jQuery] Re: problem with internet explorer...

2008-10-08 Thread Manarius

solved it all now...
internet explorer seems to have a problem with font-weight:bold; when
using opacity.
changed it to font-weight:600; and it works like a charm.

the buttons arent fixed but solved, by adding them to the main.php
file and displaying them only when needed.

so thanks for reading, this can be erased :)
greetings again


[jQuery] Re: [validate] Modify the position of the validation message

2008-10-08 Thread Weyert de Boer

Would it also be possible to show all the same errors in a -container and also near the form field itself?

On Wed, Oct 8, 2008 at 4:10 PM, Weyert de Boer <[EMAIL PROTECTED]> wrote:
> Hello
>
> I am currently trying to implement jQuery.validate in my code
> generator for creating forms. Only I am having some questions about
> how to update the position where the validation message element are
> getting created. I am having problems with it when a validation
> message has to be shown for a list of radio or check boxes. I am using
> the following html for such lists:
>
>
>  Question #13  class="required">*
>  
>  
>   name="question_13"/>Option #1
>   name="question_13"/>Option #2
>   name="question_13"/>Option #3
>  
>  
>
>
> The ideal place for the error message to be shown would be after the
> DIV element. Only I am not sure how I can change it. I understand you
> would need to modify the errorPlacement parameter of the validator.
> Only I am not sure how to do this. How would I be able to get the
> DIV-element so I can add the error message after this (div) element?
>
> Thanks.
>
> Yours,
> Weyert de Boer
>


[jQuery] Re: ClueTip postioning

2008-10-08 Thread JeffreyKarbowski


Comparing to original - 

(Line 105)
Original:
var tOffset = parseInt(opts.topOffset, 10), lOffset =
parseInt(opts.leftOffset, 10);
Changed to:
var tOffset = 100, lOffset = -738;

(Line 302)
Original:
tipY = posY;
Changed to:
tipY = 95;

(Line 305)
Original:
tipY = posY - opts.dropShadowSteps + tOffset;
Changed to:
tipY;

(Defaults)
Changed:
Width,
Height,
Position (to fixed),
Show Title,



JeffreyKarbowski wrote:
> 
> I have this working in Firefox, with a fixed position on the page, IE
> however throws errors.
> 
> In Bold are the lines that I have changed:
> 
>   if (opts.local && opts.hideLocal) { $(tipAttribute +
> ':first').hide(); }
>   var tOffset = 100, lOffset = -738;
>   // vertical measurement variables
>   var tipHeight, wHeight;
> 
>  tipHeight = defHeight == 'auto' ?
> Math.max($cluetip.outerHeight(),$cluetip.height()) :
> parseInt(defHeight,10);   
>   tipY = 95;
>   baseline = sTop + wHeight;
>   if (opts.positionBy == 'fixed') {
> tipY;
>   } else if ( (posX < mouseX && Math.max(posX, 0) + tipWidth > mouseX)
> || opts.positionBy == 'bottomTop') {
> if (posY + tipHeight + tOffset > baseline && mouseY - sTop >
> tipHeight + tOffset) { 
> 
> 
> The page in question is  http://btcamper.interactrv.com/defaultTest.aspx
> http://btcamper.interactrv.com/defaultTest.aspx 
> 
> 
> JeffreyKarbowski wrote:
>> 
>> Could you please tell me a way to position the Cluetip relative to its
>> parent div instead of having it offset from the invoking element? I need
>> the Cluetip to sit in a fixed position on the page. 
>> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/ClueTip-postioning-tp19864348s27240p19879104.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Intercept "Back" button click on browser

2008-10-08 Thread Leanan

Fantastic, thank you.

Where might I be able to get this?

Also, it seems sometimes that even though I'm using

$('a#myidxxx').history(function() {
  $.get(myurl,function(data) {
 $(myappenddiv).append(data);
  });
});

that the data is still getting appended twice.

This doesn't happen all the time though.  I'll try using your fix if I
can find it and see if that might take care of the issue.  Right now
this is only in firefox, as I haven't been able to get my stuff to
work to the point of calling the .history in IE.  (I hate how IE just
fails silently sometimes).


[jQuery] Re: Find all a elements not within a div

2008-10-08 Thread Karl Swedberg




On Oct 8, 2008, at 5:02 AM, BB wrote:



Hi,
this would be the right selector for you:

$("a").filter(function() { return !$
(this).parent("div.pages").length; });

gets all "A"s and then filter the "A"s out wich have a "DIV" with the
class "pages" as parents.


Nice one, BB!

Note that you might need to use "parents" with an "s" if the "a" can  
be nested more than one deep inside "div.pages".





--Karl

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



[jQuery] Re: get a fancybox/lightbox from a FORM?

2008-10-08 Thread Rene Veerman


i dont know fancybox, but if your lightbox supports HTML it should 
support submitting a FORM.
i'd try to initialize the fancybox on the div containing the form, not 
the form itself.


Hilmar Kolbe wrote:

Is there a way to get a fancybox () or any
other lightbox from submitting a FORM (with an image button)?

HTML looks like this:


  
  


These won't do:

$("form").fancybox(); 
$("input").fancybox();
$("input[name='weiter']").fancybox();

Anyone spotting my mistake or having a workaround or an alternative
script? Thanks in advance

  




[jQuery] Re: Is it possible to avoid jumpy / disappearing content

2008-10-08 Thread Karl Swedberg

On Oct 8, 9:14 am, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> Hi Alex,
>
> Often, if you're hiding information on page load, you'll want to have  
> that information available upon some user interaction. Hiding that  
> information with CSS would make the information unavailable to anyone  
> who has JS off but CSS on. Probably not a huge percentage of users,  
> but it's nice to let everyone see the content. Hiding the content with  
> JavaScript follows the principle of Progressive Enhancement™ . Nice  
> article -- the first in a series -- about that on 
> alistapart.com:http://www.alistapart.com/comments/understandingprogressiveenhancement/
>

Oops. wrong URL. Try this one:

http://www.alistapart.com/articles/understandingprogressiveenhancement

--Karl


[jQuery] Re: dimensions plugin integrated in jquery ?

2008-10-08 Thread Karl Swedberg

On Oct 8, 2008, at 9:05 AM, Brandon Aaron wrote:

That is correct. The dimensions plugin now completely included in  
jQuery 1.2.6.


--
Brandon Aaron

On Wed, Oct 8, 2008 at 7:41 AM, Alexandre Plennevaux <[EMAIL PROTECTED] 
> wrote:

hello!

aquick question: is it right that dimensions.js has been included in  
jquery 1.2.6? So there is no need to include it as a separate plugin?


thanks for your insight!



Also, the methods moved from Dimensions to core are available on the  
Docs site now:

http://docs.jquery.com/CSS

--Karl

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



[jQuery] Re: Is it possible to avoid jumpy / disappearing content

2008-10-08 Thread Karl Swedberg

Hi Alex,

Often, if you're hiding information on page load, you'll want to have  
that information available upon some user interaction. Hiding that  
information with CSS would make the information unavailable to anyone  
who has JS off but CSS on. Probably not a huge percentage of users,  
but it's nice to let everyone see the content. Hiding the content with  
JavaScript follows the principle of Progressive Enhancement™ . Nice  
article -- the first in a series -- about that on alistapart.com: http://www.alistapart.com/comments/understandingprogressiveenhancement/


--Karl


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




On Oct 8, 2008, at 8:30 AM, Alex Weber wrote:



Just a random question here: why would you hide the element with
jQuery as opposed to using CSS?  (on pageload that is...)

On Oct 7, 5:50 pm, "John D." <[EMAIL PROTECTED]> wrote:

Ok I found the culprit. There was a JavaScript for our Google site
search. Commenting it out solves the problem.

It's a Coldfusion page. I'm not sure why this bit of JavaScript,  
which

is included at the bottom of  the page is causing the problem.

Shouldn't the paragraph hide before the site search JavaScript is
executed?

Thanks for helping!

John

Brandon Aaron wrote:
Make sure your styles are included before the script tags. Is this  
happening

in a particular browser?
--
Brandon Aaron


On Tue, Oct 7, 2008 at 1:58 PM, John D. <[EMAIL PROTECTED]>  
wrote:



Hmm...I'm still having trouble with this.



my showHide script is as follows:



$(document).domready(function() {
   $('body').addClass('jsEnabled');  // let css know js is enabled
   $('p.firstparagraph').hide()
   $('#showh1').click(function(){
  $('p.firstparagraph').show(200);
  });
  $('#hideh1').click(function(){
  $('p.firstparagraph').hide(200);
  });
 });



Including the following:
http://code.jquery.com/
jquery.js <http://code.jquery.com/jquery.js>">
script>