[jQuery] Re: delay ajax search while using keyup

2010-01-14 Thread mslade
Here's what I would do.  Hope this makes sense:

 [0] On key down, set some global state variable to true.

 [1] On key up, set the state variable to false.

 [1a] Then use setTimeout() to have it call a new function in 1 second
(adjust for usability).

 [2] Your new function will look to to see if the state variable from
[1] is still false.  If it is false, do your ajax.  If it is not
false, do nothing.

On Jan 14, 8:20 pm, Info i...@vglservices.com wrote:
 Hi There,
 I have some code (below) that does an ajax call on keyup of a form
 field. It works great.but I really want to pause the call for 1
 sec after they do the keyup to allow them to put in some text. Is
 there a way to take this code and do that?

 $(document).ready(function(){
         $('#search').keyup(function() {
                 var searchVal = $('#search').val();
                 $.ajax({
                         type: 'GET',
                         url: 'qryget_customers.php',
                         data: 'search=' + searchVal,
                         dataType: 'html',
                         beforeSend: function() {
                                 $('#search_slips').html('img 
 src=../common/images/ajax-
 loader.gif alt=loading... /');
                         },
                         success: function(response) {
                                 $('#search_slips').html(response);
                         }
                 });
         });

 });


[jQuery] Re: jQuery animations VS Mootools animations

2010-01-06 Thread mslade
The two versions have a number of subtle but remarkable differences
that makes it difficult to do a side-by-side comparison.  One's
faster, one rotates the photographs, one bounces them around a bit
upon reaching their destination.  For what it's worth, running XP Pro
SP 3 / FF 3, I prefer the implementation using jQuery.

On Jan 6, 3:58 pm, Rey Bango r...@reybango.com wrote:
 They both seem to run equally smooth to me. I saw occasional jumpiness
 on both demos.

 Seriously, you've been on this specific topic since early November and
 just doing a Google search shows that you've asked a ton of people the
 same question. If you feel that jQuery's effects could be smoother, I
 urge you to help out the project by investing the time to tackle
 whatever concerns you have. Doing that will not only ease your
 concerns but helps out everyone in the community.

 Rey...

 On Wed, Jan 6, 2010 at 3:43 PM, Acaz Souza acazso...@gmail.com wrote:
  MooTools:http://www.jsfiddle.net/4vnya/
  jQuery:http://www.jsfiddle.net/eFbwJ/36/
  (Compare the code, the effects. You decide.)

  Why mootools is more smooth than jquery?


[jQuery] Re: Change all CSS background images url

2009-11-16 Thread mslade
This will also likely create a ton of 404s for the bogus image
requests that are made prior to your JS fixing the image URLs.  If
your client likes to look at web logs to identify broken links, this
will become a headache.

I'm going to echo everyone else's sentiments that this is a bad idea.
This is a server-side problem, not client-side.

Have you considered using a PHP script as your CSS file?  In your
markup, just link to a PHP file instead of a CSS file and use that as
your stylesheet.  Then your PHP file can just define a $base_url
parameter once and use it as the start of all URLs in the stylesheet.
If your client's base URL changes, just change it once in the entire
CSS file.  This way the end-user never has to know about the funny
business and they're getting proper background images from the start,
instead of slapping some duct tape on every page every hit (ick).

Mark

On Nov 16, 12:32 pm, Michel Belleville michel.bellevi...@gmail.com
wrote:
 Well, the other option would be once the page is loaded to round all
 elements of your page, pick the ones with a background-image and regexp them
 to submission. I'd advise against this solution though, on the grounds that
 :

    - it's not really simpler than adding a background-image correcting
    stylesheet
    - there'd be images flickering while loading
    - if you've got AJAX (and with CakePHP I bet you do have AJAX) you'll
    have to trigger that after every AJAX call

 On the other hand, having an alternate css turning up only on this part of
 the site would be really easy, you can even use it with the standard
 stylesheet and only change background-image properties as long as the
 targets are the same as in the standard sheet and you put the link to the
 alternate stylesheet after the standard.

 Michel Belleville

 2009/11/16 nomen gaston...@gmail.com

  Hi:

    Liam: My client needs to have the posibility to change itself  the
  image path and he is not a programmer, The maximun complication should
  be to change a text by another text. Anyway I know it is a posibility
  and I have it in mind.
    Michel:  I try to use the base tag but I´m using CakePHP and it
  automatically puts in the links generathed by the HTML helper, the
  subdirectory name. So it does not work correctly with those links
  because the created links should be www.domain.com/subdir/subdir/img/
  one.jpg http://www.domain.com/subdir/subdir/img/%0Aone.jpg.

  Thank you anyway for your help.

  On 16 nov, 18:03, Michel Belleville michel.bellevi...@gmail.com
  wrote:
   First idea that comes to mind is to let your client define another site
   base, you then don't even have to change your css as the apparent site
  base
   would be the client's sub-directory.
   You do that using the base tag as shown here :
 http://www.w3schools.com/TAGS/tag_base.asp

   Hope it helps.

   Michel Belleville

   2009/11/16 nomen gaston...@gmail.com

Hi all:

   I have a website. All my images are in /img directory.
   Now, my client needs to put the site in a subdirectory, so, my
images are now in /subdir/img.
   In the future, maybe we have to change the site to another
subdirectory.
   I don´t want to change all my CSS anytime the client changes the
subdirectory.
   So my question is:
       Is there a simple way to change all CSS background-image
property with the next logic:

              Change all the existing CSS background-image
properties in this way:
                  if the url starts with /img change to /subdir/
img else do nothing

  Thank you for your help in advance.


[jQuery] Re: IE7 not loading jquery in WP

2009-10-22 Thread mslade

mojoeJohn,

You have an extra trailing comma in speed: 4000,, which is
definitely going to give you trouble in IE.  IE is less forgiving of
JS syntax errors than, for example, FF.

You might find this useful:  http://www.jslint.com/

Hope that helps.

Mark


IE is (rightfully) less forgiving of syntax errors in JS.

On Oct 22, 3:57 pm, mojoeJohn mojoej...@gmail.com wrote:
 jquery isn't loading right in IE 6  7 onhttp://centermassshootingschool.com/

 you can look at the source code, but essentially this is where the
 problem is ...

 script type=text/javascript
   $(document).ready(function(){
     $(#tabs).tabs({fx:{opacity:'toggle'}});
         $('.slideshow').cycle({
                 fx:'fade',
                 speed: 4000,
         });
   });
 /script

 when you take away

 $('.slideshow').cycle({
                 fx:'fade',
                 speed: 4000,
         });

 then everything works fine.

 It works fine in all other browsers. How do i fix this?