[jQuery] adding event to dynamic element

2009-11-20 Thread tony stamp

Hello

I am using ajax in an autocomplete feature, and to resuse the existing
templates, i am attempting to dynamically add a close button/link to the
autocomplete results.

I understand that i cannot add an event listener to newly created elements,
so i am creating the element using the live() function then appending the
element to the output. Clicking the element should close the output.

var outputDiv = $("#ajaxSearchResults");
var close = $(' (close) ');
$(close).live("click", function(){
$(outputDiv).hide("slow");
return false;
});

$(outputDiv).append(close);

...but the click event is not triggering - even if i simply put an alert box
in there. What am i doing wrong?
-- 
View this message in context: 
http://old.nabble.com/adding-event-to-dynamic-element-tp26452452s27240p26452452.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Superfish - Multiple Columns

2009-11-20 Thread Chris
How would you use Superfish to make a dropdown menu that contains
multiple columns of menu items?


[jQuery] Conflict with doc-menu and startStop slider?

2009-11-20 Thread J2
Hi, I seem to be having issues while trying to include both the doc
menu jquery menu (http://www.ndesign-studio.com/blog/design/css-dock-
menu/) , and the jQuery start stop slide show (from Chris Coyer).

I finally got the slider to work properly, but now the images within
the doc menu to not appear where they should be. Also, when I hover
over the only image in the doc menu, it does not enlarge per the
intended effect.

Would anyone have a workaround or an idea on what I can do?

The page I am trying this on is here:

http://j2studio.com/11202009/index.shtml

Thanks in advance!


[jQuery] change the height of a div that is loaded after the jQuery is

2009-11-20 Thread Dave
I'm developing a comment panel for a blog that uses Disqus. The design
is really tight, and the client is insistent that THIS is the layout.
You can see it here: http://agave.purebluebeta.com/blog/2009/nov/20/test-entry/

Problem is, the height is changed AFTER my jQuery is loaded. IE,
Disqus comes in after the variables are all set. And I need to know
the maximum height for the comments panel when ever it is changed
because it will grow over time as more comments are added. But that is
done with the Disqus code.

Something like $(this).live().height();

But live is only tied to events... right?

Any tips are welcome.
Thanks.


[jQuery] Re: Load image when they are visible

2009-11-20 Thread StephenJacob
Not a problem man! I've realized that half the problem finding answers
is wording the question properly.

Good luck with your project!

On Nov 19, 4:40 pm, CrustyDOD  wrote:
> Yes, that's it..
>
> Was so looking for the wrong thing..
>
> Thanks man.
>
> On Nov 19, 9:08 pm,StephenJacob wrote:
>
> > I think this is what you're looking for. Haven't tested it myself, but
> > this is what i found with a quick search in google for "jquery load
> > images on scroll"
>
> >http://www.appelsiini.net/2007/9/lazy-load-images-jquery-plugin
>
> > On Nov 19, 2:37 pm, CrustyDOD  wrote:
>
> > > Hey guys,
>
> > > I've been searching all over if its possible to make the same effect
> > > that YouTube has.
> > > Loading images when they are visible.
>
> > > If you have no idea what i'm talking about, go to YouTube, do a search
> > > for some video and
> > > when you scroll down the list of all found videos, thumbnails of each
> > > video will be loaded once
> > > they are visible (in the visible area of the browser).
>
> > > Any ideas how to do this effect? Load images only when they are inside
> > > the viewable
> > > area of a browser..


[jQuery] Re: loosing scope in a custom object

2009-11-20 Thread mlecho
for anyone who may need this later, i found a work around (not yet
tested in ie):
this.setDelegate=function(v)
{
   this.delegate =v;
   v.me = this;   //refernce back to this class, since we loose scope
in the callbacks
   this.checked = v.checked;
   $(v).bind("change",this.onChange)
};
this.onChange = function()
{
  var val = 1;
  (this.checked) ? val = 1 : val = 0;
  this.me.swf.toggleProperty(this.me.group,this.me.prop,val);
};

