[jQuery] Re: Horizontal image carousel w/scrollbar plugin for jQuery?

2009-11-05 Thread wshawn
Have you looked at: http://flowplayer.org/tools/demos/scrollable/index.html

This is by far one of the most flexible ones I have ever seen.

On Nov 5, 12:39 am, tatlar robertlnew...@gmail.com wrote:
 Hi jQuery gurus,

 Has anyone seen an equivalent of dyn-web's scrollbar but written on
 top of jQuery?

 http://www.dyn-web.com/code/scroll/horiz.php

 I have a client who wants this functionality, but I cannot use the dyn-
 web as it conflicts with the jQuery plugins that I am currently using.
 I assume it is due to how events are registered and handled.

 I have searched all over but cannot find (a) an image carousel that is
 controlled with an onmouse event (they are all onclick events), and
 (b) the scrollbar progression beneath the carousel as the user moves
 horizontally through the gallery.

 I am more than happy to attempt to write my own, but if anyone knows
 of any pointers to get me started I would be most grateful.

 FWIW I am currently using the jCarouselLite plugin, which is great,
 but just not _exactly_ what the client wants.

 Thanks in advance.


[jQuery] Re: Horizontal image carousel w/scrollbar plugin for jQuery?

2009-11-05 Thread wshawn

Have you considered: http://flowplayer.org/tools/demos/scrollable/index.html

I is one of the most flexible ones I have seen.
On Nov 5, 11:54 am, tatlar robertlnew...@gmail.com wrote:
 Hi Karl,

 Thanks for the response. Wow - those solutions are pretty tight.

 The Highpoint site JS source code is slightly easier to read that the
 Fusionary site, so I will study that.

 Best regards,
 - Rob

 On Nov 5, 5:32 am, Karl Swedberg k...@englishrules.com wrote:

  The jQuery UI Slider is great for this sort of thing. It's not an out-
  of-the-box solution, but if you're willing to write some of your own  
  code, it can make doing this sort of thing a lot easier.

  Here are two implementations that I've put together. Nothing  
  spectacular, and probably not exactly what you're looking for, but it  
  should give you an idea of what can be done:

 http://www.fusionary.com/http://www.highpointre.com/

  --Karl

  
  Karl Swedbergwww.englishrules.comwww.learningjquery.com

  On Nov 5, 2009, at 12:39 AM, tatlar wrote:

   Hi jQuery gurus,

   Has anyone seen an equivalent of dyn-web's scrollbar but written on
   top of jQuery?

  http://www.dyn-web.com/code/scroll/horiz.php

   I have a client who wants this functionality, but I cannot use the  
   dyn-
   web as it conflicts with the jQuery plugins that I am currently using.
   I assume it is due to how events are registered and handled.

   I have searched all over but cannot find (a) an image carousel that is
   controlled with an onmouse event (they are all onclick events), and
   (b) the scrollbar progression beneath the carousel as the user moves
   horizontally through the gallery.

   I am more than happy to attempt to write my own, but if anyone knows
   of any pointers to get me started I would be most grateful.

   FWIW I am currently using the jCarouselLite plugin, which is great,
   but just not _exactly_ what the client wants.

   Thanks in advance.


[jQuery] (treeview) Question/Request regarding toggle and links

2009-11-05 Thread drmrboy
Is it  possible to not toggle a node in the tree if the user clicked
on an anchor in the list entry?  Right now, the hitbox is the entire
list element.  If that list element contains an anchor, the anchor is
followed as well as the node in the tree is toggled.  I would like to
find a way to do the toggle only if a user clicks the part of the
hitarea that is not an anchor.


[jQuery] jQuery slider

2009-11-05 Thread Arpanet
Hi there,

I'm developing a page that will present the user with a content
slider, so that the user can click 'next' to browse through the
slides.

However, when the user reaches the last slide in the list the 'next'
button needs to be replaced with a different button and take the user
to another page on the site instead of going back to the beginning of
the slides.

I wondered if anyone had any advice on how to code this?

Thank you.


[jQuery] How to Get Div from IFrame

2009-11-05 Thread Danish
I have a page with multiple Frames and Division, Now I am trying to
extract one div having id=my_div from iframe with Id =
canvas_frame but I am fail to do so, Nor I am getting iframe neither
Division in iframe.
I tried all these selectors but always null returns although they are
in page:
1) $(my_div);
2) $(my_div,canvas_frame);
3) $(canvas_frame,content.document);
4) $(canvas_frame);
5)  var $frame = $(canvas_frame,content.document);
 var $div = $(my_div,$frame);

I am able to do this with Pure JavaScript but due to some reasons I
want to use JQuery Library, Any help will be highly appreciated.


[jQuery] Validate (validation plugin)

2009-11-05 Thread Jaap
I'm using http://docs.jquery.com/Plugins/Validation and am wondering
if it's possible to have this plugin not allow the standard value.

I'm only showing my input boxes with the desired content named in it
with the value attribute. This will dissapear when somebody starts
editing.

So my form looks like:
input type=text class=inputField required name=name
value=Enter Your Name Here type=text/

So anything should be allowed except Enter Your Name Here...

Is there anyone who knows the trick?

Regards,

Jaap


[jQuery] Refreshing droppable locations

2009-11-05 Thread Keith Otto
I have a list, with many levels of child lists within some LI
elements. These child lists are set to display:none until you click on
their parent to display the first level of children.

I'm implementing the ability to drag the LI elements around in order
to change their parent to a different item. This works fine for the
first level of elements.

I added to the 'over' event of droppable to change child lists to
display: block if you drag over an LI with children. My problem is
when this list appears, and I continue dragging down to the first
child element, it actually hightlights the next root level element
(sibling to the parent that just expanded) which used to be in that
location before changing the display.

Is there any way to refresh the locations of the droppable items?


[jQuery] Checking for offset() changes in earlier launched method [events]

2009-11-05 Thread d
Hi all,

I'm having an issue with something probably easy but I might be too
dumb for it :)

Put simply it's this:

- I'm having a plugin that uses element.offset() to position other
elements. This works great. Let's call this 'MyPlugin'.

- Then another plugin/function which makes changes to the page, thus
altering the element.offset()

So the first one is the one that can be changed, the others are just
extra, other plugins, functions - which I have no control of.

Now here's the issue: in order to make the first plugin still work
correctly, I need to instantiate it after the second one, so its
calculation of the offset is correct.

In case of this, it's no problem to change the init order of the two
so the offset is calculated correct. But when you show/hide() elements
dynamically it becomes a problem - and the first one gets the offset
wrong.

Now I'm wondering: how can I make the first plugin so that it always
uses an updated version of offset(), no matter in which order all the
plugins are triggered or how the page is changed.

I hope this makes sense :)


[jQuery] how do i prevent having a paragraph tag for the text AFTER i expand?

2009-11-05 Thread Kei Simone
Hi

i noticed that whenever i expanded the text, the subsequent text
expanded.

and the expand prefix...

also tends to be on the next line.

Please advise.

This is my expand code.

$(document).ready(function() {



  // override some default options
  $('div.expandable div').expander({

slicePoint:   160,  // default is 100
expandText: 'div class=expand-
buttonnbsp;nbsp;nbsp;nbsp;nbsp;Expand/div', // default is
'read more...'
//expandSpeed:  '2000', // speed in milliseconds of the animation
effect for expanding the text
//expandPrefix: '...',
 expandEffect: 'fadeIn',
collapseTimer:0, // re-collapses after 5 seconds; default is
0, so no re-collapsing
userCollapseText: 'Collapse' , // default is '[collapse expanded
text]'

afterExpand: function($thisElement) {

  var vendorParaID = $thisElement.attr('id');

  var underscore = vendorParaID.indexOf('_');

  var vendorID = vendorParaID.substring(0, underscore);

  $(#vendor_img_+vendorID).replaceWith($preloadImgVendor
[vendorID]);

  var heightOfDIV = $thisElement.height();

  if(heightOfDIV  290){
$thisElement.attr({style : height:290px;overflow:auto});
  }

  //console.debug($thisElement);
},
onCollapse: function($thisElement, byUser) {
  //alert($thisElement.attr('id'));
  var vendorParaID = $thisElement.attr('id');
  var underscore = vendorParaID.indexOf('_');

  var vendorID = vendorParaID.substring(0, underscore);

  $(#vendor_img_+vendorID).replaceWith($preloadImgVendorCrop
[vendorID]);

  var heightOfDIV = $thisElement.height();


  if(heightOfDIV  68){
$thisElement.removeAttr(style);
  }


  //console.debug($thisElement);
}
  });



});

This is my div for the expandable.

 div class=expandable 
div id={$vender.id_manufacturer}
_desc{$vender.description}/div


/div



[jQuery] Superfish -- Problem in IE7 and IE8 for drop down with iframe with (xml xsl content)

2009-11-05 Thread Ram Kumar
Hi,
 If the dropdown overlaps on iframe with XML, XSL content in it,
dropdown is hidden back to the iframe. It is happening if IE7 or IE8.
In IE6 it works fine. If the content in iframe is html, it works fine
in all IE versions. The problem is only if the content is xml and xsl.

Suggest Please.

Regards,
Ram


[jQuery] superfish add class current automatically...

2009-11-05 Thread arnaud74130
Hello,

Just a post to share the code, because I spend some times to
automatically add the class current to all li's parent tags when you
click on the superfish navbar menu...

so here the jquery code:
script type=text/javascript

