[jQuery] Re: Calling a user-defined function

2009-10-20 Thread Giovanni Battista Lenoci


cachobong ha scritto:

How do i use a function like this?

$.clientCoords = function() {
 var dimensions = {width: 0, height: 0};
 if (document.documentElement) {
 dimensions.width = document.documentElement.offsetWidth;
 dimensions.height = document.documentElement.offsetHeight;
 } else if (window.innerWidth  window.innerHeight) {
 dimensions.width = window.innerWidth;
 dimensions.height = window.innerHeight;
 }
 return dimensions;
}

  


$.clientCoords()

:-)

Bye

--
gianiaz.net - web solutions
via piedo, 58 - 23020 tresivio (so) - italy
+39 347 7196482 



[jQuery] Re: Get url from iframe

2009-10-20 Thread Jonathan Vanherpe (T T NV)

rupak mandal wrote:
no because after clicking on any search link, it was redirect to new 
web page. But src remains same.


On Mon, Oct 19, 2009 at 9:45 PM, brian zijn.digi...@gmail.com 
mailto:zijn.digi...@gmail.com wrote:



I believe you can get it from the src attirbute.

On Mon, Oct 19, 2009 at 7:37 AM, Rupak rupakn...@gmail.com
mailto:rupakn...@gmail.com wrote:

 Hi all,

 I have an ifram in a page. iframe contains google.com
http://google.com (google search).
 from there if the user search for a key word, i and click on a
 link.Is there a way to get the url of newly open page inside the
 iframe.

 Plz help me..


 thanks
 Rupak



nameofiframe.location ?

--
www.tnt.be http://www.tnt.be/?source=emailsig   *Jonathan Vanherpe*
jonat...@tnt.be mailto:jonat...@tnt.be - www.tnt.be 
http://www.tnt.be/?source=emailsig - tel.: +32 (0)9 3860441




[jQuery] Re: Problem with animate after submit in opera

2009-10-20 Thread Constantin Valeriu Tuguran

Thanks for the help.
I wanted to give the user some feedback while waiting for an action to
complete so I can not return false.
I must find another way.

Best Regards,

2009/10/20, Karl Swedberg k...@englishrules.com:
 Is the link's href set to another page? If so, I'm surprised it works
 in any browser. You would need to return false after your animate
 methods:

  $(document).ready(function(){
 $(.action).click(function(){
 $(#panel)
 .animate({top:0px}, 500)
   .animate({top:0}, 4000)
   .animate({top:-75px}, 500);
   return false; // -- prevent the link from being followed.
 });
$(#panel).click(function(){
 $(#panel).hide();
 });
 });


 --Karl

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




 On Oct 19, 2009, at 8:55 AM, Vali wrote:


 Hello,

 Recently I encountered a problem in Opera: The browser does not run
 any javascript after a page is submitted.
 For example if you use animate on an anchor when you click on that
 anchor the animate is never run unless the href is set to #.

 This is the code:

 script type=text/javascript src=http://ajax.googleapis.com/ajax/
 libs/jquery/1.3.2/jquery.js/script
 script type=text/javascript

 $(document).ready(function(){
$(.action).click(function(){
$(#panel)
.animate({top:0px}, 500)
  .animate({top:0}, 4000)
  .animate({top:-75px}, 500);
});
   $(#panel).click(function(){
$(#panel).hide();
});
});

 /script


 style type=text/css
 body {
  margin: 0;
  padding: 0;
  font: 75%/120% Arial, Helvetica, sans-serif;
  background: #323232;
 }
 #panel {
  background: #eaeaea;
  height: 75px;
  width: 100%;
  position: absolute;
  top:-75px;
 }
 .action
 {
  padding: 2px;
  color: white;
  margin: 0 auto ;
  background: #77;
  padding:  5px;
  border:2px solid #323232;
 }

 /style
 /head

 body

 div id=panel
  Your profile customization has been saved.
 /div

 div style=margin-top: 500px;text-align:center;

 a href=some link other than #. With # it works class=actionSave
 bla bla/a

 /div
 /body
 /html




[jQuery] Re: Superfish plugin: some limitations that could be addressed

2009-10-20 Thread Florent V.


 there is no reason not to be able to build a mega menu inside UL/LI structure 
 and this has been done in superfish

Sorry, but i think this is a mistake.

This is the kind of code that Superfish expects:

ul id=menu
li
a href=#Category name/a
ul class=submenu.../ul
/li
/ul

You don't have to use a A element for the first-level name i think,
but you do have to use a UL for the submenu (while the submenu class
in this example is just for clarity, it's not required).

You can't do this, as part of the features of Superfish will then
fail:


ul id=menu
li
a href=#Category name/a
div class=submenu.../div
/li
/ul

Sure, you can try to use a UL element for the submenu, put a unique LI
inside, and then stuff whatever content you want in that LI (someone
is giving that advice here, as the first name is the same it could be
you ;) 
http://www.nabble.com/Superfish:-Mega-Menu-Ability-td23632675s27240.html).
If you do that, it will work, but it'll be a hack (you're abusing the
UL/LI elements). You may use a UL for the submenu, and use a set of LI
elements for different contents, say a first LI for a top image,
another LI for some inner title, a set of LI for links, another LI for
a second inner title, another set of LI for links, and a final LI for
a bottom image. That will work, but once again this is abusing the
basic HTML semantics. Of course if you don't care about semantics and
accessibility, that's not an issue. I happen to care. :)

I see a few different “good” answers to that problem. One is to amend
Superfish to make it more flexible (i.e. make this a configuration
option, test, document). One is to declare that Superfish is not meant
for mega-dropdowns or any rollover menu that needs anything else than
an unordered list of links for a submenu, which would be a perfectly
valid answer too. I vote for the first answer, though. And i may have
missed a few other solutions. But abusing HTML semantics is not a
solution in my book. I may resort to it if i really need to, but i
think it should be avoided.

Thanks for the input.


[jQuery] Re: password initial value without masking ****

2009-10-20 Thread Marco Barbosa

Hmmm. This is more complicated than I thought.

waseem, having 2 input fields doesn't seem correct. Thought it might
work I will have to pass that solution for this specific site.

Liam, Your code didn't work either, I don't know why.

Jörn, this watermark plugin is interesting but I don't want to use
jquery ui on this site.
That's because I'm already using that cleanField function and it would
be redundant to have a plugin just for the login form.
Also I gave it a try and the label didn't stay inside the input. So If
i have to manually position it there, then it's another reason I will
pass this solution as well.

I though a simple jquery would do this.
I think I will leave it masked and use a tooltip or something.

Thanks guys!

On Oct 19, 5:54 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
wrote:
 Instead of replacing the input, display a label above it. 
 Seehttp://wiki.jqueryui.com/Watermark

 Jörn

 On Mon, Oct 19, 2009 at 4:17 PM, Liam Potter radioactiv...@gmail.comwrote:





  Here is how I do it. Just markup the form like normal (I use a definition
  list to lay out my forms)

    $(input:password).each(function(){
        var $currentPass = $(this)
        $currentPass.css({opacity:0});
              $currentPass.before('input type=text value=Password
  class=removeit style=position:absolute;z-index:10; /');
              var $visiblePassword = $(.removeit);
              $visiblePassword.focus(function () {
            $(this).css({opacity:0});
            $currentPass.focus().css({opacity:1});
        });
                  $currentPass.blur( function () {
            if ( $currentPass.attr(value) ==  ){
                $currentPass.css({opacity:0});
                $visiblePassword.css({opacity:1}).attr(value,Password);
            }
        });
    });

  waseem sabjee wrote:

  ah yes i forgot.

  you would get access denied when tried to change an input type property

  the best way is to have two input types and just hide one and show the
  other

  but i have a solution for you
  the html

         !-- The following html of two input types - we gonna switch
  between them--
         input type=text class=textinput value=Passowrd /
         input type=password class=passinput value= /

  the css

         style type=text/css
             /*    first we need to hide the password input*/
             .passinput {
                 display:none;
             }
         /style

  the js

         script type=text/javascript
             $(function() {
                 // declare your input types
                 var textinput = $(.textinput);
                 var passinput = $(.passinput);
                 // on text input focus - hide text input and show and focus
  on password input
                 textinput.focus() {
                     textinput.blur();
                     textinput.hide();
                     passinput.show();
                     passinput.focus();
                 });
                 // on password input blud hide password input and show and
  focus on text input
                 passinput.blur(function() {
                     passinput.blur();
                     passinput.hide();
                     textinput.show();
                     textinput.focus();
                 });
             });
         /script

  On Mon, Oct 19, 2009 at 2:51 PM, Marco Barbosa 
  marco.barbos...@gmail.commailto:
  marco.barbos...@gmail.com wrote:

     Hi waseem!

     Thanks for your reply.

     Something's wrong with this line:
     $(#password).attr({type:'text'});

     I tried changing to:
     $(#password).attr('type','text'});

     but still no go.
     I have to comment out to get the other JS stuff on the site working.

     The rest of the code seems Ok. What could it be?

     I like your solution, pretty simple :)

     I was wondering if we could put this inside the cleanField function
     but I guess it's not necessary.

     ~Marco

     On Oct 19, 2:32 pm, waseem sabjee waseemsab...@gmail.com
     mailto:waseemsab...@gmail.com wrote:
      // set the initial type to text
      $(.mypasswordfield).attr({
        type:'text'

      });

      // on user focus - change type to password
      $(.mypasswordfield).focus(function() {
       $(.mypasswordfield).attr({
         type:'password'
       });

      });

      // on user blur - change type to back to text
      $(.mypasswordfield).blur(function() {
       $(.mypasswordfield).attr({
         type:'text'
       });

      });

      since text is an attribute we can change it.
      all im doing is changing the type between password and text on
     click and on
      blur
      let me know if this worked for you :)

      On Mon, Oct 19, 2009 at 11:21 AM, Marco Barbosa
      marco.barbos...@gmail.com mailto:marco.barbos...@gmail.comwrote:

       Hi!

       I'm trying to achieve something like the Facebook first page (when
       you're not logged in).

       I'm using this simple function/plugin to 

[jQuery] Re: password initial value without masking ****

2009-10-20 Thread waseem sabjee
ok,why not absolutely position some text on a password box and hide that
text on password box focus ?

On Tue, Oct 20, 2009 at 10:05 AM, Marco Barbosa
marco.barbos...@gmail.comwrote:


 Hmmm. This is more complicated than I thought.

 waseem, having 2 input fields doesn't seem correct. Thought it might
 work I will have to pass that solution for this specific site.

 Liam, Your code didn't work either, I don't know why.

 Jörn, this watermark plugin is interesting but I don't want to use
 jquery ui on this site.
 That's because I'm already using that cleanField function and it would
 be redundant to have a plugin just for the login form.
 Also I gave it a try and the label didn't stay inside the input. So If
 i have to manually position it there, then it's another reason I will
 pass this solution as well.

 I though a simple jquery would do this.
 I think I will leave it masked and use a tooltip or something.

 Thanks guys!

 On Oct 19, 5:54 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:
  Instead of replacing the input, display a label above it. Seehttp://
 wiki.jqueryui.com/Watermark
 
  Jörn
 
  On Mon, Oct 19, 2009 at 4:17 PM, Liam Potter radioactiv...@gmail.com
 wrote:
 
 
 
 
 
   Here is how I do it. Just markup the form like normal (I use a
 definition
   list to lay out my forms)
 
 $(input:password).each(function(){
 var $currentPass = $(this)
 $currentPass.css({opacity:0});
   $currentPass.before('input type=text value=Password
   class=removeit style=position:absolute;z-index:10; /');
   var $visiblePassword = $(.removeit);
   $visiblePassword.focus(function () {
 $(this).css({opacity:0});
 $currentPass.focus().css({opacity:1});
 });
   $currentPass.blur( function () {
 if ( $currentPass.attr(value) ==  ){
 $currentPass.css({opacity:0});
  
 $visiblePassword.css({opacity:1}).attr(value,Password);
 }
 });
 });
 
   waseem sabjee wrote:
 
   ah yes i forgot.
 
   you would get access denied when tried to change an input type
 property
 
   the best way is to have two input types and just hide one and show the
   other
 
   but i have a solution for you
   the html
 
  !-- The following html of two input types - we gonna switch
   between them--
  input type=text class=textinput value=Passowrd /
  input type=password class=passinput value= /
 
   the css
 
  style type=text/css
  /*first we need to hide the password input*/
  .passinput {
  display:none;
  }
  /style
 
   the js
 
  script type=text/javascript
  $(function() {
  // declare your input types
  var textinput = $(.textinput);
  var passinput = $(.passinput);
  // on text input focus - hide text input and show and
 focus
   on password input
  textinput.focus() {
  textinput.blur();
  textinput.hide();
  passinput.show();
  passinput.focus();
  });
  // on password input blud hide password input and show
 and
   focus on text input
  passinput.blur(function() {
  passinput.blur();
  passinput.hide();
  textinput.show();
  textinput.focus();
  });
  });
  /script
 
   On Mon, Oct 19, 2009 at 2:51 PM, Marco Barbosa 
 marco.barbos...@gmail.commailto:
   marco.barbos...@gmail.com wrote:
 
  Hi waseem!
 
  Thanks for your reply.
 
  Something's wrong with this line:
  $(#password).attr({type:'text'});
 
  I tried changing to:
  $(#password).attr('type','text'});
 
  but still no go.
  I have to comment out to get the other JS stuff on the site
 working.
 
  The rest of the code seems Ok. What could it be?
 
  I like your solution, pretty simple :)
 
  I was wondering if we could put this inside the cleanField function
  but I guess it's not necessary.
 
  ~Marco
 
  On Oct 19, 2:32 pm, waseem sabjee waseemsab...@gmail.com
  mailto:waseemsab...@gmail.com wrote:
   // set the initial type to text
   $(.mypasswordfield).attr({
 type:'text'
 
   });
 
   // on user focus - change type to password
   $(.mypasswordfield).focus(function() {
$(.mypasswordfield).attr({
  type:'password'
});
 
   });
 
   // on user blur - change type to back to text
   $(.mypasswordfield).blur(function() {
$(.mypasswordfield).attr({
  type:'text'
});
 
   });
 
   since text is an attribute we can change it.
   all im doing is changing the type between password and text on
  click and on
   blur
   

[jQuery] Re: Calling a user-defined function

2009-10-20 Thread Cacho Menguito
Thanks! :)

On Tue, Oct 20, 2009 at 3:02 PM, Giovanni Battista Lenoci gian...@gmail.com
 wrote:


 cachobong ha scritto:

  How do i use a function like this?

 $.clientCoords = function() {
 var dimensions = {width: 0, height: 0};
 if (document.documentElement) {
 dimensions.width = document.documentElement.offsetWidth;
 dimensions.height = document.documentElement.offsetHeight;
 } else if (window.innerWidth  window.innerHeight) {
 dimensions.width = window.innerWidth;
 dimensions.height = window.innerHeight;
 }
 return dimensions;
}




 $.clientCoords()

 :-)

 Bye

 --
 gianiaz.net - web solutions
 via piedo, 58 - 23020 tresivio (so) - italy
 +39 347 7196482