On Nov 19, 2:47 pm, mlecho  wrote:
> i am trying to bring jQuery into a custom object... The object will
> manage some logic,callbacks, etc, by assigning a "delegate". In this
> case , it will be a checkbox
> function Toggler()
> {
>         this.type = "toggler";
>         this.name = null;
>         this.delegate = null;
>         this.group=0;
>         this.checked="checked";
>         this.setDelegate=function(v)
>         {
>            this.delegate =v;
> this.checked = v.checked;
>            $(v).bind("change",this.onChange);
>         } ;
>         this.onChange = function()
>         {
>           console.log(this)
>         };
>         this.init = function(){
>
>         }
>
> }
>
> my problem is where i "bind" the delegate in "setDelegate"...you can
> see i am trying to bring the handler back to the class that is
> wrapping "v" (the delegate. However, if i log the dispatcher of this
> event, i get not the class, but the delegate...is it possible to bring
> the scope back to the class??


RE: [jQuery] Re: Why would jQuery be undefined in IE, but not FF???

2009-11-20 Thread Rick Faircloth
Really...I didn't realize it would point out syntax errors like that.

Good to know...

Thanks!

Rick

-Original Message-
From: MorningZ [mailto:morni...@gmail.com] 
Sent: Friday, November 20, 2009 2:05 PM
To: jQuery (English)
Subject: [jQuery] Re: Why would jQuery be undefined in IE, but not FF???

> I never even thought to check that.

Firefox's "View Source" highlighted that line in red




[jQuery] Re: array of attributes

2009-11-20 Thread Bill
Ha. Found an answer:

http://groups.google.com/group/jquery-en/browse_thread/thread/b73ab7267d9e0357/cc4b528a4f079254?lnk=gst&q=attr+array#cc4b528a4f079254

Has anyone used this?

$.fn.attrs = function(key, val){
if (val != undefined)
return this.attr(key, val);
return $.map(this, function(a){
return $(a).attr(key);
});
}

On Nov 20, 12:30 pm, Bill  wrote:
> Hey y'all,
>
> The jQuery attr() method returns only the attribute of a set's first
> matched element. E.g., for the HTML snippet:
>
> 
> 
> 
>
> the jQuery expression
>
> $("input").attr("name") will return only the string "input-one."
>
> What if, instead, I wanted to return all the attribute values in an
> array? What's the syntax to produce this result?
>
> Thanks in advance,
>
> --Bill


[jQuery] array of attributes

2009-11-20 Thread Bill
Hey y'all,

The jQuery attr() method returns only the attribute of a set's first
matched element. E.g., for the HTML snippet:





the jQuery expression

$("input").attr("name") will return only the string "input-one."

What if, instead, I wanted to return all the attribute values in an
array? What's the syntax to produce this result?

Thanks in advance,

--Bill


[jQuery] Re: imitate link

2009-11-20 Thread KeeganWatkins
charlie and dave are correct: you should use elements semantically to
ensure your content runs on as many platforms/devices/configurations
as possible. with that being said, there is a simple answer to your
original question:

HTML:
Home

JS:
$("#fake_link").click(function() {
window.location = "http://your.domain.com/path/to/wherever";';
});

if you don't take the advice to use  elements instead, please
Please PLEASE use  instead of .  and  elements
are long-deprecated.

On Nov 17, 10:24 pm, Dave Methvin  wrote:
> > > Can make  behave as  ?
> > Why would you not just use CSS to style an  element
> > to be bold and not underlined?
>
> Definitely the way to go. That way the link works with the keyboard
> and screen readers as well. Apps that require the mouse drive me crazy.


[jQuery] Re: IDEs of jQuery

2009-11-20 Thread devilmike
I don't believe there is an ide with that level of support (yet), but
I haven't been looking lately. I'd checkout the link MorningZ
posted...


Michael



On Nov 19, 1:56 pm, Ankur_Patel  wrote:
> to Michael, I am also use NetBeans but how can i get jQuery all library like
> php functions,properties
>
> On Thu, Nov 19, 2009 at 8:58 PM, devilmike  wrote:
> > This isn't specifically for jQuery, but NetBeans handles it extremely
> > well. I use the Early Access for PHP version.
>
> > Michael
>
> > On Nov 19, 4:13 am, Ankur_Patel  wrote:
> > > Can any one tell me name of jQuery IDEs... like dreamweaver use of IDE as
> > > HTML,PHP,ASP,XML,CSS
>
> > > Any IDE there for jQuery code so we can write codes easy & fast
>
> > > Thanx


[jQuery] Re: How to Get Div from IFrame

2009-11-20 Thread mkmanning
No. Cross domain also applies to different sub-domains, protocols, and
ports.

On Nov 20, 11:17 am, "webspee...@gmail.com" 
wrote:
> Outside of my domain, I can understand. I'll have to hold off for a
> bit then.
>
> Although the page will be remote, it will be accessible 
> byhttp://search.mydomain.com. Once it's accessible as a "sub domain',
> will I then have access to the page's elements?
>
> On Nov 16, 7:55 am, Liam Byrne  wrote:
>
>
>
> > You can't do this if the content of the iFrame is from a different
> > server / domain.
>
> > e.g. if it's not your content, then you can't get at it this way in
> > order to show it in your page; you can only display the iframe as the
> > owner intended.
>
> > L
>
> > webspee...@gmail.com wrote:
> > > When I try it, I get this error:
>
> > > Error: Permission denied for  to get property
> > > HTMLDocument.nodeType from :>.
> > > Source File:http://www..com/js/jquery/jquery.js
> > > Line: 2216
>
> > > Here is the line of JS being used.
>
> > > $("#eseSearchRight").html($('#searchFrame').contents().find
> > > ('.recordHeader').html());
>
> > > On Nov 5, 4:17 pm, Michel Belleville 
> > > wrote:
>
> > >> $('#canvas_frame').contents().find('#my_div');
>
> > >> To seek an id use "#", to seek inside a div use .contents().
>
> > >> Plus, refrain from using iframe, this is almost as bad as using frame and
> > >> almost never worth it. AJAX is good for you instead of shitty iframes.
>
> > >> Michel Belleville
>
> > >> 2009/11/5 Danish 
>
> > >>> I have a page with multiple Frames and Division, Now I am trying to
> > >>> extract one div having id="my_div" from iframe with Id =
> > >>> "canvas_frame" but I am fail to do so, Nor I am getting iframe neither
> > >>> Division in iframe.
> > >>> I tried all these selectors but always null returns although they are
> > >>> in page:
> > >>> 1) $("my_div");
> > >>> 2) $("my_div","canvas_frame");
> > >>> 3) $("canvas_frame",content.document);
> > >>> 4) $("canvas_frame");
> > >>> 5)  var $frame = $("canvas_frame",content.document);
> > >>>     var $div = $("my_div",$frame);
>
> > >>> I am able to do this with Pure JavaScript but due to some reasons I
> > >>> want to use JQuery Library, Any help will be highly appreciated.
> > >>> 
>
> > >>> No virus found in this incoming message.
> > >>> Checked by AVG -www.avg.com
> > >>> Version: 8.5.425 / Virus Database: 270.14.63/2500 - Release Date: 
> > >>> 11/13/09 07:54:00


