[jQuery] Re: attr difference in Firefox and IE7

2008-05-20 Thread David McFarland



On May 20, 2008, at 12:47 PM, Ariel Flesler wrote:



So.. Have you tried using jQuery 1.2.4 ?
jQuery.attr works completely different now.


It does? Do you mean there are API changes?

thanks

--dave



[jQuery] Re: flicking screen on fade in FF Mac

2008-04-17 Thread David McFarland


On Apr 17, 2008, at 1:08 PM, Richard W wrote:
>
> Hi There
> I was wondering if anyone else has noticed or experience the weird
> effect that fade has on the screen when viewed in FF on a mac
> (leopard). In safari and opera, even IE run under parallels, there is
> no screen flicker.
> When the fade is occuring, some colours, even the font changes
> slighty, then returns to normal state once the fade has finished. This
> does not occur with a simple timed opacity change, using regular
> javascript. I cannot say I have experienced this with other libraries.
> Is it just the type of screen i'm using, or is this common for FF(2)
> Mac

This is a bug with Firefox. Whenever you use a fade you'll see this.  
The solution is to set the opacity of the body to .999 for Firefox. In  
your stylesheet, just add this rule (or if, you've already got a body  
rule, just add the -moz-opacity: .999;)

body {
-moz-opacity: .999;
}

I prefer to use -moz-opacity instead of opacity, because this only  
appplies to Firefox.

--dave


[jQuery] Re: $ is not defined error

2008-04-17 Thread David McFarland