$(document).ready(function(){
$(ul.sf-menu).superfish({
pathClass:  'current'
});

$('#menu2 li a').click(function() {
$(#menu2 li).removeClass('current');
$(this).parents().filter(li).addClass
('current');
$(ul.sf-menu).superfish({
pathClass:  'current'
});
});
});

/script

And the html, is a usual for menus...

div id=menu2
ul class=sf-menu sf-navbar
li
a href=# Admin/a
ul
...

I start learning jquery with this problem, and even if it works, I
think there is a better way to set the class current to all the
parents BUT just for the li's parents...

The idea was to set a function on the link $(this) and then use the
parents function and select only the li...
$(this).parents().filter(li).addClass('current');

Does filter is the good way ?


thanks;

arnaud




[jQuery] looking for a plugin or code that displays text slowly

2009-11-05 Thread Chris Hall
Hello everyone.

I'm looking for a plugin or code that will display the text contents
slowly so it will simulate a live eent.

For example:

The fight begins...

 brief pause

Fighter 1 throws a stiff jab followed by an upper cut!

 brief pause

Fighter 2 tries a takedown!!!


etc.


Does anything like this exist?  If not, would it be difficult to
create using jQuery?


Re: [jQuery] looking for a plugin or code that displays text slowly

2009-11-05 Thread Logan Bailey

This is just straight JS.

You're probably looking to do a time event i'd say.
Check out
https://developer.mozilla.org/en/DOM/window.setInterval


[jQuery] Re: Submitting after Validation

2009-11-05 Thread StephenJacob
Thanks for the insight Jules! With that it pushed me in the direction
that I finally got working.

1 issue remaining that isn't that big of a deal but i would love to
resolve it.

After submitting the form it opens a div #success and closes it after
3 seconds.  If i submit the form again, without refreshing the page,
it doesn't show this success message. Any idea why it's not triggering
the success message again?

$(document).ready(function() {

$(#contactForm).validate({
rules: {
fullname: {
required: true,
minlength: 2
},
email: {
required: true,
email: true
},
company: {
required: true,
minlength: 2
},
phone: {
required: true,
minlength: 2
},
},
messages: {
fullname: 'span class=errorPlease enter 
your bfull name/
b./span',
email: 'span class=errorPlease enter a 
valid bemail address/
b./span',
company: 'span class=errorPlease enter your 
bcompany/b./
span',
phone: 'span class=errorPlease enter your 
bphone number/
b./span'
},
submitHandler: function(form) {

$('#contactForm').ajaxSubmit({
resetForm: true,
target: '#success',
success: function() {
$(#success).fadeIn(slow);
var clearSuccess = function() { 
$('#success').fadeOut('slow',
function() { $(#success).remove(); }); };

window.setTimeout(clearSuccess,3000);
}

});
}
});
});




On Nov 4, 5:03 pm, Jules jwira...@gmail.com wrote:
 Hi Stephen,

 Try using input type=button instead of submit as per my example
 below.  Excuse the aspx :).

 register.aspx code.

         string usrName = Request[userName];
         Response.Clear();
         Response.Write(Hello  + usrName);
         Response.End();

 -- client side code and html

     script type=text/javascript
         $(document).ready(function() {
             $(form).validate();
             $(#userName).rules(add,
             {
                 required: true,
                 messages: { required: User Name is required. }
             });

             $(#submitForm).click(function() {

             if ($(form).valid()) {
                 $.post(register.aspx, $(form).serialize(), function
 (data, status) { $(#message).text(data) }, text)
                 }
             });
         });

     /script

 body
 div id=message/div
 form id=dataForm
 table
 tr
 tdlabelUser Name:/label/td
 tdinput type=text id=userName name=userName value=//td
 /tr
 tr
 td colspan=2input type=button id=submitForm name=submitForm
 value=Submit //td
 /tr
 /table
 /form
 /body

 --- end of client side code and html

 On Nov 5, 7:41 am, StephenJacob turnstylecreat...@gmail.com wrote:

  Just to clarify, the $.post function works perfectly and returns my
  json results. Due to the limitations of the validation system i was
  using (no remote options) i had to begin using the standard
  jquery .validate library.

  Please help me understand how to implement the .Validate w/ my HTML
  form.

  As you can see the $.post option has the process.php written in the
  Jquery and leaves the HTML form action blank.  With the
  Jquery .Validate, I need to define the process.php as the Action
  correct?  If so, why does the form continue to submit normally?

  Thanks for all the help everyone! I think with a bit more guidance
  i'll have a really strong understanding of the validation system.

  On Nov 4, 3:33 pm, StephenJacob turnstylecreat...@gmail.com wrote:

   @Leonard, unfortunately it's not due to the function argument.

   @Dylan, I've looked at this tutorial a few times. It's not using the
   official Jquery Validate system and hasn't been able to help me fill
   in any gaps in my learning curve... It seems that every tutorial has
   their own convoluted system to doing validation.. And the ones that do
   use the standard validation system none of them thoroughly explain the
   form submission part.

   

[jQuery] Re: Submitting after Validation

2009-11-05 Thread StephenJacob
I'm learning!

I replaced:

$(#success).fadeIn(slow);
var clearSuccess = function() { $('#success').fadeOut('slow', function
() { $(#success).remove(); }); };
window.setTimeout(clearSuccess,3000);

With:

$(#success).fadeIn('slow').fadeTo(5000, 1).fadeOut('slow');


Viola!

On Nov 5, 3:46 pm, StephenJacob turnstylecreat...@gmail.com wrote:
 Thanks for the insight Jules! With that it pushed me in the direction
 that I finally got working.

 1 issue remaining that isn't that big of a deal but i would love to
 resolve it.

 After submitting the form it opens a div #success and closes it after
 3 seconds.  If i submit the form again, without refreshing the page,
 it doesn't show this success message. Any idea why it's not triggering
 the success message again?

 $(document).ready(function() {

         $(#contactForm).validate({
                         rules: {
                                 fullname: {
                                         required: true,
                                         minlength: 2
                                 },
                                 email: {
                                         required: true,
                                         email: true
                                 },
                                 company: {
                                         required: true,
                                         minlength: 2
                                 },
                                 phone: {
                                         required: true,
                                         minlength: 2
                                 },
                         },
                         messages: {
                                 fullname: 'span class=errorPlease enter 
 your bfull name/
 b./span',
                                 email: 'span class=errorPlease enter a 
 valid bemail address/
 b./span',
                                 company: 'span class=errorPlease enter 
 your bcompany/b./
 span',
                                 phone: 'span class=errorPlease enter your 
 bphone number/
 b./span'
                         },
                         submitHandler: function(form) {

                                 $('#contactForm').ajaxSubmit({
                                         resetForm: true,
                                         target: '#success',
                                         success: function() {
                                                 $(#success).fadeIn(slow);
                                                 var clearSuccess = function() 
 { $('#success').fadeOut('slow',
 function() { $(#success).remove(); }); };
                                                 
 window.setTimeout(clearSuccess,3000);
                                         }

                                 });
                         }
                 });

 });

 On Nov 4, 5:03 pm, Jules jwira...@gmail.com wrote:

  Hi Stephen,

  Try using input type=button instead of submit as per my example
  below.  Excuse the aspx :).

  register.aspx code.

          string usrName = Request[userName];
          Response.Clear();
          Response.Write(Hello  + usrName);
          Response.End();

  -- client side code and html

      script type=text/javascript
          $(document).ready(function() {
              $(form).validate();
              $(#userName).rules(add,
              {
                  required: true,
                  messages: { required: User Name is required. }
              });

              $(#submitForm).click(function() {

              if ($(form).valid()) {
                  $.post(register.aspx, $(form).serialize(), function
  (data, status) { $(#message).text(data) }, text)
                  }
              });
          });

      /script

  body
  div id=message/div
  form id=dataForm
  table
  tr
  tdlabelUser Name:/label/td
  tdinput type=text id=userName name=userName value=//td
  /tr
  tr
  td colspan=2input type=button id=submitForm name=submitForm
  value=Submit //td
  /tr
  /table
  /form
  /body

  --- end of client side code and html

  On Nov 5, 7:41 am, StephenJacob turnstylecreat...@gmail.com wrote:

   Just to clarify, the $.post function works perfectly and returns my
   json results. Due to the limitations of the validation system i was
   using (no remote options) i had to begin using the standard
   jquery .validate library.

   Please help me understand how to implement the .Validate w/ my HTML
   form.

   As you can see the $.post option has the process.php written in the
   Jquery and leaves the HTML form action blank.  With the
   Jquery .Validate, I need to define the process.php as the Action
   correct?  If so, why does the form continue to submit normally?

   Thanks for all the help everyone! I think with a bit more guidance
   i'll have a really strong understanding of the validation system.

   On Nov 4, 3:33 pm, StephenJacob turnstylecreat...@gmail.com wrote:


Re: [jQuery] jQuery slider

2009-11-05 Thread Michel Belleville
Have the next page button already on the page, hide it just as the page is
shown, then show it and hide the next slide button when you reach the last
slide. You can do that with a css toggle by giving toggle classes to the
nearest parent of both the next page and next slide buttons and writing a
css rule that does the hiding / showing when the toggle class is present or
not.

Michel Belleville


2009/11/4 Arpanet neilbrad...@gmail.com

 Hi there,

 I'm developing a page that will present the user with a content
 slider, so that the user can click 'next' to browse through the
 slides.

 However, when the user reaches the last slide in the list the 'next'
 button needs to be replaced with a different button and take the user
 to another page on the site instead of going back to the beginning of
 the slides.

 I wondered if anyone had any advice on how to code this?

 Thank you.



Re: [jQuery] How to Get Div from IFrame

2009-11-05 Thread Michel Belleville
$('#canvas_frame').contents().find('#my_div');

To seek an id use #, to seek inside a div use .contents().

Plus, refrain from using iframe, this is almost as bad as using frame and
almost never worth it. AJAX is good for you instead of shitty iframes.

Michel Belleville


2009/11/5 Danish engrdanishsid...@gmail.com

 I have a page with multiple Frames and Division, Now I am trying to
 extract one div having id=my_div from iframe with Id =
 canvas_frame but I am fail to do so, Nor I am getting iframe neither
 Division in iframe.
 I tried all these selectors but always null returns although they are
 in page:
 1) $(my_div);
 2) $(my_div,canvas_frame);
 3) $(canvas_frame,content.document);
 4) $(canvas_frame);
 5)  var $frame = $(canvas_frame,content.document);
 var $div = $(my_div,$frame);

 I am able to do this with Pure JavaScript but due to some reasons I
 want to use JQuery Library, Any help will be highly appreciated.



[jQuery] Toggle Help

2009-11-05 Thread Dave Maharaj :: WidePixels.com
I am loading a page using $Ajax and upon success i run a toggle function.
 
Now how can i set it up so that once its been loaded it will not make a
second Ajax request?
 
Basically a user clicks edit and i get the form via Ajax request  and place
it into a div. Once completed the original content toggles to the newly
loaded form. If a user clicks cancel the form toggles revealing the original
content.
But if they click edit again it runs the request to get the form. But since
its already been loaded and now just hidden in the div so i do not need to
make the Ajax request call again
 
$(a#mod_test).click(function(){
  $('#test').after('div class=loading/div');
  $('.loading').fadeIn('normal');
  $.ajax({
   type: POST,
   url: '/manage/account/edit',
   cache: true,
   success: function(data){
$('.loading').fadeOut('normal').remove();
$(#test).slideToggle('slow').toggleClass(hidden);
$(#testForm).html(data).slideToggle('slow');
}
   });
 return false;  
 });

How can I set a variable in the success function so that when the user
clicks it checks to see if its been loaded already

Something like this I tried but no go

if (loadedAlready = false)
{
$.ajax({
   type: POST,
   url: '/manage/account/edit',
   cache: true,
   success: function(data){
loadedAlready = true;
$('.loading').fadeOut('normal').remove();
$(#test).slideToggle('slow').toggleClass(hidden);
$(#testForm).html(data).slideToggle('slow');
}
   });



} else {

$('.loading').fadeOut('normal').remove();
$(#test).slideToggle('slow').toggleClass(hidden);
$(#testForm).slideToggle('slow');



}
 
Dave 



[jQuery] combining Superfish script and lightbox

2009-11-05 Thread nicoobijubi
I am having trouble using two scripts on the same page and having them
both function correctly.

The scripts are:
lightbox - from dynamic drive here 
http://www.dynamicdrive.com/dynamicindex4/lightbox2/index.htm
and
superfish - http://users.tpg.com.au/j_birch/plugins/superfish/#faq

I have discovered that the 2 clashing files are
lightbox - script type=text/javascript src=js/scriptaculous.js?
load=effects/script
and
superfish - script type=text/javascript src=js/
jquery-1.2.6.min.js/script

If i remove the link to one of these scripts the other will function
perfectly. The problems i am encountering with both scripts running
simultaneously is that lightbox wont function at all and the drop
shadow, arrows and fade in display functions of the superfish nav wont
display.

If anyone has any idea how to fix this I would greatly apreciate it.

Thanks!!


[jQuery] How to determine number of elements after dom manipulation ?

2009-11-05 Thread bakman
I am generating elements (img's) based on data from an xml file.
Once that is done, I want to determine the number of icons that were
generated.

as naive as i am, i do a: alert($('img').size())
result: 0, which isn't the case

how can i determine them after they have generated ?
**
function dataloader(location,service,div){
$.ajax({
type: GET,
url: includes/data.xml,
dataType: xml,
success: function(xml) {

$(xml).find('group').each(function(){
if($(this).attr(name) == service){
$(this).find(Service).each(function(){
var type = $(this).find(Type).text()
var host = $(this).find(Host).text()
var name = $(this).find(Name).text()
var site = $(this).find(Site).text()

if(type == Host  site == location){
$('img src=images/server.jpg 
title='+ host +' /').appendTo
('#'+div);
}
})
}
});
}
});

}


[jQuery] Superfish - Last-child and Parent class at the same time

2009-11-05 Thread Goh Hao-Wei
Hello,

How do I get a li item to have both the Parent and the Last-Child
class at the same time? Reason is, I'm making use of Last-child class
to control the borders for the last item in a sub menu, but I'm having
difficulties when the last-child has its own sub menu, making it only
having the parent class without the last-child class.


Re: [jQuery] passing a variable through an attribute filter

2009-11-05 Thread Marcel Araujo
Yes, you can do this!!!

Sorry for my poor english but I hope help you!

$(input[name='txtName']).css('background-color','#F00');

And this way too.

var field_property = txtName;

*$(input[name='+field_property+']).css('background-color','#F00');*



2009/11/3 barbercraig craigbarbe...@googlemail.com


 Hi Guys,

 This is my very first post! so please be kind :)

 Ok, i am very novice to jQuery. But what i am trying to do is use the
 jQuery
 attribute selector to select an input with a specific name.

 I can select an input of name type fine by doing the folowing:

  $(input[name='name']).do something...

 But, can i pass a variable into that filter? to search for a variable?

 So if i had a variable called 'field_name' containing the text: 'email',
 can
 i do something like this:

 $(input[name='(field_name)']).do something...

 So that it in this caseit would find an input with the name 'email'

 Sorry if this is a doofus question, just can't find any examples of this
 anywhere

 thanks for your help guys,

 cheers

 Craig

 --
 View this message in context:
 http://old.nabble.com/passing-a-variable-through-an-attribute-filter-tp26160102s27240p26160102.html
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.




-- 
Abraços..

Marcel Araujo
System Analyst
Developer Java/PHP/RIA
Linux User #490101


[jQuery] Attach a submenu to online one main menu button

2009-11-05 Thread pabera
Hey,

I have a problem I can't solve myself anymore.. I got the following
menu-structure in HTML

ul class=level_1
   li class=submenua href=# class=submenu firstLink 1/a
  ul class=level_2
 li class=firsta href=# class=firstSublink 1/a/
li
 li class=firsta href=# class=firstSublink 2/a/
li
  /ul
   /li
   li class=submenua href=# class=submenu firstLink 2/a
  ul class=level_2
 li class=firsta href=# class=firstSublink 3/a/
li
 li class=firsta href=# class=firstSublink 4/a/
li
 li class=firsta href=# class=firstSublink 5/a/
li
  /ul
   /li
   li class=submenua href=# class=submenu firstLink 3/a
  ul class=level_2
 li class=firsta href=# class=firstSublink 6/a/
li
 li class=firsta href=# class=firstSublink 7/a/
li
 li class=firsta href=# class=firstSublink 8/a/
li
 li class=firsta href=# class=firstSublink 9/a/
li
  /ul
   /li
/ul

No i want to collapse  the menu, so online Link 1, Link 2 and Link 3
can be seen. When I click on one of them, only the supposed submenu
should open.. So if I click Link 3, Sublink 6 - 9 should open.

How can I realize that, I was trying something like this, but with
this approach, all submenus open no matter what main link I click..

$j('.submenu').each(function(i) {
$j(this).click(function() {
all_hide_slow();
// $j('#sub_'+i).show('slow');
$j('ul.level_2').show('slow');
});
});

I would appreciate any help.. thanks
pabera


[jQuery] making images cycle with clueTip

2009-11-05 Thread Jack
Hello, is it possible to use clueTip to cycle images. I used jcycle to
make a slide show based on images in an html page. That works fine.
Now I would like these images to appear in a clueTip. I tried the
clueTip feature that allows you to include a web page  so I included
the web that uses jcycle with the images but it does not work.

Thanks.

Jacques


[jQuery] Re: setTimeout with variables (in a jQuery statement)

2009-11-05 Thread cosmin
have you tried placing your jquery code into a new function and
calling that function in setTimeout ?

On Nov 4, 2:27 pm, north ollo...@web.de wrote:
 Hi,

 I'm trying to use a jQuery statement inside a setTimeout function, but
 I don't get it to work. I tried a lot of variants, like this one (I'm
 using 'this' because the setTimeout is inside an each function, and
 the selector is cached/stored in an object, thus the $selector):

 setTimeout( + this.$selector + .val(' + this.savVal + '), 1);

 How do I have to write this?

 Thanks!


[jQuery] jquery instead of prototype

2009-11-05 Thread TarzanLovesCita
I need to reproduce the effect of resizing DIVs like in this page:
http://script.aculo.us/

it's possible to resize an object so that web-site-visitors has the
sensation of a growing object like in scriptaculous?

Thank u.
T.


[jQuery] Preventing for event change to execute multiple times.

2009-11-05 Thread SharepointNewbie
Hi,i have this code that comes from the server side:

 select name=ctl00$m
$g_871540ea_7c11_4663_ad02_763d4efb7a80$ctl00$ctl02$ctl00$ctl01$ctl00$ctl00$ctl11$ctl00$ctl00$ctl04$ctl00$ctl00$Elemento
onchange=javascript:setTimeout('WebForm_DoPostBackWithOptions(new
WebForm_PostBackOptions(quot;ctl00$m
$g_871540ea_7c11_4663_ad02_763d4efb7a80$ctl00$ctl02$ctl00$ctl01$ctl00$ctl00$ctl11$ctl00$ctl00$ctl04$ctl00$ctl00$Elementoquot;,
quot;quot;, true, quot;quot;, quot;quot;, false, true))', 0)
id=ctl00_m_g_871540ea_7c11_4663_ad02_763d4efb7a80_ctl00_ctl02_ctl00_ctl01_ctl00_ctl00_ctl11_ctl00_ctl00_ctl04_ctl00_ctl00_Elemento
title=Nombre de elemento Parent class=ms-input
option selected=selected 
value=Please select an Item/
option
option value=51.4/option

/select

as you can see, it has an onchange event.
Then, i have this jQuery statement, where ctr is the select drop down:

ctr.bind(change, function(eventin) {
 // then some ajax code to  bring some info and put it in a
div.
}


the fact is, thatwhen i choose an option from the select,  fires
the event in the bind , and then fires  the postback event in the
onchange.

Is there a way to warantee that only the bind event will fire?

I've tried without success:
- , using preventDefault inside the bind function:
eventin.preventDefault();
-  using the stopPropagatino insinde the bind function :
eventin.stopPropagation();
- returning false from the bind function.
- making an unbind before the binding : ctr.unbind();

neither of those options worked for me,  any sugggestions would be
appreciated :)
-


[jQuery] Get two INPUT values, do some server side calculation, then post it back to another INPUT value in correct TR

2009-11-05 Thread palgo
Hi guys,

I'm a very new to jquery, so bear with me while try to explain my
dilemma :)

I have a table with many TR (rows) that got 3 input fileds each.
What I'm trying to do with ajax is to:

* When user enters something in the two first inputs, use ajax to show
the result in the last inputfield.

I have this table (simplified):

table id=rows
  tr id=row1
tdinput  class=A  //td
tdinput  class=B  //td
tdinput  class=C  //td
/tr
  tr id=row2
tdinput  class=A  //td
tdinput  class=B  //td
tdinput  class=C  //td
/tr
/table

I tried with this JS-code, which works for first line but also fills
up the C in row2 with result.

  $(.A, .B).keyup(function(event){
$.get(script.php, { a: $(.A).val(), b: $(.B).val()},
function(data){
$(.C).val(data)
});
})


Like mentioned in the title, when I write in values in row1 (TR), the
C in that TR should be updated, and not the one in row2 as well. Is it
something I can easily do this code to acheive this?

Thank you for your time!


[jQuery] select range of days in calendar (self-created)

2009-11-05 Thread simusch
hi

i have a small problem with jquery.

under
http://inview.ch/files/calendar.php
i created a small calendar, which is thought for booking a holidays-
house.

i'd like to do 2 things:

- click on a day changes it to yellow (works fine with toggleClass)
- clicking on a day and then moving the mouse (with mousebutton
clicked) to another day should mark ALL DAYS WITHIN THIS RANGE as
yellow

does someone have an idea, how to realize this?

thanks for your help

simon (german)


Re: [jQuery] Re: getJSON - need some direction please.

2009-11-05 Thread Michel Belleville
2009/11/5 RayJames cdlcollege.rayja...@gmail.com

 Hi Michel, I think I might have confused you a bit.  The user is not
 necessarily my concern.


Well... Then I guess it's not necessarily a good thing you design UI because
it's all about the user. Ultimately, you're designing machines to work for
humans, and when you're designing user interfaces you're at the ultimate
step before the human uses the tools. If the user is not your concern here
you've picked the wrong part of the job. Really.


 The code running in the background that sends
 calls to my api while the user is viewing the course is.


Of course it is.


 These calls
 consist of functions that Initialize the learner session, terminate
 the learner session, set and get values from the LMS as well as a few
 error handling calls.


Of course they do.


 Every time the course code calls the api the
 api is supposed to execute the call and return either data, true/
 false, or both.


Of course it is.


 The problem is that on the Initialize and Terminate
 calls, nothing should happen until the api returns a true or false.


Well, if by nothing you mean nothing both server-side AND client-side I
agree with you, you need synchronous calls. That will also prevent your user
from doing anything between the beginning of the call and the end. Even
scrolling the page, or opening an outside link in a new tab, anything AT ALL
until the call finishes. I don't know you but I find that drastic.


 Once that happens, then the other calls WILL just be called in the
 background async style while the user is engaged with the course.  I
 think this is the best way, because putting a waiting class could
 result in longer waiting times for the execution of the functions and
 could still possibly timeout before the code finishes. What do you
 think?


I respectfully disagree, it is my informed opinion that adding a waiting
class will not result in significant performances losses unless you botch
the job (and I mean really botch the job, like adding the waiting class to
any element of the page instead of the topmost element that needs it) or the
calls are very close (and again I mean really very close, the kind of close
that would make your interface unusable because synchronous calls would
freeze it every odd second).

The only constraint here is that you round up elements that must not be
triggered between the beginning and the end of your pseudo-synchronous calls
and give them this little trigger :
$('.the_waiting_class .any_element_you_want_to_block').live('click',
function() { return false; });

The event will only be triggered when the targets match (so when
the_waiting_class is given to their common parent), it will work on elements
added to the dom during ajax or whatever script, and no user will notice any
performance problem as .live uses bubbling to catch the events.

I apologize for not making myself clear enough.  This is
 actually a fairly complex system and will be awesome when finished.


I'm sure it will, but remember UI is one of the most important things that
make the difference between awesome and I'm tired of this site that just
freezes on me, let's google away.


 Keep an eye on Drupal and wait for it to come out as a module.  I will
 be opening all my code up as open source once it is finished.  Thanks.


Hope you do well.


Michel Belleville


[jQuery] cycle plugin - remove positioning css?

2009-11-05 Thread Adam
I'm using the cycle plugin and was wondering if anyone has found a way
to remove the position: relative from the main div and position:
absolute from the imgs.  This is added when the plugin is used.  It's
not very friendly in IE among other issues.

Thanks!

Adam


[jQuery] Why jQuery is not working on my page ?

2009-11-05 Thread vmrao
Here is my code. I have included jQuery library.

script
(function($){
$(document).ready(function(){

$('ul.News li[id*=Story]').each(function() {
alert('test');
});
});
});
/script

ul class=News
li id=Story1My Stroy1/li
li id=Story2My Stroy2/li
li id=Story3My Stroy3/li
li id=MiscMiscelaneous/li
/ul


[jQuery] Re: Why jQuery is not working on my page ?

2009-11-05 Thread vmrao

I just got rid of unnecessary '(function($){ ' and it worked.

On Nov 5, 5:17 pm, vmrao maheshpav...@gmail.com wrote:
 Here is my code. I have included jQuery library.

 script
 (function($){
         $(document).ready(function(){

                 $('ul.News li[id*=Story]').each(function() {
                         alert('test');
                 });
         });});

 /script

 ul class=News
 li id=Story1My Stroy1/li
 li id=Story2My Stroy2/li
 li id=Story3My Stroy3/li
 li id=MiscMiscelaneous/li
 /ul


Re: [jQuery] Re: Why jQuery is not working on my page ?

2009-11-05 Thread Sam Doyle

li#Story would be more efficient

Sent from my iPhone

On 5 Nov 2009, at 22:24, vmrao maheshpav...@gmail.com wrote:



I just got rid of unnecessary '(function($){ ' and it worked.

On Nov 5, 5:17 pm, vmrao maheshpav...@gmail.com wrote:

Here is my code. I have included jQuery library.

script
(function($){
$(document).ready(function(){

$('ul.News li[id*=Story]').each(function() {
alert('test');
});
});});

/script

ul class=News
li id=Story1My Stroy1/li
li id=Story2My Stroy2/li
li id=Story3My Stroy3/li
li id=MiscMiscelaneous/li
/ul


[jQuery] Re: Get two INPUT values, do some server side calculation, then post it back to another INPUT value in correct TR

2009-11-05 Thread Maarten
On Nov 5, 10:10 pm, palgo rusha...@gmail.com wrote:

 I tried with this JS-code, which works for first line but also fills
 up the C in row2 with result.

       $(.A, .B).keyup(function(event){
         $.get(script.php, { a: $(.A).val(), b: $(.B).val()},
         function(data){
         $(.C).val(data)

Palgo,

I would replace above line of code with the following. As you can see,
it tries to find the closest TR element from the element from which
the event is triggered, from there it places the value in the INPUT
element with class 'C'. The code is untested but should be close to
what you need.

  $(event.target).closest(tr).find(input.C).val(data);

Good luck,

Maarten






[jQuery] Re: Preventing for event change to execute multiple times.

2009-11-05 Thread Maarten
On Nov 4, 5:25 am, SharepointNewbie isaaccha...@hotmail.com wrote:

 I've tried without success:
 - , using preventDefault inside the bind function:
 eventin.preventDefault();
 -  using the stopPropagatino insinde the bind function :
 eventin.stopPropagation();
 - returning false from the bind function.
 - making an unbind before the binding : ctr.unbind();

I would expect preventDefault and stopPropagation to cancel the
default actions of the element, not attached javascript functions.

Have you tried to simply reset the onchange attribute of the element
before binding your AJAX function?

$(ctr).attr(onchange, );

Maarten


[jQuery] How to call mouseover of the element in loop

2009-11-05 Thread vmrao
My code is as follows. How to call onMouseOver of 'li' element in the
loop from jQuery ?

script
$(document).ready(function(){
var curTimeInterval = 0;
var timeInterval = 2000 ;
$('ul.News li').each(function() {
curTimeInterval += timeInterval;
setTimeout(function() {
//I would like to invoke onMouseOver of the li element here
//I tried $(this).mouseover(); and it
did not work
}, curTimeInterval);
});
});
/script

ul class=News
li id=Story1 onMouseOver=UpdateNews('Story1')My Stroy1/li
li id=Story2 onMouseOver=UpdateNews('Story2)My Stroy2/li
li id=Story3 onMouseOver=UpdateNews('Story3')My Stroy3/li
/ul


[jQuery] Re: How to call mouseover of the element in loop

2009-11-05 Thread vmrao

OK. This is what I am trying to do.

$('ul.News li').each(function() {
curTimeInterval += timeInterval;
//alert(this.id); works here
setTimeout(function() {
UpdateNews(this.id); //How to get this.id to work here ?
}, curTimeInterval);
});


On Nov 5, 5:42 pm, vmrao maheshpav...@gmail.com wrote:
 My code is as follows. How to call onMouseOver of 'li' element in the
 loop from jQuery ?

 script
         $(document).ready(function(){
         var curTimeInterval = 0;
         var timeInterval = 2000 ;
         $('ul.News li').each(function() {
                 curTimeInterval += timeInterval;
                 setTimeout(function() {
                 //I would like to invoke onMouseOver of the li element here
                                 //I tried $(this).mouseover(); and it
 did not work
                 }, curTimeInterval);
         });
         });
 /script

 ul class=News
 li id=Story1 onMouseOver=UpdateNews('Story1')My Stroy1/li
 li id=Story2 onMouseOver=UpdateNews('Story2)My Stroy2/li
 li id=Story3 onMouseOver=UpdateNews('Story3')My Stroy3/li
 /ul


Re: [jQuery] Re: How to call mouseover of the element in loop

2009-11-05 Thread Michael Geary
Avoid 'this'. In the setTimeout() callback, 'this' is the window object!

Instead you can do:

   $('ul.News li').each(function( i, element ) {
   curTimeInterval += timeInterval;
   //alert(element.id); works here
   setTimeout(function() {
   UpdateNews(element.id);
   }, curTimeInterval);
   });

-Mike

On Thu, Nov 5, 2009 at 2:58 PM, vmrao maheshpav...@gmail.com wrote:


 OK. This is what I am trying to do.

$('ul.News li').each(function() {
curTimeInterval += timeInterval;
 //alert(this.id); works here
setTimeout(function() {
UpdateNews(this.id); //How to get this.id to work
 here ?
}, curTimeInterval);
});


 On Nov 5, 5:42 pm, vmrao maheshpav...@gmail.com wrote:
  My code is as follows. How to call onMouseOver of 'li' element in the
  loop from jQuery ?
 
  script
  $(document).ready(function(){
  var curTimeInterval = 0;
  var timeInterval = 2000 ;
  $('ul.News li').each(function() {
  curTimeInterval += timeInterval;
  setTimeout(function() {
  //I would like to invoke onMouseOver of the li element
 here
  //I tried $(this).mouseover(); and it
  did not work
  }, curTimeInterval);
  });
  });
  /script
 
  ul class=News
  li id=Story1 onMouseOver=UpdateNews('Story1')My Stroy1/li
  li id=Story2 onMouseOver=UpdateNews('Story2)My Stroy2/li
  li id=Story3 onMouseOver=UpdateNews('Story3')My Stroy3/li
  /ul



[jQuery] Sound

2009-11-05 Thread shapper
Hello,

Is it possible to have a music on a HTML page with two buttons to play/
stop?
Can I use JQuery for this?

Thanks,
Miguel


Re: [jQuery] Sound

2009-11-05 Thread Erik Beeson
No jQuery necessarily needed for this. Plenty of information here:

http://www.google.com/search?q=html+embed+audio

--Erik


On Thu, Nov 5, 2009 at 3:04 PM, shapper mdmo...@gmail.com wrote:

 Hello,

 Is it possible to have a music on a HTML page with two buttons to play/
 stop?
 Can I use JQuery for this?

 Thanks,
 Miguel



[jQuery] 403 forbidden error with RSV plugin

2009-11-05 Thread Jim Byrnes
I added the Real Simple Validation (RSV) plugin to a working html page 
that loads other jquery plugins just fine.  when I loaded the page I got 
an error saying RSV was not a function.  Looking at the page with 
firebug it shows a 403 forbidden error saying I don't have permission to 
access that file on that server. Its a server on my desktop that I 
access using localhost without any problems until now.


Anyone have any ideas on how to resolve this?

Regards,  Jim





[jQuery] Re: Horizontal image carousel w/scrollbar plugin for jQuery?

2009-11-05 Thread tatlar
Hi wshawn,

Yes - I checked out Flowplayer but didn't see a scrollbar progression
along the base of the carousel like in the Dyn-web interface. Unless I
am missing something in the options? I just saw filled or empty dots
to reflect the progress - not a 'slideresque' bar like my client
requires. Please correct me if I am wrong in that assumption.

On Nov 5, 11:18 am, wshawn sh...@sanityllc.com wrote:
 Have you considered:http://flowplayer.org/tools/demos/scrollable/index.html

 I is one of the most flexible ones I have seen.
 On Nov 5, 11:54 am, tatlar robertlnew...@gmail.com wrote:

  Hi Karl,

  Thanks for the response. Wow - those solutions are pretty tight.

  The Highpoint site JS source code is slightly easier to read that the
  Fusionary site, so I will study that.

  Best regards,
  - Rob

  On Nov 5, 5:32 am, Karl Swedberg k...@englishrules.com wrote:

   The jQuery UI Slider is great for this sort of thing. It's not an out-
   of-the-box solution, but if you're willing to write some of your own  
   code, it can make doing this sort of thing a lot easier.

   Here are two implementations that I've put together. Nothing  
   spectacular, and probably not exactly what you're looking for, but it  
   should give you an idea of what can be done:

  http://www.fusionary.com/http://www.highpointre.com/

   --Karl

   
   Karl Swedbergwww.englishrules.comwww.learningjquery.com

   On Nov 5, 2009, at 12:39 AM, tatlar wrote:

Hi jQuery gurus,

Has anyone seen an equivalent of dyn-web's scrollbar but written on
top of jQuery?

   http://www.dyn-web.com/code/scroll/horiz.php

I have a client who wants this functionality, but I cannot use the  
dyn-
web as it conflicts with the jQuery plugins that I am currently using.
I assume it is due to how events are registered and handled.

I have searched all over but cannot find (a) an image carousel that is
controlled with an onmouse event (they are all onclick events), and
(b) the scrollbar progression beneath the carousel as the user moves
horizontally through the gallery.

I am more than happy to attempt to write my own, but if anyone knows
of any pointers to get me started I would be most grateful.

FWIW I am currently using the jCarouselLite plugin, which is great,
but just not _exactly_ what the client wants.

Thanks in advance.


[jQuery] Re: (validate plugin) dependency callback not being triggered

2009-11-05 Thread Brad Hile
Bump

 Hi
 I've tried every way I can think of to use dependency to enable
 additional elements to be required and have had no luck at all. I
 simply want to enable required on a number of fields when a specific
 radio button is selected and for it to be disabled when its not.
 (These fields are hidden when the radio button is deselected)
 I've tested the response from the functions and it appears correct but
 after hours of staring at this I just can't figure it out.
 Help.. please?

 original code is onhttp://promotionalpenshop.com.au/testorder.php?p=4
 though I may have changed it by the time you look at this.

 So basically I've tried an inline function  something like:

 organisation:{required: function(element) {
         return $(.payment_type:checked).val()  == 'invoice');
       }
    }
 - - - - - - - - - - - - - -
 Setting a var to true/false when the radio button is clicked and
 testing that:

 var invoice;

 $(.payment_type).change(function () {
      if($(this).val() != 'paypal'){
                  $(#paybyinvoicefields).slideDown('slow');
                 invoice =  true;
          } else {
  $(#paybyinvoicefields).slideUp('slow');
                 invoice =  false;
          }

 organisation:{required: invoice}
 - - - - - - - - - - - - - -
 Using an enternal function

 organisation:{required: invoiceme() }

         function invoiceme() {
            return ($(.payment_type:checked).val()  == 'invoice')?
 true : false;
     }


[jQuery] Re: Jquery UI Accordion Navigation

2009-11-05 Thread jquery.redsqu...@googlemail.com
Your click function fail is due to the fact you hook the event up
outside of a doc ready block. You can either change it to use .live or
move it after the accordion initialise call.

On Nov 5, 2:48 pm, mehstg1319 meh...@gmail.com wrote:
 Hi guys

 I am working on the following sitehttp://www.paulbraham.com/test_site/
 and am having a few troubles with my JQuery Accordion.

 Basically, I have turned on Navigation, and inserted three anchors,
 #1, #2 and #3 for the three sections that exist. Now in theory, i
 could go to index.html#2 and it would load with section 2 open. This
 is not happening, and I cannot work out what is wrong with my code.

 Also, I have used the following code to update the hash on the address
 bar when a section is selected. This is so it is possible to bookmark
 the website with a certain section open. This is also not working.

 $(.menuLink).click(function(event){
                   window.location.hash=this.hash;
          });

 If it helps, I found this tutorial, that shows it working perfectly, I
 just can't work out what is so different about mine!!

 http://www.michaeljacobdavis.com/tutorials/statesavingaccordion/state...

 Thanks in advance

 Paul


[jQuery] Re: getJSON - need some direction please.

2009-11-05 Thread RayJames
Man, that felt like an ass chewing but I needed it.  :)  I am going to
do some more homework and see how to put the advice you gave me to
good use.  Thanks for your time Michel.  I really appreciate it.

Ray James.

On Nov 5, 2:42 pm, Michel Belleville michel.bellevi...@gmail.com
wrote:
 2009/11/5 RayJames cdlcollege.rayja...@gmail.com

  Hi Michel, I think I might have confused you a bit.  The user is not
  necessarily my concern.

 Well... Then I guess it's not necessarily a good thing you design UI because
 it's all about the user. Ultimately, you're designing machines to work for
 humans, and when you're designing user interfaces you're at the ultimate
 step before the human uses the tools. If the user is not your concern here
 you've picked the wrong part of the job. Really.

  The code running in the background that sends
  calls to my api while the user is viewing the course is.

 Of course it is.

  These calls
  consist of functions that Initialize the learner session, terminate
  the learner session, set and get values from the LMS as well as a few
  error handling calls.

 Of course they do.

  Every time the course code calls the api the
  api is supposed to execute the call and return either data, true/
  false, or both.

 Of course it is.

  The problem is that on the Initialize and Terminate
  calls, nothing should happen until the api returns a true or false.

 Well, if by nothing you mean nothing both server-side AND client-side I
 agree with you, you need synchronous calls. That will also prevent your user
 from doing anything between the beginning of the call and the end. Even
 scrolling the page, or opening an outside link in a new tab, anything AT ALL
 until the call finishes. I don't know you but I find that drastic.

  Once that happens, then the other calls WILL just be called in the
  background async style while the user is engaged with the course.  I
  think this is the best way, because putting a waiting class could
  result in longer waiting times for the execution of the functions and
  could still possibly timeout before the code finishes. What do you
  think?

 I respectfully disagree, it is my informed opinion that adding a waiting
 class will not result in significant performances losses unless you botch
 the job (and I mean really botch the job, like adding the waiting class to
 any element of the page instead of the topmost element that needs it) or the
 calls are very close (and again I mean really very close, the kind of close
 that would make your interface unusable because synchronous calls would
 freeze it every odd second).

 The only constraint here is that you round up elements that must not be
 triggered between the beginning and the end of your pseudo-synchronous calls
 and give them this little trigger :
 $('.the_waiting_class .any_element_you_want_to_block').live('click',
 function() { return false; });

 The event will only be triggered when the targets match (so when
 the_waiting_class is given to their common parent), it will work on elements
 added to the dom during ajax or whatever script, and no user will notice any
 performance problem as .live uses bubbling to catch the events.

 I apologize for not making myself clear enough.  This is

  actually a fairly complex system and will be awesome when finished.

 I'm sure it will, but remember UI is one of the most important things that
 make the difference between awesome and I'm tired of this site that just
 freezes on me, let's google away.

  Keep an eye on Drupal and wait for it to come out as a module.  I will
  be opening all my code up as open source once it is finished.  Thanks.

 Hope you do well.

 Michel Belleville


[jQuery] Multiple ajax calls messing each other up.

2009-11-05 Thread Jaap
Hello there.

I'v got two elements in my website which will be using Ajax.
One is getting a random blogpost every 9 seconds or so:

var noiseDisplayTime = 100;
var rotationTime = 8000;
function fadeOutAndGetNewTvShow(){

var fadeInData = function fadeInData() { 
$('#randomPost').animate
({foo: 1}, noiseDisplayTime).fadeIn(); }
var loadData = function loadData() { 
$('#randomPost').load((/
random-post/?cachebuster= + Math.floor(Math.random()*10001)),
fadeInData); }
$('#randomPost').fadeOut(loadData);
}

$(#randomPost).load(/random-post/);
var refreshId = setInterval(function() {
fadeOutAndGetNewTvShow();
}, rotationTime);

The other one is the handling of a form submit:

jQuery(function() {

jQuery().ajaxStart(function() {
$(#formLoader).fadeIn(fast);
}).ajaxStop(function() {
$(#contactForm).hide();
$(#formLoader).fadeOut(slow)
}).ajaxError(function(a, b, e) {
throw e;
});

var v = jQuery(#contactForm).validate({
submitHandler: function(form) {
jQuery(form).ajaxSubmit({
target: #result
});
}
});

jQuery(#reset).click(function() {
v.resetForm();
});
});

I found out what's going wrong, every time an Ajax requist is made, it
runs trough everything that's using Ajax. I just don't know how to
solve it. Or explain it better...
Hopefully someone can help out,

Regards,

Jaap


[jQuery] Class problem with parent item but also a last-child

2009-11-05 Thread Goh Hao-Wei
Hello,

I've been experimenting with SF menu on my experimental site at
getrav1.poisedvstudio.com

From my understanding, any last item will be assigned the class .last-
child and if the item has submenus under it, it will be
assigned .parent instead.

If my last item has submenus, then it loses the .last-child class and
is replaced by the .parent class.
How do I make sure both classes are assigned?

Reason I need that is because I'm making use of the .last-child class
to control the borders. Each item has borders top, left and right. The
last-child has the same, but with the bottom border as well.

I'm not a PHP expert. I tried playing around with default.php but
still could not get it right. Maybe there's a better way to do what
i'm trying to achieve? Thanks!


[jQuery] Re: How to determine number of elements after dom manipulation ?

2009-11-05 Thread RobG


On Nov 4, 6:22 am, bakman bakman.bak...@gmail.com wrote:
 I am generating elements (img's) based on data from an xml file.
 Once that is done, I want to determine the number of icons that were
 generated.

 as naive as i am, i do a: alert($('img').size())
 result: 0, which isn't the case

 how can i determine them after they have generated ?


Why not:

  document.images.length

Or increment a counter as you go.


 **
 function dataloader(location,service,div){
         $.ajax({
                 type: GET,
                 url: includes/data.xml,
                 dataType: xml,
                 success: function(xml) {

                         $(xml).find('group').each(function(){
                                 if($(this).attr(name) == service){
                                 $(this).find(Service).each(function(){

the $() function is expensive to run, so run it as infrequently as
possible, e.g.

  $(xml).find('group').each(function(){
  var element = $(this);
  if (element.attr(name) == service) {
  element.find(Service).each(function() {


                                 var type = $(this).find(Type).text()
                                 var host = $(this).find(Host).text()
                                 var name = $(this).find(Name).text()
                                 var site = $(this).find(Site).text()

  var service = $(this);
  var type = service.find(Type).text();
  var host = service.find(Host).text();
  var name = service.find(Name).text();
  var site = service.find(Site).text();

and so on.


--
Rob


[jQuery] Re: (validate plugin) dependency callback not being triggered

2009-11-05 Thread Jules
Hi,

Validation only triggered if you call submit the page or call the $
(form).valid() function. I didn't see any submit() or  $
(form).valid() call in your page.

Try adding this to your page

js script inside ready()

$(#validateMe).click(function(){
   if($(form).valid())
 alert(All data are valid);
   else
 alert(Invalid data);
});

html
input type=button id=validateMe name=validateMe
value=Validate /


Hope this help.

BTW: you misspelled territory in ACT :)

On Nov 6, 12:06 pm, Brad Hile brad.h...@gmail.com wrote:
 Bump

  Hi
  I've tried every way I can think of to use dependency to enable
  additional elements to be required and have had no luck at all. I
  simply want to enable required on a number of fields when a specific
  radio button is selected and for it to be disabled when its not.
  (These fields are hidden when the radio button is deselected)
  I've tested the response from the functions and it appears correct but
  after hours of staring at this I just can't figure it out.
  Help.. please?

  original code is onhttp://promotionalpenshop.com.au/testorder.php?p=4
  though I may have changed it by the time you look at this.

  So basically I've tried an inline function  something like:

  organisation:{required: function(element) {
          return $(.payment_type:checked).val()  == 'invoice');
        }
     }
  - - - - - - - - - - - - - -
  Setting a var to true/false when the radio button is clicked and
  testing that:

  var invoice;

  $(.payment_type).change(function () {
       if($(this).val() != 'paypal'){
                   $(#paybyinvoicefields).slideDown('slow');
                  invoice =  true;
           } else {
   $(#paybyinvoicefields).slideUp('slow');
                  invoice =  false;
           }

  organisation:{required: invoice}
  - - - - - - - - - - - - - -
  Using an enternal function

  organisation:{required: invoiceme() }

          function invoiceme() {
             return ($(.payment_type:checked).val()  == 'invoice')?
  true : false;
      }


[jQuery] Validate remote:

2009-11-05 Thread Dave Maharaj :: WidePixels.com
I have a simple test to check if email is registered already using validate
remote. But am not getting any error message.
 
I am watching the activity using Firefox and see the script checking the php
script and i see the error being reported in my debug() 
 
Array
(
[agree] = You must verify that you understand and wish to procede.
[email] = This email account is already registered.
)

My js rule looks like:
'data[Profile][email]':{required: true, email:true, remote: {url:
/manage/profile/validate.php,type: post}},


And message:
'data[Profile][email]': {
required: * JS required email address.,
email: * JS email address.,
remote: * Remote address},

Can someone point out what I am doing wrong?

Thnks,

Dave



[jQuery] fading issue in IE7 (works fine in FF)

2009-11-05 Thread Justin
Hi,

I'm having a problem with the fade in in IE7 using jQuery1.3.2 with
this simple event binding to 3 buttons. In IE when I first pressed any
of the button the fade in works, but after the initial fade in the
page loads, but does not fade in at all. I have no problem with this
in Firefox. Any help would be much appreciated.


$(function() {
$(#button1).bind(click, function() {
$(#loadhtml).fadeIn(slow).load(a.html);
  });
  $(#button2).bind(click, function() {
$(#loadhtml).fadeIn(slow).load(b.html);
  });
  $(#button3).bind(click, function() {
$(#loadhtml).fadeIn(slow).load(c.html);
  });
});

input type=button id=a value=Show a.htmll /
input type=button id=b value=Show b.html /
input type=button id=c value=Show c.html /
div id=loadhtml/div


[jQuery] show div hidden

2009-11-05 Thread alex
Hi everyone,
i'm new on google groups and i'm french, well, i hope i'm at the right
place.

here's my problem :
i'm implanting an easy chat system on my website.(like msn)
this is how it works
someone open a discussion with someone, he send a message. the message
is stored in mysql.
the other person had already opened his discussion window. and an ajax
script go to get the new message which appear like this :
div class=msg
aknot31 say blablabli blabla
/div

In order to, produce special effect. I want these div box to appear
with slideDown function of jQuery.
The matter is that i don't know how to set him hidden before it slide
down


[jQuery] Jquery validate radio buttons not working

2009-11-05 Thread azam
Hi I have been reading the tutorials, posts and forums to figure out
how to get my radio buttons on my form to validate.Everything else in
the form is validating except radio. I am not a developer or coder but
am learning as I go along.

This is what I have done :

I have included validate.js , jquery , and included a jquery
function :
script
 $(document).ready(function(){
$(#form).validate();
  });
/script

This is my form/radios :

 label for=openair
Open Air
  input type=radio name=parkingtype id=openair value=open air
validate=required:true /
   /label
   label for=covered
  input type=radio name=parkingtype id=covered
value=covered  /
/label

From what I understood , all i required to get this to work was
validate=required:true . However that is not working. Any
assistance on this matter would be greatly appreciated.


[jQuery] jquery blockui selector in opera browser

2009-11-05 Thread mic3000
script type=text/javascript

$(document).ready(function () {
$(input[name='test']).click(function(){
$.blockUI({
theme:  true,
title:  'test',
message:'test'
});
});
});

/script

html
   form ...
  input type=submit name=test value=test /
   /form
/html

when I use this code and this selector $(input[name='test']) blockui
not start in opera browser.
any suggestions?


[jQuery] Validate

2009-11-05 Thread sgomez
I have this weird problem.

I have a dynamic form, the id's are dynamic.

To submit the data I use a anchor link instead of a submit button.

form id=f1
...
a onclick=updateCompanyDetails(id);
id=updateCompanyDetails_1spanUpdate Address/span/a

/form

script
function updateCompanyDetails(id)
{
$(#f+id).validate({
 submitHandler: function(form) {
   form.submit();
 }
});


}
/script

This doesn't seem to work. Where am I going wrong?

Sid


[jQuery] jquery autocomplete - textbox : display none

2009-11-05 Thread senthil kumar pillai
Hi,

I need a text box with autocomplete feature. But, the text box is not
displayed when page loads initially. Based, upon some selection in a
regular drop down, this text box will appear. When I start typing the
letters, I should get the autocomplete drop down.

I use jquery auto-complete-4.1 version, the problem I am facing is,
autocomplete drop down shown does not have enough width (only 6px).

Width is good with other text boxes which are displayed when page
loads.

Any help would be really appreciated.

Thanks,
PSK


[jQuery] Help applying a class dynamically to a text area

2009-11-05 Thread Deepdesign
Hi

I have the following code in my head tags:

$(document).ready(function() {
$('input[title]').each(function() {
if($(this).val() === '') {
$(this).val($(this).attr('title'));
}

$(this).focus(function() {
if($(this).val() === $(this).attr('title')) {
$(this).val('').addClass('focused');
}
});

$(this).blur(function() {
if($(this).val() === '') {

$(this).val($(this).attr('title')).removeClass('focused');
}
});
});
});

$(document).ready(function() {
$('textarea[title]').each(function() {
if($(this).val() === '') {
$(this).val($(this).attr('title'));
}

$(this).focus(function() {
if($(this).val() === $(this).attr('title')) {
$(this).val('').addClass('focused');
}
});

$(this).blur(function() {
if($(this).val() === '') {

$(this).val($(this).attr('title')).removeClass('focused');
}
});
});
});

Obviously the first thing i need to do is combine these into one chunk
of code - I have no idea how to do this :/

Secondly, and more importantly, although this works perfectly on the
various text fields on the site, it wont update the colour of the
'text area' text on focus. It stays a light grey, when the CSS is:

.focused{
color: #000;
}

It populates the text area with the title text ok, it's just the
focussing that seems to break.

If anyone can shed some light on this I would be extremely grateful.
Something is making text areas behave differently to text fields

Thanks a lot in advance

James


[jQuery] on-page navigation

2009-11-05 Thread neandr
I'm trying to build a special on-page navigation. The following html
is used to have icons/buttons which in-/decrement to header lines on
the same page. The hx elements are identified by class and have
'id's.

h3 class=sectionseparator id=section1
a href=# title=lt;lt;img align=left alt=
class=dSelection /br /
/a hr /
a href=# title=gt;gt;img align=right alt=
class=iSelection //a
Section 1
/h3

A very first code (I'm a total newbie with JQuery) is this

   $(document).ready(function(){
 $(a).click(function(){
   alert(xThis: + $(this).parent);
 })
   });

but it only gives:

xThis:function (G) {
var H = o.map(this, F);
if (G  typeof G == string) {
H = o.multiFilter(G, H);
}
return this.pushStack(o.unique(H), E, G);
}

Without .parent it's:   xThis:[object Object]
How can I get info about theobject?

Any help/idea how I have write to grap the h3 with it's 'id'??
Any help welcomed!

PS: wondering why my previous post (as of Nov 4th) isn't 'moderated'
yet!!?? And receiving 'non-delivery' message on my gmail account.


[jQuery] dimension of an object

2009-11-05 Thread JamaicaMan
I am trying to find the dimension of a div named content and print
them to my screen.
I am getting the top and left, but not the width and height. Here is
what I have written so far:
$(document).ready(function(){
var p = $(#content);
var position = p.position();
var h = $(#content).height($(body).width);
var w = $(#content).width($(body).width);

$(#content).text( //n left:  + position.left + ,
top:  + position.top);
$(#content).text( /n);
$(#content).text( width:  + w +  height:   + h);
 ...


[jQuery] 'Lazy' load()

2009-11-05 Thread GT
Hi y'all.

I have a page that once given an input, goes and loads five DIVs with
content; four of the divs are not visible (they are made visible by a
click on a tab interface).

What I had tried to do was as folows (given that the code has either
been passed as a POST (the 'asxcode='' gets filled in by ?php echo
$_POST['ASXCode'] ? ) OR has been entered in the input box #getCode
and the Submit button #hitThat clicked...)

What I really wanted was for the call to doTheFirst() to populate
#summDiv, and THEN to go and doTheRest; that is, I wanted #summDiv's
content to be completely loaded and fopr the page to be 'navigable'...
and for the rest of the divs to load 'in the background' as it were.

What I find is that quite often the other divs are loading and are
finished WELL brfore #summDiv is populated (that is, before the call
to StockFullSum.php has fully returned its response).

Can anybody offer any guidance on this? I attach the javascript (of
course, jquery.js is called before this javascript script is included)


Cheers,


GT

here's the script.

script  type=text/javascript
$(document).ready(function() {
$(ul.tabs).tabs(div.panes  div);
var asxcode= '';
if(asxcode!=='')
{
dotheFirst(asxcode);
}

});
$(#hitThat).click(function() {
   var thisCode=$(#getCode).val();
   dotheFirst(thisCode);
});

function dotheFirst(z) {
  $(#summDiv).html('centerimg style=margin-top:70px;
src=http://localhost/WIP/loading.gif; //center');
  $(#summDiv).load(http://www.marketmentat.com/includes/
StockFullSum.php, {ASXCode:z});
  doTheRest(z);
}


function doTheRest(t){
   $(#fundDiv).load(http://www.marketmentat.com/includes/
StockFundSum.php, {ASXCode:t});
   $(#techDiv).load(http://www.marketmentat.com/includes/
StockTechSum.php, {ASXCode:t});
   $(#sensDiv).load(http://www.marketmentat.com/includes/
StockSensSum.php, {ASXCode:t});
   $(#optDiv).load(http://www.marketmentat.com/includes/
StockOptSum.php, {ASXCode:t});
   $(#newsDiv).load(http://www.marketmentat.com/includes/
StockNewsSum.php, {ASXCode:t});
}

/script


[jQuery] Greenhorn with starterkit question...

2009-11-05 Thread karlkras
Hey,
So I'm using the starterkit to go through the basics with jQuery and
had a question on the expected behavior of this function:
 $(document).ready(function() {
   $(li).not(:has(ul)).css(border, 1px solid black);
 });

Isn't this saying:
Select all li elements, if the li element is not contained in an
ul then apply the style.
If so, then this doesn't appear to be working properly in the
starterkit.html
e.g., if I add this to the page:

ul id=bulletlist
liFirst element/li
liSecond element/li
liThird element/li
/ul

wouldn't the .not be applied to ul and therefore in this case the
style shouldn't be applied? This isn't what I'm seeing.

thanks,
K


[jQuery] uncaught exception: Syntax error, unrecognized expression: %}, on using ajax

2009-11-05 Thread NMarcu
Hello all,

   I got an error, and I don't know how to pass on it. I got this
error when I try to use ajax from django templates.
I use this, from jquery:
$('#create-user').click(function() {
$( '#test_div' ).load( {% url test_ajax %});
});

I have this button:
button id=create-user Add a new operator/button

I have this div:

div id=test_div
pTest/p
/div

This is in urls.py:

url(r'^operators/', 'ibox2.operators.views.test_ajax1',
name='test_ajax'),

This is the view:

def test_ajax1( request ):
if request.is_ajax():
template = 'operators/operators_list.html'

data = {

}

return render_to_response( template, data,
context_instance = RequestContext( request ) )

This is the operators_list.html:
pAfter Ajax/p

Somebody get the same error, or know what I'm doing wrong?


[jQuery] Having a problem with showing a div from parent.parent in ie (7)

2009-11-05 Thread Khimaira
As the subject says; I'm having a problem with showing a div from
parent.parent in ie (7)
here's my code:

Javascript:

parent.parent.$.blockUI({
message: $(#fileConf),
fadeIn: 700,
fadeOut: 0,
showOverlay: false,
css: {
border: 'none',
padding: '20px',
backgroundColor: '#000',
'-webkit-border-radius': '10px',
'-moz-border-radius': '10px',
opacity: .6,
color: '#fff'
}
});

Body:

   div id=fileConf style=display:none;
a href=# id=downloadFile style=text-
decoration:none;font:15px arial;color:#fffDownload file/a |
a href=# id=editFile style=text-
decoration:none;font:15px arial;color:#fffEdit file/a
   /div

All this works just fine in FF, but in ie7, it throws and error
(invalid argument).

Any help would be appreciated.


[jQuery] Re: Jquery Accordion and History

2009-11-05 Thread Cowboy Ben Alman
It would probably be pretty easy to adapt the jQuery BBQ jQuery UI
tabs example to meet your needs. You should take a look at the code
and try to understand it, it's fairly well documented:

http://benalman.com/code/projects/jquery-bbq/examples/fragment-jquery-ui-tabs/

Basically, you decouple the action from the click, such that the click
*only* changes the hash state with $.bbq.pushState(), while the action
happens when the callback bound to window.onhashchange detects a hash
change.

So, instead of:

Click - Action

You have:

Click - Push hash state - EVENT FIRES - Get hash state - Action

- Ben

On Nov 4, 9:11 am, mehstg1319 meh...@gmail.com wrote:
 Hey

 Trying to implement JQuery on a website I am working on, basically,
 the whole front page is one big accordion and clicking on the various
 bars opens and closes the sections. Like this example.

 This all works perfectly, but like all javascript, if the user clicks
 the back button, it does not keep a history of the changes.

 I understand there are plugins like Jquery History and Jquery-BBQ that
 I can use, but I cannot work out how to implement them!

 The code I wrote for my accordion is as follows:
 Code:

   $(document).ready(function(){
         $(.bodyText).hide();
         $(a h3).click(function(){
         if($(this).is('.active')) {
                 $(this).toggleClass(active);
                 $(this).parent().parent().next(.bodyText).slideToggle();
                 return false;
         } else {
                 $(.bodyText:visible).slideUp(slow);
                 $(h3.active).removeClass(active);
                 $(this).toggleClass(active);
                 $(this).parent().parent().next(.bodyText).slideToggle();
                 return false;
                 }
         });

 });

 Pretty simple code really, and does what I want. Just want to get some
 kind of history, so if the user uses the back button, they nav back
 through the site.

 Any ideas?


[jQuery] IE bug (autocomplete)

2009-11-05 Thread Cody
I'm using the autocomplete plugin fromhttp://jquery.bassistance.de/,
and my client is reporting that in IE, the multiple values are not
working.  He even tried the demo at:

http://jquery.bassistance.de/autocomplete/demo/

And the bug is happening there too for 'multple cities'.

What he's describing is that the second value is replacing the first
value.

Has anyone ran into this bug before?  Any ideas?


[jQuery] How to avoid page refresh with jquery in typo3 ?

2009-11-05 Thread chris
hello,

i am completely new to jquery .. what i would like to do is one simple
thing, have my page contents load without a browser refresh on a typo3
site.

Is this very hard to do ? I couldn't find any extension that easily
allows to do this ... i would like something like this site:
http://typo3.lexmarketing.eu/index.php?id=startseite

can someone explain to me the basic steps i need to get this to work ?

Thanks for any help with this, i've been trying unsucessfully for the
last 2 days to find a tutorial or info about using AJAX libs to avoid
pagerefresh and load content in the background and then just replace
the content in the page instead of reloading a full page.

maybe this is really simple to do ?


[jQuery] How to get references to added elements

2009-11-05 Thread kheraud
Hello,

Thank you to help me to discover jQuery. I have a very easy question
but i walk around the solutions for days.

//I search for sub-elements with class test of paragraphs :
var elementSearched = $(p .test);

//Then I add a new nodes to these elements :
var returnedVar = elementSearched.after(div class=subtestHello/
div);

My aim is to add handlers already present on other nodes to these new
nodes. But returnedVar is not the new nodes added but the old one
targetted. Then I have to search for the new nodes added to apply the
handler. It is hard and if I apply the handler to a node already
handled, my handler is done twice for this node.

How can I have references to the nodes added with .after method ?

Thank you for your help.


[jQuery] Superfish sfHover IE6 - only seems to work on right click

2009-11-05 Thread Tom Simnett
Hi,

I'm having a bit of trouble with the Superfish jQuery plugin. I've got
the CSS working such that if I put the class sfHover on an li it
shows the right styles in IE6.

When I don't do that, and roll my mouse over either the link or the li
tags, nothing happens. However, oddly, when I right click with the
mouse, it then applies the class.

The code looks like this, and uses the basic Superfish call as per the
example:

ul class=navigation id=main_navigation
li id=what_we_doa href=What We Do/a/li
li id=how_we_do_ita href=How We Do It/a/li
li id=who_we_area href=Who We Are/a/li
li id=bloga href=Blog/a/li
/ul

Tom


[jQuery] How to make .get return only div contents

2009-11-05 Thread SECSteve
I have been able to get the .get method to work and put the results in
a div.  My problem is that my .get calls ont he same page as it
originates from so it returns the entire page inot the div.  I get
the entire page with my new content inside the existing page.How
do I get just the new content for my div?

Here is me code.

  function updateCompanies(alpha){
$.get(InteractionsByCompanyr6.aspx?alpha= + alpha
  ,
  , function(data){
  $(div#update1).html(data);
}
);
  }


Thanks,
Steve


[jQuery] JCarousellite: Duplicating items

2009-11-05 Thread BGood
I'm using JCarousellite to create simple carousels on a Drupal site.

In my template file I create the list items by looping through an
array. When I try and create a carousel on one of these pages it has
the habit of duplicating items in the list.

Has anybody experienced this? If so, anybody found a solution?


[jQuery] RadGrid and Jquery

2009-11-05 Thread riti
Hello All,

I have an application which has a telerik rad Grid and a Telerik Rad
Tab Strip.I want that when the user clicks on any of the row in the
Grid all the details of that person must be populated in the Tab
Strip.For this I have written a rowclicked event of jquery in the
script section,
There is a Telerik template field and in that I am having a asp:label
now I want the text of the label.I have binded the userId to the
label.

here is my code:

 telerik:GridTemplateColumn 
ItemTemplate 
asp:Label ID=lblProdId runat =server  Visible
=true Text ='%# Eval(UsertID) %' /asp:Label
/ItemTemplate
/telerik:GridTemplateColumn


Jquery function


function rowClicked(sender, args) {

var selectedPage = $find
(RadMultiPage1).get_selectedPageView().get_element()
var inputs = $(selectedPage).find('input');



var grid = $find(RadGrid1)
$('#%=RadGrid1.ClientID %').find(input:label).map
(function() {
return alert ( $(this).text
());   //this line is giving me nothing means
blank,but there is a value and also text
}).get();
}

Please help me
Riti


[jQuery] DragDrop-Determine (cursor) relative location of the draggable within the droppable

2009-11-05 Thread Steve
I'm trying to determine where the cursor (while dragging the
'draggable' element) falls within the 'droppable' element (top half,
bottom half, leftside, or rightside?).

I'm trying to use the 'drop' event in the 'droppable' element, but
don't know how to determine the cursor coordinates relative to the
droppable element.

My code so far: --- this returns the coordinates absolute to the
browser's window.  Help?  TIA, Steve

$('div.formRow').droppable({
accept: '.formRow',
tolerance:  'pointer',
over:   function(){
$(this).css(border:1px solid 
black);
},
drop:   function(event){
var x = event.clientX;
var y = event.clientY;
alert(X coords:  + x + , Y 
coords:  + y);
},
addClasses: false
});


[jQuery] (validate) Can rules be turned off by setting them to false?

2009-11-05 Thread Mike817
I'm trying to use a checkbox to turn a validation rule off or on. The
rules I'm using is:

MyField: {
required: #MyCheckbox:unchecked,
number: #MyCheckbox:unchecked
}

The required rule turns off fine, but the number rule stays on.  Is
there anyway to make this work?


[jQuery] support for IE 5.*

2009-11-05 Thread ljw
jquery works with IE 6+ and three other major current browsers.  Is it
generally expected to work with older browsers such as IE 5.*, just
not tested?  If not, what generally is expected to go wrong?


Re: [jQuery] How to get references to added elements

2009-11-05 Thread Richard D. Worth
Use insertAfter() instead. See

http://docs.jquery.com/Manipulation/insertAfter

http://docs.jquery.com/Manipulation/insertAfter- Richard

On Thu, Nov 5, 2009 at 5:50 PM, kheraud kher...@gmail.com wrote:

 Hello,

 Thank you to help me to discover jQuery. I have a very easy question
 but i walk around the solutions for days.

 //I search for sub-elements with class test of paragraphs :
 var elementSearched = $(p .test);

 //Then I add a new nodes to these elements :
 var returnedVar = elementSearched.after(div class=subtestHello/
 div);

 My aim is to add handlers already present on other nodes to these new
 nodes. But returnedVar is not the new nodes added but the old one
 targetted. Then I have to search for the new nodes added to apply the
 handler. It is hard and if I apply the handler to a node already
 handled, my handler is done twice for this node.

 How can I have references to the nodes added with .after method ?

 Thank you for your help.



[jQuery] Codebehind not working when background inactive on popup loads

2009-11-05 Thread Priya
Hi,
I put the jquery in my masterpage


[jQuery] codebehind not working when i make background inactive on popup loads

2009-11-05 Thread Priya
Hi,
I make the page dim when a popup loads.The jquery and css are written
in masterpage like this
%@ Master Language=VB CodeFile=ESCCMaster.master.vb
Inherits=ESCCMaster %
 script src=js/jquery-1.3.1.min.js type=text/javascript/script

script type=text/javascript
$(document).ready(function(){

$(#dim).css(height, $(document).height());

$(.alertdim).click(function()
{
$(#dim).fadeIn();
return false;
});
});

$(window).bind(resize, function(){
 $(#dim).css(height, $(window).height());
});


/script

style type=text/css
  #dim
{
position: absolute;
top: 0;
left: 0;
width: 100%;
z-index: 100;
background: url(  'images/dim.png' );
display: none;
text-align: left;
}
 .msgbox
{
position: absolute;
width: 300px;
height: 200px;
z-index: 200;
border: 5px solid #222;
background: #FFF;
top: 50%;
left: 50%;
margin-top: -100px;
margin-left: -150px;
}
.msgbox img
{
border: none;
margin: 5px;
}
.closedim
{
top: 0px;
float: right;
}

/style


Re: [jQuery] How to make .get return only div contents

2009-11-05 Thread Michel Belleville
Well, you should consider reading the doc sometimes :
http://docs.jquery.com/Core/jQuery#expressioncontext

 By default, if no context is specified, $() looks for DOM elements within
 the context of the current HTML document. If you do specify a context, such
 as a DOM element or jQuery object, the expression will be matched against
 the contents of that context.

$(div#update1).html($('div#update1', data));

And if you had read even a bit further you might have stubled on that :
http://docs.jquery.com/Ajax/load#urldatacallback
It allows you to do that :
$(div#update1).load(InteractionsByCompanyr6.aspx div#update1  *, {
alpha: alpha });
$(div#update1) is who will recieve the contents in your existing page
InteractionsByCompanyr6.aspx div#update1  * says you load (using get)
your asp page and just keep the contents of update1 to insert.
{ alpha: alpha } is the get parameter to happend the query
Ain't it nifty ?

Michel Belleville


2009/11/4 SECSteve dde...@gmail.com

 I have been able to get the .get method to work and put the results in
 a div.  My problem is that my .get calls ont he same page as it
 originates from so it returns the entire page inot the div.  I get
 the entire page with my new content inside the existing page.How
 do I get just the new content for my div?

 Here is me code.

  function updateCompanies(alpha){
$.get(InteractionsByCompanyr6.aspx?alpha= + alpha
  ,
  , function(data){
  $(div#update1).html(data);
}
);
  }


 Thanks,
 Steve



Re: [jQuery] DragDrop-Determine (cursor) relative location of the draggable within the droppable

2009-11-05 Thread Michel Belleville
Indeed you're using the right callback. Now you might use substract the
droppable's coordinates relative to the document (
http://docs.jquery.com/CSS/offset) to the clientX and clientY and guess what
you'll get ?... Now to know wether you're on the top / bottom | left / right
corner, you may use the droppable's .with() and .height() and compare the
mouse's coordinates.

Michel Belleville


2009/11/5 Steve sclar...@gmail.com

 I'm trying to determine where the cursor (while dragging the
 'draggable' element) falls within the 'droppable' element (top half,
 bottom half, leftside, or rightside?).

 I'm trying to use the 'drop' event in the 'droppable' element, but
 don't know how to determine the cursor coordinates relative to the
 droppable element.

 My code so far: --- this returns the coordinates absolute to the
 browser's window.  Help?  TIA, Steve

 $('div.formRow').droppable({
accept: '.formRow',
tolerance:  'pointer',
over:   function(){
$(this).css(border:1px
 solid black);
},
drop:   function(event){
var x = event.clientX;
var y = event.clientY;
alert(X coords:  + x + ,
 Y coords:  + y);
},
addClasses: false
 });



[jQuery] Preventing for event change to execute multiple times.

2009-11-05 Thread SharepointNewbie
Hi,i have this code that comes from the server side:

 select name=ctl00$m
$g_871540ea_7c11_4663_ad02_763d4efb7a80$ctl00$ctl02$ctl00$ctl01$ctl00$ctl00$ctl11$ctl00$ctl00$ctl04$ctl00$ctl00$Elemento
onchange=javascript:setTimeout('WebForm_DoPostBackWithOptions(new
WebForm_PostBackOptions(quot;ctl00$m
$g_871540ea_7c11_4663_ad02_763d4efb7a80$ctl00$ctl02$ctl00$ctl01$ctl00$ctl00$ctl11$ctl00$ctl00$ctl04$ctl00$ctl00$Elementoquot;,
quot;quot;, true, quot;quot;, quot;quot;, false, true))', 0)
id=ctl00_m_g_871540ea_7c11_4663_ad02_763d4efb7a80_ctl00_ctl02_ctl00_ctl01_ctl00_ctl00_ctl11_ctl00_ctl00_ctl04_ctl00_ctl00_Elemento
title=Nombre de elemento Parent class=ms-input
option selected=selected 
value=Please select an Item/
option
option value=51.4/option

/select

as you can see, it has an onchange event.
Then, i have this jQuery statement, where ctr is the select drop down:

ctr.bind(change, function(eventin) {
 // then some ajax code to  bring some info and put it in a
div.
}


the fact is, thatwhen i choose an option from the select,  fires
the event in the bind , and then fires  the postback event in the
onchange.

Is there a way to warantee that only the bind event will fire?

I've tried without success:
- , using preventDefault inside the bind function:
eventin.preventDefault();
-  using the stopPropagatino insinde the bind function :
eventin.stopPropagation();
- returning false from the bind function.
- making an unbind before the binding : ctr.unbind();

neither of those options worked for me,  any sugggestions would be
appreciated :)
-


Re: [jQuery] How to avoid page refresh with jquery in typo3 ?

2009-11-05 Thread Michel Belleville
Yes indeed, you don't know the super-secret website to get answers to
questions :
http://www.lmgtfy.com/?q=jquery+tutorial

Now jQuery users, especially when new should consider reading the api,
especially since jQuery's api is so readable and not very long. For exemple,
this may answer most of your questions regarding jquery for a start :
http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery
http://docs.jquery.com/Core
http://docs.jquery.com/Selectors
http://docs.jquery.com/Ajax

You don't even have to read it all, just picking elements you feel you need
might be just right.

Michel Belleville


2009/11/6 chris c...@cs-cc.com

 hello,

 i am completely new to jquery .. what i would like to do is one simple
 thing, have my page contents load without a browser refresh on a typo3
 site.

 Is this very hard to do ? I couldn't find any extension that easily
 allows to do this ... i would like something like this site:
 http://typo3.lexmarketing.eu/index.php?id=startseite

 can someone explain to me the basic steps i need to get this to work ?

 Thanks for any help with this, i've been trying unsucessfully for the
 last 2 days to find a tutorial or info about using AJAX libs to avoid
 pagerefresh and load content in the background and then just replace
 the content in the page instead of reloading a full page.

 maybe this is really simple to do ?



Re: [jQuery] Having a problem with showing a div from parent.parent in ie (7)

2009-11-05 Thread Michel Belleville
   '-webkit-border-radius': '10px',
   '-moz-border-radius': '10px',
Guess what, IE doesn't use webkit nor does it accept's mozilla-specific
properties. I'm not sure it's what's causing the problem but I'm sure css
properties would better be in a css rule in a css file and your JavaScript
would have a better time just adding a class rather than fixing decorations
like that. Let JavaScript only set css when it really has to, in any other
case it's better in a css file where the browser will happily ignore
properties it can't use.

Michel Belleville


Re: [jQuery] 'Lazy' load()

2009-11-05 Thread Michel Belleville
This might help :
http://docs.jquery.com/Tutorials:Getting_Started_with_jQuery
http://docs.jquery.com/Core/jQuery#callback

Michel Belleville


2009/11/6 GT geoffrey.tran...@gmail.com

 Hi y'all.

 I have a page that once given an input, goes and loads five DIVs with
 content; four of the divs are not visible (they are made visible by a
 click on a tab interface).

 What I had tried to do was as folows (given that the code has either
 been passed as a POST (the 'asxcode='' gets filled in by ?php echo
 $_POST['ASXCode'] ? ) OR has been entered in the input box #getCode
 and the Submit button #hitThat clicked...)

 What I really wanted was for the call to doTheFirst() to populate
 #summDiv, and THEN to go and doTheRest; that is, I wanted #summDiv's
 content to be completely loaded and fopr the page to be 'navigable'...
 and for the rest of the divs to load 'in the background' as it were.

 What I find is that quite often the other divs are loading and are
 finished WELL brfore #summDiv is populated (that is, before the call
 to StockFullSum.php has fully returned its response).

 Can anybody offer any guidance on this? I attach the javascript (of
 course, jquery.js is called before this javascript script is included)


 Cheers,


 GT

 here's the script.

 script  type=text/javascript
 $(document).ready(function() {
 $(ul.tabs).tabs(div.panes  div);
 var asxcode= '';
 if(asxcode!=='')
 {
 dotheFirst(asxcode);
 }

 });
 $(#hitThat).click(function() {
   var thisCode=$(#getCode).val();
   dotheFirst(thisCode);
 });

 function dotheFirst(z) {
  $(#summDiv).html('centerimg style=margin-top:70px;
 src=http://localhost/WIP/loading.gif; //center');
  $(#summDiv).load(http://www.marketmentat.com/includes/
 StockFullSum.phphttp://www.marketmentat.com/includes/%0AStockFullSum.php,
 {ASXCode:z});
  doTheRest(z);
 }


 function doTheRest(t){
   $(#fundDiv).load(http://www.marketmentat.com/includes/
 StockFundSum.phphttp://www.marketmentat.com/includes/%0AStockFundSum.php,
 {ASXCode:t});
   $(#techDiv).load(http://www.marketmentat.com/includes/
 StockTechSum.phphttp://www.marketmentat.com/includes/%0AStockTechSum.php,
 {ASXCode:t});
   $(#sensDiv).load(http://www.marketmentat.com/includes/
 StockSensSum.phphttp://www.marketmentat.com/includes/%0AStockSensSum.php,
 {ASXCode:t});
   $(#optDiv).load(http://www.marketmentat.com/includes/
 StockOptSum.php http://www.marketmentat.com/includes/%0AStockOptSum.php,
 {ASXCode:t});
   $(#newsDiv).load(http://www.marketmentat.com/includes/
 StockNewsSum.phphttp://www.marketmentat.com/includes/%0AStockNewsSum.php,
 {ASXCode:t});
 }

 /script



Re: [jQuery] Greenhorn with starterkit question...

2009-11-05 Thread Michel Belleville
It's not saying what you want, instead it's saying :

   - $(li) get all li
   - .not(:has(ul)) keep only those that don't contain any ul

You might prefer something on the lines of :
$(li).not(ul li)

Which says :

   - $(li) get all li
   - .not(ul li) don't keep those that have ul for ancestor


Michel Belleville


2009/11/6 karlkras karlk...@gmail.com

 Hey,
 So I'm using the starterkit to go through the basics with jQuery and
 had a question on the expected behavior of this function:
  $(document).ready(function() {
   $(li).not(:has(ul)).css(border, 1px solid black);
  });

 Isn't this saying:
 Select all li elements, if the li element is not contained in an
 ul then apply the style.
 If so, then this doesn't appear to be working properly in the
 starterkit.html
 e.g., if I add this to the page:

ul id=bulletlist
liFirst element/li
liSecond element/li
liThird element/li
/ul

 wouldn't the .not be applied to ul and therefore in this case the
 style shouldn't be applied? This isn't what I'm seeing.

 thanks,
 K



Re: [jQuery] show div hidden

2009-11-05 Thread Michel Belleville
I guess you're at the right place, and what you want is exceedingly simple :
.hide() on the element you'd like to hide will do the trick.

Michel Belleville


2009/11/3 alex akno...@gmail.com

 Hi everyone,
 i'm new on google groups and i'm french, well, i hope i'm at the right
 place.

 here's my problem :
 i'm implanting an easy chat system on my website.(like msn)
 this is how it works
 someone open a discussion with someone, he send a message. the message
 is stored in mysql.
 the other person had already opened his discussion window. and an ajax
 script go to get the new message which appear like this :
 div class=msg
 aknot31 say blablabli blabla
 /div

 In order to, produce special effect. I want these div box to appear
 with slideDown function of jQuery.
 The matter is that i don't know how to set him hidden before it slide
 down



Re: [jQuery] Re: getJSON - need some direction please.

2009-11-05 Thread Michel Belleville
As long as you find your way b^^d

Kind regards, and keep us updated.

Michel Belleville


2009/11/6 RayJames cdlcollege.rayja...@gmail.com

 Man, that felt like an ass chewing but I needed it.  :)  I am going to
 do some more homework and see how to put the advice you gave me to
 good use.  Thanks for your time Michel.  I really appreciate it.

 Ray James.

 On Nov 5, 2:42 pm, Michel Belleville michel.bellevi...@gmail.com
 wrote:
  2009/11/5 RayJames cdlcollege.rayja...@gmail.com
 
   Hi Michel, I think I might have confused you a bit.  The user is not
   necessarily my concern.
 
  Well... Then I guess it's not necessarily a good thing you design UI
 because
  it's all about the user. Ultimately, you're designing machines to work
 for
  humans, and when you're designing user interfaces you're at the
 ultimate
  step before the human uses the tools. If the user is not your concern
 here
  you've picked the wrong part of the job. Really.
 
   The code running in the background that sends
   calls to my api while the user is viewing the course is.
 
  Of course it is.
 
   These calls
   consist of functions that Initialize the learner session, terminate
   the learner session, set and get values from the LMS as well as a few
   error handling calls.
 
  Of course they do.
 
   Every time the course code calls the api the
   api is supposed to execute the call and return either data, true/
   false, or both.
 
  Of course it is.
 
   The problem is that on the Initialize and Terminate
   calls, nothing should happen until the api returns a true or false.
 
  Well, if by nothing you mean nothing both server-side AND client-side I
  agree with you, you need synchronous calls. That will also prevent your
 user
  from doing anything between the beginning of the call and the end. Even
  scrolling the page, or opening an outside link in a new tab, anything AT
 ALL
  until the call finishes. I don't know you but I find that drastic.
 
   Once that happens, then the other calls WILL just be called in the
   background async style while the user is engaged with the course.  I
   think this is the best way, because putting a waiting class could
   result in longer waiting times for the execution of the functions and
   could still possibly timeout before the code finishes. What do you
   think?
 
  I respectfully disagree, it is my informed opinion that adding a waiting
  class will not result in significant performances losses unless you botch
  the job (and I mean really botch the job, like adding the waiting class
 to
  any element of the page instead of the topmost element that needs it) or
 the
  calls are very close (and again I mean really very close, the kind of
 close
  that would make your interface unusable because synchronous calls would
  freeze it every odd second).
 
  The only constraint here is that you round up elements that must not be
  triggered between the beginning and the end of your pseudo-synchronous
 calls
  and give them this little trigger :
  $('.the_waiting_class .any_element_you_want_to_block').live('click',
  function() { return false; });
 
  The event will only be triggered when the targets match (so when
  the_waiting_class is given to their common parent), it will work on
 elements
  added to the dom during ajax or whatever script, and no user will notice
 any
  performance problem as .live uses bubbling to catch the events.
 
  I apologize for not making myself clear enough.  This is
 
   actually a fairly complex system and will be awesome when finished.
 
  I'm sure it will, but remember UI is one of the most important things
 that
  make the difference between awesome and I'm tired of this site that
 just
  freezes on me, let's google away.
 
   Keep an eye on Drupal and wait for it to come out as a module.  I will
   be opening all my code up as open source once it is finished.  Thanks.
 
  Hope you do well.
 
  Michel Belleville



Re: [jQuery] support for IE 5.*

2009-11-05 Thread Michel Belleville
Well, don't expect much to work on IE 5, and remember IE6 handles most CSS
like sh...

Just a question : why bother trying to be compliant to a product that's been
obsolete for something like 8 years already and that no-one bothers to use
anymore ?

Michel Belleville


2009/11/6 ljw linne...@gmail.com

 jquery works with IE 6+ and three other major current browsers.  Is it
 generally expected to work with older browsers such as IE 5.*, just
 not tested?  If not, what generally is expected to go wrong?



[jQuery] Re: Get two INPUT values, do some server side calculation, then post it back to another INPUT value in correct TR

2009-11-05 Thread palgo
Thanks Maarten.
I'll go ahead an test this soon. Let you know how that goes! :)

- Palgo

On 5 Nov, 23:30, Maarten maartenwie...@gmail.com wrote:
 On Nov 5, 10:10 pm, palgo rusha...@gmail.com wrote:

  I tried with this JS-code, which works for first line but also fills
  up the C in row2 with result.

        $(.A, .B).keyup(function(event){
          $.get(script.php, { a: $(.A).val(), b: $(.B).val()},
          function(data){
          $(.C).val(data)

 Palgo,

 I would replace above line of code with the following. As you can see,
 it tries to find the closest TR element from the element from which
 the event is triggered, from there it places the value in the INPUT
 element with class 'C'. The code is untested but should be close to
 what you need.

   $(event.target).closest(tr).find(input.C).val(data);

 Good luck,

 Maarten