[jQuery] Re: show/hide div on select change

2009-11-20 Thread KeeganWatkins
also, just as a head's up... even when you store numbers as the
"value" attribute on an  tag, they are interpreted as strings
in javascript. so, from your example above, you might also consider
switching your condition to:

// Compare as string instead
if ($("#id_status").val() === '6'){
$('div.textfield1').show();
}

when you compare the two as strings using the strict equality operator
(===), your results will likely be far more predictable. hope that
helps.

On Nov 18, 2:03 pm, mtuller  wrote:
> Thanks.
>
> On Nov 18, 1:50 pm, Charlie Griefer  wrote:
>
> > You're missing a $ on this line:
>
> > ('#id_status').change(function() {
>
> > Change to:
>
> > $('#id_status').change(function() {
>
> > unsolicited word of advice... run firebug :)
>
> > On Wed, Nov 18, 2009 at 11:44 AM, mtuller  wrote:
> > > I am trying to have a div show and hide based on the value of a select
> > > list. I have looked at a number of examples, but can't seem to get it
> > > to work. Would appreciate someone taking a look at what I have and
> > > giving me any advice.
>
> > > 
> > > $(document).ready(function() {
> > >        $('div.textfield1').hide();
>
> > >        ('#id_status').change(function() {
>
> > >                if ($("#id_status").val() == 6){
> > >                        $('div.textfield1').show();
> > >                }
> > >                else{
> > >                        $('div.textfield1').hide();
> > >                }
> > >   });
> > > });
> > > 
>
> > > Status:
> > >        
> > >                New
> > >                In Review
> > >                Working On
> > >                Elevated
> > >                Approved
> > >                Deferred
> > >                Denied
> > >                Duplicate
> > >                Completed
> > >                Needs more information
> > >        
>
> > > 
> > > test
> > >    
> > >  
> > > 
>
> > --
> > Charlie Grieferhttp://charlie.griefer.com/
>
> > I have failed as much as I have succeeded. But I love my life. I love my
> > wife. And I wish you my kind of success.


[jQuery] Re: How to Get Div from IFrame

2009-11-20 Thread webspee...@gmail.com
Outside of my domain, I can understand. I'll have to hold off for a
bit then.

Although the page will be remote, it will be accessible by
http://search.mydomain.com. Once it's accessible as a "sub domain',
will I then have access to the page's elements?

On Nov 16, 7:55 am, Liam Byrne  wrote:
> You can't do this if the content of the iFrame is from a different
> server / domain.
>
> e.g. if it's not your content, then you can't get at it this way in
> order to show it in your page; you can only display the iframe as the
> owner intended.
>
> L
>
>
>
> webspee...@gmail.com wrote:
> > When I try it, I get this error:
>
> > Error: Permission denied for  to get property
> > HTMLDocument.nodeType from :>.
> > Source File:http://www..com/js/jquery/jquery.js
> > Line: 2216
>
> > Here is the line of JS being used.
>
> > $("#eseSearchRight").html($('#searchFrame').contents().find
> > ('.recordHeader').html());
>
> > On Nov 5, 4:17 pm, Michel Belleville 
> > wrote:
>
> >> $('#canvas_frame').contents().find('#my_div');
>
> >> To seek an id use "#", to seek inside a div use .contents().
>
> >> Plus, refrain from using iframe, this is almost as bad as using frame and
> >> almost never worth it. AJAX is good for you instead of shitty iframes.
>
> >> Michel Belleville
>
> >> 2009/11/5 Danish 
>
> >>> I have a page with multiple Frames and Division, Now I am trying to
> >>> extract one div having id="my_div" from iframe with Id =
> >>> "canvas_frame" but I am fail to do so, Nor I am getting iframe neither
> >>> Division in iframe.
> >>> I tried all these selectors but always null returns although they are
> >>> in page:
> >>> 1) $("my_div");
> >>> 2) $("my_div","canvas_frame");
> >>> 3) $("canvas_frame",content.document);
> >>> 4) $("canvas_frame");
> >>> 5)  var $frame = $("canvas_frame",content.document);
> >>>     var $div = $("my_div",$frame);
>
> >>> I am able to do this with Pure JavaScript but due to some reasons I
> >>> want to use JQuery Library, Any help will be highly appreciated.
> >>> 
>
> >>> No virus found in this incoming message.
> >>> Checked by AVG -www.avg.com
> >>> Version: 8.5.425 / Virus Database: 270.14.63/2500 - Release Date: 
> >>> 11/13/09 07:54:00


