[jQuery] Images shrinking?!?!

2009-03-30 Thread Jen

Hi there,

I have a couple of image slideshows on my site and in IE occasionally
the images appear shrunk down like thumbnails instead of full size.
Any ideas why that might happen and what i could do to stop it?

http://www.bonsaibranding.com/riverstone/home.html

Thanks
Jen


[jQuery] Re: Ugly code causing problems in IE

2009-03-30 Thread bgthomson

MorningZ,
For sure - there was a lot of context missing in the original post.

The problem is in the load() part. In IE, when the click event loads,
the fade effect malfunctions and doesn't load the content. You can see
what I mean by clicking on the link edcp impact on 
http://m1.cust.educ.ubc.ca/newsite/

On Mar 29, 1:12 pm, MorningZ morni...@gmail.com wrote:
 Might help others help you if you point out what is not working

 the .load() part?  adjusting the CSS?

 On Mar 29, 2:26 pm, bgthomson bjorn.thom...@gmail.com wrote:

  Hello,
  I am a jquery newbie, and I am trying to get an effect off the ground.
  It works fine in Mozilla but not in IE.

  Does anyone know what I'm doing wrong. Many apologies for the ugly
  code - I'm not really a jquery programmer, so not sure how to make it
  more efficient.

  At the moment, I'm just wondering why it doesn't work. The page is 
  at:http://m1.cust.educ.ubc.ca/newsite/

  The code is:

   $(document).ready(function(){

  q1 = {
          init: function() {
                  $(.loader1).click(function() {
                          $(#fader).fadeOut('slow', function() {
                                  
  $(this).load('homepage_text/0.php').fadeIn('slow');
                          });
                          $(#featureBanner).fadeOut('slow', function() {
                                  
  $(this).load('homepage_images/0.php').fadeIn('slow');
                          });
                          $(#over).css({color: 'white', backgroundColor: 
  '#2e4468',
  textDecoration: 'underline'});
                          $(#other).css({color: '#242f37', backgroundColor: 
  '#A4BEDF',
  textDecoration: 'none'});
                          $(#other2).css({color: '#242f37', 
  backgroundColor: '#A4BEDF',
  textDecoration: 'none'});
                          $(#other3).css({color: '#242f37', 
  backgroundColor: '#A4BEDF',
  textDecoration: 'none'});
                  });
          }}

  q1.init();
  q2 = {
          init: function() {
                  $(.loader2).click(function() {
                          $(#fader).fadeOut('slow', function() {
                                  
  $(this).load('homepage_text/1.php').fadeIn('slow');
                          });
                          $(#featureBanner).fadeOut('slow', function() {
                                  
  $(this).load('homepage_images/1.php').fadeIn('slow');
                          });
                          $(#over).css({color: '#242f37', backgroundColor: 
  '#A4BEDF',
  textDecoration: 'none'});
                          $(#other).css({color: 'white', backgroundColor: 
  '#2e4468',
  textDecoration: 'underline'});
                          $(#other2).css({color: '#242f37', 
  backgroundColor: '#A4BEDF',
  textDecoration: 'none'});
                          $(#other3).css({color: '#242f37', 
  backgroundColor: '#A4BEDF',
  textDecoration: 'none'});

                  });
          }}

  q2.init();

  q3 = {
          init: function() {
                  $(.loader3).click(function() {
                          $(#fader).fadeOut('slow', function() {
                                  
  $(this).load('homepage_text/2.php').fadeIn('slow');
                          });
                          $(#featureBanner).fadeOut('slow', function() {
                                  
  $(this).load('homepage_images/2.php').fadeIn('slow');
                          });
                          $(#over).css({color: '#242f37', backgroundColor: 
  '#A4BEDF',
  textDecoration: 'none'});
                          $(#other).css({color: '#242f37', backgroundColor: 
  '#A4BEDF',
  textDecoration: 'none'});
                          $(#other2).css({color: 'white', backgroundColor: 
  '#2e4468',
  textDecoration: 'underline'});
                          $(#other3).css({color: '#242f37', 
  backgroundColor: '#A4BEDF',
  textDecoration: 'none'});
                  });
          }}

  q3.init();

  q4 = {
          init: function() {
                  $(.loader4).click(function() {
                          $(#fader).fadeOut('slow', function() {
                                  
  $(this).load('homepage_text/3.php').fadeIn('slow');
                          });
                          $(#featureBanner).fadeOut('slow', function() {
                                  
  $(this).load('homepage_images/3.php').fadeIn('slow');
                          });
                          $(#over).css({color: '#242f37', backgroundColor: 
  '#A4BEDF',
  textDecoration: 'none'});
                          $(#other).css({color: '#242f37', backgroundColor: 
  '#A4BEDF',
  textDecoration: 'none'});
                          $(#other2).css({color: '#242f37', 
  backgroundColor: '#A4BEDF',
  textDecoration: 'none'});
                          $(#other3).css({color: 'white', backgroundColor: 
  '#2e4468',
  textDecoration: 'underline'});
                  });
          }}

  q4.init();

  });


[jQuery] Re: Get element's html and the element

2009-03-30 Thread Steven Yang
well html() just gets the innerHTMLso your out of luck there
there is actually a plugin for getting the actually container html
I remember coming across it on the jquery plugin pages
you can try finding it there

All i can say is its doesnt seem hard, but also not as easy as you think
^^


[jQuery] Re: Why isn't there any list widget?

2009-03-30 Thread ryan.j

obviously adding content to an element is simple enough in jQuery that
you don't really need a plugin to do it, and providing you have some
way of tracking them removing them isn't a hassle either.

what additional functionality are you looking for?

On Mar 29, 5:38 am, Zach zsoa...@gmail.com wrote:
 Sorry, that site is a bad example. I was referring to the list of
 links on the site. I can't just use CSS because I want the list to be
 dynamically generated with addItem() and removeItem() methods, and I
 also want items to be selectable.

 On Mar 29, 12:30 am, brian bally.z...@gmail.com wrote:

  On Sat, Mar 28, 2009 at 11:30 PM, Zach zsoa...@gmail.com wrote:

   I've searched extensively for a jquery widget that allows me to add/
   remove items to a list, set font size, etc. For an example of what I
   mean, see here:

  http://www.webresourcesdepot.com/dnspinger/

  What are we supposed to be looking at? Is there supposed to be some
  dynamic list style-changer thingy? I don't see it.

  Maybe what you're looking for is simply plain CSS.


[jQuery] Re: Hide problem

2009-03-30 Thread LaUr3nTiU

Yes, floating them to the left worked, thanks :)


[jQuery] handler is undefined error

2009-03-30 Thread macsig

Hello guys,
I'm trying to create an horizontal accordion using the code below:

$(document).ready(function(){
lastBlock = $(#a1);
maxWidth = 210;
minWidth = 75;

$(.accordion_trigger).hover(function(){
$(lastBlock).animate({width: minWidth+px}, { queue:false,
duration:400 });
$(this).animate({width: maxWidth+px}, { queue:false, duration:
400});
lastBlock = this;
  }
);
});

with the following HTML:

ul class=accordion
  li
span id=a1 class=accordion_trigger
  img src=images/free_thumb.jpg /
  p
strongFreebies/strongbr/
Download free files to make your job easier.
  /p
/span
  /li
  li
span class=accordion_trigger
   img src=images/tut_thumb.jpg /
   p
 strongTutorials/strongbr/
 Tips and tricks to help you
 keep up with the latest technology.
   /p
/span
  /li
  li
span class=accordion_trigger
  img src=images/inspire_thumb.jpg /
  p
strongInspiration/strongbr/
Get inspired by what other designers are doing.
  /p
/span
  /li
/ul


The effect works well but I get this error:

handler is undefined
http://localhost:3000/javascripts/jquery.js?1236564794
Line 25

Any idea about the reason I get it?

I'm using some other scripts and plug-ins. Can it be a conflict issue?

Thanks and have a nice day




[jQuery] Re: JQuery form validation not working with jsp

2009-03-30 Thread Jörn Zaefferer
Looks like you copied too much demo code. Remove the
errorPlacement-option - you don't have a table layout.

Jörn

On Sat, Mar 28, 2009 at 5:09 PM, Smruti Pragyan Misra
smruti...@gmail.com wrote:
 Hi John,
    Thanks for ur reply.presently I am able to call validate()
 method for both the fields.But it's not working with following code.

 ?xml version=1.0 encoding=UTF-8?
 %@ taglib prefix=fmt uri=http://java.sun.com/jsp/jstl/fmt%
 %@ taglib prefix=html tagdir=/WEB-INF/tags/html%
 %@ taglib uri=http://java.sun.com/jsp/jstl/core; prefix=c%
 %@ taglib prefix=form uri=http://www.springframework.org/tags/form%
 %@ taglib prefix=spring uri=http://www.springframework.org/tags%
 spring:theme var=css code=css /
 c:if test=${not empty css}
     link rel=stylesheet href=c:url value=${css}/signup.css/
 type=text/css /
 /c:if
 html:page title=irise.user.inviteuser
 script id=demo type=text/javascript
 $(document).ready(function() {
  // validate signup form on keyup and submit
  var validator = $(#signupform).validate({
   rules: {
    email: {
 required: true,
 email: true
    }
   },
   messages: {
    email: {
 required: Please enter a valid email address,
 minlength: Please enter a valid email address
    }
   },
   // the errorPlacement has to take the table layout into account
   errorPlacement: function(error, element) {
 error.appendTo( element.parent().next() );
   },
   // specifying a submitHandler prevents the default submit, good for the
 demo
   submitHandler: function() {
    alert(submitted!);
   },
   // set this class to error-labels to indicate valid fields
   success: function(label) {
    // set nbsp; as text for IE
    label.html(nbsp;).addClass(checked);
   }
  });

 });
 /script

     h2fmt:message key=register.user.adduser //h2


     span class=boldlabel for=rolefmt:message
 key=irise.user.defaultrole //label/span
     form:form commandName=signupform
 action=/user/register/registerUser method=post cssClass=default
     fieldset
     ol
     li
     input type=text name=emailId size=25 /
  td class=status/td
     form:errors path=emailId cssClass=errors/
     /li
     /ol
     /fieldsetbr/br
     span class=boldfmt:message key=register.user.edit
 //span
     fieldset
     ol
     lifmt:message key=register.user.Subject /:
     form:input id=subject path=subject /
     form:errors path=subject cssClass=errors/
     /li
     /ol
     /fieldset
    table align=right
     tr
     tdinput name=Register type=submit  value=submit
 //td
     /tr
    /table

     /form:form
 /html:page
 Note: validate.js and jquery.js are included in header.tag.

     When I am clicking on submit button , JQuery Validation is not
 happening.Can you please tell me what may the problem?

 Thanks,
 Lucky

 On Fri, Mar 27, 2009 at 4:33 AM, Jörn Zaefferer
 joern.zaeffe...@googlemail.com wrote:

 Same as for any other backend, eg. pick a validation plugin ala
 http://docs.jquery.com/Plugins/Validation and follow the examples.
 Come back with any specific questions.

 Jörn

 On Thu, Mar 26, 2009 at 8:01 PM, Lucky smruti...@gmail.com wrote:
 
  Hi,
        I  am new to JQuery , can anyone tell me any example ,how to do
  form validation for JSP. I have two text box one for Subject and
  another one for email Id .
 
  Thanks,
  Lucky
 



 --
 Thanks N Regards,

 Smruti  Pragyan Mishra



[jQuery] Re: [Validate] Support for Validation Grouping

2009-03-30 Thread Jörn Zaefferer

You can add class=cancel to any submit button to skip validation.

Jörn

On Sun, Mar 29, 2009 at 6:08 AM, jmarnold rncodep...@gmail.com wrote:

 I'm working on integrating the validate plugin with ASP.NET. I have
 the basic validation working just fine but I'm running into a few
 limitations of the plugin now with regards to ASP.NET's concept of
 CausesValdiation and ValidationGroup. I envision having some sort of
 grouping mechanism of rules by name. I think this goes beyond ASP.NET
 integration as it would allow for simple validation of sub-forms.
 Maybe something like:

 $('#myform').validate({
        rules: {
                        'SignUp' : {
                                firstname: {
                                        required:true,
                                        validationGroup: 'name'
                                }
                        }
        }
 });

 I'm not sure of the best way to trigger the validation of that rule
 set. Maybe there could be some sort of submission method through the
 validator that would handle that? (e.g.,
 ('#myform').submitThroughValidation('SignUp')).

 It would also be great to specify a selector for elements that can
 bypass validation. Perhaps something like:

 $('#myform').validate({
        skipValidation: '#cancelButton'
 });




[jQuery] Re: handler is undefined error

2009-03-30 Thread Macsig

Update:

looks like the issue is related to the function hover: if I change it
with click I don't get the error but I want to use hover instead click

Thanks for any help.