[jQuery] Re: password initial value without masking ****

2009-10-20 Thread Bi Jing
For now, our project use two input elements to implement this, we still can
not get easier way.
Actually, not only password, but also text element, you need two inputs, one
hidden one shown.


Becoder.
On Tue, Oct 20, 2009 at 4:08 PM, waseem sabjee waseemsab...@gmail.comwrote:

 ok,why not absolutely position some text on a password box and hide that
 text on password box focus ?


 On Tue, Oct 20, 2009 at 10:05 AM, Marco Barbosa marco.barbos...@gmail.com
  wrote:


 Hmmm. This is more complicated than I thought.

 waseem, having 2 input fields doesn't seem correct. Thought it might
 work I will have to pass that solution for this specific site.

 Liam, Your code didn't work either, I don't know why.

 Jörn, this watermark plugin is interesting but I don't want to use
 jquery ui on this site.
 That's because I'm already using that cleanField function and it would
 be redundant to have a plugin just for the login form.
 Also I gave it a try and the label didn't stay inside the input. So If
 i have to manually position it there, then it's another reason I will
 pass this solution as well.

 I though a simple jquery would do this.
 I think I will leave it masked and use a tooltip or something.

 Thanks guys!

 On Oct 19, 5:54 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:
  Instead of replacing the input, display a label above it. Seehttp://
 wiki.jqueryui.com/Watermark
 
  Jörn
 
  On Mon, Oct 19, 2009 at 4:17 PM, Liam Potter radioactiv...@gmail.com
 wrote:
 
 
 
 
 
   Here is how I do it. Just markup the form like normal (I use a
 definition
   list to lay out my forms)
 
 $(input:password).each(function(){
 var $currentPass = $(this)
 $currentPass.css({opacity:0});
   $currentPass.before('input type=text value=Password
   class=removeit style=position:absolute;z-index:10; /');
   var $visiblePassword = $(.removeit);
   $visiblePassword.focus(function () {
 $(this).css({opacity:0});
 $currentPass.focus().css({opacity:1});
 });
   $currentPass.blur( function () {
 if ( $currentPass.attr(value) ==  ){
 $currentPass.css({opacity:0});
  
 $visiblePassword.css({opacity:1}).attr(value,Password);
 }
 });
 });
 
   waseem sabjee wrote:
 
   ah yes i forgot.
 
   you would get access denied when tried to change an input type
 property
 
   the best way is to have two input types and just hide one and show
 the
   other
 
   but i have a solution for you
   the html
 
  !-- The following html of two input types - we gonna switch
   between them--
  input type=text class=textinput value=Passowrd /
  input type=password class=passinput value= /
 
   the css
 
  style type=text/css
  /*first we need to hide the password input*/
  .passinput {
  display:none;
  }
  /style
 
   the js
 
  script type=text/javascript
  $(function() {
  // declare your input types
  var textinput = $(.textinput);
  var passinput = $(.passinput);
  // on text input focus - hide text input and show and
 focus
   on password input
  textinput.focus() {
  textinput.blur();
  textinput.hide();
  passinput.show();
  passinput.focus();
  });
  // on password input blud hide password input and show
 and
   focus on text input
  passinput.blur(function() {
  passinput.blur();
  passinput.hide();
  textinput.show();
  textinput.focus();
  });
  });
  /script
 
   On Mon, Oct 19, 2009 at 2:51 PM, Marco Barbosa 
 marco.barbos...@gmail.commailto:
   marco.barbos...@gmail.com wrote:
 
  Hi waseem!
 
  Thanks for your reply.
 
  Something's wrong with this line:
  $(#password).attr({type:'text'});
 
  I tried changing to:
  $(#password).attr('type','text'});
 
  but still no go.
  I have to comment out to get the other JS stuff on the site
 working.
 
  The rest of the code seems Ok. What could it be?
 
  I like your solution, pretty simple :)
 
  I was wondering if we could put this inside the cleanField
 function
  but I guess it's not necessary.
 
  ~Marco
 
  On Oct 19, 2:32 pm, waseem sabjee waseemsab...@gmail.com
  mailto:waseemsab...@gmail.com wrote:
   // set the initial type to text
   $(.mypasswordfield).attr({
 type:'text'
 
   });
 
   // on user focus - change type to password
   $(.mypasswordfield).focus(function() {
$(.mypasswordfield).attr({
  type:'password'
});
 
   });
 
   // on user blur - change type to back to text
   

[jQuery] Re: Where to access datepicker?

2009-10-20 Thread Richard D. Worth
On Mon, Oct 19, 2009 at 2:29 PM, Andrew243 m...@andrewcampbell.us wrote:


 Hi Charlie,

 The Google link works -- thanks, I did not understand how to contruct
 the Google URL from their site.

 What URL can I use to link to datepicker?


For the jQuery UI Datepicker, you'll need jQuery, jQuery UI, and a theme:

script src=http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js
/script
script src=
http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js
/script
link href=
http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/themes/base/jquery-ui.css;
rel=stylesheet type=text/css /

You can change /base/ in that last line to any of the theme names in the
ThemeRoller gallery ( http://themeroller.com/ ). Here are some examples:

Sunny Theme: http://jsbin.com/evanu

Flick Theme: http://jsbin.com/utito

Humanity Theme: http://jsbin.com/oviwa

and also if you want to preview all the different themes:

Themeswitcher: http://jsbin.com/ifine

If you have any more questions about the jQuery UI Datepicker plugin, note
there's a dedicated list for jQuery UI questions:

http://groups.google.com/group/jquery-ui

Thanks.

- Richard


[jQuery] [Validate] How to raze error manually?

2009-10-20 Thread SirShurf

Hi all,

I have a Validate of a form that is inside a UIDialog.

On submit I am sending AJAX request for the server (LINE SAVE), the
Client side validation is passed but now I have a server side, plus
save errors codes...

How can I raize validation error on codes returned from AJAX?

Any examples would be welcomed...


[jQuery] Re: Weird z-index problem JQuery dialog + Text field

2009-10-20 Thread Richard D. Worth
On Mon, Oct 19, 2009 at 10:54 PM, Bi Jing beco...@gmail.com wrote:

 Could please provide some code fragments?


Even better would be a live sample page. If you don't have a place to host
one, you can use jsbin.com:

http://jsbin.com/

- Richard


[jQuery] Re: easing 1.3 plugin how to implement pls?

2009-10-20 Thread Richard D. Worth
Looking at the 'Available Options' on http://fancybox.net/howto , my guess
would be one of these settings:
easingIn, easingOut, easingChange   Easing used for animations

- Richard

On Mon, Oct 19, 2009 at 8:10 AM, jessie mi...@optusnet.com.au wrote:


 Ok after reading a bit i know realise that i have to animate and add
 the motion

 Does anyone know how i would do this please?

 This is what i have for my fancybox to which i'd like to animate
 differently to the standard swing.

 jQuery(function($) {
 $(a.group).fancybox({ overlayShow : true });});


 Thanx
 Jess


 On Oct 19, 9:23 am, jessie mi...@optusnet.com.au wrote:
  Hi
 
  I have fancybox lightbox installed and i wanted a different transition
  effect.  So i've installed theeasing1.3 plugin
 
  I have read and re-read the instructions but i don't really understand
  where i need to make the change for it to take effect.
 
  Its all loading fine so there are no problems there.
 
  Here is the instructions.http://gsgd.co.uk/sandbox/jquery/easing/
 
  Usage
  Default
  Choose a defaulteasingmethod to overwrite the standard 'swing'
  animation. Theeasingdefault is 'easeOutQuad', specify your own using
  the following:
  jQuery.easing.def = string;
  Where string is one of the equation names. The old swing function is
  renamed to jswing.
 
  U yes, and where do I make this change? And not sure I know what a
  string is but I thought it would be any othereasingfunction such as
  ‘easeInSine’ etc. no? but where exactly do I put it?  am i suppose to
  edit the plugin or have another js file with those commands?
 
  Thanks
  Jess



[jQuery] Re: Jquery Simple Accordion Script (No Plugins)

2009-10-20 Thread Richard D. Worth
Your title says (No Plugins). Are you set on not using an already built
accordion plugin that has solved these issues, and more? Because you're
hitting the first of many issues that previous plugin authors have hit
before you.
- Richard

On Mon, Oct 19, 2009 at 10:06 AM, Joel typefasterj...@gmail.com wrote:


 Good Day,

 I've been working around Jquery for a little while now and I'm
 creating a News Accordion menu to go on my site. The accordion works
 fine in all browsers, however there is a bouncing effect if Click on
 the same news article.

 Here is the snippet of the first code I was working on:

 Code:

 $(.newsArticle:not(:first)).hide();
  $(.newsHeader h3).click(function() {
 $(.newsArticle:visible).slideUp(slow);
 $(this).parent().next().slideDown(slow);
 return false;
  });


 I played around with it for a while and I came up with the following:


 Code:

 if($(#newsAccordion)) {// IE Fix
 $(.newsArticle).hide();
 $(.newsArticle:first).show();
 $(.newsArticle:first).addClass(active);
  }
  $(.newsHeader h3).click(function() {
 if($(.newsArticle).hasClass(active)) {
$(.newsArticle:visible).slideToggle(slow);
$(.newsArticle:visible).toggleClass(active);
console.log(Inside If);
 } else if($(.newsArticle:hidden)) {
$(.newsArticle:visible).slideUp(slow, function() {
   $(this).parent().next().slideDown(slow);
});
$(.newsArticle:visible).removeClass(active);
$(this).parent().next().slideDown(slow);
$(this).parent().next().addClass(active);
console.log(The Other if);
 }
  });

 This top code actually works with what I want it to do. To close in
 case the news h3 was clicked again. However, if I clicked on a closed
 one it closes the current one, but doesn't open the new one.
 The HTML Hierarchy goes as follow:

 Code:

 div id=newsAccordion
   div class=newsHeader
   h3News Header/h3
   p class=dateAugust 10,2009/p
   /div
   div class=newsArticle
   pContent of Article/p
   /div
 /div


 Any help would be gladly appreciated. Thanks! :)



[jQuery] Re: Sortable: get the element that received the sortable?

2009-10-20 Thread Richard D. Worth
On Mon, Oct 19, 2009 at 7:29 AM, Matt guitarroman...@gmail.com wrote:


 Anyway: is there a way that I can get the element that has received
 the sortable item? It could be one of three in my case, and I only
 want this code to be added for two of them.


$(this)

If you have any more questions about this plugin, please post to the
jquery-ui list:

http://groups.google.com/group/jquery-ui

Thanks.

- Richard


[jQuery] Re: .html(data) in Select Box Not working

2009-10-20 Thread Evgeny Bobovik

May be IE don't understand your POST paranetres try to use this method
$(document).ready(function(){
$(#place).change( function() {
$.post(types.php,{
local: '' + $(#place).val() + ''
}, function(data) {
$('#types').html(data);
$('#types').focus();
});
});
});
   Gk___




2009/10/19 zebamba zeba...@gmail.com:

 I have this function:

 script language=javascript
 $(document).ready(function()
 {
   $(#place).change(function()
    {
      $.post(types.php,{
          local:$('#place').val()
          } ,function(data)
        {
         $('#types').html(data);
                 $('#types').focus();
            });
    });
 });
 /script

 I does work fine on firefox.. but as normal on IE does not load the
 result form types.php...
 .html(data) is not showing up.

 May anybody help me with?



[jQuery] Am i missing something? tis not working in IE

2009-10-20 Thread jessie

Hi

Everything is working as it should in Firefox, i've checked the
firebug and its not spitting out any errors.

Except in IE its not working...

Can someone please have a look at my code and tell me if i'm missing
somethin gplease.

Thank-you in advance.

Jess.

Here is the scripts.. in order.
script type=text/javascript src=http://ajax.googleapis.com/ajax/
libs/jquery/1.3.2/jquery.min.js/script
script type=text/javascript src=skins/{VAL_SKIN}/jquery.easing.
1.3.js/script
script type=text/javascript src=skins/{VAL_SKIN}/
jquery.fancybox-1.2.1.pack.js/script
script type=text/javascript src=skins/{VAL_SKIN}/effects.js/
script

Here is all my code

jQuery(function($) {

function getLeaf(url) {
var splited=url.split('?');// remove all the parameter from url
url=splited[0];
url=splited[0];
return url.substring(url.lastIndexOf(/)+1);// return file name
}
jQuery.fn.extend({
 enter: function() {//plugins creation
 return this.each(function() {
   var pth = $(this).find(img)[0];
  //alert($(this).children().attr(href));
   if($(this).children().attr(href)==getLeaf
(document.location.href)){// check that the link url and document url

   $(pth).attr(src,pth.src.replace(/.gif/g, '_active.gif'));
   } else{
   $(this).hover(function(){
  $(pth).attr(src,pth.src.replace(/.gif/
g,'_active.gif'));// mouse over Image
  },function(){
  $(pth).attr(src,pth.src.replace(/_active.gif/
g,'.gif'));
  });
   }
   });
 }
});
$(function(){  // Document is ready
 $(.LPButton,.CatMoreBtn).enter();// call the function
});
$('input[type=image]').hover(
function () { $(this).attr(src, $(this).attr(src).split('-
off').join('-on')); },
function () { $(this).attr(src, $(this).attr(src).split('-
on').join('-off')); }
);
});
$(function(){  // Document is ready
$(a.group).fancybox({
'overlayShow'   : true,
'zoomSpeedIn'   : 600,
'zoomSpeedOut'  : 500,
});
});



It works fine if i delete this part

$(function(){  // Document is ready
$(a.group).fancybox({
'overlayShow'   : true,
'zoomSpeedIn'   : 600,
'zoomSpeedOut'  : 500,
});
});

So i must be missing something here.

Thanks


[jQuery] Re: Difference with two ways to select elements?

2009-10-20 Thread Evgeny Bobovik

1: $(select[name^='start_me_']).val(0); - this method set value only
in first founded selector, second method is most optimal to do what
you want - this method found all elements matches your criteria.
   Gk___
Sent from Minsk, Belarus



2009/10/19 Morris Li morris...@gmail.com:

 Hi All

 I am having a question and seeking some help from the group.

 What I want to do? - to set the SELECTS that match the citerias to be
 defaul option.

 1: $(select[name^='start_me_']).val(0);
 2: $(select[name^='start_me_']).each(function() { this.value =
 0; });

 I found 1 doesn't work in IE but FF. Could someone let me konw why?
 And what's the difference between them?

 Many thanks
 Morris Li



[jQuery] Re: easing 1.3 plugin how to implement pls?

2009-10-20 Thread jessie

Thanx Richard,

Well its all now working apart from IE!

Everything seems to flow fine in Firefox but none of it works in IE
after i implemented this to my effects.js
$(function(){  // Document is ready
$(a.group).fancybox({
'overlayShow'   : true,
'zoomSpeedIn'   : 600,
'zoomSpeedOut'  : 500,
});
});


Jess :)

On Oct 20, 7:15 pm, Richard D. Worth rdwo...@gmail.com wrote:
 Looking at the 'Available Options' onhttp://fancybox.net/howto, my guess
 would be one of these settings:
 easingIn, easingOut, easingChange   Easing used for animations

 - Richard



 On Mon, Oct 19, 2009 at 8:10 AM, jessie mi...@optusnet.com.au wrote:

  Ok after reading a bit i know realise that i have to animate and add
  the motion

  Does anyone know how i would do this please?

  This is what i have for my fancybox to which i'd like to animate
  differently to the standard swing.

  jQuery(function($) {
  $(a.group).fancybox({ overlayShow : true });});

  Thanx
  Jess

  On Oct 19, 9:23 am, jessie mi...@optusnet.com.au wrote:
   Hi

   I have fancybox lightbox installed and i wanted a different transition
   effect.  So i've installed theeasing1.3 plugin

   I have read and re-read the instructions but i don't really understand
   where i need to make the change for it to take effect.

   Its all loading fine so there are no problems there.

   Here is the instructions.http://gsgd.co.uk/sandbox/jquery/easing/

   Usage
   Default
   Choose a defaulteasingmethod to overwrite the standard 'swing'
   animation. Theeasingdefault is 'easeOutQuad', specify your own using
   the following:
   jQuery.easing.def = string;
   Where string is one of the equation names. The old swing function is
   renamed to jswing.

   U yes, and where do I make this change? And not sure I know what a
   string is but I thought it would be any othereasingfunction such as
   ‘easeInSine’ etc. no? but where exactly do I put it?  am i suppose to
   edit the plugin or have another js file with those commands?

   Thanks
   Jess- Hide quoted text -

 - Show quoted text -


[jQuery] Safari ignoring CSS width value when animating width

2009-10-20 Thread Gavin

Hey,

I have a series of elements that are all set in the CSS to 120px in
width - here's the CSS:

li{ height: 20px; margin: 2px 0; -moz-border-radius: 3px; position:
relative; -webkit-border-radius: 3px; width: 120px; }

My jQuery animates these elements' widths to different sizes. The
following is within a loop that goes through each element and uses
corresponding values in an array to determine their widths (that's
elementSize). 'time' is set by another function.

$('#graph #item-' + i).animate({width:elementSize+px},time,function()
{
$('.value',this).fadeIn(700);
$(this).fadeTo(200,55);
});

This works perfectly in Firefox, however in Safari things work in
reverse - the elements start at 100% of the page's width and shrink to
their proper widths as determined by that array. It is even ignoring a
500px wide wrapper that contains all of the elements. It seems Safari
doesn't like working from the predetermined value of 120px width. The
same behavior exists if I remove the variable - {width:300px}.

Any ideas? Your input is appreciated!

Thanks in advance for any words.


[jQuery] How to get active image centeres in jCarousel?

2009-10-20 Thread Ghprod

Hi,

i use jcarousel in one of my project.  As we know active image in
jCarousel, default set in the left or right. Can i customized so
active image will centered?  Let say there's 5 image and i want image
number 3 in the middle is set as active image :)

regards

thnx


[jQuery] superfish navbar - how do I center the whole bar?

2009-10-20 Thread Shawn

I'm using a navbar with superfish. I simply put my menu list inside a
wrapper so the markup looks like this:

div class=navbar-wrapper
ul class=sf-menu sf-navbar
li.../li
li.../li
li.../li
/ul
/div

now I want to make the navbar-wrapper 100% of width and the navbar to
be centered in it, I thought it should be simple just do the following
css trick

div.navbar-wrapper{ width:100%; text-align:center; }

However this didn't work, the supersish menu just didn't get
centered.

How can I fix this? Thanks.


[jQuery] Re: Copy content from one field to another

2009-10-20 Thread Ghprod

Hi ... if u work with newer version of jquery, maybe u'll change $
into jQuery :)

Hope it helps :)

regards


[jQuery] Re: Copy content from one field to another

2009-10-20 Thread rupak mandal
Try this

   $(#billing_first_name1).attr(value,$(#shiping_first_name).val())
   $(#billing_last_name1).attr(value,$(#shiping_last_name).val())

Thanks

On Tue, Oct 20, 2009 at 8:55 AM, Ghprod greenhousep...@yahoo.co.id wrote:


 Hi ... if u work with newer version of jquery, maybe u'll change $
 into jQuery :)

 Hope it helps :)

 regards



[jQuery] Re: superfish navbar - how do I center the whole bar?

2009-10-20 Thread rupak mandal
Put the ul inside a div. I think it will work



On Tue, Oct 20, 2009 at 9:05 AM, Shawn shallway...@gmail.com wrote:


 I'm using a navbar with superfish. I simply put my menu list inside a
 wrapper so the markup looks like this:

 div class=navbar-wrapper
 ul class=sf-menu sf-navbar

div

 li.../li
 li.../li
 li.../li
 /ul

/div

 /div

 now I want to make the navbar-wrapper 100% of width and the navbar to
 be centered in it, I thought it should be simple just do the following
 css trick

 div.navbar-wrapper{ width:100%; text-align:center; }

 However this didn't work, the supersish menu just didn't get
 centered.

 How can I fix this? Thanks.



[jQuery] Re: How to get active image centeres in jCarousel?

2009-10-20 Thread rupak mandal
jQuery(document).ready(function() {
jQuery('#mycarousel').jcarousel({
start: 3
});
});


http://sorgalla.com/projects/jcarousel/examples/static_start.html

Thanks

On Tue, Oct 20, 2009 at 8:49 AM, Ghprod greenhousep...@yahoo.co.id wrote:


 Hi,

 i use jcarousel in one of my project.  As we know active image in
 jCarousel, default set in the left or right. Can i customized so
 active image will centered?  Let say there's 5 image and i want image
 number 3 in the middle is set as active image :)

 regards

 thnx



[jQuery] Re: superfish navbar - how do I center the whole bar?

2009-10-20 Thread Florent V.

Hello,

This is a CSS issue, not really related to Superfish or jQuery.

The solution depends on your code, and also on the browsers you want
to support (IE 6 and 7 will limit what you can do).

If your UL has a fixed width, you can center it horizontally in its
container using automatic margins.
Insert search engine name is your friend.
If the container has a fixed width too, using some padding or a margin
might do the trick too.

If the width of your UL element can't be predicted, it gets harder.
Using text-align:center won't work because your top-level LI are not
text, they are blocks, most probably floated blocks (i don't know what
your code looks like, but this is the most common solution). You can't
center blocks using text-align:center. You CAN center inline-block
elements, so it may be tempting to use display:inline-block on your
top-level LI (and no float), but IE 6-7 won't support that. Likewise,
using display:table-cell on your top-level LI elements is not an
option if you want to support IE 6-7.

So, if your series of top-level LI has an unknown, variable width,
you're stuck with:
1. A JavaScript solution that requires getting the container's width,
the UL's width, and add something like half the difference as a margin-
left or padding-left to the UL;
2. A CSS solution that relies on a display:table element wrapping your
UL (or display:table on the UL element itself). Elements that have a
table-like display CAN be centered using automatic margins, even if
they don't have an explicit width. And the one IE 6-7 compatible way
to have a table-like display is to use a TABLE element. So you would
need to wrap your UL in tabletrtd.../td/tr/table, then use
automatic margins on that table element. Not nice, but it works.


[jQuery] Re: password initial value without masking ****

2009-10-20 Thread rupak mandal
either you ca maintain two input element (like facebook), or make an image
of passwordand  set the image to textbox background, on focus or click
just remove the background-image.

On Tue, Oct 20, 2009 at 2:09 PM, Bi Jing beco...@gmail.com wrote:

 For now, our project use two input elements to implement this, we still can
 not get easier way.
 Actually, not only password, but also text element, you need two inputs,
 one hidden one shown.


 Becoder.

 On Tue, Oct 20, 2009 at 4:08 PM, waseem sabjee waseemsab...@gmail.comwrote:

 ok,why not absolutely position some text on a password box and hide that
 text on password box focus ?


 On Tue, Oct 20, 2009 at 10:05 AM, Marco Barbosa 
 marco.barbos...@gmail.com wrote:


 Hmmm. This is more complicated than I thought.

 waseem, having 2 input fields doesn't seem correct. Thought it might
 work I will have to pass that solution for this specific site.

 Liam, Your code didn't work either, I don't know why.

 Jörn, this watermark plugin is interesting but I don't want to use
 jquery ui on this site.
 That's because I'm already using that cleanField function and it would
 be redundant to have a plugin just for the login form.
 Also I gave it a try and the label didn't stay inside the input. So If
 i have to manually position it there, then it's another reason I will
 pass this solution as well.

 I though a simple jquery would do this.
 I think I will leave it masked and use a tooltip or something.

 Thanks guys!

 On Oct 19, 5:54 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:
  Instead of replacing the input, display a label above it. Seehttp://
 wiki.jqueryui.com/Watermark
 
  Jörn
 
  On Mon, Oct 19, 2009 at 4:17 PM, Liam Potter radioactiv...@gmail.com
 wrote:
 
 
 
 
 
   Here is how I do it. Just markup the form like normal (I use a
 definition
   list to lay out my forms)
 
 $(input:password).each(function(){
 var $currentPass = $(this)
 $currentPass.css({opacity:0});
   $currentPass.before('input type=text value=Password
   class=removeit style=position:absolute;z-index:10; /');
   var $visiblePassword = $(.removeit);
   $visiblePassword.focus(function () {
 $(this).css({opacity:0});
 $currentPass.focus().css({opacity:1});
 });
   $currentPass.blur( function () {
 if ( $currentPass.attr(value) ==  ){
 $currentPass.css({opacity:0});
  
 $visiblePassword.css({opacity:1}).attr(value,Password);
 }
 });
 });
 
   waseem sabjee wrote:
 
   ah yes i forgot.
 
   you would get access denied when tried to change an input type
 property
 
   the best way is to have two input types and just hide one and show
 the
   other
 
   but i have a solution for you
   the html
 
  !-- The following html of two input types - we gonna switch
   between them--
  input type=text class=textinput value=Passowrd /
  input type=password class=passinput value= /
 
   the css
 
  style type=text/css
  /*first we need to hide the password input*/
  .passinput {
  display:none;
  }
  /style
 
   the js
 
  script type=text/javascript
  $(function() {
  // declare your input types
  var textinput = $(.textinput);
  var passinput = $(.passinput);
  // on text input focus - hide text input and show and
 focus
   on password input
  textinput.focus() {
  textinput.blur();
  textinput.hide();
  passinput.show();
  passinput.focus();
  });
  // on password input blud hide password input and
 show and
   focus on text input
  passinput.blur(function() {
  passinput.blur();
  passinput.hide();
  textinput.show();
  textinput.focus();
  });
  });
  /script
 
   On Mon, Oct 19, 2009 at 2:51 PM, Marco Barbosa 
 marco.barbos...@gmail.commailto:
   marco.barbos...@gmail.com wrote:
 
  Hi waseem!
 
  Thanks for your reply.
 
  Something's wrong with this line:
  $(#password).attr({type:'text'});
 
  I tried changing to:
  $(#password).attr('type','text'});
 
  but still no go.
  I have to comment out to get the other JS stuff on the site
 working.
 
  The rest of the code seems Ok. What could it be?
 
  I like your solution, pretty simple :)
 
  I was wondering if we could put this inside the cleanField
 function
  but I guess it's not necessary.
 
  ~Marco
 
  On Oct 19, 2:32 pm, waseem sabjee waseemsab...@gmail.com
  mailto:waseemsab...@gmail.com wrote:
   // set the initial type to text
   $(.mypasswordfield).attr({
 type:'text'

[jQuery] Re: superfish navbar - how do I center the whole bar?

2009-10-20 Thread Shawn


If you have markup as indicated below, then you have invalid markup, 
which will cause problems.


A UL element can't contain a div - it has to contain li's, which in turn 
can contain a div.  I would expect that structure to fail.


Removing the div immediately after the UL, will clean things up.

Now, for centering, you may have to wrap the whole thing in a separate 
div and then use the CSS tricks to center THAT div - auto margins, 
text-align, etc.


er. just read your request a little more.  Try this:

div class=navbar-wrapper
  div class=centerMe
ul class=sf-menu sf-navbar
  li.../li
  li.../li
  li.../li
/ul
  /div
/div

Apply the centering tricks to div.centerMe.

Disclaimer - I just pulled an all nighter, so I need to freely suggest 
that my advice at this point may be questionable... :)


Shawn

rupak mandal wrote:

Put the ul inside a div. I think it will work



On Tue, Oct 20, 2009 at 9:05 AM, Shawn shallway...@gmail.com 
mailto:shallway...@gmail.com wrote:



I'm using a navbar with superfish. I simply put my menu list inside a
wrapper so the markup looks like this:

div class=navbar-wrapper
ul class=sf-menu sf-navbar

div

li.../li
li.../li
li.../li
/ul

/div

/div

now I want to make the navbar-wrapper 100% of width and the navbar to
be centered in it, I thought it should be simple just do the following
css trick

div.navbar-wrapper{ width:100%; text-align:center; }

However this didn't work, the supersish menu just didn't get
centered.

How can I fix this? Thanks.




[jQuery] Re: Copy content from one field to another

2009-10-20 Thread ReynierPM


Ghprod wrote:

Hi ... if u work with newer version of jquery, maybe u'll change $
into jQuery :)


With newer version you mean 1.3.2?


Hope it helps :)

regards




--
Saludos
ReynierPM


[jQuery] Re: Copy content from one field to another

2009-10-20 Thread ReynierPM


rupak mandal wrote:

Try this

   $(#billing_first_name1).attr(value,$(#shiping_first_name).val())
   $(#billing_last_name1).attr(value,$(#shiping_last_name).val())



Maybe I'm doing something wrong because it not works. Check the code 
online at http://jose-couto.com/pintpal4/order_pintpal.html.

Thanks for all the help and the time
--
Saludos
ReynierPM


[jQuery] Re: Superfish plugin: some limitations that could be addressed

2009-10-20 Thread Charlie





not sure what you mean by "hack" or "abusing the ul/li elements"

only interpretation can think of for "abusing" is invalidation, here's
an example of large container div inside a sub in superfish.

http://tinyurl.com/yzfwmvy

here's the 100% validation thru w3c validator
http://tinyurl.com/yh9b7qh


Florent V. wrote:

  
  
  
there is no reason not to be able to build a mega menu inside UL/LI structure and this has been done in superfish

  
  
Sorry, but i think this is a mistake.

This is the kind of code that Superfish expects:

	ul id="menu"
		li
			a href=""Category name/a
			ul class="submenu".../ul
		/li
	/ul

You don't have to use a A element for the first-level name i think,
but you do have to use a UL for the submenu (while the "submenu" class
in this example is just for clarity, it's not required).

You can't do this, as part of the features of Superfish will then
fail:


	ul id="menu"
		li
			a href=""Category name/a
			div class="submenu".../div
		/li
	/ul

Sure, you can try to use a UL element for the submenu, put a unique LI
inside, and then stuff whatever content you want in that LI (someone
is giving that advice here, as the first name is the same it could be
you ;) http://www.nabble.com/Superfish:-Mega-Menu-Ability-td23632675s27240.html).
If you do that, it will work, but it'll be a hack (you're abusing the
UL/LI elements). You may use a UL for the submenu, and use a set of LI
elements for different contents, say a first LI for a top image,
another LI for some inner title, a set of LI for links, another LI for
a second inner title, another set of LI for links, and a final LI for
a bottom image. That will work, but once again this is abusing the
basic HTML semantics. Of course if you don't care about semantics and
accessibility, that's not an issue. I happen to care. :)

I see a few different good answers to that problem. One is to amend
Superfish to make it more flexible (i.e. make this a configuration
option, test, document). One is to declare that Superfish is not meant
for mega-dropdowns or any rollover menu that needs anything else than
an unordered list of links for a submenu, which would be a perfectly
valid answer too. I vote for the first answer, though. And i may have
missed a few other solutions. But abusing HTML semantics is not a
solution in my book. I may resort to it if i really need to, but i
think it should be avoided.

Thanks for the input.

  






[jQuery] Why doesn't this work (comet)?

2009-10-20 Thread bobslf

I found this in a thread here called 'jquery doing comet'. It didn't
work for me unmodified. I also modified it a
little and it still doesn't work. Can someone tell me what's wrong?

Bob



here is the html file:
-

!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.1//EN http://www.w3.org/
TR/xhtml11/DTD/xhtml11.dtd
html xmlns=http://www.w3.org/1999/xhtml;
head
   titleCollecting Data.../title
   meta http-equiv=Content-Type content=text/html; charset=utf-8/

   script type=text/javascript src=jquery-1.3.2.min.js/script
/head
body

div id=comet_frame style=display:none;visibility:hidden/div
div id=content/div

script type=text/javascript
   var comet = {
  load: function() {
 $(#comet_frame).html('iframe id=comet_iframe
src=backend.php/iframe');
  },

  unload: function() {
 $(#comet_frame).html('iframe id=comet_iframe src=/
iframe');
  },

  clearFrame: function() {
 $(#comet_iframe).html();
  },

  time: function(ctime) {
 $(#content).html(ctime);
  }
   }

   $(document).ready(function() {
  comet.load();
   });

/script


body
/body
/html


here is backend.php:
--

?php
   set_time_limit(0);
   header(Cache-Control: no-cache, must-revalidate);
   header(Expires: Mon, 26 Jul 1997 05:00:00 GMT);
   flushHard();

   $x = 0;

   while(1) {
  if($x == 10) {
 echo 'script type=text/javascriptparent.comet.clearFrame
();/ script' . \n;
  }
  else {
 echo 'script type=text/javascriptparent.comet.time(' .
date('H:i:s') . ');/script' . \n;
  }
  flushHard();
  ++$x;
  sleep(1);
   }
   echo 'script type=text/javascriptparent.comet.unload();/
script' . \n;
?




[jQuery] Re: Copy content from one field to another

2009-10-20 Thread rupak mandal
change the id of lastname of billing information to billing_last_name

Thanks

On Tue, Oct 20, 2009 at 5:44 PM, ReynierPM rper...@uci.cu wrote:


 rupak mandal wrote:

 Try this

   $(#billing_first_name1).attr(value,$(#shiping_first_name).val())
   $(#billing_last_name1).attr(value,$(#shiping_last_name).val())


 Maybe I'm doing something wrong because it not works. Check the code online
 at http://jose-couto.com/pintpal4/order_pintpal.html.
 Thanks for all the help and the time
 --
 Saludos
 ReynierPM



[jQuery] Re: Copy content from one field to another

2009-10-20 Thread rupak mandal
sorry
change the id of lastname of shiping information to shiping_first_name

Thanks

On Tue, Oct 20, 2009 at 6:04 PM, rupak mandal rupakn...@gmail.com wrote:


 change the id of lastname of billing information to billing_last_name

 Thanks


 On Tue, Oct 20, 2009 at 5:44 PM, ReynierPM rper...@uci.cu wrote:


 rupak mandal wrote:

 Try this

   $(#billing_first_name1).attr(value,$(#shiping_first_name).val())
   $(#billing_last_name1).attr(value,$(#shiping_last_name).val())


 Maybe I'm doing something wrong because it not works. Check the code
 online at http://jose-couto.com/pintpal4/order_pintpal.html.
 Thanks for all the help and the time
 --
 Saludos
 ReynierPM





[jQuery] Re: Copy content from one field to another

2009-10-20 Thread ReynierPM


rupak mandal wrote:

change the id of lastname of billing information to billing_last_name



Thanks a lot, that was the mistake. Now it works

--
Saludos
ReynierPM


[jQuery] Re: Copy content from one field to another

2009-10-20 Thread ReynierPM


rupak mandal wrote:

sorry
change the id of lastname of shiping information to shiping_first_name



I have another question related to this. How can I clear the fields if I 
uncheck the checkbox? I mean when marked fill fields as I do until now 
and when unmarked empty those fields? How can I check when the checkbox 
is checked or not?

Cheers
--
ReynierPM


[jQuery] Re: Copy content from one field to another

2009-10-20 Thread ReynierPM


ReynierPM wrote:


rupak mandal wrote:

I have another question related to this. How can I clear the fields if I 
uncheck the checkbox? I mean when marked fill fields as I do until now 
and when unmarked empty those fields? How can I check when the checkbox 
is checked or not?

Cheers


Reply by myself:

if ($('#checkbox_id').is(':checked')) {
  // fill fields
} else {
 // empty fields
}

Now I empty fields in this way:
$(#billing_first_name).attr(value, );
Exists a nice or simply way to do this? Maybe something like:
$(#billing_first_name).empty()
Cheers
--
ReynierPM


[jQuery] Re: Copy content from one field to another

2009-10-20 Thread rupak mandal
function doCopy(){
if($('#same').is(':checked'))
{
$(#billing_first_name).attr(value,
$('#shiping_first_name').val());

}
else
{
$(#billing_first_name).attr(value,);
}
 }



 I have another question related to this. How can I clear the fields if I
 uncheck the checkbox? I mean when marked fill fields as I do until now and
 when unmarked empty those fields? How can I check when the checkbox is
 checked or not?
 Cheers
 --
 ReynierPM



[jQuery] Re: Am i missing something? tis not working in IE

2009-10-20 Thread MorningZ

Can you be more specific than dumping a bunch of lines of code and
saying doesn't work... like can you pin down a general location of
where it might be failing?

one thing that stands out is the use of enter as a function name,
and IE and reserved words like that don't play nice, try Enter or
something that has no chance to conflict.  again, that's just a
wild guess though


On Oct 20, 5:40 am, jessie mi...@optusnet.com.au wrote:
 Hi

 Everything is working as it should in Firefox, i've checked the
 firebug and its not spitting out any errors.

 Except in IE its not working...

 Can someone please have a look at my code and tell me if i'm missing
 somethin gplease.

 Thank-you in advance.

 Jess.

 Here is the scripts.. in order.
 script type=text/javascript src=http://ajax.googleapis.com/ajax/
 libs/jquery/1.3.2/jquery.min.js/script
 script type=text/javascript src=skins/{VAL_SKIN}/jquery.easing.
 1.3.js/script
 script type=text/javascript src=skins/{VAL_SKIN}/
 jquery.fancybox-1.2.1.pack.js/script
 script type=text/javascript src=skins/{VAL_SKIN}/effects.js/
 script

 Here is all my code

 jQuery(function($) {

 function getLeaf(url) {
 var splited=url.split('?');// remove all the parameter from url
 url=splited[0];
 url=splited[0];
 return url.substring(url.lastIndexOf(/)+1);// return file name}

 jQuery.fn.extend({
  enter: function() {//plugins creation
      return this.each(function() {
        var pth = $(this).find(img)[0];
       //alert($(this).children().attr(href));
        if($(this).children().attr(href)==getLeaf
 (document.location.href)){// check that the link url and document url

            $(pth).attr(src,pth.src.replace(/.gif/g, '_active.gif'));
        } else{
                $(this).hover(function(){
                   $(pth).attr(src,pth.src.replace(/.gif/
 g,'_active.gif'));// mouse over Image
                   },function(){
                       $(pth).attr(src,pth.src.replace(/_active.gif/
 g,'.gif'));
                       });
                }
                });
      }});

 $(function(){  // Document is ready
  $(.LPButton,.CatMoreBtn).enter();// call the function});

         $('input[type=image]').hover(
                 function () { $(this).attr(src, $(this).attr(src).split('-
 off').join('-on')); },
                 function () { $(this).attr(src, $(this).attr(src).split('-
 on').join('-off')); }
         );});

 $(function(){  // Document is ready
 $(a.group).fancybox({
                 'overlayShow'                   : true,
                 'zoomSpeedIn'                   : 600,
                 'zoomSpeedOut'                  : 500,
         });
         });

 It works fine if i delete this part

 $(function(){  // Document is ready
 $(a.group).fancybox({
                 'overlayShow'                   : true,
                 'zoomSpeedIn'                   : 600,
                 'zoomSpeedOut'                  : 500,
         });
         });

 So i must be missing something here.

 Thanks


[jQuery] Re: easing 1.3 plugin how to implement pls?

2009-10-20 Thread Charlie





take out trailing comma after "500"

IE will throw error every time on trailing commas


jessie wrote:

  Thanx Richard,

Well its all now working apart from IE!

Everything seems to flow fine in Firefox but none of it works in IE
after i implemented this to my effects.js
$(function(){  // Document is ready
$("a.group").fancybox({
		'overlayShow'			: true,
		'zoomSpeedIn'			: 600,
		'zoomSpeedOut'			: 500,
	});
	});


Jess :)

On Oct 20, 7:15pm, "Richard D. Worth" rdwo...@gmail.com wrote:
  
  
Looking at the 'Available Options' onhttp://fancybox.net/howto, my guess
would be one of these settings:
easingIn, easingOut, easingChange  Easing used for animations

- Richard



On Mon, Oct 19, 2009 at 8:10 AM, jessie mi...@optusnet.com.au wrote:



  Ok after reading a bit i know realise that i have to animate and add
the motion
  


  Does anyone know how i would do this please?
  


  This is what i have for my fancybox to which i'd like to animate
differently to the standard swing.
  


  jQuery(function($) {
$("a.group").fancybox({ "overlayShow" : true });});
  


  Thanx
Jess
  


  On Oct 19, 9:23 am, jessie mi...@optusnet.com.au wrote:
  
  
Hi

  


  
I have fancybox lightbox installed and i wanted a different transition
effect. So i've installed theeasing1.3 plugin

  


  
I have read and re-read the instructions but i don't really understand
where i need to make the change for it to take effect.

  


  
Its all loading fine so there are no problems there.

  


  
Here is the instructions.http://gsgd.co.uk/sandbox/jquery/easing/

  


  
Usage
Default
Choose a defaulteasingmethod to overwrite the standard 'swing'
animation. Theeasingdefault is 'easeOutQuad', specify your own using
the following:
jQuery.easing.def = "string";
Where string is one of the equation names. The old swing function is
renamed to jswing.

  


  
U yes, and where do I make this change? And not sure I know what a
string is but I thought it would be any othereasingfunction such as
easeInSine etc. no? but where exactly do I put it? am i suppose to
edit the plugin or have another js file with those commands?

  


  
Thanks
Jess- Hide quoted text -

  

- Show quoted text -

  
  
  






[jQuery] Access denied | uncaught exception in FF 2.0 | servlet call from another domain

2009-10-20 Thread Mohammed Arif

Hi,

Seems like got stuck in the cross domain issue.

Just trying to get the XML response from the servlet call through POST
method:

$.ajax({
type: POST,
url: http://10.210.221.43:9081/shopsfinder/servlet/
ShopsFinderStoreServlet //THIS DOESN'T
//url: ../ShopsFinderStoreServlet //IT WORKS
..


It works fine when we place the servlet at the same location where our
application server is, with the relative path.

BUT we have to put the servlet somewhere else means [at some other
location], due to some limitations.

Then it doesn't hit the servlet and we don't give any response back to
the browser and it goes in error function as given:

error: function(XMLHttpRequest, textStatus, 
errorThrown) {
alert(errror XMLHttpRequest:  + 
XMLHttpRequest.responseXML + 
textStatus:  + textStatus +   errorThrown:  +errorThrown);
}

Which gives all the values NULL and get the exception in FF.

Do we have any work around to overcome this issue?

Many thanks
Mohammed Arif


[jQuery] Re: Access denied | uncaught exception in FF 2.0 | servlet call from another domain

2009-10-20 Thread Mohammed Arif

P.S: We also don't want to use the cross domain solution through
'PROXY'.

Thanks
Mohammed Arif

On Oct 20, 6:17 pm, Mohammed Arif arif.moham...@gmail.com wrote:
 Hi,

 Seems like got stuck in the cross domain issue.

 Just trying to get the XML response from the servlet call through POST
 method:

 $.ajax({
                         type: POST,
                         url: http://10.210.221.43:9081/shopsfinder/servlet/
 ShopsFinderStoreServlet //THIS DOESN'T
 //url: ../ShopsFinderStoreServlet //IT WORKS
 ..

 It works fine when we place the servlet at the same location where our
 application server is, with the relative path.

 BUT we have to put the servlet somewhere else means [at some other
 location], due to some limitations.

 Then it doesn't hit the servlet and we don't give any response back to
 the browser and it goes in error function as given:

                         error: function(XMLHttpRequest, textStatus, 
 errorThrown) {
                                 alert(errror XMLHttpRequest:  + 
 XMLHttpRequest.responseXML + 
 textStatus:  + textStatus +   errorThrown:  +errorThrown);
                                 }

 Which gives all the values NULL and get the exception in FF.

 Do we have any work around to overcome this issue?

 Many thanks
 Mohammed Arif


[jQuery] Re: Access denied | uncaught exception in FF 2.0 | servlet call from another domain

2009-10-20 Thread MorningZ

Behaves as expected, you cannot make cross site/domain requests.

You've got two choices:
1) Use jsonP (http://www.ibm.com/developerworks/library/wa-aj-jsonp1/)
or
2) in the same location as your app, make a server side proxy class/
snippet that calls and mirrors the remote request

On Oct 20, 9:17 am, Mohammed Arif arif.moham...@gmail.com wrote:
 Hi,

 Seems like got stuck in the cross domain issue.

 Just trying to get the XML response from the servlet call through POST
 method:

 $.ajax({
                         type: POST,
                         url: http://10.210.221.43:9081/shopsfinder/servlet/
 ShopsFinderStoreServlet //THIS DOESN'T
 //url: ../ShopsFinderStoreServlet //IT WORKS
 ..

 It works fine when we place the servlet at the same location where our
 application server is, with the relative path.

 BUT we have to put the servlet somewhere else means [at some other
 location], due to some limitations.

 Then it doesn't hit the servlet and we don't give any response back to
 the browser and it goes in error function as given:

                         error: function(XMLHttpRequest, textStatus, 
 errorThrown) {
                                 alert(errror XMLHttpRequest:  + 
 XMLHttpRequest.responseXML + 
 textStatus:  + textStatus +   errorThrown:  +errorThrown);
                                 }

 Which gives all the values NULL and get the exception in FF.

 Do we have any work around to overcome this issue?

 Many thanks
 Mohammed Arif


[jQuery] Re: Access denied | uncaught exception in FF 2.0 | servlet call from another domain

2009-10-20 Thread Mohammed Arif

Exceptions are XMLHttpRequest: null failure code 0x80004005
ns_error_failure etc.


On Oct 20, 6:18 pm, Mohammed Arif arif.moham...@gmail.com wrote:
 P.S: We also don't want to use the cross domain solution through
 'PROXY'.

 Thanks
 Mohammed Arif

 On Oct 20, 6:17 pm, Mohammed Arif arif.moham...@gmail.com wrote:

  Hi,

  Seems like got stuck in the cross domain issue.

  Just trying to get the XML response from the servlet call through POST
  method:

  $.ajax({
                          type: POST,
                          url: http://10.210.221.43:9081/shopsfinder/servlet/
  ShopsFinderStoreServlet //THIS DOESN'T
  //url: ../ShopsFinderStoreServlet //IT WORKS
  ..

  It works fine when we place the servlet at the same location where our
  application server is, with the relative path.

  BUT we have to put the servlet somewhere else means [at some other
  location], due to some limitations.

  Then it doesn't hit the servlet and we don't give any response back to
  the browser and it goes in error function as given:

                          error: function(XMLHttpRequest, textStatus, 
  errorThrown) {
                                  alert(errror XMLHttpRequest:  + 
  XMLHttpRequest.responseXML + 
  textStatus:  + textStatus +   errorThrown:  +errorThrown);
                                  }

  Which gives all the values NULL and get the exception in FF.

  Do we have any work around to overcome this issue?

  Many thanks
  Mohammed Arif


[jQuery] Re: Am i missing something? tis not working in IE

2009-10-20 Thread jessie

Thank-you.

It was the trailing comma after 500

Simple but nasty to find!  LOL

Thanx
Jess

On Oct 20, 11:12 pm, MorningZ morni...@gmail.com wrote:
 Can you be more specific than dumping a bunch of lines of code and
 saying doesn't work... like can you pin down a general location of
 where it might be failing?

 one thing that stands out is the use of enter as a function name,
 and IE and reserved words like that don't play nice, try Enter or
 something that has no chance to conflict.  again, that's just a
 wild guess though

 On Oct 20, 5:40 am, jessie mi...@optusnet.com.au wrote:



  Hi

  Everything is working as it should in Firefox, i've checked the
  firebug and its not spitting out any errors.

  Except in IE its not working...

  Can someone please have a look at my code and tell me if i'm missing
  somethin gplease.

  Thank-you in advance.

  Jess.

  Here is the scripts.. in order.
  script type=text/javascript src=http://ajax.googleapis.com/ajax/
  libs/jquery/1.3.2/jquery.min.js/script
  script type=text/javascript src=skins/{VAL_SKIN}/jquery.easing.
  1.3.js/script
  script type=text/javascript src=skins/{VAL_SKIN}/
  jquery.fancybox-1.2.1.pack.js/script
  script type=text/javascript src=skins/{VAL_SKIN}/effects.js/
  script

  Here is all my code

  jQuery(function($) {

  function getLeaf(url) {
  var splited=url.split('?');// remove all the parameter from url
  url=splited[0];
  url=splited[0];
  return url.substring(url.lastIndexOf(/)+1);// return file name}

  jQuery.fn.extend({
   enter: function() {//plugins creation
       return this.each(function() {
         var pth = $(this).find(img)[0];
        //alert($(this).children().attr(href));
         if($(this).children().attr(href)==getLeaf
  (document.location.href)){// check that the link url and document url

             $(pth).attr(src,pth.src.replace(/.gif/g, '_active.gif'));
         } else{
                 $(this).hover(function(){
                    $(pth).attr(src,pth.src.replace(/.gif/
  g,'_active.gif'));// mouse over Image
                    },function(){
                        $(pth).attr(src,pth.src.replace(/_active.gif/
  g,'.gif'));
                        });
                 }
                 });
       }});

  $(function(){  // Document is ready
   $(.LPButton,.CatMoreBtn).enter();// call the function});

          $('input[type=image]').hover(
                  function () { $(this).attr(src, 
  $(this).attr(src).split('-
  off').join('-on')); },
                  function () { $(this).attr(src, 
  $(this).attr(src).split('-
  on').join('-off')); }
          );});

  $(function(){  // Document is ready
  $(a.group).fancybox({
                  'overlayShow'                   : true,
                  'zoomSpeedIn'                   : 600,
                  'zoomSpeedOut'                  : 500,
          });
          });

  It works fine if i delete this part

  $(function(){  // Document is ready
  $(a.group).fancybox({
                  'overlayShow'                   : true,
                  'zoomSpeedIn'                   : 600,
                  'zoomSpeedOut'                  : 500,
          });
          });

  So i must be missing something here.

  Thanks- Hide quoted text -

 - Show quoted text -


[jQuery] Re: easing 1.3 plugin how to implement pls?

2009-10-20 Thread jessie

yes i found the solution just 10 min ago on the fancybox groups !

It was a nasty, nasty thing i would of never figured it out! yet
so simple!

Thanx by the way.

Jess.

On Oct 20, 11:13 pm, Charlie charlie...@gmail.com wrote:
 take out trailing comma after 500
 IE will throw error every time on trailing commas
 jessie wrote:Thanx Richard, Well its all now working apart from IE! 
 Everything seems to flow fine in Firefox but none of it works in IE after i 
 implemented this to my effects.js $(function(){ // Document is ready 
 $(a.group).fancybox({ 'overlayShow' : true, 'zoomSpeedIn' : 600, 
 'zoomSpeedOut' : 500, }); }); Jess :) On Oct 20, 7:15 pm, Richard D. 
 Worthrdwo...@gmail.comwrote:Looking at the 'Available Options' 
 onhttp://fancybox.net/howto, my guess would be one of these settings: 
 easingIn, easingOut, easingChange   Easing used for animations - Richard On 
 Mon, Oct 19, 2009 at 8:10 AM, jessiemi...@optusnet.com.auwrote:Ok after 
 reading a bit i know realise that i have to animate and add the motionDoes 
 anyone know how i would do this please?This is what i have for my fancybox to 
 which i'd like to animate differently to the standard 
 swing.jQuery(function($) { $(a.group).fancybox({ overlayShow : true 
 });});Thanx JessOn Oct 19, 9:23 am, jessiemi...@optusnet.com.auwrote:HiI 
 have fancybox lightbox installed and i wanted a different transition effect.  
 So i've installed theeasing1.3 pluginI have read and re-read the instructions 
 but i don't really understand where i need to make the change for it to take 
 effect.Its all loading fine so there are no problems there.Here is the 
 instructions.http://gsgd.co.uk/sandbox/jquery/easing/Usage Default Choose a 
 defaulteasingmethod to overwrite the standard 'swing' animation. 
 Theeasingdefault is 'easeOutQuad', specify your own using the following: 
 jQuery.easing.def = string; Where string is one of the equation names. The 
 old swing function is renamed to jswing.U yes, and where do I make this 
 change? And not sure I know what a string is but I thought it would be any 
 othereasingfunction such as ‘easeInSine’ etc. no? but where exactly do I put 
 it?  am i suppose to edit the plugin or have another js file with those 
 commands?Thanks Jess- Hide quoted text -- Show quoted text -


[jQuery] Re: Problem with animate after submit in opera

2009-10-20 Thread Karl Swedberg


On Oct 20, 2009, at 3:53 AM, Constantin Valeriu Tuguran wrote:


Thanks for the help.
I wanted to give the user some feedback while waiting for an action to
complete so I can not return false.
I must find another way.


How about this, then? ...

$(document).ready(function(){
   $(.action).click(function(){
var thisHref = this.href;
$(#panel)
.animate({top:0px}, 500)
.animate({top:0}, 4000)
.animate({top:-75px}, 500, function() {
			window.location = thisHref; // -- follow the link after the last  
animation finishes.

});
		return false; // -- prevent the link from being followed before  
animations.

   });
 $(#panel).click(function(){
   $(#panel).hide();
   });
   });



--Karl


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



[jQuery] Re: Problem with animate after submit in opera

2009-10-20 Thread Constantin Valeriu Tuguran
Thanks again for your time.
The idea is this: I have an action that usually finishes instantly but can
take alot of time if on that action the database is migrated (this happens
rarely but it happens).
On this action i triggered the animation because I wanted to notify the user
somehow that things are happening in the background.
Actually in my code I added a delay function and it looks like this:

 $(#panel).delay(3000)
   .animate({top:0px}, 500)
 .animate({top:0}, 6)
   .animate({top:-75px}, 500);

So if the action takes more than 3 seconds it must be database migration so
the panel is shown.


2009/10/20 Karl Swedberg k...@englishrules.com


 On Oct 20, 2009, at 3:53 AM, Constantin Valeriu Tuguran wrote:

 Thanks for the help.
 I wanted to give the user some feedback while waiting for an action to
 complete so I can not return false.
 I must find another way.


 How about this, then? ...

 $(document).ready(function(){
$(.action).click(function(){
 var thisHref = this.href;
 $(#panel)
 .animate({top:0px}, 500)
  .animate({top:0}, 4000)
  .animate({top:-75px}, 500, function() {
 window.location = thisHref; // -- follow the link after the last animation
 finishes.
 });
  return false; // -- prevent the link from being followed before
 animations.
});
  $(#panel).click(function(){
$(#panel).hide();
});
});



 --Karl

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




[jQuery] jQuery Tabs - retain tabs on browser refresh

2009-10-20 Thread Chris

I have created a page that uses the jQuery UI tabs widget and an
accordion. I'm creating tabs dynamically when an item is clicked in
the accordion and loading a page into the tab. I have seen that there
is a cookie facility for the tabs to provide the ability to retain the
selected tab but I'm wondering if there is a way to retain my dynamic
tabs when the browser is refreshed?


[jQuery] jqueryui's sortable and Flash

2009-10-20 Thread David

Hi,

I've spend an insane amount of time on this issue but can't find a
solution, hopefully someone else has encountered (and solved) it.

I've created a simple ul list, with a bunch of li.  One of the
li is actually a Flash object that has its own event handlers for
mouse clicks.  However, the jquery's handlers always take precedence.
When I try to interact with the flash object, it instantly becomes a
draggable object.

I've (unsuccessfully) tried to:
- unblind click handlers for the Flash object - $
('flash_object').unbind('click');
- bind a new click handler to the Flash object - $
('flash_object').click(function(event) {event.stopImmediatePropagation
();})

I also tried various combinations of HTML tricks, no luck.
Thanks for your expertise!


[jQuery] html select to get value from mysql on change

2009-10-20 Thread rftemp

Hi Peoples,
Would appreciate some help with this one, have a nice little muliform
page
which is all working well but i need some of the html selects to call
back to jquery (working)
then the the jquery to call the php (working) then the php to call the
mysql ( not working at the moment)
then the whole lot to return the mysql data to the jquery to be used
in a formula. The problem i am having is
every time i select an option i add to the number of responses i get
ie select once 1 callback select something
else get 2 callbacks, i only want one callback per response!
here is the jquery :
$(select:#stock).change(function()
{
var stock = $(select#stock).val();
$.get(implement/stock_mysql.php, {'stockID': stock}, 
function(sw)
{
var pages = $(select#S_page_count).val();
var SW_total = (sw * pages);
alert( 'SW_total = ' + SW_total);
$(#Spine1).text(SW_total);
$(#Spine2).text(SW_total);
});
});
thanks in advance
rftemp


[jQuery] JQuery blockUI plugin - support for queueEmpty function

2009-10-20 Thread Subtle

How would I extend blockUI to have a function callback for when the
queue is empty?  I want to use something like this in a project where
I have several queued ajax requests, but I only want to call blockUI
on the first request and unblockUI when the queue is empty.

Thanks,

Russ


[jQuery] Some little Problems to extract data from ajax response ....

2009-10-20 Thread WebHamster

Hi all ...

I have some small problems with Jquery ...

I have a index.php site, inside this file it gives some div's with
ID's. When i load the index.php file (over $.ajax), it isnt accessible
for me  ... i thinks its better when i make a example...

$.ajax({
   url:'/index.php',
   type:'GET',
   success: function(data) {
   var responseText = $(data);
   $('body').html(responseText.find('body').html());
   }
})

This example does not work by me, make i something wrong? Another
issue is, that i can only find elements that are enclosed by a div
tag, but a body tag i cant make the div arround, because outside
of body div's will not be recognized ...


Anybody have me a hint for this? Thanks a lot and have a nice day ...


Cheers
WebHamster


[jQuery] Help validating form

2009-10-20 Thread ReynierPM


Hi every:
I'm trying to validate this form but I have a lot of problems. The file 
jquery.validations.paypal.js contains the code to validate the form. 
What's happen? For example if I leave a required field empty it doesn't 
validate and don't show the messages and so on. Can any help to fix this 
problems? I can't find where the problems are located!!! :(


Cheers and thanks in advance
[1] http://jose-couto.com/pintpal4/order_pintpal.html
--
Saludos
ReynierPM


[jQuery] getJSON: use retrieved data outside the function???

2009-10-20 Thread Dave

Hi

In the code below the second alert is executed before the first one
making it show the empty content, and not the result from the .json
file. Why, and how can I make it work???

-
getjson.html file
-
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
html xmlns=http://www.w3.org/1999/xhtml;
head
titlegetJson/title
script type=text/javascript src=http://code.jquery.com/jquery-
latest.js/script
script type=text/javascript
$(document).ready(function(){
var content = 'empty';
$.getJSON(getjson.json,
function(json){
content = json.layout.template[1].content;
alert(content);//This work
});
alert(content); //This don't
});
/script
/head
body/body
/html

-
getjson.json file
-
{
layout:
{
template:
[
{
key: 01,
content: span id=\span1\010101/span
},
{
key: 02,
content: span id=\span2\020202/span
},
{
key: 03,
content: span id=\span3\030303/span
}
]
}
}


[jQuery] Re: getJSON: use retrieved data outside the function???

2009-10-20 Thread MorningZ

Why, and how can I make it work??? 

Because you aren't understanding asynchronous behavior...

The script doesn't wait for the $.getJSON call to finish before
continuing on you'll need to do your work with content inside
the success event, even if that means calling another function passing
the json to it, like:

var content = 'empty';
$.getJSON(getjson.json,
function(json){
content = json.layout.template[1].content;
SomeFunction(content);
});


On Oct 20, 12:30 pm, Dave messedupp...@gmail.com wrote:
 Hi

 In the code below the second alert is executed before the first one
 making it show the empty content, and not the result from the .json
 file. Why, and how can I make it work???

 -
 getjson.html file
 -
 !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
 http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
 html xmlns=http://www.w3.org/1999/xhtml;
 head
     titlegetJson/title
     script type=text/javascript src=http://code.jquery.com/jquery-
 latest.js/script
     script type=text/javascript
         $(document).ready(function(){
             var content = 'empty';
             $.getJSON(getjson.json,
                 function(json){
                     content = json.layout.template[1].content;
                     alert(content);//This work
                 });
             alert(content); //This don't
         });
     /script
 /head
 body/body
 /html

 -
 getjson.json file
 -
 {
         layout:
         {
                 template:
                 [
                         {
                                 key: 01,
                                 content: span id=\span1\010101/span
                         },
                         {
                                 key: 02,
                                 content: span id=\span2\020202/span
                         },
                         {
                                 key: 03,
                                 content: span id=\span3\030303/span
                         }
                 ]
         }

 }


[jQuery] Re: password initial value without masking ****

2009-10-20 Thread Marco Barbosa

You were right Waseem.
Specially after Bi Jing confirmed. I think that is the best way.

If it doesn't work I wil go for background like Rupak suggested.

Thank you all for your help!

On Oct 20, 1:55 pm, rupak mandal rupakn...@gmail.com wrote:
 either you ca maintain two input element (like facebook), or make an image
 of passwordand  set the image to textbox background, on focus or click
 just remove the background-image.



 On Tue, Oct 20, 2009 at 2:09 PM, Bi Jing beco...@gmail.com wrote:
  For now, our project use two input elements to implement this, we still can
  not get easier way.
  Actually, not only password, but also text element, you need two inputs,
  one hidden one shown.

  Becoder.

  On Tue, Oct 20, 2009 at 4:08 PM, waseem sabjee 
  waseemsab...@gmail.comwrote:

  ok,why not absolutely position some text on a password box and hide that
  text on password box focus ?

  On Tue, Oct 20, 2009 at 10:05 AM, Marco Barbosa 
  marco.barbos...@gmail.com wrote:

  Hmmm. This is more complicated than I thought.

  waseem, having 2 input fields doesn't seem correct. Thought it might
  work I will have to pass that solution for this specific site.

  Liam, Your code didn't work either, I don't know why.

  Jörn, this watermark plugin is interesting but I don't want to use
  jquery ui on this site.
  That's because I'm already using that cleanField function and it would
  be redundant to have a plugin just for the login form.
  Also I gave it a try and the label didn't stay inside the input. So If
  i have to manually position it there, then it's another reason I will
  pass this solution as well.

  I though a simple jquery would do this.
  I think I will leave it masked and use a tooltip or something.

  Thanks guys!

  On Oct 19, 5:54 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
  wrote:
   Instead of replacing the input, display a label above it. Seehttp://
  wiki.jqueryui.com/Watermark

   Jörn

   On Mon, Oct 19, 2009 at 4:17 PM, Liam Potter radioactiv...@gmail.com
  wrote:

Here is how I do it. Just markup the form like normal (I use a
  definition
list to lay out my forms)

  $(input:password).each(function(){
      var $currentPass = $(this)
      $currentPass.css({opacity:0});
            $currentPass.before('input type=text value=Password
class=removeit style=position:absolute;z-index:10; /');
            var $visiblePassword = $(.removeit);
            $visiblePassword.focus(function () {
          $(this).css({opacity:0});
          $currentPass.focus().css({opacity:1});
      });
                $currentPass.blur( function () {
          if ( $currentPass.attr(value) ==  ){
              $currentPass.css({opacity:0});

  $visiblePassword.css({opacity:1}).attr(value,Password);
          }
      });
  });

waseem sabjee wrote:

ah yes i forgot.

you would get access denied when tried to change an input type
  property

the best way is to have two input types and just hide one and show
  the
other

but i have a solution for you
the html

       !-- The following html of two input types - we gonna switch
between them--
       input type=text class=textinput value=Passowrd /
       input type=password class=passinput value= /

the css

       style type=text/css
           /*    first we need to hide the password input*/
           .passinput {
               display:none;
           }
       /style

the js

       script type=text/javascript
           $(function() {
               // declare your input types
               var textinput = $(.textinput);
               var passinput = $(.passinput);
               // on text input focus - hide text input and show and
  focus
on password input
               textinput.focus() {
                   textinput.blur();
                   textinput.hide();
                   passinput.show();
                   passinput.focus();
               });
               // on password input blud hide password input and
  show and
focus on text input
               passinput.blur(function() {
                   passinput.blur();
                   passinput.hide();
                   textinput.show();
                   textinput.focus();
               });
           });
       /script

On Mon, Oct 19, 2009 at 2:51 PM, Marco Barbosa 
  marco.barbos...@gmail.commailto:
marco.barbos...@gmail.com wrote:

   Hi waseem!

   Thanks for your reply.

   Something's wrong with this line:
   $(#password).attr({type:'text'});

   I tried changing to:
   $(#password).attr('type','text'});

   but still no go.
   I have to comment out to get the other JS stuff on the site
  working.

   The rest of the code seems Ok. What could it be?

   I like your solution, pretty simple :)

 

[jQuery] Re: getJSON: use retrieved data outside the function???

2009-10-20 Thread Dave

Ok, thats how it work. Thanks for your answer. :)

Cheers / David

On Oct 20, 6:38 pm, MorningZ morni...@gmail.com wrote:
 Why, and how can I make it work??? 

 Because you aren't understanding asynchronous behavior...

 The script doesn't wait for the $.getJSON call to finish before
 continuing on you'll need to do your work with content inside
 the success event, even if that means calling another function passing
 the json to it, like:

 var content = 'empty';
             $.getJSON(getjson.json,
                 function(json){
                     content = json.layout.template[1].content;
                     SomeFunction(content);
                 });

 On Oct 20, 12:30 pm, Dave messedupp...@gmail.com wrote:



  Hi

  In the code below the second alert is executed before the first one
  making it show the empty content, and not the result from the .json
  file. Why, and how can I make it work???

  -
  getjson.html file
  -
  !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
  http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;
  html xmlns=http://www.w3.org/1999/xhtml;
  head
      titlegetJson/title
      script type=text/javascript src=http://code.jquery.com/jquery-
  latest.js/script
      script type=text/javascript
          $(document).ready(function(){
              var content = 'empty';
              $.getJSON(getjson.json,
                  function(json){
                      content = json.layout.template[1].content;
                      alert(content);//This work
                  });
              alert(content); //This don't
          });
      /script
  /head
  body/body
  /html

  -
  getjson.json file
  -
  {
          layout:
          {
                  template:
                  [
                          {
                                  key: 01,
                                  content: span 
  id=\span1\010101/span
                          },
                          {
                                  key: 02,
                                  content: span 
  id=\span2\020202/span
                          },
                          {
                                  key: 03,
                                  content: span 
  id=\span3\030303/span
                          }
                  ]
          }

  }


[jQuery] Re: JQuery blockUI plugin - support for queueEmpty function

2009-10-20 Thread Subtle

Solved the problem using $.ajaxStop to call unblockUI. See
http://docs.jquery.com/Ajax/ajaxStop

On Oct 20, 8:28 am, Subtle subtlekil...@gmail.com wrote:
 How would I extend blockUI to have a function callback for when the
 queue is empty?  I want to use something like this in a project where
 I have several queued ajax requests, but I only want to call blockUI
 on the first request and unblockUI when the queue is empty.

 Thanks,

 Russ


[jQuery] Re: Change row colors of table based on content

2009-10-20 Thread gjha...@gmail.com
Thanks for the solutions, I have figured out solutions like yours, but I
tought that may exists less-code solutions, so I opened this thread.
Thanks anyway, great solutions.

On Tue, Oct 20, 2009 at 00:18, Charlie charlie...@gmail.com wrote:

  I try to learn as much as I can from this sort of exercise.

 I made a couple of revisions to previously untested version, went back and
 made a couple of syntax and code fixes to previously untested suggestion

 I only submit this because it works on a limited sized table with simple
 names, not suggesting that it is highly efficient or not, and always open to
 learning why something isn;t efficient. Have been told in past not to use
 attr() but still not sure why.

 tested this in FF and IE
 live version :  http://jsbin.com/ayaji

 js:
 $(document).ready(function() {
var colorArray=[red,blue,green,orange,black];
 var colorCount=0;
 $(# table tr).each(function() {
 var classname= $(this).find(td).eq(1).text();
 if ($(.+classname).length 0) {
 var thisStyle=$(.+classname).eq(0).attr(style)
 $(this).attr(style, thisStyle)
 }else{
 if(colorCount4){
 colorCount=0
 }
 $(this).addClass(classname).css(color,colorArray[colorCount]
 )
 colorCount++
 }
 });
  });



 Bi Jing wrote:

 I like this issue and following is my draft implement, its working on
 IE/FF, hope it helps

 Firstly, I suggest adding a class to COSTUMER column that gonna making
 things easier.

 HTML sample code:

 TR
 TD1/TD
 TD class=COSTUMERdd/TD
 TDcc/TD
 TDss/TD
 TDss/TD
  /TR
  TR
 TD2/TD
 TD class=COSTUMER22/TD
 TD33/TD
 TDdsaf/TD
 TDfdas/TD
  /TR
 TR
 TD1/TD
 TD class=COSTUMERdd/TD
 TDcc/TD
 TDss/TD
 TDss/TD
  /TR

 and following is JS code :

 var color={};
 var offset=0;

 // Following fragment change cells color.
 $(tr .COSTUMER).each(function(i){
 var value=$.trim($(this).text());
 if(isDuplicated(value)){
 this.style.backgroundColor=generateColor(value);
 }
 });

 // This function is used to check whether content of one rows appears more
 than one time.
 function isDuplicated(value){
 return $(tr .COSTUMER).filter(function (){
 return $.trim($(this).html())==value;
 }).length1;
 }

 //Generate color with provided text value.
 function generateColor(text){
 if(!color[text]){
 color[text] = ['#ccc','#999','#88','#336699'][offset++];// For
 testing, only 4 elements in color array, you can increase it.
 }
 return color[text];
 }

 If you have more than 100 rows, this fragment maybe slow, but actually
 there should have a pagination, isnt it?

 Best
 Becoder.

 On Tue, Oct 20, 2009 at 5:33 AM, Charlie charlie...@gmail.com wrote:

 my starting thought would be use the name as a class, assign a color to
 class perhaps from an array of colors so you could have 10 colors and use
 them in order for first ten unique names, then repeat for next 10 unique
 names

 use a length ( or size) test to see if that class already exists, if it
 does, get the css from the first element with that class [grab the
 attr(style) ], don't use a new color and go to next name

 this is really rough and untested:

 var colorArray=[red,blueetc  ///setup color array, assuming 10
 colors for code below]
 var colorCount;
 $(#yourTable tr).each(function() {

 var classname= $(this).find(td).eq(1).text();
 if ($(.+classname).length 0) {
 var thisStyle=$(.+classname +).eq(0).attr(style)
 $(this).attr(style, thisStyle)
 }else{
 colorCount++
 if(colorCount9){
 colorCount=0
 }
 $(this).addClass(classname).css(color, colorArray[colorCount])
 }
 });






 Gewton Jhames wrote:

 Anybody want to discuss a way to change row colors of table based on
 content, for example:
 +-|---+
 |acess|COSTUMER   |
 |-|
 | 1   |   joseph  |
 | 2   |   mary|
 | 3   |   john|
 | 4   |   joseph  |
 | 5   |   joseph  |
 | 6   |   guile   |
 | 7   |   mary|
 | 8   |   craig   |
 +-+

 in this table, the name Joseph and Mary are repeated, so, every joseph
 or mary row must have the same color (picked randomly or not). so as every
 craig, guile or john row.
 I don't want to use css class names based on the name of the costumers
 because I don't know how many costumers are and how many times they appear
 or repeat.

 thanks







[jQuery] Re: password initial value without masking ****

2009-10-20 Thread waseem sabjee
I am experimenting around with other ways.the bad part about this is the a
browser will not allow you to change the type attribute - u suppose thats
for security purposes.
but ye - may be an absolutely positioned element over the text box can help
if you can get the z-indexing right to support IE.

On Tue, Oct 20, 2009 at 6:58 PM, Marco Barbosa marco.barbos...@gmail.comwrote:


 You were right Waseem.
 Specially after Bi Jing confirmed. I think that is the best way.

 If it doesn't work I wil go for background like Rupak suggested.

 Thank you all for your help!

 On Oct 20, 1:55 pm, rupak mandal rupakn...@gmail.com wrote:
  either you ca maintain two input element (like facebook), or make an
 image
  of passwordand  set the image to textbox background, on focus or click
  just remove the background-image.
 
 
 
  On Tue, Oct 20, 2009 at 2:09 PM, Bi Jing beco...@gmail.com wrote:
   For now, our project use two input elements to implement this, we still
 can
   not get easier way.
   Actually, not only password, but also text element, you need two
 inputs,
   one hidden one shown.
 
   Becoder.
 
   On Tue, Oct 20, 2009 at 4:08 PM, waseem sabjee waseemsab...@gmail.com
 wrote:
 
   ok,why not absolutely position some text on a password box and hide
 that
   text on password box focus ?
 
   On Tue, Oct 20, 2009 at 10:05 AM, Marco Barbosa 
   marco.barbos...@gmail.com wrote:
 
   Hmmm. This is more complicated than I thought.
 
   waseem, having 2 input fields doesn't seem correct. Thought it might
   work I will have to pass that solution for this specific site.
 
   Liam, Your code didn't work either, I don't know why.
 
   Jörn, this watermark plugin is interesting but I don't want to use
   jquery ui on this site.
   That's because I'm already using that cleanField function and it
 would
   be redundant to have a plugin just for the login form.
   Also I gave it a try and the label didn't stay inside the input. So
 If
   i have to manually position it there, then it's another reason I will
   pass this solution as well.
 
   I though a simple jquery would do this.
   I think I will leave it masked and use a tooltip or something.
 
   Thanks guys!
 
   On Oct 19, 5:54 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
   wrote:
Instead of replacing the input, display a label above it.
 Seehttp://
   wiki.jqueryui.com/Watermark
 
Jörn
 
On Mon, Oct 19, 2009 at 4:17 PM, Liam Potter 
 radioactiv...@gmail.com
   wrote:
 
 Here is how I do it. Just markup the form like normal (I use a
   definition
 list to lay out my forms)
 
   $(input:password).each(function(){
   var $currentPass = $(this)
   $currentPass.css({opacity:0});
 $currentPass.before('input type=text
 value=Password
 class=removeit style=position:absolute;z-index:10; /');
 var $visiblePassword = $(.removeit);
 $visiblePassword.focus(function () {
   $(this).css({opacity:0});
   $currentPass.focus().css({opacity:1});
   });
 $currentPass.blur( function () {
   if ( $currentPass.attr(value) ==  ){
   $currentPass.css({opacity:0});
 
   $visiblePassword.css({opacity:1}).attr(value,Password);
   }
   });
   });
 
 waseem sabjee wrote:
 
 ah yes i forgot.
 
 you would get access denied when tried to change an input type
   property
 
 the best way is to have two input types and just hide one and
 show
   the
 other
 
 but i have a solution for you
 the html
 
!-- The following html of two input types - we gonna
 switch
 between them--
input type=text class=textinput value=Passowrd /
input type=password class=passinput value= /
 
 the css
 
style type=text/css
/*first we need to hide the password input*/
.passinput {
display:none;
}
/style
 
 the js
 
script type=text/javascript
$(function() {
// declare your input types
var textinput = $(.textinput);
var passinput = $(.passinput);
// on text input focus - hide text input and show
 and
   focus
 on password input
textinput.focus() {
textinput.blur();
textinput.hide();
passinput.show();
passinput.focus();
});
// on password input blud hide password input and
   show and
 focus on text input
passinput.blur(function() {
passinput.blur();
passinput.hide();
textinput.show();
textinput.focus();
});
});
/script
 
 On 

[jQuery] Re: password initial value without masking ****

2009-10-20 Thread waseem sabjee
strangest thing though - to get around faults like these. i coded my own
jquery select box...as its made of div tags you can;t give it a name
attribute. but you can still send the value through ajax or a query string.

On Tue, Oct 20, 2009 at 7:49 PM, waseem sabjee waseemsab...@gmail.comwrote:

 I am experimenting around with other ways.the bad part about this is the a
 browser will not allow you to change the type attribute - u suppose thats
 for security purposes.
 but ye - may be an absolutely positioned element over the text box can help
 if you can get the z-indexing right to support IE.


 On Tue, Oct 20, 2009 at 6:58 PM, Marco Barbosa 
 marco.barbos...@gmail.comwrote:


 You were right Waseem.
 Specially after Bi Jing confirmed. I think that is the best way.

 If it doesn't work I wil go for background like Rupak suggested.

 Thank you all for your help!

 On Oct 20, 1:55 pm, rupak mandal rupakn...@gmail.com wrote:
  either you ca maintain two input element (like facebook), or make an
 image
  of passwordand  set the image to textbox background, on focus or click
  just remove the background-image.
 
 
 
  On Tue, Oct 20, 2009 at 2:09 PM, Bi Jing beco...@gmail.com wrote:
   For now, our project use two input elements to implement this, we
 still can
   not get easier way.
   Actually, not only password, but also text element, you need two
 inputs,
   one hidden one shown.
 
   Becoder.
 
   On Tue, Oct 20, 2009 at 4:08 PM, waseem sabjee 
 waseemsab...@gmail.comwrote:
 
   ok,why not absolutely position some text on a password box and hide
 that
   text on password box focus ?
 
   On Tue, Oct 20, 2009 at 10:05 AM, Marco Barbosa 
   marco.barbos...@gmail.com wrote:
 
   Hmmm. This is more complicated than I thought.
 
   waseem, having 2 input fields doesn't seem correct. Thought it might
   work I will have to pass that solution for this specific site.
 
   Liam, Your code didn't work either, I don't know why.
 
   Jörn, this watermark plugin is interesting but I don't want to use
   jquery ui on this site.
   That's because I'm already using that cleanField function and it
 would
   be redundant to have a plugin just for the login form.
   Also I gave it a try and the label didn't stay inside the input. So
 If
   i have to manually position it there, then it's another reason I
 will
   pass this solution as well.
 
   I though a simple jquery would do this.
   I think I will leave it masked and use a tooltip or something.
 
   Thanks guys!
 
   On Oct 19, 5:54 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
   wrote:
Instead of replacing the input, display a label above it.
 Seehttp://
   wiki.jqueryui.com/Watermark
 
Jörn
 
On Mon, Oct 19, 2009 at 4:17 PM, Liam Potter 
 radioactiv...@gmail.com
   wrote:
 
 Here is how I do it. Just markup the form like normal (I use a
   definition
 list to lay out my forms)
 
   $(input:password).each(function(){
   var $currentPass = $(this)
   $currentPass.css({opacity:0});
 $currentPass.before('input type=text
 value=Password
 class=removeit style=position:absolute;z-index:10; /');
 var $visiblePassword = $(.removeit);
 $visiblePassword.focus(function () {
   $(this).css({opacity:0});
   $currentPass.focus().css({opacity:1});
   });
 $currentPass.blur( function () {
   if ( $currentPass.attr(value) ==  ){
   $currentPass.css({opacity:0});
 
   $visiblePassword.css({opacity:1}).attr(value,Password);
   }
   });
   });
 
 waseem sabjee wrote:
 
 ah yes i forgot.
 
 you would get access denied when tried to change an input type
   property
 
 the best way is to have two input types and just hide one and
 show
   the
 other
 
 but i have a solution for you
 the html
 
!-- The following html of two input types - we gonna
 switch
 between them--
input type=text class=textinput value=Passowrd /
input type=password class=passinput value= /
 
 the css
 
style type=text/css
/*first we need to hide the password input*/
.passinput {
display:none;
}
/style
 
 the js
 
script type=text/javascript
$(function() {
// declare your input types
var textinput = $(.textinput);
var passinput = $(.passinput);
// on text input focus - hide text input and
 show and
   focus
 on password input
textinput.focus() {
textinput.blur();
textinput.hide();
passinput.show();
passinput.focus();
});
// on password input blud hide password input
 and
   show and
 

[jQuery] Re: JQuery, JFeed, Blogger

2009-10-20 Thread rob

I'm not sure if this JFeed plugin is not being used much, or maybe I'm
using it for the wrong thing.  Here's a better way to pull the Blogger
Content...

http://code.google.com/apis/gdata/samples/blogger_sample.html


On Oct 19, 2:59 pm, rob rob.sche...@gmail.com wrote:
 Hello,

 I've been working on this for a while and I can't seem to figure this
 out.  I'm trying to use the jFeed plugin to access an RSS feed from
 Blogger.  I'm not trying to use any authentication, I just want to use
 public read-only access.

 I tried some real simple examples at first (using jFeed Demo from
 jQuery.com).  When using the local XML file, everything works fine.
 When I try to use a blogger address it doesn't work.

 I've tried using:

 http://blogName.blogspot.com/atom.xmlhttp://blogName.blogspot.com/feeds/posts/defaulthttp://www.blogger.com/feeds/blogID/posts/default

 None of these seem to work.  Since a local XML file worked in the
 demo, I decided to use my own local XML file.  This worked fine,
 however, when I copied it over to another web server, I was seeing the
 same behavior.

 In all cases where there's an error, I see an Error 405 message.  In
 the function, it is requesting the file by 'GET' instead of 'POST',
 but when I look in firebug, it says 'OPTION.'

 Any help would be appreciated.


[jQuery] Re: password initial value without masking ****

2009-10-20 Thread Don Dunbar
Hi, another thing you can try is to use a label for the password input. Just
change the label styles to go on top of the input field ( it will look like
it is in the field.) Then when the input field has focus, hide the label so
it doesn't block the field.  I just saw Waseem has the same idea. Actually
in 'Learning jQuery 1.3', Karl shows how to do this in detail.DED

On Tue, Oct 20, 2009 at 3:05 AM, Marco Barbosa marco.barbos...@gmail.comwrote:


 Hmmm. This is more complicated than I thought.

 waseem, having 2 input fields doesn't seem correct. Thought it might
 work I will have to pass that solution for this specific site.

 Liam, Your code didn't work either, I don't know why.

 Jörn, this watermark plugin is interesting but I don't want to use
 jquery ui on this site.
 That's because I'm already using that cleanField function and it would
 be redundant to have a plugin just for the login form.
 Also I gave it a try and the label didn't stay inside the input. So If
 i have to manually position it there, then it's another reason I will
 pass this solution as well.

 I though a simple jquery would do this.
 I think I will leave it masked and use a tooltip or something.

 Thanks guys!

 On Oct 19, 5:54 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com
 wrote:
  Instead of replacing the input, display a label above it. Seehttp://
 wiki.jqueryui.com/Watermark
 
  Jörn
 
  On Mon, Oct 19, 2009 at 4:17 PM, Liam Potter radioactiv...@gmail.com
 wrote:
 
 
 
 
 
   Here is how I do it. Just markup the form like normal (I use a
 definition
   list to lay out my forms)
 
 $(input:password).each(function(){
 var $currentPass = $(this)
 $currentPass.css({opacity:0});
   $currentPass.before('input type=text value=Password
   class=removeit style=position:absolute;z-index:10; /');
   var $visiblePassword = $(.removeit);
   $visiblePassword.focus(function () {
 $(this).css({opacity:0});
 $currentPass.focus().css({opacity:1});
 });
   $currentPass.blur( function () {
 if ( $currentPass.attr(value) ==  ){
 $currentPass.css({opacity:0});
  
 $visiblePassword.css({opacity:1}).attr(value,Password);
 }
 });
 });
 
   waseem sabjee wrote:
 
   ah yes i forgot.
 
   you would get access denied when tried to change an input type
 property
 
   the best way is to have two input types and just hide one and show the
   other
 
   but i have a solution for you
   the html
 
  !-- The following html of two input types - we gonna switch
   between them--
  input type=text class=textinput value=Passowrd /
  input type=password class=passinput value= /
 
   the css
 
  style type=text/css
  /*first we need to hide the password input*/
  .passinput {
  display:none;
  }
  /style
 
   the js
 
  script type=text/javascript
  $(function() {
  // declare your input types
  var textinput = $(.textinput);
  var passinput = $(.passinput);
  // on text input focus - hide text input and show and
 focus
   on password input
  textinput.focus() {
  textinput.blur();
  textinput.hide();
  passinput.show();
  passinput.focus();
  });
  // on password input blud hide password input and show
 and
   focus on text input
  passinput.blur(function() {
  passinput.blur();
  passinput.hide();
  textinput.show();
  textinput.focus();
  });
  });
  /script
 
   On Mon, Oct 19, 2009 at 2:51 PM, Marco Barbosa 
 marco.barbos...@gmail.commailto:
   marco.barbos...@gmail.com wrote:
 
  Hi waseem!
 
  Thanks for your reply.
 
  Something's wrong with this line:
  $(#password).attr({type:'text'});
 
  I tried changing to:
  $(#password).attr('type','text'});
 
  but still no go.
  I have to comment out to get the other JS stuff on the site
 working.
 
  The rest of the code seems Ok. What could it be?
 
  I like your solution, pretty simple :)
 
  I was wondering if we could put this inside the cleanField function
  but I guess it's not necessary.
 
  ~Marco
 
  On Oct 19, 2:32 pm, waseem sabjee waseemsab...@gmail.com
  mailto:waseemsab...@gmail.com wrote:
   // set the initial type to text
   $(.mypasswordfield).attr({
 type:'text'
 
   });
 
   // on user focus - change type to password
   $(.mypasswordfield).focus(function() {
$(.mypasswordfield).attr({
  type:'password'
});
 
   });
 
   // on user blur - change type to back to text
   

[jQuery] Toggle Help

2009-10-20 Thread Dave Maharaj :: WidePixels.com
I am trying to toggle two different views on the page. I have the users
personal info in div id=edit_personalcontent/
 
So when the user clicks edit the content gets replaced with a form url:
/manage/personal/edit,

What would be the best way to do this/ So if they click edit the content
gets replaced with the form, if they hit cancel the form gets replaces with
the original content?
 
script type= text/javascript
$(document).ready(function(){
$(#edit_personal).click(function(){
  $(#edit_personal).toggle().ajax(function(){
   url: /manage/personal/edit,
 cache: false
  });   
 return false; 
 });
 });
/script
 
 
Thanks,
 
Dave


[jQuery] How to

2009-10-20 Thread vaqz

Hello..newbie here..
How do we compress a script tag without .js extension?

example:
*instead of this lt;script src=http://www.samplesite.com/apps/who/
onlinejs.jsgt;lt;/scriptgt;
*it will look like this lt;script src=http://www.samplesite.com/apps/
who/onlinejsgt;lt;/scriptgt;

notice that in my 2nd example it does not have .js at the end. So how
does it happen?
Any help is really appreciated.


Best,
vaqz


[jQuery] Re: JQuery blockUI plugin - support for queueEmpty function

2009-10-20 Thread Mike Alsup

 How would I extend blockUI to have a function callback for when the
 queue is empty?  I want to use something like this in a project where
 I have several queued ajax requests, but I only want to call blockUI
 on the first request and unblockUI when the queue is empty.

You can use the ajaxStart and ajaxStop events for managing concurrent
requests.  If your requests are really queued then I assume your code
would know when the queue empty state changes and you can write your
blocking logic around that.


[jQuery] Using CKEDITOR within Tabs plugin

2009-10-20 Thread Greg.Soulsby

I would like to use CKEDITOR on a textarea field within a form which
is within an Ajax Tab.

I thought the following would work - binding to the Load event, so
CKEDITOR is triggered once the Ajax data is loaded. The form and
texarea on the first Tab.

However, when I click from off this tab to another it leaves the
CKEDITOR tab showing.

$('#tabs2').tabs(
{
 remote: true,
 load: function(event, ui)
 {
  CKEDITOR.replace('editor1');
 }
});

I through it might be the CKEDITOR, so I got it to trigger only when
on the first Tab.

$('#tabs2').tabs(
{
 remote: true, load: function(event, ui)
 {
  alert('tabs load for' + ui.index);
  if(ui.index == 0)
  {
   alert('running editor');
   CKEDITOR.replace('editor1');
  }
 }
});

However, while this works to allow going to the other tabs, when I
click back on the first tab it loses the plot - not showing the first
tab, and then when clicking other tabs it does things like appending
the Ajax data to the end of the tab, without clearing the original
data.


[jQuery] Cluetip persist when mouse over hover

2009-10-20 Thread JD

I need the tooltip to persist when the mouse is over either the link
or over the tooltip.  I saw this functionality being displayed by
aCoolTip and it seemed to be the default.

The tooltip needs to be activated on hover and I also want sticky to
be false.

Is there any combination of settings that will give me this behavior?
Thanks!


[jQuery] Superfish - problems with other extensions

2009-10-20 Thread moby

Hallo,
as mentioned herehttp://forum.joomla.ch/viewtopic.php?t=5910
superfish unfortunately hinders other modules from working corretcly.
In my case it interferes with the gk_news_highlighter.

So I had to set priorities and removed superfish. Sorry.
Best regards


[jQuery] Marquee - can it be centered

2009-10-20 Thread Amy

I am using the Giva Labs marquee but I want the text to be centered.
Any thoughts on how to do this?


[jQuery] Re: Toggle Help

2009-10-20 Thread Etienne Robillard

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


I think you must have missed the docs for the $.ajax constructor. Looks
in the docs for the correct way to use it... ;-)

Hope this helps,

Etienne

Dave Maharaj :: WidePixels.com wrote:
 I am trying to toggle two different views on the page. I have the users
 personal info in div id=edit_personalcontent/
  
 So when the user clicks edit the content gets replaced with a form url:
 /manage/personal/edit,
 
 What would be the best way to do this/ So if they click edit the content
 gets replaced with the form, if they hit cancel the form gets replaces with
 the original content?
  
 script type= text/javascript
 $(document).ready(function(){
 $(#edit_personal).click(function(){
   $(#edit_personal).toggle().ajax(function(){
url: /manage/personal/edit,
  cache: false
   });   
  return false; 
  });
  });
 /script
  
  
 Thanks,
  
 Dave
 


- --
Etienne Robillard robillard.etie...@gmail.com
Green Tea Hackers Club http://gthc.org/
Blog: http://gthc.org/blog/
PGP Fingerprint: 178A BF04 23F0 2BF5 535D  4A57 FD53 FD31 98DC 4E57
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkreFvMACgkQ/VP9MZjcTlerTACgsNb4UsesKIbbJddNIIUDPsY6
JLQAn2/RLZBAHx/jbgiKnrnTHNNoNXtu
=oRtu
-END PGP SIGNATURE-


[jQuery] Delay keyup

2009-10-20 Thread wheatstraw

Hello

In the following code, I would like it delay the keyup. Does anyone
have an idea?

$(#search_query).bind(keyup, function(e){
$(#quickresults).slideDown(fast);

$.post(http://www.wesbite.com;, {search_query: 
$(e.target).val()},
function(result_list){
$(#quickresults  *:not(h3)).remove();
$(#quickresults).append(result_list);
});
});


[jQuery] Re: Delay keyup

2009-10-20 Thread aquaone
use clearTimeout and setTimeout w/ callbacks.

e.g. from my tablefilter code:
  // bind text entry
  $(input, $trInput).each( function(){
$(this).keyup( function(){
  var input = this;
  var timerCallback = function(){
filter( input, cache, $table[0] );
};
  clearTimeout( timer );
  timer = setTimeout( timerCallback, filterConfig.timerWait );
  return false;
  });
});


On Tue, Oct 20, 2009 at 13:13, wheatstraw psurr...@gmail.com wrote:


 Hello

 In the following code, I would like it delay the keyup. Does anyone
 have an idea?

$(#search_query).bind(keyup, function(e){
$(#quickresults).slideDown(fast);

$.post(http://www.wesbite.com;, {search_query:
 $(e.target).val()},
function(result_list){
$(#quickresults  *:not(h3)).remove();
$(#quickresults).append(result_list);
});
});



[jQuery] Autocomplete and Fancybox

2009-10-20 Thread Ramalho

Hi to all,

I'm trying to work out how to integrate a result comming from a
autocomplete to be showed in a fancybox, someone has some idea.


[jQuery] Overlay: extra, oversized, un-css-able border in IE 6 and 7

2009-10-20 Thread fatbike

Hi,
I'm a new to jquery (I like to think of it as young) but very familiar
with IE's standards or lack of them.

I've created a overlay using jquery.tools, obviously it works just
fine in all browsers, however the IE browsers are rendering an extra,
oversized border which I am not able to control with css. Upon further
investigation while using IE6's developer toolbar there appears to be
an image tag generated which has in-line style in the tag:

IMG style=BORDER-RIGHT: 0px; BORDER-TOP: 0px; DISPLAY: inline; Z-
INDEX: ; LEFT: 391px; BORDER-LEFT: 0px; WIDTH: 477px; BORDER-
BOTTOM: 0px; POSITION: absolute; TOP: 80px src=http://localhost/
fatbike/ overlay=true jQuery1256078090890=22 /

My questions are:

1. Is this image tag generated by jquery but all the proper browsers
know how to handle it?
2. How is the rendering of this image controllable in IE browsers (the
not so proper browsers) if jquery is responsible

You can see the problem live at www.fatbike.co.uk if you click the
'Contact' link in the footer, this, unfortunately does mean you have
to use a not so proper browser to see the problem.

If any body can help me with this it would be much appreciated


[jQuery] Same input, different data sources

2009-10-20 Thread robert

I have the following situation:  I'm trying to make the autocomplete
work for an input that will store 3 different variables (ex. sum,
currency and period) separated by comma. The autocomplete will work
for the last two, wich will be retrieved from  2 different urls.
Currently, I tryied to bind on keyup the input and execute the
autocomplete when it's' necesary, but, autocomplete plugin already has
a bind, and the result is a bubble, which sends lots of requests to
the urls I have configured.

Can someone tell me what is the the right approach for this kind of
functionality?


[jQuery] EasySlider 1.7

2009-10-20 Thread emmy wang

Hi,
I know noting about Javascript, but I try to use this plugin,
EasySlider/ 
http://cssglobe.com/post/5780/easy-slider-17-numeric-navigation-jquery-slider,
on my web page. Could anybody take a look here
http://crk.iri.columbia.edu/health/test/courseindex2.html, and let me
know how to make a text link to jump to a certain slide. For example,
click Influenza and Climate will jump to slide #2. Please help.
Thanks.


[jQuery] please help

2009-10-20 Thread wael alzard

hello all,

i have program a web site based on jquery ajax , but i have a problem
on preformence

that when i request any page and the content loaded form another page
the browser hangs when i call this method

$('Content').html(a); // this but the loaded page into current page

how can i improve the preformence ?


[jQuery] images show before jquery and cycle plugin work their magic

2009-10-20 Thread thor

Hi,
I am looking for assistance with a loading problem and my apologies if
this is beyond the scope of this group.

I am running the lastest jQuery and Jquery cycle plugin. I haven't
done any customization per se only trying to get the two components to
work.  I am at the point where things seem to work, however when the
page loads all 4 images in my DIV span down the page and then merge
into one at the end of the page load.

I've seen other implementation of these 2 components but the images
don't flash first and then merge.

Do you believe I need to create another function or put some more
logic into my page to have it load correctly.  My goal would be to
have everything seemlessly loaded from the start.  I've explored the
document.ready function and believe I have it in the correct location
of my site.  No matter what though other parts of the page load
first

I realize there are a lot of unknown variables but maybe someone has
an idea?

My site is clippervacations.com and I am going to change out the
current homepage banners with jquery functionality.  Nothing is LIVE
right now, but perhaps someone can get an idea.

Thanks,
Thor



[jQuery] Re: please help

2009-10-20 Thread Karl Swedberg
You could set up your server-side code to send back only a portion of  
the page rather than the entire thing. Other than that, we'd probably  
need to see more of your code before we could offer constructive advice.


--Karl


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




On Oct 20, 2009, at 4:52 PM, wael alzard wrote:



hello all,

i have program a web site based on jquery ajax , but i have a problem
on preformence

that when i request any page and the content loaded form another page
the browser hangs when i call this method

$('Content').html(a); // this but the loaded page into current page

how can i improve the preformence ?




[jQuery] Re: images show before jquery and cycle plugin work their magic

2009-10-20 Thread Karl Swedberg
If you have large images, they would take longer to load. No way  
around that. One thing you can do to avoid having the images span  
down the page is to add a style declaration for them in your  
stylesheet: position:absolute; I believe the cycle plugin sets the  
cycled elements to position:absolute as a safeguard in case it hasn't  
been done in the css already, but you should really do that yourself  
in the stylesheet. Also, make sure you set the container element to  
position: relative (if it's position: absolute, you can keep it that  
way) and set its overflow property hidden and give it explicit height  
and width. You still might see images loading one after the other, but  
at least they'll be overlapping, confined within the same space as  
dictated by the height and width of the container element. There are  
ways to get around this last issue, too, but first see how my  
suggestions so far work for you.



--Karl


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




On Oct 20, 2009, at 7:38 PM, thor wrote:



Hi,
I am looking for assistance with a loading problem and my apologies if
this is beyond the scope of this group.

I am running the lastest jQuery and Jquery cycle plugin. I haven't
done any customization per se only trying to get the two components to
work.  I am at the point where things seem to work, however when the
page loads all 4 images in my DIV span down the page and then merge
into one at the end of the page load.

I've seen other implementation of these 2 components but the images
don't flash first and then merge.

Do you believe I need to create another function or put some more
logic into my page to have it load correctly.  My goal would be to
have everything seemlessly loaded from the start.  I've explored the
document.ready function and believe I have it in the correct location
of my site.  No matter what though other parts of the page load
first

I realize there are a lot of unknown variables but maybe someone has
an idea?

My site is clippervacations.com and I am going to change out the
current homepage banners with jquery functionality.  Nothing is LIVE
right now, but perhaps someone can get an idea.

Thanks,
Thor





[jQuery] Strange formatting error (FF3 and jQuery)

2009-10-20 Thread JohnnyCee

I see a formatting error in Firefox 3.5.3 when I include jQuery 1.3.2
on a page even though I have not added any JavaScript of my own. A
paragraph element that is placed after an image is not honoring the
margin-top CSS parameter. The HTML and CSS are valid, and if I remove
the jQuery library, the margin-top works properly. I can adjust the
CSS a couple different ways to avoid the problem, but those changes
are not desirable (they don't provide the same result).

It seems like something in the jQuery initialization code is
interacting with some aspect of Firefox 3 and producing the incorrect
result when the page is fetched for the first time. Refreshing the
page corrects the problem.

In case it's not obvious, I need the jQuery library because the actual
page has scripting. I stripped that out while diagnosing the problem.

I've created a test page (URL below) that has only the bare
essentials, but please note that it takes a bit of care to see the
problem. Various things that should not affect the formatting of the
page, such as refreshing the page, will alter the page format and the
page will look right. If it looks right to you, you can try clearing
the FF3 cache, quitting Firefox, and refetching the page. That usually
works to show the issue.

The page shows the same image twice. The first image has a caption
that is right below the image, which is not right. The second image
has a 1em margin between the bottom of the image and top of the
paragraph text, which is the desired outcome.

To make the second image and caption work properly, I removed padding
from the element that encloses the IMG and P elements. That shouldn't
affect the margin on the P element, but it does. As explained above,
other tweaks like that can be used to avoid the problem, but they
affect what I am trying to do on the actual page.

Test page: http://www.johncardinal.com/tests/caption.htm

The test page references jQuery 1.3.2 via googleapis.com but that
doesn't matter; the problem was still there when I tested with a local
copy of jQuery.

Thanks in advance... I've been beating my head against the wall on
this one.


[jQuery] jQuery validation and error messages

2009-10-20 Thread talasan.nichol...@gmail.com

I don't really know where to start on this, but I need to take a form
like:

input name=username type=text id=username /
pinput description/p

And put an icon [the error label] next to input on success or fail;
but also change the p's text on success or fail.

So a fail would change the message to whatever the message was, and on
success it would return it back to it's normal text.

Or to make it more simple, how can I change the p's text but return
it back to its default on success?


[jQuery] Re: jQuery validation and error messages

2009-10-20 Thread Bi Jing
You can set id attribute of p element, e.g. username_desc
And then using following script,
if(success){
$(#username_desc).html('default msg');
}else{
$(#username_desc).html('error msg');
}

Or you can add a new p used to show error message, toggle it between
default p on your validation result.

Becoder.
On Wed, Oct 21, 2009 at 11:06 AM, talasan.nichol...@gmail.com 
talasan.nichol...@gmail.com wrote:


 I don't really know where to start on this, but I need to take a form
 like:

 input name=username type=text id=username /
 pinput description/p

 And put an icon [the error label] next to input on success or fail;
 but also change the p's text on success or fail.

 So a fail would change the message to whatever the message was, and on
 success it would return it back to it's normal text.

 Or to make it more simple, how can I change the p's text but return
 it back to its default on success?


[jQuery] Re: How to get active image centeres in jCarousel?

2009-10-20 Thread Ghprod

Hi,

this param just get where image to start but not center them :(

regards

thnx