On Apr 17, 2008, at 2:07 PM, dustinl wrote:
>
> I get this error in the Firefox error console: "$ is not defined" and
> it points me to line
>
> $(document).ready( function() {
>
> I have the most up to date jQuery and I am pointing it to the correct
> location but I can't figure out why I get this error.  Anybody else
> experience this?

That seems to indicate that the page isn't correctly loading jQuery.  
Are you sure you're correctly pointing the the jquery file? You also  
have to include the jquery file BEFORE using $(document).ready(). If  
you can put an example page online, I'm sure someone here will figure  
the problem out.

--dave



[jQuery] Re: Do I need Livequery?

2008-04-17 Thread David McFarland


On Apr 16, 2008, at 5:25 PM, [EMAIL PROTECTED] wrote:
>
> Hello there :)
>
> I've got a bit stuck. I suspect this is a job for Livequery, but can't
> understand how to use it (sorry, Ariel).
>
> With this:
> $( '.showlayer' ).click( function () {
>   $( '#div1 ).fadeIn( 750 );
>
> I'm trying to make each link with a class of 'showlayer' show the div
> which is named in its href:
> 

$('.showlayer').click( function() {
   var target = $(this).attr('href');
   $(target).fadeIn(750);
});


[jQuery] Re: Wait for Fade event to complete before initiating next action

2008-04-15 Thread David McFarland


On Apr 14, 2008, at 4:13 AM, Iminay wrote:
>
> sample code:
>
>   $(document).ready(function(){
>   $("#menu li").click(function(){
>   $(this).fadeTo(1000,0).html("changed").fadeTo(1000,1);
>   });
>   });


$(document).ready(function(){
   $("#menu li").click(function(){
  $(this).fadeTo(1000,0,function() {
 $(this).html("changed");
  }).fadeTo(1000,1);
});
});

To have the text change after the fade out you have to use a callback  
function.

--dave



[jQuery] Re: general onload

2008-03-23 Thread David McFarland


On Mar 23, 2008, at 10:10 AM, [EMAIL PROTECTED] wrote:
>
> I need to know how to create an onload for all occasions. How do I
> make an onload for jquery and other scripts on my site. Not a jscript
> coder so take it easy for me.

Check this out: http://jquery.open2space.com/node/9

--dave


[jQuery] Re: How do you test if hidden or shown in jquery

2008-03-03 Thread David McFarland


On Mar 3, 2008, at 5:42 AM, otherjohn wrote:

>  Where can I
> find specific functions like this. I searched the api and couldn't
> find anything like it.

http://docs.jquery.com/Traversing


[jQuery] Re: toggle disables links - unwanted

2008-02-25 Thread David McFarland


On Feb 25, 2008, at 4:10 AM, Ariel Flesler wrote:

>
> Try the latest jQuery (1.2.3) which removed .toggle()

toggle() was removed? i'm using jquery 1.2.3 and it seems to be  
working for me. This isn't mentioned in the release notes either: 
http://docs.jquery.com/Release:jQuery_1.2.3


--dave



[jQuery] Re: checkbox and toggle function

2008-01-11 Thread David McFarland


On Jan 11, 2008, at 9:18 AM, jeff w wrote:

>
> yeah,
>
> I am having the same issue.
>
> Anyone have a solution??

check the discussion archives. there are two solutions posted:

http://groups.google.com/group/jquery-en/browse_thread/thread/270e0659ae6c72ac/5208edce49f105c8?lnk=gst&q=toggle()+checkbox#5208edce49f105c8


--dave


[jQuery] Re: toggle function on checkbox

2008-01-08 Thread David McFarland

>
>
>
> $(document).ready(function(){
>  $("#precheck").toggle(
> function () {
>$(".preregbox").show('slow');
> },
> function () {
>$(".preregbox").hide('slow');
> }
>  );
> });

I've had that problem too and switched to this structure:

$('input#precheck').click(function() {
 if($(this).attr("checked")) {
//show
 } else {
   // hide
 }  
}); 


--dave


[jQuery] Re: jquery remove() not removing

2008-01-08 Thread David McFarland


On Jan 8, 2008, at 7:07 AM, justinteractive wrote:

>
> Hi folks,
>
> I'm using remove() to remove a list, then re-creating a list using the
> same id. Remove does not appear to be actually removing the instance.
>
> If I check for the element, it returns true, but if I try to work with
> it nothing happens? Firebug shows no evidence of the list either.

can you show us your JavaScript code?

--dave


[jQuery] Re: $('table tr').hover() not working in IE

2008-01-07 Thread David McFarland

>
>
> <>
>$('table tr').hover(
>function() {$(this).addClass('hover');},
>function() {$(this).removeClass('hover');
>});
> <>
>
>
> This is my CSS:
>
> <>
> tr.hover {background-color:#E6;}
> tr.hover a{color: #4F839F}
> tr.hover a:hover{background:none; font-weight:bold; color: #4F839F}
> <>
>
>
> This works fine in Firefox - it turns the background color light blue
> and sets the links inside that tablerow to a darkblue.
>
> In Internet Explore 7.0 (possibly others, but i havent tested in older
> ones yet) it only changes the color of the links - it does NOT change
> the color of the tablerow background-color.

Bryan,

Based on the snippets you provided this works fine for me in IE6 and  
IE7 (Firefox and Safari too). Perhaps there is a conflict with other  
style rules in your stylesheet.

--dave


[jQuery] Re: How to find a table cells value?

2007-12-19 Thread David McFarland

>>
>
> Don't forget that every row has rowIndex and sectionRowIndex
> properties and every cell a cellIndex property.  These are very much
> faster than CSS-style selectors, e.g.:
>
>$($('#tableID').rows[x].cells[y]).text();

Hi Rob,

I've never seen that syntax before, and I can't get it to work. Do you  
have a working example you can show us?

thanks

--dave


[jQuery] Re: Events don't work after load content using $.get

2007-12-17 Thread David McFarland


On Dec 17, 2007, at 11:56 AM, LeonL wrote:

>
>
> Hi everyone,
>
> I have an event that is not being listened and I can't figure out why.
>
> The thing is that everything is working fine while all my html code is
> static, but as soon as I modified it with some data pulled from the  
> db, the
> click() events doesn't trigger the actions any more.

Hi Leon,

This is question comes up a lot. Basically, you've added listeners for  
the click event THEN updated the DOM. You need to either reapply the  
click event AFTER the Ajax call or use the LiveQuery plugin:

http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_Ajax_request.3F

--dave


[jQuery] Re: sound library for jQuery

2007-12-14 Thread David McFarland

>
>> Has anyone developed a sound plugin for jQuery like the one Prototype
>> has?
>>
>>
> Give this a try: http://dev.jquery.com/view/trunk/plugins/sound/
>
> A port of the scriptacolous sound.js library, based on jQuery and  
> some slight API changes. Works for me on IE6, FF2, Safari 3 and  
> Opera 3, though that result may differ depending on plugins installed.
>
> If I get a few more test results or other feedback, I'd set up a  
> plugin page and a bit more documentation.

Ha! "Ask and ye shall receive"
Thanks Jorn--you're incredible. I'll try it out this weekend, and give  
feedback.

--dave


[jQuery] Re: Alter Status Message

2007-12-11 Thread David McFarland

>
>
>
> $(document).ready(function() {
> $("#main #welcome a").hover(
> function() {
> var href = $(this).attr('href');
> var a1 = href.split("DURL=");
> if (a1 != href) {
> window.status = a1[1];
> }
> }
> );
> });
>
>
> On mouseover, the status bar display is not affected.  On mouseout,  
> FireBug reports the following error message:
>
>
> g has no properties
> handleHover(mouseout clientX=0, clientY=0 )jquery-packed.js (line 1)
> e( mouseout clientX=0, clientY=0)jquery-packed.js (line 1)
> e ()jquery-packed.js (line 1)
>  eval(function(p,a,c,k,e,r){e=function(c){return(c a)))+((c=c%a...

hover() requires two functions as arguments: one for mouseover and one  
for mouseout. Use mouseover instead
$("#main #welcome a").mouseover(

However, a lot of Web browsers don't let you change the status bar.  
Firefox (at least version 2) has disabled the option to control the  
status bar with JavaScript--your end users will have to have purposely  
opened their Firefox preferences and enabled the option for your  
script to work.

I just tested in Safari 3 and it also won't allow script control of  
the status bar

--dave



[jQuery] Re: .click() issue

2007-12-10 Thread David McFarland

>
> Works:
>
> $(".flag").hide();
>
> Doesn't work (wont alert):
>
> $(".flag").click(function (){
> alert("hello");
> });
>
> WORKS:
> $(".flag").click(function (){
> alert("hello");
> }).click();
>
> It seems like the browser just doesn't see the click event! Weird..

What does the HTML look like?

--dave