[jQuery] Re: jq 1.3.2 in IE6 syntax error line 324

2009-11-20 Thread KeeganWatkins
can you post a test page? just by scanning, there isn't anything that
jumps out at me as being broken/syntactically incorrect...
just a tip, though, you can combine your selectors to make that part
more efficient:

$(function(){
$('#username, #password, #valicode').keydown(function(event){
if(event.keyCode==13){
formLogin();
}
});
});

the initial selection might take longer (to find three elements, as
opposed to just one), but in the new format you will avoid creating
three separate (but identical) closures to handle the keydown event.
hope that helps, post a test page and we can help diagnose the error.

On Nov 19, 12:43 am, viperasi  wrote:
> Either jquery-1.2.3.js or jquery-1.3.2.min.js, i got the error in
> IE6,other browsers without error.
> the code:
>
> $(function(){
>         $('#username').keydown(function(event){
>                 if(event.keyCode==13){
>                         formLogin();
>                 }
>         });
>         $('#password').keydown(function(event){
>                 if(event.keyCode==13){
>                         formLogin();
>                 }
>         });
>         $('#valicode').keydown(function(event){
>                 if(event.keyCode==13){
>                         formLogin();
>                 }
>         });
>
> });
>
> Can anyway help me please? I think it's something really simple and
> I'm just being stupid.
>
> Many thanks for reading and sorry for my poor English.


[jQuery] Re: getjson request an unavailable page

2009-11-20 Thread MorningZ
"ok, I will try by the use of ajax but nobody that used getjson had
this problem?"

Everyone and anyone using "$.getJSON" *is* using "$.ajax"

straight from the jQuery file


getJSON: function( url, data, callback ) {
return jQuery.get(url, data, callback, "json");
},

which in turn calls