On Mar 30, 1:16 am, macsig sigbac...@gmail.com wrote:
 Hello guys,
 I'm trying to create an horizontal accordion using the code below:

 $(document).ready(function(){
     lastBlock = $(#a1);
     maxWidth = 210;
     minWidth = 75;

     $(.accordion_trigger).hover(function(){
         $(lastBlock).animate({width: minWidth+px}, { queue:false,
 duration:400 });
         $(this).animate({width: maxWidth+px}, { queue:false, duration:
 400});
         lastBlock = this;
       }
     );

 });

 with the following HTML:

 ul class=accordion
   li
     span id=a1 class=accordion_trigger
       img src=images/free_thumb.jpg /
       p
         strongFreebies/strongbr/
         Download free files to make your job easier.
       /p
     /span
   /li
   li
     span class=accordion_trigger
        img src=images/tut_thumb.jpg /
        p
          strongTutorials/strongbr/
          Tips and tricks to help you
          keep up with the latest technology.
        /p
     /span
   /li
   li
     span class=accordion_trigger
       img src=images/inspire_thumb.jpg /
       p
         strongInspiration/strongbr/
         Get inspired by what other designers are doing.
       /p
     /span
   /li
 /ul

 The effect works well but I get this error:

 handler is undefinedhttp://localhost:3000/javascripts/jquery.js?1236564794
 Line 25

 Any idea about the reason I get it?

 I'm using some other scripts and plug-ins. Can it be a conflict issue?

 Thanks and have a nice day


[jQuery] Re: Validation

2009-03-30 Thread Jörn Zaefferer

As the author, I recommend this plugin:
http://bassistance.de/jquery-plugins/jquery-plugin-validation/

You always have to write serverside validation. Clientside validation
must be entirely optional. Thats pretty much all there is.

Jörn

On Sun, Mar 29, 2009 at 4:05 PM, iceangel89 iceange...@gmail.com wrote:

 whats the best way/plugin for validation in jquery?

 just wondering whats the best practice for validation if user disables
 js?


[jQuery] .upload doesn't work on a mac??

2009-03-30 Thread 123gotoandplay

Hi all,

I am having problems with
//$('#upload_link').click(function() {alert(Upload clicked)});
$('#upload_link').upload({

when i use .upload it doesn't work with apple mac?? I doesn't open up
the folder/file browser

any tips, suggestions

grtz


[jQuery] ie6 and ie7 don't load image well when using Cycle plugin

2009-03-30 Thread mangajin

I found that using cycle plugin by http://jquery.malsup.com/cycle/ is
very nice while seeing the page with FF and the rest. However, ie6 and
ie7 sometime can't load the slide show well. To explain in details,
ie6 and 7 at the firsttime loading page can't load the image for my
website. However the second time i visit the same page with cycle
pluging embedded, it would work fine.

I don't know if someone experience the same problem. I am not sure if
it's about the size of image. Should i reduce it? or i should i move
the javascript code from the header to the body?

Thanks


[jQuery] Bugs in jquery-1.3.2-vsdoc2.js ajax events

2009-03-30 Thread hwiechers

Hi

These bugs are present in vsdoc version of jquery, jquery-1.3.2-
vsdoc2.js, not in jquery-1.3.2.js.

The ajax events (ajaxStart, ajaxError etc.) are broken.
When you try to call them you get  'f' is undefined.

Looking at the offending code...

//--
// [vsdoc] The following section has been denormalized from original
sources for IntelliSense.
// Attach a bunch of functions for handling common AJAX events
// jQuery.each
( ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend.split
(,), function(i,o){
//  jQuery.fn[o] = function(f){
//  return this.bind(o, f);
//  };
// });

jQuery.fn[ajaxStart] = function(callback) {
/// summary
/// Attach a function to be executed whenever an AJAX 
request begins
and there is none already active. This is an Ajax Event.
/// /summary
/// param name=callback type=FunctionThe function to 
execute./
param
/// returns type=jQuery /
return this.bind(ajaxStart, f);
};

//--

... the problem is that in
jQuery.fn[ajaxStart] = function(callback) {
the parameter was renamed from f to callback, but it wasn't renamed in
the method body.

Where can I log this bug?

I would open a new ticket for this on jquery.com, but I'm not sure if
the jquery team maintain the vsdoc stuff or if someone at Microsoft
does it.

Regards,
Henri Wiechers


[jQuery] slideToggle: IE vs. Firefox, etc.

2009-03-30 Thread Jerry

Hi all.

I'm an absolute newbie to jquery (as of about 5 hours or so), using
version 1.3.2., and haven't touched any code in about 5 years.

From the starterkit, I'm using the following code in a site I'm
working on:
 $(document).ready(function() {
   $('#faq').find('dd').hide().end().find('dt').click(function() {
 $(this).next().slideToggle();
   });
 });

Outside of changing the ID of the DIV, this is exactly what's in the
starterkit.  Here's a link:
http://eastsidewebservices.com/scripttest.html

Code executes fine.

On Firefox and Safari, text layout for revealed has all text indented
to the right.

On IE 7, the animation that reveals the text starts off the same as
FF, but then redoes the layout so all but the first line of text is
now left-aligned.  The first line only is still indented.

Playing with various CSS box attributes seems completely
ineffective.

Same behavior if I use toggle() instead of slideToggle() - it seems to
be an IE7 layout weirdness.

Suggestions for things to work correctly in IE?

Thanks!
Jerry




[jQuery] Re: ie6 and ie7 don't load image well when using Cycle plugin

2009-03-30 Thread Mike Alsup

 I found that using cycle plugin byhttp://jquery.malsup.com/cycle/is
 very nice while seeing the page with FF and the rest. However, ie6 and
 ie7 sometime can't load the slide show well. To explain in details,
 ie6 and 7 at the firsttime loading page can't load the image for my
 website. However the second time i visit the same page with cycle
 pluging embedded, it would work fine.

 I don't know if someone experience the same problem. I am not sure if
 it's about the size of image. Should i reduce it? or i should i move
 the javascript code from the header to the body?

 Thanks

That's not much info to go on.  What version of Cycle are you using?
Have you tried the latest?  Can you post a link to your  page?


[jQuery] Catch generic events

2009-03-30 Thread julio

Hi,

in my code I use typically something like this to catch events in DOM
elements:

$wnd.$(document).bind('click', function(event) {...}
$wnd.$(document).bind('mouseover', function(event) {...}
$wnd.$(document).bind('mouseout', function(event) {...}
etc.

is it possible instead catch a generic event and delegate externally
management?
For example:

$wnd.$(document).bind(function(type, event) {
// where type is a string for 'click' or 'mouseover', etc.
}

Thanks,
Julio


[jQuery] TreeView Appears as prepopulated

2009-03-30 Thread Coder555

Hi falks

I'm using jquery treeview plug in.

I'm using cookie based persistence.

My problem is that when I reload the page , the treeview appears as
expanded rather than collapsed.

So what could be the work around for this?

Please Help


[jQuery] Re: Catch generic events

2009-03-30 Thread Eric Garside

Nope. You have to specify the type of event you want to bind.

On Mar 30, 8:04 am, julio antongiuli...@gmail.com wrote:
 Hi,

 in my code I use typically something like this to catch events in DOM
 elements:

 $wnd.$(document).bind('click', function(event) {...}
 $wnd.$(document).bind('mouseover', function(event) {...}
 $wnd.$(document).bind('mouseout', function(event) {...}
 etc.

 is it possible instead catch a generic event and delegate externally
 management?
 For example:

 $wnd.$(document).bind(function(type, event) {
 // where type is a string for 'click' or 'mouseover', etc.

 }

 Thanks,
 Julio


[jQuery] Re: .upload doesn't work on a mac??

2009-03-30 Thread 123gotoandplay

oh forgot to mention it's the upload plugin from 
http://www.michaelmitchell.co.nz



On Mar 30, 11:14 am, 123gotoandplay wesweatyous...@gmail.com wrote:
 Hi all,

 I am having problems with
 //$('#upload_link').click(function() {alert(Upload clicked)});
 $('#upload_link').upload({

 when i use .upload it doesn't work with apple mac?? I doesn't open up
 the folder/file browser

 any tips, suggestions

 grtz


[jQuery] Download problem UI 1.7.1

2009-03-30 Thread mick

Hi

I'm trying to download a theme in jquery ui 1.7.1. version. The
downloaded file is broken due to a fault in the path (in the
developement directory)
Anyone got this problem?

Michael



[jQuery] Re: handler is undefined error

2009-03-30 Thread Eric Garside

Could you give a bit more information? I'm not exactly understanding
what your issue is.

On Mar 30, 4:38 am, Macsig sigbac...@gmail.com wrote:
 Update:

 looks like the issue is related to the function hover: if I change it
 with click I don't get the error but I want to use hover instead click

 Thanks for any help.

 On Mar 30, 1:16 am, macsig sigbac...@gmail.com wrote:

  Hello guys,
  I'm trying to create an horizontal accordion using the code below:

  $(document).ready(function(){
      lastBlock = $(#a1);
      maxWidth = 210;
      minWidth = 75;

      $(.accordion_trigger).hover(function(){
          $(lastBlock).animate({width: minWidth+px}, { queue:false,
  duration:400 });
          $(this).animate({width: maxWidth+px}, { queue:false, duration:
  400});
          lastBlock = this;
        }
      );

  });

  with the following HTML:

  ul class=accordion
    li
      span id=a1 class=accordion_trigger
        img src=images/free_thumb.jpg /
        p
          strongFreebies/strongbr/
          Download free files to make your job easier.
        /p
      /span
    /li
    li
      span class=accordion_trigger
         img src=images/tut_thumb.jpg /
         p
           strongTutorials/strongbr/
           Tips and tricks to help you
           keep up with the latest technology.
         /p
      /span
    /li
    li
      span class=accordion_trigger
        img src=images/inspire_thumb.jpg /
        p
          strongInspiration/strongbr/
          Get inspired by what other designers are doing.
        /p
      /span
    /li
  /ul

  The effect works well but I get this error:

  handler is undefinedhttp://localhost:3000/javascripts/jquery.js?1236564794
  Line 25

  Any idea about the reason I get it?

  I'm using some other scripts and plug-ins. Can it be a conflict issue?

  Thanks and have a nice day


[jQuery] a keydown problem? :)

2009-03-30 Thread liec

$(window).keydown(function(e){
if (e.keyCode == 13)
sendmsg();
});

It works well on firefox and chrome
but It is not work on IE7.0 ?


[jQuery] Re: Download problem UI 1.7.1

2009-03-30 Thread MorningZ

There's a dedicated group for the UI stuff

http://groups.google.com/group/jquery-ui?hl=en



On Mar 30, 3:06 am, mick michaelsperbe...@gmail.com wrote:
 Hi

 I'm trying to download a theme in jquery ui 1.7.1. version. The
 downloaded file is broken due to a fault in the path (in the
 developement directory)
 Anyone got this problem?

 Michael


[jQuery] Re: ie6 and ie7 don't load image well when using Cycle plugin

2009-03-30 Thread johan . borestad

I can only guess that you've set the loop-delay too soon, and don't
control if the image have been loaded. That would explain why it looks
better the next time you arrive, since the image will be in the
browsercache.

There's a couple of ways to go around this:
1) Load the cycle plugin onload instead onDomReady
2) Set a generic initial delay of the script (like 10 seconds)
3) Check if  the image have been downloaded before you initialize the
plugin

On 30 Mar, 12:48, mangajin sushisupers...@gmail.com wrote:
 I found that using cycle plugin byhttp://jquery.malsup.com/cycle/is
 very nice while seeing the page with FF and the rest. However, ie6 and
 ie7 sometime can't load the slide show well. To explain in details,
 ie6 and 7 at the firsttime loading page can't load the image for my
 website. However the second time i visit the same page with cycle
 pluging embedded, it would work fine.

 I don't know if someone experience the same problem. I am not sure if
 it's about the size of image. Should i reduce it? or i should i move
 the javascript code from the header to the body?

 Thanks


[jQuery] Re: a keydown problem? :)

2009-03-30 Thread ryan.j

i've lifted this from something i wrote t'other day which was working
in ie7...

$(document).keypress(function(e){
var key;
if (!e)
e = window.event
if ((!e.charCode)|(e.charCode == 0)) {
key = e.keyCode
} else {
key = e.charCode
}

/* put stuff here! */

});

give it a go. it has lots of magical little quirks which can make
keypress/down/up stuff a royal pain in the arse.

a good reference (which may not be much use to your issue) is
http://www.quirksmode.org/js/keys.html

On Mar 30, 8:45 am, liec lie...@gmail.com wrote:
 $(window).keydown(function(e){
         if (e.keyCode == 13)
                 sendmsg();

 });

 It works well on firefox and chrome
 but It is not work on IE7.0 ?


[jQuery] Re: a keydown problem? :)

2009-03-30 Thread ryan.j

IE also had issues with $(window) over $(document) but i can't
remember exactly what the problem was.

On Mar 30, 2:33 pm, ryan.j ryan.joyce...@googlemail.com wrote:
 i've lifted this from something i wrote t'other day which was working
 in ie7...

         $(document).keypress(function(e){
                 var key;
                 if (!e)
                         e = window.event
                 if ((!e.charCode)|(e.charCode == 0)) {
                         key = e.keyCode
                 } else {
                         key = e.charCode
                 }

                 /* put stuff here! */

         });

 give it a go. it has lots of magical little quirks which can make
 keypress/down/up stuff a royal pain in the arse.

 a good reference (which may not be much use to your issue) 
 ishttp://www.quirksmode.org/js/keys.html

 On Mar 30, 8:45 am, liec lie...@gmail.com wrote:

  $(window).keydown(function(e){
          if (e.keyCode == 13)
                  sendmsg();

  });

  It works well on firefox and chrome
  but It is not work on IE7.0 ?


[jQuery] Re: Images shrinking?!?!

2009-03-30 Thread johan . borestad

1) Your site doesn't validate correct
2) You're using very large images, around 450kb on frontpage =
causing slowdowns, especially in IE
3) Set an correct hardcoded height/width on the images, either in the
tag directly or width CSS.
4) You seems to be using some kind of filter on the footer images. I
found http://www.bonsaibranding.com/riverstone/blank.gif; as a
background. Is this some kind of copyprotection you're using. That
could also potentially be a problem.

Johan




Jen skrev:
 Hi there,

 I have a couple of image slideshows on my site and in IE occasionally
 the images appear shrunk down like thumbnails instead of full size.
 Any ideas why that might happen and what i could do to stop it?

 http://www.bonsaibranding.com/riverstone/home.html

 Thanks
 Jen


[jQuery] AJAX - ignore mime type

2009-03-30 Thread the_woodsman

Hi,

My ajax requests return xml, with the corresponding mime type.

I'm using $.get, as so:

$.get(
$(this).attr('href'),
function(data, textStatus)
{

$('#requestArea').val(data);
},
'html' //type, correct?
);

$('#requestArea').val(data) sets a text area to say [object
XMLDocument]

So it seems my setting the type to html does nothing!

I've played around with this a bit, including using other ajax methods
apart from .get(), with the same results.

Am I missing something here?

Thanks in advance!



[jQuery] Re: Counting Divs (IE6)

2009-03-30 Thread johan . borestad

Does your entire page validate? No mysterious unclosed divs somewhere?

Johan


On 29 Mar, 18:16, lardlad chris.mloa...@gmail.com wrote:
 I am having a problem counting the number of divs inside a container,

         var cellCount = $(#cellCont).children().length;

 cellCount is coming up undefined in IE6. Any idea why?

 here's the html:

 div class=block id=cellCont
         div class=cell id=cellFirst?php include('design/print/
 brochures.php'); ?/div
         div class=cell?php include('design/print/catalog.php'); ?/
 div
         div class=cell?php include('design/print/annual_reports.php'); 
 ?/div

         div class=cell?php include('design/print/magazines.php'); ?/
 div
         div class=cell?php include('design/print/direct_mail.php'); ?/
 div
         div class=cell?php include('design/print/newsletters.php'); ?/
 div
         div class=cell?php include('design/print/
 product_services.php'); ?/div
 /div


[jQuery] How to wait for getJSON to complete before continue?

2009-03-30 Thread iceangel89

can i want for getJSON to complete before excecuting code? cos i am
validating my input. and i need some values from server 1st. so apart
from putting all code that is to be executed after getJSON() inside

.getJSON(url, function(json) {
   // *** here ***
});

can i have it outside?

and how can i access the json object outside the

.getJSON(url, function(json) {});

function?


[jQuery] Re: jqmodal Ajax issue

2009-03-30 Thread Tad

OK, I've tried the onShow and no dice. I keep getting errors that are
more of an issue than the ones I'm trying to avoid.
So for now I'm just going to have to live with it as is and try to
make sure no one uses those links with my .pop-up class.
Thanks for your input Alexandre.


On Mar 25, 2:55 pm, Alexandre Plennevaux aplennev...@gmail.com
wrote:
 1/ i would make sure the div exist before initalising the jqModal, so  add
 the jqm initialisation to your createDiv function or through a callback
 executed when the createDiv is done.2/ for your specific question: your
 check is incorrect. The good use would be to use jqmodal onShow() callback
 and check at that moment whether the link is valid or not.

 onshow:function(hash){
 if (hash.t.attr('href') ==='#' || hash.t.attr('href') ===''){
 return false;}

 // otherwise, launch the popup
 hash.w.css('opacity',0.88).show();

 }

 from the doc:

   Each callback is passed the jqModal hash for a window. Relevant
 hash properties are;

         ---
         w: (jQuery object) The window element. e.g. '#example' in the sample 
 above
         c: (object) The config object (holds passed+default parameters)
         o: (jQuery object) The overlay
         t: (DOM object) The triggering element

   NOTE; If you supply a onHide callback, you MUST execute hash.o.remove(); 
 to
     remove the overlay. You should also hide the window via hash.w.hide();, or
     with a special effect.

   NOTE; If you supply a onShow callback, you should make the dialog visible
     via hash.w.show();, or with a special effect.

   NOTE; onLoad callbacks are ONLY executed if the ajax parameter was passed.
     onLoad is called after the ajax response. As with $.load(), the this
     scope is a reference to the ajax target as a DOM element.

 On Wed, Mar 25, 2009 at 6:13 PM, Tad tad.ni...@gmail.com wrote:

  Hello,
  I'm new to jquery and jqmodal. I have a script that runs fine except
  when the URL (href) of the anchor tag is Blank or #. so what I want
  to do is check for that possibility and stop the Jqmodal from acting
  or put up an error message, without my page being messed up. I've
  tried to use callbacks, but get an error that the hash is not defined.
  I tried to use the click event of the anchor, but the Jqmodal would
  load the content but only show it after clicking another anchor tag or
  clicking the same one again. the goal here is to have a default pop Up
  jqmodal that checks the link it is given and doesn't use it if it will
  cause an error.

  ~~ code that works but doesn't check href of anchor~~
  $(function(){
  /* init pop-up/overlay */
     popUp.init();
  });
  /* pop-up/overlay Functionality */
  var popUp = {
     init: function(){
         var link = $(a.popup);
         if(link.length = 0)
             return false;
         popUp.createDiv();

         $('div#popup-wraper').jqm({
            trigger: $(a.popup),
            closeClass: 'close',
            toTop: true,
            ajax: '@href',
            target: $(div#popup-wraper div#popup),
            ajaxText: (loading...),
            cache: false
         })
     },
     createDiv: function(){
         var strJq = div id='popup-wraper' class='jqmWindow';
         strJq +=  div id='overlay-utility';
         strJq +=   a class='close' href='#'Close/a;
         strJq +=  /div;
         strJq +=  div id='popup';
         strJq +=  /div;
         strJq += /div;
         $(body).append(strJq);
     }

  }

  /* pop-up/overlay Functionality END */
  ~~ end code ~~


[jQuery] Re: How to wait for getJSON to complete before continue?

2009-03-30 Thread Joseph Le Brech

.getJSON(url, function_name(json) {});

 

 

/* elsewhere */

function function_name(json){

 

 

}

_
View your Twitter and Flickr updates from one place – Learn more!
http://clk.atdmt.com/UKM/go/137984870/direct/01/

[jQuery] Re: How to wait for getJSON to complete before continue?

2009-03-30 Thread ryan.j

could you assign the data object to a global variable with the
callback event?

On Mar 30, 2:44 pm, iceangel89 iceange...@gmail.com wrote:
 can i want for getJSON to complete before excecuting code? cos i am
 validating my input. and i need some values from server 1st. so apart
 from putting all code that is to be executed after getJSON() inside

 .getJSON(url, function(json) {
    // *** here ***

 });

 can i have it outside?

 and how can i access the json object outside the

 .getJSON(url, function(json) {});

 function?


[jQuery] Re: How to wait for getJSON to complete before continue?

2009-03-30 Thread Martijn Houtman


On Mar 30, 2009, at 3:53 PM, ryan.j wrote:


could you assign the data object to a global variable with the
callback event?


And how would you synchronize that? I'd go for Joseph's suggestion.

Regards,
--
Martijn.

[jQuery] Re: How to wait for getJSON to complete before continue?

2009-03-30 Thread ryan.j

heh you're too quick for me!

i realized that wasn't what he was asking about 3 seconds after
hitting send :|

On Mar 30, 2:55 pm, Martijn Houtman martijn.hout...@gmail.com wrote:
 On Mar 30, 2009, at 3:53 PM, ryan.j wrote:

  could you assign the data object to a global variable with the
  callback event?

 And how would you synchronize that? I'd go for Joseph's suggestion.

 Regards,
 --
 Martijn.


[jQuery] Re: How to wait for getJSON to complete before continue?

2009-03-30 Thread Joseph Le Brech

get rid of the curly braces at the end of the delegate call also :)

 

i accidentally left them in.
 


From: martijn.hout...@gmail.com
Subject: [jQuery] Re: How to wait for getJSON to complete before continue?
Date: Mon, 30 Mar 2009 15:55:40 +0200
To: jquery-en@googlegroups.com




On Mar 30, 2009, at 3:53 PM, ryan.j wrote:

could you assign the data object to a global variable with the

callback event?


And how would you synchronize that? I'd go for Joseph's suggestion.


Regards,
-- 
Martijn.
_
 25GB of FREE Online Storage – Find out more
http://clk.atdmt.com/UKM/go/134665320/direct/01/

[jQuery] How to access variable outside function

2009-03-30 Thread iceangel89

i sometimes do something like

var i;
$.getJSON(url, function (json) {
   // update i
   i = json.var;
});

how can i access the updated i outside the function(json)...?



[jQuery] Re: How to wait for getJSON to complete before continue?

2009-03-30 Thread iceangel89

hmm... is there a diff bet

.getJSON(url, function_name);

function function_name(json) {

}

and

getJSON(url, function(json){ ... });

On Mar 30, 10:05 pm, Joseph Le Brech jlebr...@hotmail.com wrote:
 get rid of the curly braces at the end of the delegate call also :)

 i accidentally left them in.

 From: martijn.hout...@gmail.com
 Subject: [jQuery] Re: How to wait for getJSON to complete before continue?
 Date: Mon, 30 Mar 2009 15:55:40 +0200
 To: jquery-en@googlegroups.com

 On Mar 30, 2009, at 3:53 PM, ryan.j wrote:

 could you assign the data object to a global variable with the

 callback event?

 And how would you synchronize that? I'd go for Joseph's suggestion.

 Regards,
 --
 Martijn.
 _
  25GB of FREE Online Storage – Find out 
 morehttp://clk.atdmt.com/UKM/go/134665320/direct/01/


[jQuery] Re: How to access variable outside function

2009-03-30 Thread iceangel89

can i do this at all? i think maybe becos getJSON will be async, i
wont be able to do this?

btw, background is i am doing some validation. within this validation
i need to get some value from server

so i did

function validate() {
   var validated = true;

   // some validation
   ...

   // get value from server
   $.getJSON(url, function(json) {
  if (...) {
 validated = false;
  }
   });
}

On Mar 30, 10:09 pm, iceangel89 iceange...@gmail.com wrote:
 i sometimes do something like

 var i;
 $.getJSON(url, function (json) {
    // update i
    i = json.var;

 });

 how can i access the updated i outside the function(json)...?


[jQuery] Re: How to wait for getJSON to complete before continue?

2009-03-30 Thread Joseph Le Brech

the first *might* use an extra cycle of processor but the reusability and 
readability of the code is key. 

 

the second is an anonymous function, it's not reusable as theres only one entry 
point.

 

if what you are doing is a never-to-be-used again one liner go for the second 
option, but personality i like my opening and closing braces to not be further 
apart than one screenful for readability. I now split everything i do into 
components.
 
 Date: Mon, 30 Mar 2009 07:16:13 -0700
 Subject: [jQuery] Re: How to wait for getJSON to complete before continue?
 From: iceange...@gmail.com
 To: jquery-en@googlegroups.com
 
 
 hmm... is there a diff bet
 
 .getJSON(url, function_name);
 
 function function_name(json) {
 
 }
 
 and
 
 getJSON(url, function(json){ ... });
 
 On Mar 30, 10:05 pm, Joseph Le Brech jlebr...@hotmail.com wrote:
  get rid of the curly braces at the end of the delegate call also :)
 
  i accidentally left them in.
 
  From: martijn.hout...@gmail.com
  Subject: [jQuery] Re: How to wait for getJSON to complete before continue?
  Date: Mon, 30 Mar 2009 15:55:40 +0200
  To: jquery-en@googlegroups.com
 
  On Mar 30, 2009, at 3:53 PM, ryan.j wrote:
 
  could you assign the data object to a global variable with the
 
  callback event?
 
  And how would you synchronize that? I'd go for Joseph's suggestion.
 
  Regards,
  --
  Martijn.
  _
   25GB of FREE Online Storage – Find out 
  morehttp://clk.atdmt.com/UKM/go/134665320/direct/01/

_
View your Twitter and Flickr updates from one place – Learn more!
http://clk.atdmt.com/UKM/go/137984870/direct/01/

[jQuery] Re: How to wait for getJSON to complete before continue?

2009-03-30 Thread Martijn Houtman


On Mar 30, 2009, at 4:16 PM, iceangel89 wrote:


hmm... is there a diff bet

.getJSON(url, function_name);

function function_name(json) {

}

and

getJSON(url, function(json){ ... });


Well,

$.getJSON(url, function_name);

function function_name(json) { ... };

and

$.getJSON(url, function(json) { ... });

have the same effect (the first is a named function while the latter  
is an anonymous function). Note what Joseph says about the curly  
braces: they need to be removed.


Regards,
--
Martijn.

[jQuery] Re: How to access variable outside function

2009-03-30 Thread Martijn Houtman


On Mar 30, 2009, at 4:20 PM, iceangel89 wrote:


can i do this at all? i think maybe becos getJSON will be async, i
wont be able to do this?

btw, background is i am doing some validation. within this validation
i need to get some value from server

so i did

function validate() {
   var validated = true;

   // some validation
   ...

   // get value from server
   $.getJSON(url, function(json) {
  if (...) {
 validated = false;
  }
   });
}


This example will not work, unless you set the ajax option 'async' to  
false (which I would not recommend, because it locks the browser).  
It's because the function validate() returns right after the getJSON  
function, because the latter is asynchronous. But you already figured  
that out.


These sort of things are best done passing callbacks to the getJSON  
function, as the previous examples show.


Regards,
--
Martijn.

[jQuery] Enable a disabled button by id

2009-03-30 Thread Thierry

I can disable button with specific id with the following code:

jQuery(#click_me:button).attr(disabled, true);

If I want to re-enable the button, the following doesn't work:

jQuery(#click_me:button).attr(disabled, false);

Does anyone know what I'm missing?


[jQuery] Re: jQuery and !important

2009-03-30 Thread segarva

Hi Martinjn,

in my CSS file I have:

*{
background-color:#ff!important;
}

.destacado{
background-color:green!important;
}

and, in my jQuery code:

$(a).click(function(){
$(p:last).addClass(destacado);
}

and it's working fine! the last paragraph is converted to green using !
important and  addClass method.

try it.

regards
sebastian




On 27 mar, 14:36, Martijn Houtman martijn.hout...@gmail.com wrote:
 Hello,

 I know I should actually avoid using !important, but nonetheless I'd  
 like to set it using jQuery's css(), but it seems to ignore setting  
 this property completely. Anyone knows if this is supposed to work or  
 why it does not?

 Regards,
 --
 Martijn.


[jQuery] Re: Enable a disabled button by id

2009-03-30 Thread Martijn Houtman


On Mar 30, 2009, at 4:44 PM, Thierry wrote:


jQuery(#click_me:button).attr(disabled, false);


jQuery(#click_me:button).removeAttr(disabled);

Regards,
--
Martijn.

[jQuery] Re: Enable a disabled button by id

2009-03-30 Thread Leonardo K
Shoud be:

jQuery(#click_me:button).attr(disabled, disabled);

and to re-enable

jQuery(#click_me:button).removeAttr(disabled);

On Mon, Mar 30, 2009 at 11:44, Thierry lamthie...@gmail.com wrote:


 I can disable button with specific id with the following code:

 jQuery(#click_me:button).attr(disabled, true);

 If I want to re-enable the button, the following doesn't work:

 jQuery(#click_me:button).attr(disabled, false);

 Does anyone know what I'm missing?


[jQuery] Re: jQuery and !important

2009-03-30 Thread Martijn Houtman

Hey Sebastian,

On Mar 30, 2009, at 4:49 PM, segarva wrote:


in my CSS file I have:

*{
background-color:#ff!important;
}

.destacado{
background-color:green!important;
}

and, in my jQuery code:

$(a).click(function(){
$(p:last).addClass(destacado);
}

and it's working fine! the last paragraph is converted to green  
using !

important and  addClass method.



Thanks, it is indeed a nicer solution to use classes, rather than  
directly setting CSS properties. However, in my case it's a special  
CSS setting per element, so I would have to define lots of classes in  
order to support many elements (i.e. it will be limited to the amount  
of classes I pre-define. In this case it will not really help.


Thanks for the suggestion anyways!

Regards,
--
Martijn.




[jQuery] [beginner] passing variables to a Jquery function

2009-03-30 Thread Peter Van Dijck
Hi all,I couldn't find a good answer to this, although it has probably been
answered before, apologies!

I have a link
a id=doit href=/bla/something.php?id=123type=456do it/a

And some jQuery code

$(#doit).click(function(){ // upon click
$.get(this.href); // call the URL
$('#doit').replaceWith(I've been there (a
href=/bla/something.undo.php?id=123type=456'undo/a));
return false;
 });

My problem is that I want to populate the URL that's in replaceWith with
the correct id, depending on the id that was in the original link. I've
thought of using a fake attribute in the link somehow (a type=456
id=doit), but I can't seem to get it to work, and I'm not sure this is the
right approach...

What would be the jquery-like best way to do this?

Thanks!
Peter

-- 
me: http://petervandijck.com
blog: http://poorbuthappy.com/ease/
global UX consulting: http://290s.com
free travel guides: http://poorbuthappy.com
Belgium: (+32) 03/325 88 70
Skype id: peterkevandijck


[jQuery] Dynamic Form - Best practice

2009-03-30 Thread Kreeves

There is plenty of discussion on Dynamic form validation in this
group, but my question is of a slightly different nature.

I'm attempting to create a page that will build the form based on user
input.  IE: User is prompted with one search box with several
options.  They can then hit an Add search and be allowed another
search box to further narrow down their search results. (The web-app
is a report utility).

I've looked around for websites that do this in an attempt to get an
idea of what might be the best way of pulling it off.  One website I
ran across did it like so...

script type=text/javascript
// only for demo purposes
$.validator.setDefaults({
submitHandler: function() {
alert(submitted!);
}
});
$.validator.messages.max = jQuery.format(Your totals musn't exceed
{0}!);

$.validator.addMethod(quantity, function(value, element) {
return !this.optional(element)  !this.optional($(element).parent
().prev().children(select)[0]);
}, Please select both the item and its amount.);

$().ready(function() {
$(#orderform).validate({
errorPlacement: function(error, element) {
error.appendTo( element.parent().next() );
},
highlight: function(element, errorClass) {
$(element).addClass(errorClass).parent().prev().children
(select).addClass(errorClass);
}
});

var template = jQuery.format($(#template).val());
function addRow() {
$(template(i++)).appendTo(#orderitems tbody);
}

var i = 1;
// start with one row
addRow();
// add more rows on click
$(#add).click(addRow);

// check keyup on quantity inputs to update totals field
$(#orderform).delegate(keyup, input.quantity, function(event) {
var totals = 0;
$(#orderitems input.quantity).each(function() {
totals += +this.value;
});
$(#totals).attr(value, totals).valid();
});

});
/script

They then wrap the search fields in a textarea and label it a
template.  Note the line ABOVE that reads var template =
jQuery.format

textarea style=display:none id=template
tr
td
label{0}. Item/label
/td
td class='type'
select name=item-type-{0}
option value=Select.../option
option value=0Learning jQuery/option
option value=1jQuery Reference 
Guide/option
option value=2jQuery Cookbook/option
option vlaue=3jQuery In Action/option
option value=4jQuery For Designers/option
/select
/td
td class='quantity'
input size='4' class=quantity min=1 
id=item-quantity-{0}
name=item-quantity-{0} /
/td
td class='quantity-error'/td
/tr
/textarea

The original page is at 
http://jquery.bassistance.de/validate/demo/dynamic-totals.html.

Is this best practice?  Is there a different way to do this?  It
really just seems like a hacked up way to do it.

Thanks.


[jQuery] Re: Enable a disabled button by id

2009-03-30 Thread Jonathan Vanherpe (T T NV)

Thierry wrote:
 I can disable button with specific id with the following code:
 
 jQuery(#click_me:button).attr(disabled, true);
 
 If I want to re-enable the button, the following doesn't work:
 
 jQuery(#click_me:button).attr(disabled, false);
 
 Does anyone know what I'm missing?
 

I think you need to use removeAttribute('disabled'). Browsers check for 
the attribute's existence, and not for the value (which should be 
technically be 'disabled', btw )

Jonathan
-- 
Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be


[jQuery] Error in IE8

2009-03-30 Thread Schockwelle

Hi,

I use blockui on my website www.rbl-check.com and i have an error in
the internet explorer 8.

Row: 227
Sign: 17
Code: 0
URI: http://www.rbl-check.com/ajax/jquery.blockui.js

In e.g. Firefox blockui works fine... Can anybody help me?

Best regards from Germany



[jQuery] Catching document.forms['formid'].submit() with jquery validator

2009-03-30 Thread Yeuker

For those of you who frequent the jqueryhelp.com pages, forgive my
question here as well.

I am using the excellent jquery validation plugin found here:

http://docs.jquery.com/Plugins/Validation

It works incredibly well and am very happy with it (thanks).  My
problem is that sometimes my forms are submitted via document.forms
['formid'].submit().  I have no control over this statement as it is
generated for me by jsf when it is rendering the element, which in my
case is an anchor.

Because it is getting submitted via document.forms['formid'].submit(),
the jquery validation plugin does not catch this submit, therefor does
not validate, therefor submits the form when it shouldn't.  I've been
stuck here for quite some time and could really use some help on how
to get jquery to validate when a form is submitted this way.  Any help
would be greatly, greatly appreciated.

I have posted some code below that shows that the submit handler does
not catch the javascript submit.


form name=aform id=aform
   input type=submit /br/
   a href=# onclick=$('#aform').submit();submit with jquery/
abr/
   a href=# onclick=document.forms['aform'].submit();submit with
old js/a
/form

script type=text/javascript

   $(document).ready(function(){
  $(#aform).submit(
 function(){ alert(Submitted); });
   });
/script

Thanks so much,

Yeuker



[jQuery] Re: How to access variable outside function

2009-03-30 Thread Joseph Le Brech

because you are updating i asyncronously it will be overwritten asynconously.

 

what you could do is add your purged data to an array, and read that array 
elsewhere in a loop.
 
 Date: Mon, 30 Mar 2009 07:20:21 -0700
 Subject: [jQuery] Re: How to access variable outside function
 From: iceange...@gmail.com
 To: jquery-en@googlegroups.com
 
 
 can i do this at all? i think maybe becos getJSON will be async, i
 wont be able to do this?
 
 btw, background is i am doing some validation. within this validation
 i need to get some value from server
 
 so i did
 
 function validate() {
 var validated = true;
 
 // some validation
 ...
 
 // get value from server
 $.getJSON(url, function(json) {
 if (...) {
 validated = false;
 }
 });
 }
 
 On Mar 30, 10:09 pm, iceangel89 iceange...@gmail.com wrote:
  i sometimes do something like
 
  var i;
  $.getJSON(url, function (json) {
 // update i
 i = json.var;
 
  });
 
  how can i access the updated i outside the function(json)...?

_
View your Twitter and Flickr updates from one place – Learn more!
http://clk.atdmt.com/UKM/go/137984870/direct/01/

[jQuery] Re: How to load redirected content in dialog?

2009-03-30 Thread Adam

Anyone?

On Mar 27, 4:39 pm, Adam apcau...@gmail.com wrote:
 I have some content that loads in a dialog popup via ajax.  For some
 reason when the URL redirects (i.e. 301, 302, etc.), the content never
 loads in the dialog.  Is this normal behavior for ajax, or should the
 redirected content load?

 Thanks.

 a href=url_that_redirects class=myDialogdo something/a

 $(.myDialog).click(function() {
     $(this).openDialog();

 });

 $.fn.openDialog = function () {
                 var url = $(this).attr(href);
                 popup = $(this).dialog();
                 $.ajax(
                         {
                                 url: url,
                                 success: function(message) {
                                         popup.html(message);
                                 },
                                 error: function() {
                                         popup.html(div 
 class='portlet-msg-error'The content could not
 be loaded./div);
                                 },
                                 timeout: 2
                         }
                 );

                 return this;
          };


[jQuery] Re: tooltip container flowing off page in Safari 4, not resizing as should

2009-03-30 Thread roryreiff

Does anyone know if this can be easily addressed? It is Safari 4 Mac,
to be precise.

Thanks,



On Mar 10, 8:52 am, roryreiff roryre...@gmail.com wrote:
 Hi there,

 In my implementation of the tooltip plugin, I have notice that in
 Safari 4 the tooltip does not resize when the cursor moves against the
 window. That is, I have track set to true as default, so initially the
 tooltip formats so that it does not overflow over the side of the
 window, but then as the mouse moves it will maintain the same height
 and width, forcing a scrollbar when moused over in the direction of
 the window. Im not sure if this is just a little bug that needs to be
 fixed for the plugin, or something wrong with my implementation.

 Here is the page in question. Hover over the image in the article body
 (in Safari 4) to see what I mean.http://www.pomona.edu/dev/web44.asp

 Thanks,


[jQuery] Re: HELP: a = $('pfoo/ppbar/p'); a.after('bxyz/b') not adding element

2009-03-30 Thread stephen

Thanks (late) to everybody for answering.Saw your posts just now. I
overlooked that line in the documentation...RTFM to me! Sorry about
that.

However, do you know if there is another way to achieve the same
result, without inserting the nodes in the DOM first?

By chance, i've found the add() method to push more nodes inside a
jquery object. Is this the right way to do it?

a = $('pfoo/ppbar/p'); a.add('bxyz/b') -- is a equivalent
to $('pfoo/ppbar/pbxyz/b') ?

Stephen

On Feb 27, 3:48 am, mkmanning michaell...@gmail.com wrote:
 Sorry for not being clearer; that's what comes from posting at 3 in
 the morning :P
 I was going on the post's title, attempting to use .after(). As
 Ricardo says, append/appendTo, prepend/prependTo work on newly created
 nodes, but after/insertAfter, and before/insertBefore require that the
 nodes be a part of the DOM.

 Check out the docs, specifically the entries for the different
 methods, as they will tell you this and save you having to wait for
 responses in the forum :)

 http://docs.jquery.com/Manipulation



[jQuery] Re: tooltip container flowing off page in Safari 4, not resizing as should

2009-03-30 Thread roryreiff

Does anyone know if this can be easily addressed? It is Safari 4 Mac,
to be precise.

Thanks,



On Mar 10, 8:52 am, roryreiff roryre...@gmail.com wrote:
 Hi there,

 In my implementation of the tooltip plugin, I have notice that in
 Safari 4 the tooltip does not resize when the cursor moves against the
 window. That is, I have track set to true as default, so initially the
 tooltip formats so that it does not overflow over the side of the
 window, but then as the mouse moves it will maintain the same height
 and width, forcing a scrollbar when moused over in the direction of
 the window. Im not sure if this is just a little bug that needs to be
 fixed for the plugin, or something wrong with my implementation.

 Here is the page in question. Hover over the image in the article body
 (in Safari 4) to see what I mean.http://www.pomona.edu/dev/web44.asp

 Thanks,


[jQuery] Re: HELP: a = $('pfoo/ppbar/p'); a.after('bxyz/b') not adding element

2009-03-30 Thread Joseph Le Brech

do not underestimate the power of $()
 
 Date: Mon, 30 Mar 2009 08:36:48 -0700
 Subject: [jQuery] Re: HELP: a = $('pfoo/ppbar/p'); 
 a.after('bxyz/b') not adding element
 From: stephen.cant...@gmail.com
 To: jquery-en@googlegroups.com
 
 
 Thanks (late) to everybody for answering.Saw your posts just now. I
 overlooked that line in the documentation...RTFM to me! Sorry about
 that.
 
 However, do you know if there is another way to achieve the same
 result, without inserting the nodes in the DOM first?
 
 By chance, i've found the add() method to push more nodes inside a
 jquery object. Is this the right way to do it?
 
 a = $('pfoo/ppbar/p'); a.add('bxyz/b') -- is a equivalent
 to $('pfoo/ppbar/pbxyz/b') ?
 
 Stephen
 
 On Feb 27, 3:48 am, mkmanning michaell...@gmail.com wrote:
  Sorry for not being clearer; that's what comes from posting at 3 in
  the morning :P
  I was going on the post's title, attempting to use .after(). As
  Ricardo says, append/appendTo, prepend/prependTo work on newly created
  nodes, but after/insertAfter, and before/insertBefore require that the
  nodes be a part of the DOM.
 
  Check out the docs, specifically the entries for the different
  methods, as they will tell you this and save you having to wait for
  responses in the forum :)
 
  http://docs.jquery.com/Manipulation
 

_
Free photo editing software from Windows Live . Try it now! 
http://clk.atdmt.com/UKM/go/134665240/direct/01/

[jQuery] Re: ie6 and ie7 don't load image well when using Cycle plugin

2009-03-30 Thread joy

Hi Johan,

Thanks a lot for your reply. It's true that i should move the code for
cycle plugin to onload instead of Dom ready.
I did test with window.onload = functionA;

However the problem is the png transparency that use my other jquery
script won't load if i use window.onload =functionA;
Are there any other way to put the cycle function to onload but not
using window.onload.?

Thanks





On Mar 30, 3:24 pm, johan.bores...@gmail.com wrote:
 I can only guess that you've set the loop-delay too soon, and don't
 control if the image have been loaded. That would explain why it looks
 better the next time you arrive, since the image will be in the
 browsercache.

 There's a couple of ways to go around this:
 1) Load the cycle plugin onload instead onDomReady
 2) Set a generic initial delay of the script (like 10 seconds)
 3) Check if  the image have been downloaded before you initialize the
 plugin

 On 30 Mar, 12:48, mangajin sushisupers...@gmail.com wrote:

  I found that using cycle plugin byhttp://jquery.malsup.com/cycle/is
  very nice while seeing the page with FF and the rest. However, ie6 and
  ie7 sometime can't load the slide show well. To explain in details,
  ie6 and 7 at the firsttime loading page can't load the image for my
  website. However the second time i visit the same page with cycle
  pluging embedded, it would work fine.

  I don't know if someone experience the same problem. I am not sure if
  it's about the size of image. Should i reduce it? or i should i move
  the javascript code from the header to the body?

  Thanks


[jQuery] Passing parameters to XSLT's

2009-03-30 Thread moocher

Hi,
I'm writing some JQuery that uses the google plugin (http://
www.jongma.org/webtools/jquery/xslt/#demo) to call an xslt. This works
great except that I need to somehow pass parameters to the xslt. I've
read through the documentation and there is no mention that this can
be done. Does anyone know if it is even possible, or suggest a
different plugin that does support it?

This is my code:

$('#myResults).xslt({ xml: xmlData, xslUrl: C:\MyXSL.xslt });

I'm comfortable with using paramters in xslt, it's just how to pass
them in JQuery that I don't know.

Thanks


[jQuery] Re: Get element's html and the element

2009-03-30 Thread mkmanning

Resort to wrappers :). They don't actually have to be in the DOM:

var outerhtml = $('div').append($('#container').clone()).html();

outerhtml -- div id=containerall the content/div

On Mar 30, 12:40 am, Steven Yang kenshin...@gmail.com wrote:
 well html() just gets the innerHTMLso your out of luck there
 there is actually a plugin for getting the actually container html
 I remember coming across it on the jquery plugin pages
 you can try finding it there

 All i can say is its doesnt seem hard, but also not as easy as you think
 ^^


[jQuery] [autocomplete] onselect handler

2009-03-30 Thread Diego Plentz
Hey guys, here I'm again.

Is there a way to associate a callback function with the select event of an
autocomplete? I want to do something like this: on select item from
autocomplete, set the value of field x and hide div xpto. I looked at the
format* callbacks, but it won't work in my case. Any tip?

Thanks

-- 
http://plentz.org


[jQuery] Anyone have jQuery emulation of box-sizing: border-box for IE?

2009-03-30 Thread Eric

I've searched around a bit. I can't find any jQuery script/plugin to
emulate box-sizing: border-box on IE. Border-box is fantastic for form
fields:

.input {
  width: 100%;
  -moz-box-sizing: border-box; /* plus other vend-specific ones */
  padding: 5px;
}

The inputs still take up 100% width but gain 5px in padding.

Any hints to get this working on IE?

I know IE7.js or IE8.js do this, but I'd rather not introduce yet
*another* .js file when I'm already loading down on my site with
jquery.js.


[jQuery] [tooltip]

2009-03-30 Thread jmmccoy...@googlemail.com

Hi, im using your jquery tooltip although I have a question about
doing something bespoke

I call the code to my page via

$(function() {
$('a,div,span,img,td,input').tooltip({ etc.

Which works fine, however, if using ajax I populate a div with
external content, any title tags from the ajax request do not have the
tooltip function applied to it

I thought I had found a way around it by recalling
$(function() {
$('a,div,span,img,td,input').tooltip({ etc.

That works for the new content populated via ajax, but any other title
is thus dead and will not display

I need some code I can call to repopulate all title tags on the page


[jQuery] Work on one specific node and not on the window.document

2009-03-30 Thread tij_dev

Hi guys !

I assume this is a really basic question but I'm a JQuery rookie :) so
please be indulgent :)

I would like to get an element by its id but just on a specific node.
I only see on the web things like that : $(#myId). That is the
equivalent of window.document.getElementById(myId). But for me that
should be something like myNode.getElementById(myId).

Is that clear?...

Thanks in advance


[jQuery] Re: Enable a disabled button by id

2009-03-30 Thread Gilles

HTML way == input type=button disabled
XHTML way == input type=button disabled=disabled

if you set attribute to false

input type=button disabled=false

Button is still disabled

So like said before, remove the attribute completly :)


On Mar 30, 3:47 pm, Jonathan Vanherpe (T  T NV) jonat...@tnt.be
wrote:
 Thierry wrote:
  I can disable button with specific id with the following code:

  jQuery(#click_me:button).attr(disabled, true);

  If I want to re-enable the button, the following doesn't work:

  jQuery(#click_me:button).attr(disabled, false);

  Does anyone know what I'm missing?

 I think you need to use removeAttribute('disabled'). Browsers check for
 the attribute's existence, and not for the value (which should be
 technically be 'disabled', btw )

 Jonathan
 --
 Jonathan Vanherpe - Tallieu  Tallieu NV - jonat...@tnt.be


[jQuery] [tooltip]

2009-03-30 Thread jmmccoy...@googlemail.com

Hi, im using your jquery tooltip although I have a question about
doing something bespoke

I call the code to my page via

$(function() {
$('a,div,span,img,td,input').tooltip({ etc.

Which works fine, however, if using ajax I populate a div with
external content, any title tags from the ajax request do not have the
tooltip function applied to it

I thought I had found a way around it by recalling
$(function() {
$('a,div,span,img,td,input').tooltip({ etc.

That works for the new content populated via ajax, but any other title
is thus dead and will not display

I need some code I can call to repopulate all title tags on the page


[jQuery] jCarousel Flickr API /.I VANT THE FULL LIST BUT HOW??(All items not in the visible range are removed from the list to keep the list small.)

2009-03-30 Thread ::rg::

jCarousel Flickr API /.I VANT THE FULL LIST BUT HOW??(All items not in
the visible range are removed from the list to keep the list small.)


SOMEBODIE CAN HELP ME OUT PLESE NWITH A WERSION OF THIS SCRIPT WITHOUT
REMOVING THE NOT VISISBLE PARTS...
 I NEED THE FULL LIST...


All items not in the visible range are removed from the list to keep
the list small   VEL I NEED THE FULL LIST AND I DONT VANA MAKE
REQUEST ON EACH KLICK...

CAN BE DONE?
PLEASE IF U HAWE ANI IDEA .. EMAIL ME ! rg...@live.com

thanx vould help big!

www.0001.tk   the projeckt i need it for...!
thanx again

rg


[jQuery] Re: Cycle plugin adds white background in ie6 and ie7

2009-03-30 Thread Smoggy

It also seems to only be an issue with the latest release I am using
an older version of cycle and it works fine I will try the issues
mentioned above also.

On Mar 29, 6:07 pm, Christian Cibelli chcibe...@gmail.com wrote:
 Hey Mike,

 I have the same problem on my site. I added the cleartypeNoBg but
 nothing happens, it just was fixed when i use cleartype but, the text
 goes ugly :(

 any idea?

 thanks a lot,

 On Mar 29, 11:09 am, Merindol rndme...@gmail.com wrote:

  Great option !
  And the text is no affected.
  Thanks to you.

  Mike Alsup a écrit :

Thanks for the tip. Removing the cleartype solves the issue but indeed
the text is ugly (I'm usingCycleon paragraphs of text).
Actually, instead of removing cleartype, I just added the CSS rule
background: transparent !important; on paragraphs, because I
discovered that on IE7/8 a background-color is added.

   Actually, you can probably solve it by setting the 'cleartypeNoBg'
   option to false.  I always forget about that one.

   Cheers!


[jQuery] Re: Get element's html and the element

2009-03-30 Thread will

Thanks.  I did resort to wrappers. I actually wound up going the other
direction.  I won't bore you with my app but I inserted an inner
wrapper and then grabbed the html.

$('#content').wrapInner('div id=template/div')
var stuffToSave = $('#content').html();

then after some back and forth with the server the content is loaded
via
$('#content').load(stuffISaved);

your method keeps the extra div out though and that's sexier. My inner
nerd might make me switch to it.

Thank you,
Will

On Mar 30, 9:33 am, mkmanning michaell...@gmail.com wrote:
 Resort to wrappers :). They don't actually have to be in the DOM:

 var outerhtml = $('div').append($('#container').clone()).html();

 outerhtml -- div id=containerall the content/div

 On Mar 30, 12:40 am, Steven Yang kenshin...@gmail.com wrote:

  well html() just gets the innerHTMLso your out of luck there
  there is actually a plugin for getting the actually container html
  I remember coming across it on the jquery plugin pages
  you can try finding it there

  All i can say is its doesnt seem hard, but also not as easy as you think
  ^^




[jQuery] Re: Cycle plugin adds white background in ie6 and ie7

2009-03-30 Thread Smoggy

I just added cleartypeNoBg: true and that removed the background on
the newest version if cycle

On Mar 30, 11:47 am, Smoggy nate.scave...@gmail.com wrote:
 It also seems to only be an issue with the latest release I am using
 an older version ofcycleand it works fine I will try the issues
 mentioned above also.

 On Mar 29, 6:07 pm, Christian Cibelli chcibe...@gmail.com wrote:

  Hey Mike,

  I have the same problem on my site. I added the cleartypeNoBg but
  nothing happens, it just was fixed when i use cleartype but, the text
  goes ugly :(

  any idea?

  thanks a lot,

  On Mar 29, 11:09 am, Merindol rndme...@gmail.com wrote:

   Great option !
   And the text is no affected.
   Thanks to you.

   Mike Alsup a écrit :

 Thanks for the tip. Removing the cleartype solves the issue but indeed
 the text is ugly (I'm usingCycleon paragraphs of text).
 Actually, instead of removing cleartype, I just added the CSS rule
 background: transparent !important; on paragraphs, because I
 discovered that on IE7/8 a background-color is added.

Actually, you can probably solve it by setting the 'cleartypeNoBg'
option to false.  I always forget about that one.

Cheers!


[jQuery] Which attributes of a file input pass to a .php or .aspx using $.getJSON() ?

2009-03-30 Thread StErMi

Hi all, i'm using jQuery to pass a file to a .php or .aspx page using
$.getJSON() function.

My problem is: how can i pass all the input file data to that page?
Which attributes of the input file have i to pass?

I think that i have to pass the name of the file ( and here ok, i can
get it with .attr('value') ), than the real data of the file input,
and this is the real problem couse i don't know how to retrive it...
Can someone help me giving me some answer, hints or tutorials?


[jQuery] JQuery Cycle

2009-03-30 Thread gmca...@gmail.com

I am trying to use the JQuery Slider from http://www.malsup.com/jquery/cycle/

When i run this page in IE, the images dont load so It only has the
first picture in the slide show for each example.

When i tried to make a simple example it did the same thing in IE7
Everything works in Firefox, both the actual page and my simple
example. Has anyone experienced this ?

Heres my simple example just to make sure ididnt foul something up...
but the i dont think i did since the actual website does the same
thing.

The only thing i could think maybe is a browser setting ?

html
head

link rel=stylesheet type=text/css media=screen href=css.css /


script type=text/javascript src=jquery-1.3.2.min.js/script
script type=text/javascript src=jquery.cycle.all.min.js/script
script type=text/javascript
$(function() {
// run the code in the markup!
$('#s1').cycle('fade');
$('#s2').cycle({
fx: 'scrollDown'
});
});

/script

style

.pics {
height:  232px;
width:   232px;
padding: 0;
margin:  0;
}

.pics img {
padding: 15px;
border:  1px solid #ccc;
background-color: #eee;
width:  200px;
height: 200px;
top:  0;
left: 0
}

/style
/head

body
table cellspacing=20trtd
div id=s1 class=pics
img src=1.jpg width=200 height=200 /

img src=2.png width=200 height=200 /
img src=3.png width=200 height=200 /
/div

/tdtd
div id=s2 class=pics
  img src=1.jpg width=200 height=200 /

img src=2.png width=200 height=200 /
img src=3.png width=200 height=200 /
/div
/td/tr
/table
/body
/html

Thanks


[jQuery] Animate children of element?

2009-03-30 Thread Patrick Jarrett

What I have is a simple series of divs, and in the divs I have a few
items of content, here's an example:

div class=block in-focus
h3Corporate Responsibility/h3
img src=place1.png width=133 height=95
pLorem ipsum dolor sit amet. Sit amo mortus amorte./p
/div

Now I have CSS tied to the container CSS. So the h3, p, and img all
look slightly different if the in-focus is present or not.

If I run a standard:

$(.in-focus).removeClass(in-focus,500);

I can see it resize the container, but the contents don't change until
the animate completes. Is there some way to tie the interior elements
to the animation or do I need to do multiple animates to create that
effect?

Thanks
-- Patrick


[jQuery] Using Ajax with Redirects

2009-03-30 Thread Adam

I have some content that loads in a dialog popup via ajax.  For some
reason when the URL redirects (i.e. 301, 302, etc.), the content never
loads in the dialog.  Is this normal behavior for ajax, or should the
redirected content load?

Thanks.

a href=url_that_redirects class=myDialogdo something/a

$(.myDialog).click(function() {
$(this).openDialog();

});

$.fn.openDialog = function () {
var url = $(this).attr(href);
popup = $(this).dialog();
$.ajax(
{
url: url,
success: function(message) {
popup.html(message);
},
error: function() {
popup.html(div
class='portlet-msg-error'The content could not
be loaded./div);
},
timeout: 2
}
);

return this;
 };


[jQuery] Re: simplemodal help - dynamic load of modal content breaks close button

2009-03-30 Thread dbonneville

This does not work quite yet. Anything look wrong?

- #button-sales is a button on the page
- in firebug, I can see all the loaded data (a small chunk of HTML)
in the http-request pane, but it's only in memory - doesn't show up
anywhere.

How do I get the data into the #modalContentInstSales div?

This code launches the modal window where I can firebug down to
#modalContentInstSales, but no content shows up inside it.

$(#button-sales).click(function(e) {

e.preventDefault();

$.get(includes/institutional-sales.html, function(data){

// create a modal dialog with the data
$('#modalContentInstSales').modal({
onClose: modalClose,
onOpen: modalOpen,
containerCss: {
height: 420,
width: 342
}
}); // contains a button with simplemodal-close 
class
});
});


[jQuery] Re: Which attributes of a file input pass to a .php or .aspx using $.getJSON() ?

2009-03-30 Thread James

You cannot upload a file using XMLHttpRequest (aka. AJAX), which means
you cannot pass a file using $.getJSON().
Doing what you want to do requires a workaround for uploading files in
a AJAX-style manner through using iframes.
On your page you have an iframe somewhere, maybe 1x1px in size so it's
not easily viewable. Your form will submit normcally with a target to
this iframe to your php or aspx resource. With that, you parse the
content of the file (you have to do it server-side since Javascript
cannot read the contents of your file), and do what you want to do
with it, and output data back. Note that the data will be outputted
back to the iframe, so all you have to do is use Javascript to access
the iframe and read the content of it as your response.


On Mar 30, 7:42 am, StErMi ste...@gmail.com wrote:
 Hi all, i'm using jQuery to pass a file to a .php or .aspx page using
 $.getJSON() function.

 My problem is: how can i pass all the input file data to that page?
 Which attributes of the input file have i to pass?

 I think that i have to pass the name of the file ( and here ok, i can
 get it with .attr('value') ), than the real data of the file input,
 and this is the real problem couse i don't know how to retrive it...
 Can someone help me giving me some answer, hints or tutorials?


[jQuery] Re: Dynamic Form - Best practice

2009-03-30 Thread Jörn Zaefferer
There probably isn't a best practice. The example you link to is just
that, an example. But I see no reason why you shouldn't use that to
get started and build whatever you need above it. The validation
plugin itself is a good choice anyway.

Jörn

On Mon, Mar 30, 2009 at 2:01 PM, Kreeves kree...@gmail.com wrote:

 There is plenty of discussion on Dynamic form validation in this
 group, but my question is of a slightly different nature.

 I'm attempting to create a page that will build the form based on user
 input.  IE: User is prompted with one search box with several
 options.  They can then hit an Add search and be allowed another
 search box to further narrow down their search results. (The web-app
 is a report utility).

 I've looked around for websites that do this in an attempt to get an
 idea of what might be the best way of pulling it off.  One website I
 ran across did it like so...

 script type=text/javascript
 // only for demo purposes
 $.validator.setDefaults({
        submitHandler: function() {
                alert(submitted!);
        }
 });
 $.validator.messages.max = jQuery.format(Your totals musn't exceed
 {0}!);

 $.validator.addMethod(quantity, function(value, element) {
        return !this.optional(element)  !this.optional($(element).parent
 ().prev().children(select)[0]);
 }, Please select both the item and its amount.);

 $().ready(function() {
        $(#orderform).validate({
                errorPlacement: function(error, element) {
                        error.appendTo( element.parent().next() );
                },
                highlight: function(element, errorClass) {
                        
 $(element).addClass(errorClass).parent().prev().children
 (select).addClass(errorClass);
                }
        });

        var template = jQuery.format($(#template).val());
        function addRow() {
                $(template(i++)).appendTo(#orderitems tbody);
        }

        var i = 1;
        // start with one row
        addRow();
        // add more rows on click
        $(#add).click(addRow);

        // check keyup on quantity inputs to update totals field
        $(#orderform).delegate(keyup, input.quantity, function(event) {
                var totals = 0;
                $(#orderitems input.quantity).each(function() {
                        totals += +this.value;
                });
                $(#totals).attr(value, totals).valid();
        });

 });
 /script

 They then wrap the search fields in a textarea and label it a
 template.  Note the line ABOVE that reads var template =
 jQuery.format

 textarea style=display:none id=template
        tr
                td
                        label{0}. Item/label
                /td
                td class='type'
                        select name=item-type-{0}
                                option value=Select.../option
                                option value=0Learning jQuery/option
                                option value=1jQuery Reference 
 Guide/option
                                option value=2jQuery Cookbook/option
                                option vlaue=3jQuery In Action/option
                                option value=4jQuery For Designers/option
                        /select
                /td
                td class='quantity'
                        input size='4' class=quantity min=1 
 id=item-quantity-{0}
 name=item-quantity-{0} /
                /td
                td class='quantity-error'/td
        /tr
 /textarea

 The original page is at 
 http://jquery.bassistance.de/validate/demo/dynamic-totals.html.

 Is this best practice?  Is there a different way to do this?  It
 really just seems like a hacked up way to do it.

 Thanks.



[jQuery] Re: Catch generic events

2009-03-30 Thread James

I don't think there's a simple way for that, but you can combine them
though:
$(document).bind('click mouseover mouseout', function(event) {...}

On Mar 30, 2:42 am, Eric Garside gars...@gmail.com wrote:
 Nope. You have to specify the type of event you want to bind.

 On Mar 30, 8:04 am, julio antongiuli...@gmail.com wrote:

  Hi,

  in my code I use typically something like this to catch events in DOM
  elements:

  $wnd.$(document).bind('click', function(event) {...}
  $wnd.$(document).bind('mouseover', function(event) {...}
  $wnd.$(document).bind('mouseout', function(event) {...}
  etc.

  is it possible instead catch a generic event and delegate externally
  management?
  For example:

  $wnd.$(document).bind(function(type, event) {
  // where type is a string for 'click' or 'mouseover', etc.

  }

  Thanks,
  Julio




[jQuery] Re: Dynamic Form - Best practice

2009-03-30 Thread Kreeves

Exactly what I wanted to know.  I'm a bit new to the jQuery scene and
I was not certain if there might be a cleaner way of accomplishing
this behavior.

Thanks!

On Mar 30, 2:20 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
wrote:
 There probably isn't a best practice. The example you link to is just
 that, an example. But I see no reason why you shouldn't use that to
 get started and build whatever you need above it. The validation
 plugin itself is a good choice anyway.

 Jörn

 On Mon, Mar 30, 2009 at 2:01 PM, Kreeves kree...@gmail.com wrote:

  There is plenty of discussion on Dynamic form validation in this
  group, but my question is of a slightly different nature.

  I'm attempting to create a page that will build the form based on user
  input.  IE: User is prompted with one search box with several
  options.  They can then hit an Add search and be allowed another
  search box to further narrow down their search results. (The web-app
  is a report utility).

  I've looked around for websites that do this in an attempt to get an
  idea of what might be the best way of pulling it off.  One website I
  ran across did it like so...

  script type=text/javascript
  // only for demo purposes
  $.validator.setDefaults({
 submitHandler: function() {
 alert(submitted!);
 }
  });
  $.validator.messages.max = jQuery.format(Your totals musn't exceed
  {0}!);

  $.validator.addMethod(quantity, function(value, element) {
 return !this.optional(element)  !this.optional($(element).parent
  ().prev().children(select)[0]);
  }, Please select both the item and its amount.);

  $().ready(function() {
 $(#orderform).validate({
 errorPlacement: function(error, element) {
 error.appendTo( element.parent().next() );
 },
 highlight: function(element, errorClass) {
 
  $(element).addClass(errorClass).parent().prev().children
  (select).addClass(errorClass);
 }
 });

 var template = jQuery.format($(#template).val());
 function addRow() {
 $(template(i++)).appendTo(#orderitems tbody);
 }

 var i = 1;
 // start with one row
 addRow();
 // add more rows on click
 $(#add).click(addRow);

 // check keyup on quantity inputs to update totals field
 $(#orderform).delegate(keyup, input.quantity, function(event) {
 var totals = 0;
 $(#orderitems input.quantity).each(function() {
 totals += +this.value;
 });
 $(#totals).attr(value, totals).valid();
 });

  });
  /script

  They then wrap the search fields in a textarea and label it a
  template.  Note the line ABOVE that reads var template =
  jQuery.format

  textarea style=display:none id=template
 tr
 td
 label{0}. Item/label
 /td
 td class='type'
 select name=item-type-{0}
 option value=Select.../option
 option value=0Learning jQuery/option
 option value=1jQuery Reference 
  Guide/option
 option value=2jQuery Cookbook/option
 option vlaue=3jQuery In Action/option
 option value=4jQuery For 
  Designers/option
 /select
 /td
 td class='quantity'
 input size='4' class=quantity min=1 
  id=item-quantity-{0}
  name=item-quantity-{0} /
 /td
 td class='quantity-error'/td
 /tr
  /textarea

  The original page is 
  athttp://jquery.bassistance.de/validate/demo/dynamic-totals.html.

  Is this best practice?  Is there a different way to do this?  It
  really just seems like a hacked up way to do it.

  Thanks.


[jQuery] Re: Catching document.forms['formid'].submit() with jquery validator

2009-03-30 Thread Jörn Zaefferer

The only approach I see is to find all those inline event handlers and
replace them with something that goes through the jQuery event chain,
including validation.

Something like this:

$(a[onclick]).each(function() {
  this.onclick = function() {};
  $(#form).submit();
});

Jörn

On Mon, Mar 30, 2009 at 3:57 PM, Yeuker yeu...@gmail.com wrote:

 For those of you who frequent the jqueryhelp.com pages, forgive my
 question here as well.

 I am using the excellent jquery validation plugin found here:

 http://docs.jquery.com/Plugins/Validation

 It works incredibly well and am very happy with it (thanks).  My
 problem is that sometimes my forms are submitted via document.forms
 ['formid'].submit().  I have no control over this statement as it is
 generated for me by jsf when it is rendering the element, which in my
 case is an anchor.

 Because it is getting submitted via document.forms['formid'].submit(),
 the jquery validation plugin does not catch this submit, therefor does
 not validate, therefor submits the form when it shouldn't.  I've been
 stuck here for quite some time and could really use some help on how
 to get jquery to validate when a form is submitted this way.  Any help
 would be greatly, greatly appreciated.

 I have posted some code below that shows that the submit handler does
 not catch the javascript submit.


 form name=aform id=aform
   input type=submit /br/
   a href=# onclick=$('#aform').submit();submit with jquery/
 abr/
   a href=# onclick=document.forms['aform'].submit();submit with
 old js/a
 /form

 script type=text/javascript

   $(document).ready(function(){
      $(#aform).submit(
         function(){ alert(Submitted); });
   });
 /script

 Thanks so much,

 Yeuker




[jQuery] Re: Modifying CSS classes with jQuery (or '.live()' for '.css')

2009-03-30 Thread James

Documentation:
http://docs.jquery.com/CSS

$(#myElem).css('color', '#ff');

It would probably be better if 'cat_[id]' is the element's ID rather
than a CLASS, provided that it's unique in the whole document:
div id=cat_12.../div

Using that, you can easily update a whole set of 'cat_[id]' in one
call (if that's what you want to do):
$([id^=cat_]).css('color', '#ff');
This will update every element with IDs that begin with 'cat_'.

Theoretically you can do that with CLASS also, but when the CLASS
attribute also allows definition of multiple classes, such as:
class=header cat_45
in which case would require a bit more work to locate because it would
not fall in the criteria of begins with cat_ anymore.

On Mar 29, 4:23 am, Lars Schöning tahp...@gmail.com wrote:
 Hello,

 Apologies if this turns out to be a trivial question. I currently am
 working with jQuery on a set of elements assigned to colored
 categories via a 'cat_[id]' class. Categories can change colors and if
 they do I want to update the color of every elements belonging to it.
 I want the same to be true in all new events added.

 I would believe that the easiest solution to this problem would be
 changing the 'color' attribute directly in the CSS class 'cat_[id]',
 but have found no way to do so. As I am fairly new to jQuery I might
 also be overseeing a much more elegant solution. Can anyone clarify?

 Thanks in advance,
 Lars


[jQuery] Re: $.post problem

2009-03-30 Thread James

Where are you defining the 'click'? Before the $.post, in the success
callback function of $.post, or after the $.post?

On Mar 28, 5:10 am, paljo constantinos_...@hotmail.com wrote:
 Hi,

 I' m using $.post in this form: $.post(rpc.php,{data:data},function
 (result){$('.aDiv').html(result);});
 Basically i' m searching inside a database and the results are echoed
 from rpc.php in this form:
 ulli class=aClassa href=#Some text/a/li.../
 ul . Everything works fine except that the links don't work.
 So if i use something like:$(.aClass).each(function(){
                                      $(this).find('a').click(function{
                                         bla bla bla

 });
 });

 it won't work. How can i make them work?

 Thanks in advance.


[jQuery] Re: Sync response in ajax forms

2009-03-30 Thread James

Do a search on how to use the setTimeout() function. You can set a
timeout on when each of the text will be displayed.

On Mar 28, 9:41 am, Josip Lazic jlaz...@gmail.com wrote:
 Is it possible to display response from ajax script err something
 like this:
 I call ajax.php and usually i takes few seconds to finish, and I would
 like to update 'target' with something like text progressbar.

 Finding solution
 Coumputing infinity...
 Talking with God...
 Done.

 Currently this response is shown all at once after script finish.


[jQuery] Re: Fire up on field focus

2009-03-30 Thread Ed J

Hi Andrea,

 I have updated my local version of the plugin to support the behavior
that we both want.
In the unminified version 1.02 of the autocomplete plugin, change line
165
from:
if ( hasFocus++  1  !select.visible() ) {
to:
if ( hasFocus++  0  !select.visible() ) {

In my test on Firefox 3.x and iPhone safari, it worked fine. When you
single click into the field, your complete drop down list will now
show up, and autocomplete works correctly.

Hope this helps,

Ed

On Mar 19, 3:20 am, Mr.Rech andrea.ricip...@gmail.com wrote:
 You are right, but sometimes it's nice to have a list of options
 rolled down as soon as the field gets the focus. Especially when that
 list is quite short (maybe as a consequence of some filtering based on
 already filled in fields). In these cases, it'd be nice to have
 autocomplete working without any input from the user. Using the same
 widget for all the (text) input fields instead of many different ones
 will end in a better user experience (IMHO).

 Any hints?

 Andrea

 On Mar 19, 10:48 am, bart b...@ivwd.nl wrote:

  Isn't the entire idea behind auto_complete_ that it actually needs
  input before it can complete anything for you?

  On Mar 19, 10:37 am, Mr.Rech andrea.ricip...@gmail.com wrote:

   Hi,
   on the autocomplete demo-page I've noticed many examples that set
   minChars option to 0, giving the impression that they will fire up
   as soon as each input field gets the focus. However, they don't, and I
   have to type in at least one character to get the autocompletion
   working. Now, since I'd really need to autocomplete fields when they
   get focus, I'm wondering if I can get this in any way. Is autocomplete
   expected to support this feature at any time in the future? If
   autocomplete doesn't support this at all, how can I get a similar
   result?

   TIA,
    Andrea


[jQuery] .draggableDisable vs .draggable('disable') ?

2009-03-30 Thread nmiddleweek

Hello, I've got the jQuery in Action book and it talks
about .draggableDisable()  but it doesn't disable the dragging in my
code... I can only get it to work with .draggable('disable')

Am I missing something?


Thanks...


[jQuery] Basic - chaining multiple selectors?

2009-03-30 Thread M4rc0

Hi there!

Please bare with me if this question is too basic :)

I have the following code:

$(function(){
$(form a.option).click(function(){
$(form 
input.fileimage:visible).slideUp(slow);
$(form 
input.fileimage:hidden).slideDown(slow);
});
});

I have an input with the class .fileimage and a link saying I don't
want to upload an image now

It works good. Now there's something I would like to do but that I
don't know how to.

When I click the anchor, I would like to change the text as well.
So when the input is there (visible) it stays normal, but when I click
to hide it should say I want to upload an image now instead.

I'm trying with $(form a.option).text(new text).end();
But I don't know where to put that, and once it changes the text it
doesn't change back to I don't want... when the input is visible.

Can somebody point me out in the right direction here?


[jQuery] Re: onselect handler

2009-03-30 Thread James

Use the autocomplete's 'result' function:
http://docs.jquery.com/Plugins/Autocomplete/result#handler


On Mar 30, 6:47 am, Diego Plentz diego.pi...@gmail.com wrote:
 Hey guys, here I'm again.

 Is there a way to associate a callback function with the select event of an
 autocomplete? I want to do something like this: on select item from
 autocomplete, set the value of field x and hide div xpto. I looked at the
 format* callbacks, but it won't work in my case. Any tip?

 Thanks

 --http://plentz.org


[jQuery] Re: [tooltip]

2009-03-30 Thread Jörn Zaefferer

Check out 
http://docs.jquery.com/FAQ#Why_do_my_events_stop_working_after_an_AJAX_request.3F

Jörn

On Mon, Mar 30, 2009 at 4:13 PM, jmmccoy...@googlemail.com
jmmccoy...@googlemail.com wrote:

 Hi, im using your jquery tooltip although I have a question about
 doing something bespoke

 I call the code to my page via

 $(function() {
        $('a,div,span,img,td,input').tooltip({ etc.

 Which works fine, however, if using ajax I populate a div with
 external content, any title tags from the ajax request do not have the
 tooltip function applied to it

 I thought I had found a way around it by recalling
 $(function() {
        $('a,div,span,img,td,input').tooltip({ etc.

 That works for the new content populated via ajax, but any other title
 is thus dead and will not display

 I need some code I can call to repopulate all title tags on the page



[jQuery] Re: Basic - chaining multiple selectors?

2009-03-30 Thread James

Maybe something along the lines of:

$(form a.option).click(function() {
 var $input = $(form input.fileimage);
 if ( $(form input.fileimage).is(:visible) ) {
  $input.slideUpslow);
  $(this).text(I want to...);
 }
 else {
  $input.slideDown(slow);
  $(this).text(I don't want to...);
 }
}

On Mar 30, 9:44 am, M4rc0 maluc...@gmail.com wrote:
 Hi there!

 Please bare with me if this question is too basic :)

 I have the following code:

 $(function(){
                         $(form a.option).click(function(){
                                 $(form 
 input.fileimage:visible).slideUp(slow);
                                 $(form 
 input.fileimage:hidden).slideDown(slow);
                         });
                 });

 I have an input with the class .fileimage and a link saying I don't
 want to upload an image now

 It works good. Now there's something I would like to do but that I
 don't know how to.

 When I click the anchor, I would like to change the text as well.
 So when the input is there (visible) it stays normal, but when I click
 to hide it should say I want to upload an image now instead.

 I'm trying with $(form a.option).text(new text).end();
 But I don't know where to put that, and once it changes the text it
 doesn't change back to I don't want... when the input is visible.

 Can somebody point me out in the right direction here?


[jQuery] Re: Fire up on field focus

2009-03-30 Thread Ed J

I've posted the 'single click' jquery autocomplete plugin here. Both
full and minified versions are updated:

http://www.edwardotis.com/public_files/js/jquery-autocompleteplugin/autocomplete-single-click-dropdown-option.zip

enjoy,

Ed

On Mar 30, 12:41 pm, Ed J edwardo...@gmail.com wrote:
 Hi Andrea,

  I have updated my local version of the plugin to support the behavior
 that we both want.
 In the unminified version 1.02 of the autocomplete plugin, change line
 165
 from:
                 if ( hasFocus++  1  !select.visible() ) {
 to:
                 if ( hasFocus++  0  !select.visible() ) {

 In my test on Firefox 3.x and iPhone safari, it worked fine. When you
 single click into the field, your complete drop down list will now
 show up, and autocomplete works correctly.

 Hope this helps,

 Ed

 On Mar 19, 3:20 am, Mr.Rech andrea.ricip...@gmail.com wrote:

  You are right, but sometimes it's nice to have a list of options
  rolled down as soon as the field gets the focus. Especially when that
  list is quite short (maybe as a consequence of some filtering based on
  already filled in fields). In these cases, it'd be nice to have
  autocomplete working without any input from the user. Using the same
  widget for all the (text) input fields instead of many different ones
  will end in a better user experience (IMHO).

  Any hints?

  Andrea

  On Mar 19, 10:48 am, bart b...@ivwd.nl wrote:

   Isn't the entire idea behind auto_complete_ that it actually needs
   input before it can complete anything for you?

   On Mar 19, 10:37 am, Mr.Rech andrea.ricip...@gmail.com wrote:

Hi,
on the autocomplete demo-page I've noticed many examples that set
minChars option to 0, giving the impression that they will fire up
as soon as each input field gets the focus. However, they don't, and I
have to type in at least one character to get the autocompletion
working. Now, since I'd really need to autocomplete fields when they
get focus, I'm wondering if I can get this in any way. Is autocomplete
expected to support this feature at any time in the future? If
autocomplete doesn't support this at all, how can I get a similar
result?

TIA,
 Andrea


[jQuery] Re: Fire up on field focus

2009-03-30 Thread Ed J

Also, I used jquery-1.3.2.js when I tested the patch.

On Mar 30, 12:55 pm, Ed J edwardo...@gmail.com wrote:
 I've posted the 'single click' jquery autocomplete plugin here. Both
 full and minified versions are updated:

 http://www.edwardotis.com/public_files/js/jquery-autocompleteplugin/a...

 enjoy,

 Ed

 On Mar 30, 12:41 pm, Ed J edwardo...@gmail.com wrote:

  Hi Andrea,

   I have updated my local version of the plugin to support the behavior
  that we both want.
  In the unminified version 1.02 of the autocomplete plugin, change line
  165
  from:
                  if ( hasFocus++  1  !select.visible() ) {
  to:
                  if ( hasFocus++  0  !select.visible() ) {

  In my test on Firefox 3.x and iPhone safari, it worked fine. When you
  single click into the field, your complete drop down list will now
  show up, and autocomplete works correctly.

  Hope this helps,

  Ed

  On Mar 19, 3:20 am, Mr.Rech andrea.ricip...@gmail.com wrote:

   You are right, but sometimes it's nice to have a list of options
   rolled down as soon as the field gets the focus. Especially when that
   list is quite short (maybe as a consequence of some filtering based on
   already filled in fields). In these cases, it'd be nice to have
   autocomplete working without any input from the user. Using the same
   widget for all the (text) input fields instead of many different ones
   will end in a better user experience (IMHO).

   Any hints?

   Andrea

   On Mar 19, 10:48 am, bart b...@ivwd.nl wrote:

Isn't the entire idea behind auto_complete_ that it actually needs
input before it can complete anything for you?

On Mar 19, 10:37 am, Mr.Rech andrea.ricip...@gmail.com wrote:

 Hi,
 on the autocomplete demo-page I've noticed many examples that set
 minChars option to 0, giving the impression that they will fire up
 as soon as each input field gets the focus. However, they don't, and I
 have to type in at least one character to get the autocompletion
 working. Now, since I'd really need to autocomplete fields when they
 get focus, I'm wondering if I can get this in any way. Is autocomplete
 expected to support this feature at any time in the future? If
 autocomplete doesn't support this at all, how can I get a similar
 result?

 TIA,
  Andrea


[jQuery] Re: Sync response in ajax forms

2009-03-30 Thread Josip Lazic

I don't think that is solution. I need realtime response, from php
script. Finding solution... Computing infi was just for example :)
Real output is a bit more informational

Resizing image 001.jpg...
Adding do db...
Resizing image 002.jpg...


And so on...

On Mar 30, 9:38 pm, James james.gp@gmail.com wrote:
 Do a search on how to use the setTimeout() function. You can set a
 timeout on when each of the text will be displayed.

 On Mar 28, 9:41 am, Josip Lazic jlaz...@gmail.com wrote:

  Is it possible to display response from ajax script err something
  like this:
  I call ajax.php and usually i takes few seconds to finish, and I would
  like to update 'target' with something like text progressbar.

  Finding solution
  Coumputing infinity...
  Talking with God...
  Done.

  Currently this response is shown all at once after script finish.


[jQuery] Re: simplemodal help - dynamic load of modal content breaks close button

2009-03-30 Thread dbonneville

I have this example too. I have the data loaded, and onShow will
trigger an alert if I put one in, but the close button still does not
work:

$(#button-sales).click(function(event) {


$(#modalContentInstSales).load(includes/institutional-
sales.html);

$('#modalContentInstSales').modal({
onClose: modalClose,
onOpen: modalOpen,
containerCss: {
height: 420,
width: 342
},
onShow: function (dialog){
$(.simplemodal-close, 
dialog.data).click(function (e) {
e.preventDefault();
$.modal.close();
});
}
});
});


[jQuery] Re: Basic - chaining multiple selectors?

2009-03-30 Thread Ricardo

Marco, you don't need the end() in that statement you posted, that's
meant to return the object to it's previous state after you do
traversing/filtering on it.

A condensed version:

$(form a.option).click(function() {
   var $input = $(form input.fileimage),
visible = $input.is('visible');

   $input[ visible ? 'slideDown' : 'slideUp' ]('slow');
   $(this).text( visible ? 'I do'  : 'I don't' );

}

On Mar 30, 4:50 pm, James james.gp@gmail.com wrote:
 Maybe something along the lines of:

 $(form a.option).click(function() {
      var $input = $(form input.fileimage);
      if ( $(form input.fileimage).is(:visible) ) {
           $input.slideUpslow);
           $(this).text(I want to...);
      }
      else {
           $input.slideDown(slow);
           $(this).text(I don't want to...);
      }

 }

 On Mar 30, 9:44 am, M4rc0 maluc...@gmail.com wrote:

  Hi there!

  Please bare with me if this question is too basic :)

  I have the following code:

  $(function(){
                          $(form a.option).click(function(){
                                  $(form 
  input.fileimage:visible).slideUp(slow);
                                  $(form 
  input.fileimage:hidden).slideDown(slow);
                          });
                  });

  I have an input with the class .fileimage and a link saying I don't
  want to upload an image now

  It works good. Now there's something I would like to do but that I
  don't know how to.

  When I click the anchor, I would like to change the text as well.
  So when the input is there (visible) it stays normal, but when I click
  to hide it should say I want to upload an image now instead.

  I'm trying with $(form a.option).text(new text).end();
  But I don't know where to put that, and once it changes the text it
  doesn't change back to I don't want... when the input is visible.

  Can somebody point me out in the right direction here?


[jQuery] Triggering a pop up when javascript function call originates from Flash

2009-03-30 Thread RR_QQ


Ok...so I found this cool site http://dev.iceburg.net/jquery/jqModal/

I'm trying to follow an example with the javascript that looks like this:

alert(called successfully);
   $('#ex3a').jqm({
trigger: '#ex3aTrigger',
overlay: 30, /* 0-100 (int) : 0 is off/transparent, 100 is 
opaque */
overlayClass: 'whiteOverlay'
}).jqDrag('.jqDrag'); /* make dialog draggable, assign handle to title 
*/

//alert(HI  + title);
// Close Button Highlighting. IE doesn't support :hover. Surprise?
$('input.jqmdX')
.hover(
function() {$(this).addClass('jqmdXFocus'); },
function() {$(this).removeClass('jqmdXFocus'); }
).focus(function() {
this.hideFocus=true; $(this).addClass('jqmdXFocus'); 
}).blur(function() {
$(this).removeClass('jqmdXFocus');
});

I put the above code inside a function that gets called when I click on a
Flash link. The call to the javascript takes place perfectly (something I
prove in this line 'alert(called successfully);'). However things dont
work right. As you can see in

$('#ex3a').jqm({
trigger: '#ex3aTrigger',

HOW do I tell it what the right trigger is? What does that code look like?
Again the function call comes from Flash.

OK lets say you never heard of jqModal - HOW can I susscessfully display a
popup with jquery and CSS when the function call comes from Flash (in
general)?

HELP!
-- 
View this message in context: 
http://www.nabble.com/Triggering-a-pop-up-when-javascript-function-call-originates-from-Flash-tp22793628s27240p22793628.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: fastest way to create a million div's?

2009-03-30 Thread Hector Virgen
IMHO Canvas is still the best choice for pixel editing. Take a look at some
of Google's achievements with the canvas tag:
http://www.chromeexperiments.com/detail/javascript-canvas-raytracer/

-Hector


On Sun, Mar 29, 2009 at 10:50 PM, Shedokan shedo...@yahoo.com wrote:


 thanks for all of your comments, I will try them all.

 As for canvas, I can't really use it because I want to support pixel
 editing and when resizing the canvas I'll need to re render it again
 and again.

 and as for flash, when I try to add that much pixels it gives me a
 warning about stopping the script.

 but I am looking at all possible ways.


[jQuery] [validate] Duplicate error msgs (and no re-validation) in FF/Opera. Works in IE6/7

2009-03-30 Thread MKDRF

I'm using the Validation plugin - 
http://bassistance.de/jquery-plugins/jquery-plugin-validation/

In IE6/7, it works fine.

In FF/Opera, there are two (possibly related) problems:

1) If I submit the blank form, the validation seems to work. All of
the required fields have the error message appended to them as they
should. However, if I submit again, a 2nd, duplicate error message
shows as well. This can be repeated indefinitely.

2) If I change the data an in Invalid input field, the error message
does not go away.



Screenshots:
Form: http://i41.tinypic.com/29fw8ch.gif
After 1 submit: http://i41.tinypic.com/30i9nhl.gif
After 2 submits: http://i43.tinypic.com/24wwy7m.gif


Code:
http://pastebin.com/m6e59dcaf


Thanks!


[jQuery] Stop on mouseover, restart on mouseout

2009-03-30 Thread flcarneiro

I'm replacing another developer on the tail-end of a development
project, and I've run into a snag. The page I'm working on has a div
named media-scrollcontainer which has a property of overflow: hidden
and holds another div named media-scroll. Within media-scroll are
four divs which hold different content: news, photos, videos, and
facebook. Above this container is a div named media-nav, which
contains a list-based nav menu for each of these panels (you click on
one and it animates the relevant panel into view).

The client would like for these panels to move on their own and then
stop when there is activity within them. I've taken the current code
and wrapped it in a function that loops the panel animations at a set
pace. The code for this isn't as elegant as I'd like, but I'm having
to work with what the previous developer established. This is the
loop:

function loop(){
$('#media-scroll').animate({left:'0'},{queue:false, 
duration:600 });
$('#media-status').animate({left:'30px'},{queue:false, duration:
600 });
$('#media-nav a').removeClass('active');
$('#news-link').addClass('active');

setTimeout(function(){

$('#media-scroll').animate({left:'-425px'},{queue:false, duration:
600 });
$('#media-status').animate({left:'105px'},{queue:false, 
duration:
600 });
$('#media-nav a').removeClass('active');
$('#photos-link').addClass('active');
}, 9000);
setTimeout(function(){

$('#media-scroll').animate({left:'-850px'},{queue:false, duration:
600 });
$('#media-status').animate({left:'170px'},{queue:false, 
duration:
600 });
$('#media-nav a').removeClass('active');
$('#videos-link').addClass('active');
}, 18000);
setTimeout(function(){

$('#media-scroll').animate({left:'-1300px'},{queue:false, duration:
600 });
$('#media-status').animate({left:'250px'},{queue:false, 
duration:
600 });
$('#media-nav a').removeClass('active');
$('#facebook-link').addClass('active');
}, 27000);
}
//setTimeout(loop,3);
setInterval(loop, 36000);

The panels loop as they're supposed to. The issue I'm having is
getting them to stop when there's activity within the media div that
holds all of this mess. I attempted to use the .hover listener
with .mouseover and .mouseout events. This seems like the best way to
do it, but this method still had issues:

$('#media').hover(function() {clearInterval(loop);}, function()
{setInterval(loop,36000);});

The looping wont stop when the mouse enters the media div. Does
anyone have any ideas for a solution? I'd really appreciate the help.

Thanks in advance.


[jQuery] Stop on mouseover, restart on mouseout

2009-03-30 Thread flcarneiro

I'm coming in on the tail end of the development of a site, and I'm
having to replace another developer. I'm experiencing an issue with a
snippet of code that causes a div to periodically move in order to
show other content (similar to the main flash panel of hulu.com).
There is one div named media-scroll-container that has an overflow:
hidden property and holds another div named media-scroll. Within
media-scroll, there are four panels: news, photos, videos, and
facebook, and each of these holds their own information. Above the
media-scroll-container div is a div named media-nav, which holds a
list that serves as the navigation to these panels (the user clicks
video, and the video panel animates into view, etc). All of this
functionality works.

I've set up a function that loops through these panels at a set pace,
and it works with no issues. The problem I'm having is getting the
panels to stop when there is activity within them (like when a user
clicks play on a video), and then get moving again when the activity
stops. I figured that one of the ways to do this is with
the .mouseover and .mouseout event handlers. I'm having trouble
getting this aspect to work, however, so I thought I'd throw the
problem out there to see if anyone has any ideas for a solution.

This is the loop code I'm currently using:

function loop(){
$('#media-scroll').animate({left:'0'},{queue:false, 
duration:600 });
$('#media-status').animate({left:'30px'},{queue:false, duration:
600 });
$('#media-nav a').removeClass('active');
$('#news-link').addClass('active');

setTimeout(function(){

$('#media-scroll').animate({left:'-425px'},{queue:false, duration:
600 });
$('#media-status').animate({left:'105px'},{queue:false, 
duration:
600 });
$('#media-nav a').removeClass('active');
$('#photos-link').addClass('active');
}, 9000);
setTimeout(function(){

$('#media-scroll').animate({left:'-850px'},{queue:false, duration:
600 });
$('#media-status').animate({left:'170px'},{queue:false, 
duration:
600 });
$('#media-nav a').removeClass('active');
$('#videos-link').addClass('active');
}, 18000);
setTimeout(function(){

$('#media-scroll').animate({left:'-1300px'},{queue:false, duration:
600 });
$('#media-status').animate({left:'250px'},{queue:false, 
duration:
600 });
$('#media-nav a').removeClass('active');
$('#facebook-link').addClass('active');
}, 27000);
}
setTimeout(loop,3);
setInterval(loop, 36000);

The code isn't as graceful as I'd like, since I'm having to build on
top of what a previous developer has done.

I'd appreciate any help on this. Thanks in advance.


  1   2   >