get: function( url, data, callback, type ) {
// shift arguments if data argument was ommited
if ( jQuery.isFunction( data ) ) {
callback = data;
data = null;
}

return jQuery.ajax({
type: "GET",
url: url,
data: data,
success: callback,
dataType: type
});
},



On Nov 20, 1:25 pm, Jon Crump  wrote:
> On Wed, 18 Nov 2009, Humpty Dumpty wrote:
>
> > Thanks, I though that there was a "JSON" solution;
> > ok, I will try by the use of ajax but nobody that used getjson had
> > this problem?
>
> As a matter of fact, I just did. As I understand it $.getJSON() seems to
> be just a wrapper around an $.ajax() request. So I used $.ajaxSetup() to
> define an error handling routine.
>
> see:http://stackoverflow.com/questions/572991/jquery-getjson-doesnt-trigg...
>
> and:http://docs.jquery.com/Ajax/jQuery.ajax


[jQuery] Re: Why would jQuery be undefined in IE, but not FF???

2009-11-20 Thread MorningZ
> I never even thought to check that.

Firefox's "View Source" highlighted that line in red


Re: [jQuery] Re: getjson request an unavailable page

2009-11-20 Thread Jon Crump

On Wed, 18 Nov 2009, Humpty Dumpty wrote:



Thanks, I though that there was a "JSON" solution;
ok, I will try by the use of ajax but nobody that used getjson had
this problem?



As a matter of fact, I just did. As I understand it $.getJSON() seems to 
be just a wrapper around an $.ajax() request. So I used $.ajaxSetup() to 
define an error handling routine.


see: 
http://stackoverflow.com/questions/572991/jquery-getjson-doesnt-trigger-callback


and:
http://docs.jquery.com/Ajax/jQuery.ajax


RE: [jQuery] Why would jQuery be undefined in IE, but not FF???

2009-11-20 Thread Rick Faircloth
Yep…that was it.  Thanks for your input, Michel!

 

Rick

 

From: Michel Belleville [mailto:michel.bellevi...@gmail.com] 
Sent: Friday, November 20, 2009 12:38 PM
To: jquery-en@googlegroups.com
Subject: Re: [jQuery] Why would jQuery be undefined in IE, but not FF???

 

The missing > issue mentionned by MorningZ might be your killer then.

Michel Belleville



2009/11/20 Rick Faircloth 

Thanks for the reminder on that one, Michel...I checked that to make sure

the load sequence was correct, and it is…

 





 

Rick

 

From: Michel Belleville [mailto:michel.bellevi...@gmail.com] 
Sent: Friday, November 20, 2009 12:29 PM


To: jquery-en@googlegroups.com

Subject: Re: [jQuery] Why would jQuery be undefined in IE, but not FF???

 

Well, the most obvious idea that's coming to my mind would be to check wether 
your jQuery  loader line comes before the plugin's loading line. If 
not, the code of the plugin, which requires jQuery, will lack jQuery and fail.

Michel Belleville

2009/11/20 Rick Faircloth 

Even stranger…

 

I went back to another site where I have the cycle plug-in successfully running

on IE and FF to retrieve the versions of jquery core and cycle plug-in that are 
working.

 

I put those into the site at www.holtzmanrealestate.com and I get the same 
problem

as before…

 

‘jQuery’ is undefined (line 10 of jquery.cycle.2.03.pack.js)

and
‘jQuery’ is undefined (line 90 www.holtzmanrealestate.com, which refers to the

cycle plug-in script as defined below.)

 

What could possibly be the issue?

 

Rick

 

From: Rick Faircloth [mailto:r...@whitestonemedia.com] 
Sent: Friday, November 20, 2009 11:36 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Why would jQuery be undefined in IE, but not FF???

 

Hi, all…

 

Anyone have any idea about this?  First time I’ve seen it…

 

I using Mike Alsup’s cycle plug-in to cross fade three photos.

When I first set this up, it worked fine in IE and FF.

 

Now, however, the code only works in FF.  IE7 & IE8 (at a minimum),

return the error messages:

 

‘jQuery’ is undefined

jquery.cycle.all.2.65.min.js (line 16)

 

Line 16 refers to the first line of code in jquery.cycle.all.2.65.min.js, that 
starts:

;(function($){var 
ver="2.65";if($.support==undefined){$.support={opacity:!($.browser.msie)};}function
 log(){if(window.console&&window.console.log){ etc…

 

The next error message returned by IE is:

‘jQuery’ is undefined

www.holtzmanrealestate.com (line 85)

That’s referencing this code on index.cfm: