[jQuery] Re: Looking for expand/collapse tree directory navigation

2009-07-26 Thread 刘永杰
dhtmlxtree,it is very good.

2009/7/26 Magnificent imightbewrongbutidontthin...@gmail.com


 Hello,

 I'm looking for an expanding/collapsing tree directory type of
 navigation and was wondering if someone knows of a good one that's out
 there and available.

 What I'm specifically looking for is one that is triggered on the
 click of a *graphic* that toggles the show/hide.  Each text nav item
 should be hyperlinkable to it's own link/page.  So for example (the +
 and - are the collapse/expand graphics, the dot leader is for some
 formatting):

 - Nav Item 1 (text should be hyperlinkable)
 ...Sub Nav 1(text should be hyperlinkable)
 ...- Sub Nav 2 (text should be hyperlinkable)
 ..Sub Nav 2a (text should be hyperlinkable)
 ..Sub Nav 2b (text should be hyperlinkable)
 ..Sub Nav 2c (text should be hyperlinkable)
 ...Sub Nav 3 (text should be hyperlinkable)
 + Nav Item 2 (text should be hyperlinkable)
 + Nav Item 3 (text should be hyperlinkable)
 + Nav Item 4 (text should be hyperlinkable)

 Ideally, this would work for plain old ul and li structure.  I
 suppose infinite nesting would be cool, but I don't think I need to go
 beyond 3 levels with the first 2 levels having the show/hide graphic
 triggers.


[jQuery] Re: Form values getting unsynchronized after ajaxsubmit [validate]

2009-07-26 Thread anoop

After several attempts, I have been able to consistently reproduce
this problem. It appears that this is an issue with the ajaxSubmit in
the form plugin and only in firefox (latest version), IE 7 does not
seem to have this issue.

The issue occurs in firefox only; when a page with multiple forms is
refreshed (by hitting F5 or ctrl-r) the body of the form and the form
header get unsynchronized. But after clicking on the reset button for
each form it gets rectified.
On IE 7 the refresh did not cause any issue anytime.

I tried after removing the ajaxSubmit and the problem did not occur in
firefox or IE.

I have these lines which I think is the cause of the problem:

submitHandler: function(form) {
$(form).ajaxSubmit({
  target: 'body',
  error: function (xhr) {
$('.derror').text(Errors: Please fix  +
xhr.statustext).show(fast);
}

It could be that I am doing something wrong, but that does not explain
the inconsistent behavior between the 2 browsers. It was this block of
text that I had to remove to make my forms work even after a refresh.

Thanks,
Anoop


On Jul 24, 11:01 am, Anoop kumar V anoopkum...@gmail.com wrote:
 Attached an html - that shows my situation...

 In the page - clicking on any region opens the pop-up form, and once in a
 while after you submit the pop-ups are mixed up, you see Newyork details for
 the Washington tab etc. But as soon as I click on the reset button, it
 rectifies itself...

 Can somebody please help a bit? I am not able to understand / explain why
 this happens - I do not have a lot of javascript / jquery code, just the 2
 functions...

 Should I call reset for all forms after I submit? If so can someone please
 show / hint at how that can be achieved?

 Thanks,
 Anoop

 On Fri, Jul 24, 2009 at 2:09 AM, Anoop kumar V anoopkum...@gmail.comwrote:

  Hi All,

  I have a very weird issue that I have been trying to resolve for over a
  week now with no success in sight.

  I use jsp to generate a page of regional information. The regions are
  displayed as clickable blocks. On clicking each block a pop-up form opens up
  with the corresponding region details like id, name and acronym. These can
  be edited and submitted as updates. There is also a last block that allows
  to create a new region which on clicking opens the same kind of form as the
  others, except all the fields are blank and required.

  I am using jquery validator plugin (bassistance) to ensure that the user
  does not leave any field blank and I also use the form plugin to do an
  ajaxsubmit, so that the id enterred is not a duplicate id.

  On submitting the new region form, a new region gets created and updates
  the page fine, but intermittently when I click on the other existing blocks
  the information shown in the pop-up is for a completely different region:
  for example when I click on a block labelled Washington, the popup that
  comes up shows New York, NY, 02. On clicking New York block, the same
  (correct) information is show. This does not happen always and I have
  noticed it happening only in firefox, I use firefox more often also. Also if
  I take out the ajaxsubmit and do a simple form submit, it seems to not
  occur, but I need the ajaxsubmit for the id validation..
  Interestingly, when I click on the reset button on the individual form, the
  values in the fields correct themselves automagically for that form..

  I also used firebug, and when I mouseover the field in the firebug console,
  the values in the fields are shown correct (in forebug), except the page
  displays the incorrect info. I think this safely eliminates my java code as
  the culprit... Again - when I reset the particular form, the values are
  good, but only for that form, so if I want to clean all such incorrect data,
  I will have to open each form pop-up on the page and click on the reset
  button - this would not work even as a workaround.

  Below is the code if it helps:

  *** JS***
  $(function() {
  var bbap = function() {
        $('.cbnav').live('click',function(event) {
          var target = $(event.target);
          if(($(target).is(.main-title)) || ($(target).is(.cls)))
          {
            $('.details').hide();
            if($(target).is(.main-title))
              $(target).next('.details').show(450);
          } else if ($(target).is('input[type=reset]')){
              $('.derrors').hide();
              $('.errors').hide();
          }
      });
    }
    bbap();
  });

  var v = $(function() {
      $('.main-title').click(function(event) {
        var target = $(event.target);
        var parent = $(target).parent();
        $(parent).validate({
          rules: {
              regionid: required,
              regionname: required,
              regionacronym: required,
              regioncode: required
          },
          submitHandler: function(form) {
            

[jQuery] Re: Check if movie (.mp4) is finished

2009-07-26 Thread 刘永杰
how does touch it finished?

2009/7/26 Sam Sherlock sam.sherl...@gmail.com

 I think you'd have to load a swf and have that call back to the page (via
 ex interface) when its completed
 hth - S


 2009/7/25 Eswip i...@fairmedia.nl


 Hi everyone,

 I'm using the jQuery Media Plugin to play a movie (.mp4) on a page
 when a button is clicked. But I want to remove the embed from the
 DOM when the movie is finished. Is this possible? And in what way? I
 searched on the group here and googled, but I found nothing.

 Regards,
 Eswip





[jQuery] Re: Form values getting unsynchronized after ajaxsubmit [validate]

2009-07-26 Thread anoop

After several attempts, I have been able to consistently reproduce
this problem. It appears that this is an issue with the ajaxSubmit in
the form plugin and only in firefox (latest version), IE 7 does not
seem to have this issue.

The issue occurs in firefox only; when a page with multiple forms is
refreshed (by hitting F5 or ctrl-r) the body of the form and the form
header get unsynchronized. But after clicking on the reset button for
each form it gets rectified.
On IE 7 the refresh did not cause any issue anytime.

I tried after removing the ajaxSubmit and the problem did not occur in
firefox or IE.

I have these lines which I think is the cause of the problem:

submitHandler: function(form) {
$(form).ajaxSubmit({
  target: 'body',
  error: function (xhr) {
$('.derror').text(Errors: Please fix  +
xhr.statustext).show(fast);
}

It could be that I am doing something wrong, but that does not explain
the inconsistent behavior between the 2 browsers. It was this block of
text that I had to remove to make my forms work even after a refresh.

Thanks,
Anoop


On Jul 24, 11:01 am, Anoop kumar V anoopkum...@gmail.com wrote:
 Attached an html - that shows my situation...

 In the page - clicking on any region opens the pop-up form, and once in a
 while after you submit the pop-ups are mixed up, you see Newyork details for
 the Washington tab etc. But as soon as I click on the reset button, it
 rectifies itself...

 Can somebody please help a bit? I am not able to understand / explain why
 this happens - I do not have a lot of javascript / jquery code, just the 2
 functions...

 Should I call reset for all forms after I submit? If so can someone please
 show / hint at how that can be achieved?

 Thanks,
 Anoop

 On Fri, Jul 24, 2009 at 2:09 AM, Anoop kumar V anoopkum...@gmail.comwrote:

  Hi All,

  I have a very weird issue that I have been trying to resolve for over a
  week now with no success in sight.

  I use jsp to generate a page of regional information. The regions are
  displayed as clickable blocks. On clicking each block a pop-up form opens up
  with the corresponding region details like id, name and acronym. These can
  be edited and submitted as updates. There is also a last block that allows
  to create a new region which on clicking opens the same kind of form as the
  others, except all the fields are blank and required.

  I am using jquery validator plugin (bassistance) to ensure that the user
  does not leave any field blank and I also use the form plugin to do an
  ajaxsubmit, so that the id enterred is not a duplicate id.

  On submitting the new region form, a new region gets created and updates
  the page fine, but intermittently when I click on the other existing blocks
  the information shown in the pop-up is for a completely different region:
  for example when I click on a block labelled Washington, the popup that
  comes up shows New York, NY, 02. On clicking New York block, the same
  (correct) information is show. This does not happen always and I have
  noticed it happening only in firefox, I use firefox more often also. Also if
  I take out the ajaxsubmit and do a simple form submit, it seems to not
  occur, but I need the ajaxsubmit for the id validation..
  Interestingly, when I click on the reset button on the individual form, the
  values in the fields correct themselves automagically for that form..

  I also used firebug, and when I mouseover the field in the firebug console,
  the values in the fields are shown correct (in forebug), except the page
  displays the incorrect info. I think this safely eliminates my java code as
  the culprit... Again - when I reset the particular form, the values are
  good, but only for that form, so if I want to clean all such incorrect data,
  I will have to open each form pop-up on the page and click on the reset
  button - this would not work even as a workaround.

  Below is the code if it helps:

  *** JS***
  $(function() {
  var bbap = function() {
        $('.cbnav').live('click',function(event) {
          var target = $(event.target);
          if(($(target).is(.main-title)) || ($(target).is(.cls)))
          {
            $('.details').hide();
            if($(target).is(.main-title))
              $(target).next('.details').show(450);
          } else if ($(target).is('input[type=reset]')){
              $('.derrors').hide();
              $('.errors').hide();
          }
      });
    }
    bbap();
  });

  var v = $(function() {
      $('.main-title').click(function(event) {
        var target = $(event.target);
        var parent = $(target).parent();
        $(parent).validate({
          rules: {
              regionid: required,
              regionname: required,
              regionacronym: required,
              regioncode: required
          },
          submitHandler: function(form) {
            

[jQuery] Re: jQuery Nesting Tables

2009-07-26 Thread nullstring

oh grace god, someone replied. thanks @FrenchiNLA

here's the generated .NET html code

table class=list cellspacing=0 border=0
id=ctl00_ContentPlaceHolder1_GV style=border-collapse:collapse;
tr
th scope=colnbsp;/thth 
scope=colnbsp;/thth
scope=cola href=javascript:__doPostBack
('ctl00$ContentPlaceHolder1$GV','Sort$Printer')Printer/a/thth
scope=cola href=javascript:__doPostBack
('ctl00$ContentPlaceHolder1$GV','Sort$Process')Process/a/thth
scope=cola href=javascript:__doPostBack
('ctl00$ContentPlaceHolder1$GV','Sort$PackageType')PackageType/a/
thth scope=cola href=javascript:__doPostBack
('ctl00$ContentPlaceHolder1$GV','Sort$LeadTime')LeadTime/a/th
/trtr
td
a
id=ctl00_ContentPlaceHolder1_GV_ctl02_HyperLink2
href=PrinterProcessPackageTypeModify.aspx?
PrinterProcessPackageTypePK=1Edit/a
/tdtd
a
id=ctl00_ContentPlaceHolder1_GV_ctl02_HyperLink1
href=PrinterProcessPackageTypeView.aspx?
PrinterProcessPackageTypePK=1View/a
/tdtdAlcan/tdtdGravure/tdtdLabels/
tdtd35/td
/trtr
td
a
id=ctl00_ContentPlaceHolder1_GV_ctl03_HyperLink2
href=PrinterProcessPackageTypeModify.aspx?
PrinterProcessPackageTypePK=2Edit/a
/tdtd
a
id=ctl00_ContentPlaceHolder1_GV_ctl03_HyperLink1
href=PrinterProcessPackageTypeView.aspx?
PrinterProcessPackageTypePK=2View/a
/tdtdAlcan/tdtdGravure/tdtdMultipack
Lidding (not foil)/tdtd35/td
/trtr
td
a
id=ctl00_ContentPlaceHolder1_GV_ctl04_HyperLink2
href=PrinterProcessPackageTypeModify.aspx?
PrinterProcessPackageTypePK=3Edit/a
/tdtd
a
id=ctl00_ContentPlaceHolder1_GV_ctl04_HyperLink1
href=PrinterProcessPackageTypeView.aspx?
PrinterProcessPackageTypePK=3View/a
/tdtdEmsur/tdtdGravure/tdtdLabels/
tdtd30/td
/trtr
td colspan=6
!-- here's the table I want to remove and move on top just before the
parent table --
table border=0
tr
tdspan1/span/tdtda 
href=javascript:__doPostBack
('ctl00$ContentPlaceHolder1$GV','Page$2')2/a/td
/tr
/table
/td
/tr
/table

That nested table is actually the Page Links and it's not always
there .. I mean, it only exists if GridView has something to page ..

here's the idea behind these problem:
I am using someones JS to manipulate the Table and do some column
freezing stuff .. but everytime this page links exists, cells always
messed up.. so my idea is to check if that page link exists, move it
before the table(parent table) ..

this code works .. but I need to check if the page links table
exists ..
this.before('divtable id=\'pages\'/table/div');
jQuery(#ctl00_ContentPlaceHolder1_GV).find('tbody tr:last').remove
().appendTo($(#pages));

On Jul 26, 12:54 am, FrenchiINLA mamali.sohe...@gmail.com wrote:
 Could you provide your html code generated by .net? it would help, but
 in general rule you don't have to check existence of an element to
 apply action to it. Jquery disregard the action if it doesn't exist.
 For your example:
 $('tbody[tr:last][td][table]', $(this)).remove(); will work if it can
 find your criteria within $(this) otherwise it does nothing.

 On Jul 25, 8:57 am, nullstring jayz...@gmail.com wrote:



  Please help?

  On Jul 25, 10:12 pm, nullstring jayz...@gmail.com wrote:

   Hi,

   In my last row (parent Table) with colspan(tr), I have another Table
   (without any.attributes) which was generated by GridView, Paging
   enabled and located in footer ..l

   How do I know if that Table exists in my last row(parent Table)..

   this code won't work ..

   if(jQuery(this).is('table')) {
                   if(this.find('tbody tr:last td table')) {
                             /* remove paging table element */
                   }

   }


[jQuery] Re: Looking for expand/collapse tree directory navigation

2009-07-26 Thread Anoop kumar V
Would this work for you?

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

sample 0 seems to fit your requirements.

Thanks,
Anoop


On Sat, Jul 25, 2009 at 4:10 PM, Magnificent 
imightbewrongbutidontthin...@gmail.com wrote:


 Hello,

 I'm looking for an expanding/collapsing tree directory type of
 navigation and was wondering if someone knows of a good one that's out
 there and available.

 What I'm specifically looking for is one that is triggered on the
 click of a *graphic* that toggles the show/hide.  Each text nav item
 should be hyperlinkable to it's own link/page.  So for example (the +
 and - are the collapse/expand graphics, the dot leader is for some
 formatting):

 - Nav Item 1 (text should be hyperlinkable)
 ...Sub Nav 1(text should be hyperlinkable)
 ...- Sub Nav 2 (text should be hyperlinkable)
 ..Sub Nav 2a (text should be hyperlinkable)
 ..Sub Nav 2b (text should be hyperlinkable)
 ..Sub Nav 2c (text should be hyperlinkable)
 ...Sub Nav 3 (text should be hyperlinkable)
 + Nav Item 2 (text should be hyperlinkable)
 + Nav Item 3 (text should be hyperlinkable)
 + Nav Item 4 (text should be hyperlinkable)

 Ideally, this would work for plain old ul and li structure.  I
 suppose infinite nesting would be cool, but I don't think I need to go
 beyond 3 levels with the first 2 levels having the show/hide graphic
 triggers.


[jQuery] Re: tablesorter, sort values in anchor as numerics

2009-07-26 Thread 刘永杰
easyer.

2009/7/25 mila mshneyder...@gmail.com



 I have data that looks like that

 a href='myURL/myapp?name=mynameparam1=val'23/a
 a href='myURL/myapp?name=hisnameparam1=val1'9/a

 I need it to be sorted numericaly by values between /a.  How do I
 do that?



[jQuery] Re: Check if movie (.mp4) is finished

2009-07-26 Thread Peter Edwards


Hi Eswip,

It is possible to use the getEndTime method of the quicktime movie, but 
I think only when the plugin/movie has loaded. Apple docs:


http://developer.apple.com/documentation/QuickTime/REF/QT41_HTML/QT41WhatsNew-74.html

Not sure how you would implement this though...

bjorsq

on 25/07/2009 17:26 Eswip said::

Hi everyone,

I'm using the jQuery Media Plugin to play a movie (.mp4) on a page
when a button is clicked. But I want to remove the embed from the
DOM when the movie is finished. Is this possible? And in what way? I
searched on the group here and googled, but I found nothing.

Regards,
Eswip

  


[jQuery] small problem

2009-07-26 Thread GaVrA

Hmm check out my site:

http://www.crtaci.info/

on top-right position i have search field. When you move your mouse
over there small text shows up that says:

Napredna pretraga

Now, for some reason those letters change color to like yellow for
very short period of time in ff 3.5 and to some strange color in
safari 4.0.2 for win. In ie8, opera and chrome it works just the way
it should, white letters stay white during the animation.

Any sugestions?


[jQuery] Re: small problem

2009-07-26 Thread tain

Really wierd.

I have
FF 3.5.1 - works good. no color transformation.
IE8 - like in ff, works good.

On Jul 26, 11:40 am, GaVrA ga...@crtaci.info wrote:
 Hmm check out my site:

 http://www.crtaci.info/

 on top-right position i have search field. When you move your mouse
 over there small text shows up that says:

 Napredna pretraga

 Now, for some reason those letters change color to like yellow for
 very short period of time in ff 3.5 and to some strange color in
 safari 4.0.2 for win. In ie8, opera and chrome it works just the way
 it should, white letters stay white during the animation.

 Any sugestions?


[jQuery] Listnav Umlauts and special chars

2009-07-26 Thread sixtyseven

I ran into a problem when having umlauts as first letter in the li
tag. They will not be shown, until I add them to the letters array.
IMHO the better way would be to have a function, that degrades the
letter to the next near neighbor, i.e. if it is ü, make it to u, if
it's é make it to e, etc. Do you have any Idea how to achieve this?
Such a function would make the listnav more multilingual. While
speaking of this, perhaps you could make the word All a variable,
too.

Same thing with special chars like *,# etc. How about adding them into
a group of its own? Probably one could handle it like this: If the
first letter is neither a number nor a letter, it must be a special
char.

Hope I could explain the problem, my english is not that good.

Greetings from Germany

André


[jQuery] Re: Listnav Umlauts and special chars

2009-07-26 Thread sixtyseven

Oh, and of course the not found sentence should be a variable, too.

This is a real fantastic plugin, I used it to make a faq section for a
site, by combining it with a simple div display-switch. Works like a
charm, except the umlauts/specialchar problem.


[jQuery] Re: Listnav Umlauts and special chars

2009-07-26 Thread sixtyseven

Oh, I almost forgot to say thank you for this gem. This is a real
fantastic plugin, I used it to make a faq section for a site, by
combining it with a simple div display-switch. Works like a charm,
except the umlauts/specialchar problem.



[jQuery] Re: small problem

2009-07-26 Thread GaVrA

Maybe it has something to do with the fact i am using Windows 7?

On Jul 26, 12:27 pm, tain bugi@gmail.com wrote:
 Really wierd.

 I have
 FF 3.5.1 - works good. no color transformation.
 IE8 - like in ff, works good.

 On Jul 26, 11:40 am, GaVrA ga...@crtaci.info wrote:

  Hmm check out my site:

 http://www.crtaci.info/

  on top-right position i have search field. When you move your mouse
  over there small text shows up that says:

  Napredna pretraga

  Now, for some reason those letters change color to like yellow for
  very short period of time in ff 3.5 and to some strange color in
  safari 4.0.2 for win. In ie8, opera and chrome it works just the way
  it should, white letters stay white during the animation.

  Any sugestions?


[jQuery] Re: accessing iframe content

2009-07-26 Thread helpfulMike

Hi,
I had a similar problem a couple of days ago and this worked for me...
   iframe = $('iframe.CLASS_NAME')[0];
hope it helps,
Mike


On Jul 26, 2:39 am, kknaru isai...@gmail.com wrote:
 hi there, i just started working with iframes and i'm stucked :D

 so...i have this code inside a html file:

 iframe id=myframe
          ptext/p
 /iframe

 what i'm trying to do is to grab that paragraph text(using jquery).

 by now i tried something like this:

 $(#myframe).contents().find(p).html();

 butwith no result :(

 does anyone know the answer?


[jQuery] How to Show image Title in Lightbox? Please

2009-07-26 Thread jimmyhill

Hi

It seems to me that it normally happens by default... set a Title in
the image tag and it shows in the lightbox-image-details-caption.  But
mine just doesn't at http://dev.beecheshotelnorwich.co.uk/

Any suggestions how to fix, please?


[jQuery] Re: accessing iframe content

2009-07-26 Thread helpfulMike

Hi,
Try this. It works for me.
iframe = $('iframe.CLASS_NAME')[0];

I am accessing iframe content via class and works fine. Should work
with id too.
Hope its what you need,
regards
Mike


[jQuery] My messages don't show?

2009-07-26 Thread Jon Jackson

What could I be doing wrong?

I've joined the group, posted a message (tried it twice)... but it 
doesn't show?

Jon Jackson (JimmyHill, jonj...@googlemail.com)


[jQuery] Superfish drowdown doesn't close (IE 7 + IE 8 tested)

2009-07-26 Thread conlabz-cs


On one of our websites I'm using a horizontal superfish menu. It works fine
in FF and Safari, but I have a problem with the dropdown in IE 7 and IE 8.
It doesn't close if I got to another menu entry. I tried to look for a
solution, but had no chance to find it... I guess that the problem is in the
javascript files. I don't think that it is a CSS problem.

You can try to look at: www.trassenheide.net. Here you can see my problem.

Thanks...
-- 
View this message in context: 
http://www.nabble.com/Superfish-drowdown-doesn%27t-close-%28IE-7-%2B-IE-8-tested%29-tp24662728s27240p24662728.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] jQuery / CSS: element jump around on .animate()

2009-07-26 Thread jezmck

Hi Gang,

If you have a look at http://webcam.jezmckean.com/ and click on an
image you will see what I mean.

It's as if the image is converted to a div while animating.

Any ideas anyone?


[jQuery] Re: How to deterine number of words in a string?

2009-07-26 Thread Conrad Cheng
Thank all, i will try once get back to offce tomorrow.

On Sat, Jul 25, 2009 at 8:40 PM, CarComplaints.com w...@autobeef.comwrote:


 With regular expressions, it's simpler than all this .. you can count
 letter groups that are split up by anything that's not a letter or a
 digit.

 var string = $(span.string).text();
 var mresult = string.match(/\w+/g);
 alert(mresult.length);





 On Jul 24, 8:41 pm, Lukas Lt 1luk...@gmail.com wrote:
  Well you can replace '!, into spaces and then count
 
  Also I'd do a loop and remove empty elements (if multiple paces was in
  text) before counting.
 
  On 24 Lie, 13:25, Raju raju3...@gmail.com wrote:
 
   Hi
 
   i want a jquery plugin to view word files,
 
   can somebody help me out in this regards
 
   Warm Regards,
 
   Mari Raj K,
   Bangalore
   +91 9916140688
 
   On Fri, Jul 24, 2009 at 3:49 PM, Liam Potter radioactiv...@gmail.com
 wrote:
 
you don't need a plugin, this will do it
 
var string = $(span.string).text();
var count = string.split( );
alert(count.length);
 
Conrad Cheng wrote:
 
Hi all,
Any jquery plugin can check number of word in a string instead using
 of
.length?...
 
Many thanks.
 
Conrad



[jQuery] Fetching data from callback with $.ajax

2009-07-26 Thread Sander Thalen
Hello all,

I've recently started with jQuery because I wanted to use it for posting
details from an login form to a PHP script which should return whether the
user is authenticated or not.

For this I use $.ajax, because of it's flexibility and I prefer to use it in
this implementation. Reading (jQuery docs and examples) and searching a lot
did not solve me on one issue: fetching the data in the callback to the
global scope. This one is driving me crazy.

Here is the code:
script type=text/javascript
$(document).ready(function(){
var form = $('#form');
form.submit(function(){ // Only execute this function on submit
if(isAuthenticated($('#username').val(), $('#password').val()))
{
return true; // I only want the form to be submitted when
the credentials are valid (found to be valid by the PHP script)
} else {
return false;
}
});

function isAuthenticated(username, password) { // This function call
the PHP script to ask whether the credentials are valid or not.
$.ajax({
type: POST,
url: json.php?module=loginaction=authenticate,
data: username= + username + password= + password,
success: function(msg) {
alert(msg); // This returns 'authenticated' in plain
text (at the moment) from the PHP script. Functions fine or course, but I
want to use it outside this function. How??
}
});

   And here is why I want this to work:
if(msg == authenticated) { // This function should be able to
read the var 'msg' from the callback in the function above. How?
alert(Outside:  + msg); // At this point, msg is of course
undefined.
return true;
}
}
});
/script

So the only question actually is, how can I let the function that should
check the message of the response know that 'msg' has been set?

I hope this makes it clear what I mean ;)


Thanks,
Sander


[jQuery] mouseleave triggering prematurely?

2009-07-26 Thread iceangel89

i am trying to develop my own accordion/sliding menu. (as a side qn,
any good ones that can be easily customized/skinned?)

i found that seem to trigger when i am sliding down an inner menu.
since its inner, my mouse definately has not left #mainnav

my test page http://iceangel89.5gigs.net/test.html

without that annoying test alert http://iceangel89.5gigs.net/test_1.html

$(#mainnav).mouseleave(function() {
alert(mouseleave #mainnav);
});

more complete source:

$(function() {
$(#mainnav  li  a).hover(mouseOver);
$(#mainnav).mouseleave(function() {
alert(mouseleave #mainnav);
});
});
function mouseOver() {
$(this).next(ul).slideDown(fast, function() {
$(li:has(ul)  a, this).hover(mouseOver);
});
}

#mainnav, #mainnav ul {
list-style: none;
padding: 0;
margin: 0;
background: #bbb;
}
#mainnav ul {
display: none;
margin: 5px 10px;
}
#mainnav a {
display: block;
padding: 5px 10px;
margin: 2px 0;
background: yellow;
}

ul id=mainnav
lia href=#Test/a/li
lia href=#Test/a/li
lia href=#Test/a/li
li
a href=#Test/a
ul
lia href=#Test/a/li
li
a href=#Test 1/a
ul
lia href=#Test/a/li
lia href=#Test/a/li
lia href=#Test/a/li
/ul
/li
lia href=#Test/a/li
/ul
/li
lia href=#Test/a/li
lia href=#Test/a/li
/ul



[jQuery] Re: How to Show image Title in Lightbox? Please

2009-07-26 Thread brian

You mean the alt text? It workes for me--The Beeches Hotel. I see it
at bottom left.

On Sun, Jul 26, 2009 at 6:41 AM, jimmyhilljonj...@googlemail.com wrote:

 Hi

 It seems to me that it normally happens by default... set a Title in
 the image tag and it shows in the lightbox-image-details-caption.  But
 mine just doesn't at http://dev.beecheshotelnorwich.co.uk/

 Any suggestions how to fix, please?



[jQuery] Re: Superfish drowdown doesn't close (IE 7 + IE 8 tested)

2009-07-26 Thread Charlie





try changing animation option for height to 'show'

$('ul.sf-menu').superfish({
  animation: {opacity:'show', height:'show'},
dropShadows: false
 });

you still get a slidedown effect and can also add option speed: 

conlabz-cs wrote:

  
On one of our websites I'm using a horizontal superfish menu. It works fine
in FF and Safari, but I have a problem with the dropdown in IE 7 and IE 8.
It doesn't close if I got to another menu entry. I tried to look for a
solution, but had no chance to find it... I guess that the problem is in the
_javascript_ files. I don't think that it is a CSS problem.

You can try to look at: www.trassenheide.net. Here you can see my problem.

Thanks...
  






[jQuery] Re: Check if movie (.mp4) is finished

2009-07-26 Thread Eswip

I tried getting a decent .swf file with the movie.. but when I
exported it from After Effects the file was 66MB.. also tried to do it
using Adobe Flash and inserting the .mp4 file, but had problems with
syncing the audio and video..

So if anyone knows how to create a nice .swf from a video file then
please tell me.. :)

Eswip

On Jul 26, 3:39 am, Sam Sherlock sam.sherl...@gmail.com wrote:
 I think you'd have to load a swf and have that call back to the page (via ex
 interface) when its completed
 hth - S

 2009/7/25 Eswip i...@fairmedia.nl





  Hi everyone,

  I'm using the jQuery Media Plugin to play a movie (.mp4) on a page
  when a button is clicked. But I want to remove the embed from the
  DOM when the movie is finished. Is this possible? And in what way? I
  searched on the group here and googled, but I found nothing.

  Regards,
  Eswip


[jQuery] Re: Check if movie (.mp4) is finished

2009-07-26 Thread Eswip

Hey, thnx for that.. but the movie has a standard playing time (about
40 seconds), so I already know that after 40 seconds the movie starts
playing, I car remove the embed tag. The problem is that the movie
will not start inmediately when activated, since it has to download
and buffer first.

Eswip

On Jul 26, 10:37 am, Peter Edwards p...@bjorsq.net wrote:
 Hi Eswip,

 It is possible to use the getEndTime method of the quicktime movie, but
 I think only when the plugin/movie has loaded. Apple docs:

 http://developer.apple.com/documentation/QuickTime/REF/QT41_HTML/QT41...

 Not sure how you would implement this though...

 bjorsq

 on 25/07/2009 17:26 Eswip said::



  Hi everyone,

  I'm using the jQuery Media Plugin to play a movie (.mp4) on a page
  when a button is clicked. But I want to remove the embed from the
  DOM when the movie is finished. Is this possible? And in what way? I
  searched on the group here and googled, but I found nothing.

  Regards,
  Eswip


[jQuery] Re: Fetching data from callback with $.ajax

2009-07-26 Thread FrenchiINLA

I would do like that:
isAuthenticated function return true or false according the entry,
then check if is Authenticated, ajax to your php something like
if(isAuthenticated($('#username').val(), $('#password').val())) {

$ajax(
{
--
--
success: function(msg){
alert(msg=='authenticated')
}
}
);

}

On Jul 26, 3:56 am, Sander Thalen stha...@gmail.com wrote:
 Hello all,

 I've recently started with jQuery because I wanted to use it for posting
 details from an login form to a PHP script which should return whether the
 user is authenticated or not.

 For this I use $.ajax, because of it's flexibility and I prefer to use it in
 this implementation. Reading (jQuery docs and examples) and searching a lot
 did not solve me on one issue: fetching the data in the callback to the
 global scope. This one is driving me crazy.

 Here is the code:
 script type=text/javascript
     $(document).ready(function(){
         var form = $('#form');
         form.submit(function(){ // Only execute this function on submit
             if(isAuthenticated($('#username').val(), $('#password').val()))
 {
                 return true; // I only want the form to be submitted when
 the credentials are valid (found to be valid by the PHP script)
             } else {
                 return false;
             }
         });

         function isAuthenticated(username, password) { // This function call
 the PHP script to ask whether the credentials are valid or not.
             $.ajax({
                 type: POST,
                 url: json.php?module=loginaction=authenticate,
                 data: username= + username + password= + password,
                 success: function(msg) {
                     alert(msg); // This returns 'authenticated' in plain
 text (at the moment) from the PHP script. Functions fine or course, but I
 want to use it outside this function. How??
                 }
             });

            And here is why I want this to work:
             if(msg == authenticated) { // This function should be able to
 read the var 'msg' from the callback in the function above. How?
                 alert(Outside:  + msg); // At this point, msg is of course
 undefined.
                 return true;
             }
         }
     });
     /script

 So the only question actually is, how can I let the function that should
 check the message of the response know that 'msg' has been set?

 I hope this makes it clear what I mean ;)

 Thanks,
 Sander


[jQuery] Re: mouseleave triggering prematurely?

2009-07-26 Thread Charlie





take a closer look at how hover function works. It requires *two*
functions called. You are also embedding a hover function within a
hover function (mouseover) then calling the mouseover function within
itself

http://docs.jquery.com/Events/hover

try this and see if this is the effect you want

$(function() {
 $("#mainnav  li  a").mouseover(function() {

$(this).next("ul").slideDown("fast").addClass("open"); 
 });

$("#mainnav").mouseleave(function() {
 $(".open").slideUp("fast")
});
 });

iceangel89 wrote:

  i am trying to develop my own accordion/sliding menu. (as a side qn,
any good ones that can be easily customized/skinned?)

i found that seem to trigger when i am sliding down an "inner" menu.
since its "inner", my mouse definately has not left #mainnav

my test page http://iceangel89.5gigs.net/test.html

without that annoying test alert http://iceangel89.5gigs.net/test_1.html

$("#mainnav").mouseleave(function() {
alert("mouseleave #mainnav");
});

more complete source:

$(function() {
$("#mainnav  li  a").hover(mouseOver);
$("#mainnav").mouseleave(function() {
alert("mouseleave #mainnav");
});
});
function mouseOver() {
$(this).next("ul").slideDown("fast", function() {
$("li:has(ul)  a", this).hover(mouseOver);
});
}

#mainnav, #mainnav ul {
list-style: none;
padding: 0;
margin: 0;
background: #bbb;
}
#mainnav ul {
display: none;
margin: 5px 10px;
}
#mainnav a {
display: block;
padding: 5px 10px;
margin: 2px 0;
background: yellow;
}

ul id="mainnav"
lia href=""Test/a/li
lia href=""Test/a/li
lia href=""Test/a/li
li
a href=""Test/a
ul
lia href=""Test/a/li
li
a href=""Test 1/a
ul
lia href=""Test/a/li
lia href=""Test/a/li
lia href=""Test/a/li
/ul
/li
lia href=""Test/a/li
/ul
/li
lia href=""Test/a/li
lia href=""Test/a/li
/ul


  






[jQuery] Request Path

2009-07-26 Thread Pops

This is probably isn't a jquery question, but I am  using jQuery media
plugin in this case, so I am wondering if someone  can assist here.

I have a http folder with my server-side scripts for media stuff

  /public/wcflash/wcflash.wcx-- server side compiled script
for our web server

I found jquery-media.js and want to see how I can use it. So I put the
following under the under the folder:

  /public/wcflash/jmedia/jquery.media.js
  /public/wcflash/jmedia/jquery.metadata.js
  /public/wcflash/jmedia/mediaplayer.js

The wcx script spits out a html script tag:

 script type=text/javascript src=/public/wcflash/jmedia/
jquery.media.js/script
 script type=text/javascript src=/public/wcflash/jmedia/
jquery.metadata.js/script

The problem is that jquery.metadata.js is attempted to load
mediaplayer.swf from the /public/wcflash path, not the base path that
the script was under.

I don't want to copy this jmedia files to folders where they will be
used. wcx scripts can be anywhere in the web site?

Short of changing jquery.metadata.js,  how can I resolve this?

thanks









[jQuery] Re: Setting identical events to multiple elements using a for loop

2009-07-26 Thread FrenchiINLA

in your case you can use:
$('span[id^sp_span]') to get all span with id starting with sp_span
then you can get the id when is clicked

$('span[id^sp_span]').click(function(){
var spanID = $(this).attr('id').split('_')[1] ;will give you span1,
span2 etc
$('#'+spanID).slideToggle(slideSpeed);

});

On Jul 25, 4:37 pm, Blake stickynote...@gmail.com wrote:
 On my site, I have some click-able spans (will be referred to as
 toggle spans) that show or hide other spans (that contain the content
 I want on my site; will be referred to as content spans). The layout
 of these spans is like this:

 --
 span id=sp_span1Span 1/span - span id=sp_span2Span 2/span
 - span id=sp_span3Span 3/span

 span class=contentSpan id=span1
 pSpan 1 content./p
 /span

 span class=contentSpan id=span2
 pSpan 2 content./p
 /span

 span class=contentSpan id=span3
 pSpan 3 content./p
 /span
 --

 Then, in my jQuery I have something like this:

 --
 slideSpeed=1000;

 $(span#sp_span1).click(function () {
 $(span#span1).slideToggle(slideSpeed);
 $(span.contentSpan:not(#span1)).slideUp(slideSpeed);

 });

 $(span#sp_span2).click(function () {
 $(span#span2).slideToggle(slideSpeed);
 $(span.contentSpan:not(#span2)).slideUp(slideSpeed);});

 --

 and so on for each separate content span. What the above code does is:
 for example, when toggle span 1 is clicked on, content span 1 opens if
 it is not open, and if content span 2 or 3 is open, that content span
 is closed and content span 1 is opened. (If that doesn't make sense, I
 apologize, and a download-able example can be found 
 here:http://willhostforfood.com/access.php?fileid=76513)

 This method works perfectly fine, but to make it easier for me to add
 more content spans, I would like to use a for loop that will
 automatically enter all that for me.

 What I would like to do in my jQuery is use an array that will contain
 the IDs of all the different content spans I want to have displayed on
 the page. Then, a for loop will enter the appropriate information
 (identical to the code above). I've tried many things, but I cannot
 get this to work. Here's kind of what I have:

 --
 sections=new Array(span1,span2,span3);

 for (i=0;isections.length-1;i+=1) {
 $(span#+sections[i]).click(function() {
 $(span#+sections[i]).slideToggle(slideSpeed);
 //$(span.contentSpan:not(attr('id')==sections[i])).slideUp
 (slideSpeed);});
 }

 --

 That doesn't work, though. What I need to do is get the value of
 sections[i] and use that in the element bit of the code.

 Any ideas? If you need more information, please ask.

 Thanks!
 Blake


[jQuery] Re: How to Show image Title in Lightbox? Please

2009-07-26 Thread Blake

I can see it as well. Went to the site, clicked an image, the lightbox
popped up, and I could toggle through the images. The Plantation
(Secret) Garden and The Beeches Hotel were the captions I came
across as I toggled through the images.

On Jul 26, 8:54 am, brian bally.z...@gmail.com wrote:
 You mean the alt text? It workes for me--The Beeches Hotel. I see it
 at bottom left.

 On Sun, Jul 26, 2009 at 6:41 AM, jimmyhilljonj...@googlemail.com wrote:

  Hi

  It seems to me that it normally happens by default... set a Title in
  the image tag and it shows in the lightbox-image-details-caption.  But
  mine just doesn't athttp://dev.beecheshotelnorwich.co.uk/

  Any suggestions how to fix, please?


[jQuery] Re: jQuery Nesting Tables

2009-07-26 Thread FrenchiINLA

I didn't go through your whole code, but you can always check
existence of jquery object with 'has' to check attribution, or check
for length to see if the array is not empty somethign like
$('tbody[tr:last]', '[id$=GV]).length  0 means it exists.

On Jul 25, 11:55 pm, nullstring jayz...@gmail.com wrote:
 oh grace god, someone replied. thanks @FrenchiNLA

 here's the generated .NET html code

 table class=list cellspacing=0 border=0
 id=ctl00_ContentPlaceHolder1_GV style=border-collapse:collapse;
                 tr
                         th scope=colnbsp;/thth 
 scope=colnbsp;/thth
 scope=cola href=javascript:__doPostBack
 ('ctl00$ContentPlaceHolder1$GV','Sort$Printer')Printer/a/thth
 scope=cola href=javascript:__doPostBack
 ('ctl00$ContentPlaceHolder1$GV','Sort$Process')Process/a/thth
 scope=cola href=javascript:__doPostBack
 ('ctl00$ContentPlaceHolder1$GV','Sort$PackageType')PackageType/a/
 thth scope=cola href=javascript:__doPostBack
 ('ctl00$ContentPlaceHolder1$GV','Sort$LeadTime')LeadTime/a/th
                 /trtr
                         td
                     a
 id=ctl00_ContentPlaceHolder1_GV_ctl02_HyperLink2
 href=PrinterProcessPackageTypeModify.aspx?
 PrinterProcessPackageTypePK=1Edit/a
                 /tdtd
                     a
 id=ctl00_ContentPlaceHolder1_GV_ctl02_HyperLink1
 href=PrinterProcessPackageTypeView.aspx?
 PrinterProcessPackageTypePK=1View/a
                 /tdtdAlcan/tdtdGravure/tdtdLabels/
 tdtd35/td
                 /trtr
                         td
                     a
 id=ctl00_ContentPlaceHolder1_GV_ctl03_HyperLink2
 href=PrinterProcessPackageTypeModify.aspx?
 PrinterProcessPackageTypePK=2Edit/a
                 /tdtd
                     a
 id=ctl00_ContentPlaceHolder1_GV_ctl03_HyperLink1
 href=PrinterProcessPackageTypeView.aspx?
 PrinterProcessPackageTypePK=2View/a
                 /tdtdAlcan/tdtdGravure/tdtdMultipack
 Lidding (not foil)/tdtd35/td
                 /trtr
                         td
                     a
 id=ctl00_ContentPlaceHolder1_GV_ctl04_HyperLink2
 href=PrinterProcessPackageTypeModify.aspx?
 PrinterProcessPackageTypePK=3Edit/a
                 /tdtd
                     a
 id=ctl00_ContentPlaceHolder1_GV_ctl04_HyperLink1
 href=PrinterProcessPackageTypeView.aspx?
 PrinterProcessPackageTypePK=3View/a
                 /tdtdEmsur/tdtdGravure/tdtdLabels/
 tdtd30/td
                 /trtr
                         td colspan=6
 !-- here's the table I want to remove and move on top just before the
 parent table --
                                 table border=0
                                         tr
                                                 tdspan1/span/tdtda 
 href=javascript:__doPostBack
 ('ctl00$ContentPlaceHolder1$GV','Page$2')2/a/td
                                         /tr
                                 /table
                         /td
                 /tr
         /table

 That nested table is actually the Page Links and it's not always
 there .. I mean, it only exists if GridView has something to page ..

 here's the idea behind these problem:
 I am using someones JS to manipulate the Table and do some column
 freezing stuff .. but everytime this page links exists, cells always
 messed up.. so my idea is to check if that page link exists, move it
 before the table(parent table) ..

 this code works .. but I need to check if the page links table
 exists ..
 this.before('divtable id=\'pages\'/table/div');
 jQuery(#ctl00_ContentPlaceHolder1_GV).find('tbody tr:last').remove
 ().appendTo($(#pages));

 On Jul 26, 12:54 am, FrenchiINLA mamali.sohe...@gmail.com wrote:



  Could you provide your html code generated by .net? it would help, but
  in general rule you don't have to check existence of an element to
  apply action to it. Jquery disregard the action if it doesn't exist.
  For your example:
  $('tbody[tr:last][td][table]', $(this)).remove(); will work if it can
  find your criteria within $(this) otherwise it does nothing.

  On Jul 25, 8:57 am, nullstring jayz...@gmail.com wrote:

   Please help?

   On Jul 25, 10:12 pm, nullstring jayz...@gmail.com wrote:

Hi,

In my last row (parent Table) with colspan(tr), I have another Table
(without any.attributes) which was generated by GridView, Paging
enabled and located in footer ..l

How do I know if that Table exists in my last row(parent Table)..

this code won't work ..

if(jQuery(this).is('table')) {
                if(this.find('tbody tr:last td table')) {
                          /* remove paging table element */
                }

}- Hide quoted text -

 - Show quoted text -


[jQuery] Re: Setting identical events to multiple elements using a for loop

2009-07-26 Thread FrenchiINLA

sorry i got a typo error, the corrent code is:
$('span[id^=sp_span]').

On Jul 26, 8:39 am, FrenchiINLA mamali.sohe...@gmail.com wrote:
 in your case you can use:
 $('span[id^sp_span]') to get all span with id starting with sp_span
 then you can get the id when is clicked

 $('span[id^sp_span]').click(function(){
 var spanID = $(this).attr('id').split('_')[1] ;will give you span1,
 span2 etc
 $('#'+spanID).slideToggle(slideSpeed);

 });

 On Jul 25, 4:37 pm, Blake stickynote...@gmail.com wrote:



  On my site, I have some click-able spans (will be referred to as
  toggle spans) that show or hide other spans (that contain the content
  I want on my site; will be referred to as content spans). The layout
  of these spans is like this:

  --
  span id=sp_span1Span 1/span - span id=sp_span2Span 2/span
  - span id=sp_span3Span 3/span

  span class=contentSpan id=span1
  pSpan 1 content./p
  /span

  span class=contentSpan id=span2
  pSpan 2 content./p
  /span

  span class=contentSpan id=span3
  pSpan 3 content./p
  /span
  --

  Then, in my jQuery I have something like this:

  --
  slideSpeed=1000;

  $(span#sp_span1).click(function () {
  $(span#span1).slideToggle(slideSpeed);
  $(span.contentSpan:not(#span1)).slideUp(slideSpeed);

  });

  $(span#sp_span2).click(function () {
  $(span#span2).slideToggle(slideSpeed);
  $(span.contentSpan:not(#span2)).slideUp(slideSpeed);});

  --

  and so on for each separate content span. What the above code does is:
  for example, when toggle span 1 is clicked on, content span 1 opens if
  it is not open, and if content span 2 or 3 is open, that content span
  is closed and content span 1 is opened. (If that doesn't make sense, I
  apologize, and a download-able example can be found 
  here:http://willhostforfood.com/access.php?fileid=76513)

  This method works perfectly fine, but to make it easier for me to add
  more content spans, I would like to use a for loop that will
  automatically enter all that for me.

  What I would like to do in my jQuery is use an array that will contain
  the IDs of all the different content spans I want to have displayed on
  the page. Then, a for loop will enter the appropriate information
  (identical to the code above). I've tried many things, but I cannot
  get this to work. Here's kind of what I have:

  --
  sections=new Array(span1,span2,span3);

  for (i=0;isections.length-1;i+=1) {
  $(span#+sections[i]).click(function() {
  $(span#+sections[i]).slideToggle(slideSpeed);
  //$(span.contentSpan:not(attr('id')==sections[i])).slideUp
  (slideSpeed);});
  }

  --

  That doesn't work, though. What I need to do is get the value of
  sections[i] and use that in the element bit of the code.

  Any ideas? If you need more information, please ask.

  Thanks!
  Blake- Hide quoted text -

 - Show quoted text -


[jQuery] Re: Setting identical events to multiple elements using a for loop

2009-07-26 Thread Blake

Okay, it seems to work well. Here is the jQuery that I have now:

--
$('span[id^=sp_span]').click(function(){
var spanID = $(this).attr('id').split('_')[1];
$('#'+spanID).slideToggle(slideSpeed);
$('span.contentSpan:not(#'+spanID+')').slideUp(slideSpeed);
});
--

First of all - what does the [1] on line 2 do? Why do [0] and [2] not
work?

On Jul 26, 9:58 am, FrenchiINLA mamali.sohe...@gmail.com wrote:
 sorry i got a typo error, the corrent code is:
 $('span[id^=sp_span]').

 On Jul 26, 8:39 am, FrenchiINLA mamali.sohe...@gmail.com wrote:

  in your case you can use:
  $('span[id^sp_span]') to get all span with id starting with sp_span
  then you can get the id when is clicked

  $('span[id^sp_span]').click(function(){
  var spanID = $(this).attr('id').split('_')[1] ;will give you span1,
  span2 etc
  $('#'+spanID).slideToggle(slideSpeed);

  });

  On Jul 25, 4:37 pm, Blake stickynote...@gmail.com wrote:

   On my site, I have some click-able spans (will be referred to as
   toggle spans) that show or hide other spans (that contain the content
   I want on my site; will be referred to as content spans). The layout
   of these spans is like this:

   --
   span id=sp_span1Span 1/span - span id=sp_span2Span 2/span
   - span id=sp_span3Span 3/span

   span class=contentSpan id=span1
   pSpan 1 content./p
   /span

   span class=contentSpan id=span2
   pSpan 2 content./p
   /span

   span class=contentSpan id=span3
   pSpan 3 content./p
   /span
   --

   Then, in my jQuery I have something like this:

   --
   slideSpeed=1000;

   $(span#sp_span1).click(function () {
   $(span#span1).slideToggle(slideSpeed);
   $(span.contentSpan:not(#span1)).slideUp(slideSpeed);

   });

   $(span#sp_span2).click(function () {
   $(span#span2).slideToggle(slideSpeed);
   $(span.contentSpan:not(#span2)).slideUp(slideSpeed);});

   --

   and so on for each separate content span. What the above code does is:
   for example, when toggle span 1 is clicked on, content span 1 opens if
   it is not open, and if content span 2 or 3 is open, that content span
   is closed and content span 1 is opened. (If that doesn't make sense, I
   apologize, and a download-able example can be found 
   here:http://willhostforfood.com/access.php?fileid=76513)

   This method works perfectly fine, but to make it easier for me to add
   more content spans, I would like to use a for loop that will
   automatically enter all that for me.

   What I would like to do in my jQuery is use an array that will contain
   the IDs of all the different content spans I want to have displayed on
   the page. Then, a for loop will enter the appropriate information
   (identical to the code above). I've tried many things, but I cannot
   get this to work. Here's kind of what I have:

   --
   sections=new Array(span1,span2,span3);

   for (i=0;isections.length-1;i+=1) {
   $(span#+sections[i]).click(function() {
   $(span#+sections[i]).slideToggle(slideSpeed);
   //$(span.contentSpan:not(attr('id')==sections[i])).slideUp
   (slideSpeed);});
   }

   --

   That doesn't work, though. What I need to do is get the value of
   sections[i] and use that in the element bit of the code.

   Any ideas? If you need more information, please ask.

   Thanks!
   Blake- Hide quoted text -

  - Show quoted text -


[jQuery] Re: Setting identical events to multiple elements using a for loop

2009-07-26 Thread Blake

Oh, and...can I use a for loop to give me the result I want?

On Jul 26, 10:33 am, Blake stickynote...@gmail.com wrote:
 Okay, it seems to work well. Here is the jQuery that I have now:

 --
 $('span[id^=sp_span]').click(function(){
 var spanID = $(this).attr('id').split('_')[1];
 $('#'+spanID).slideToggle(slideSpeed);
 $('span.contentSpan:not(#'+spanID+')').slideUp(slideSpeed);});

 --

 First of all - what does the [1] on line 2 do? Why do [0] and [2] not
 work?

 On Jul 26, 9:58 am, FrenchiINLA mamali.sohe...@gmail.com wrote:

  sorry i got a typo error, the corrent code is:
  $('span[id^=sp_span]').

  On Jul 26, 8:39 am, FrenchiINLA mamali.sohe...@gmail.com wrote:

   in your case you can use:
   $('span[id^sp_span]') to get all span with id starting with sp_span
   then you can get the id when is clicked

   $('span[id^sp_span]').click(function(){
   var spanID = $(this).attr('id').split('_')[1] ;will give you span1,
   span2 etc
   $('#'+spanID).slideToggle(slideSpeed);

   });

   On Jul 25, 4:37 pm, Blake stickynote...@gmail.com wrote:

On my site, I have some click-able spans (will be referred to as
toggle spans) that show or hide other spans (that contain the content
I want on my site; will be referred to as content spans). The layout
of these spans is like this:

--
span id=sp_span1Span 1/span - span id=sp_span2Span 2/span
- span id=sp_span3Span 3/span

span class=contentSpan id=span1
pSpan 1 content./p
/span

span class=contentSpan id=span2
pSpan 2 content./p
/span

span class=contentSpan id=span3
pSpan 3 content./p
/span
--

Then, in my jQuery I have something like this:

--
slideSpeed=1000;

$(span#sp_span1).click(function () {
$(span#span1).slideToggle(slideSpeed);
$(span.contentSpan:not(#span1)).slideUp(slideSpeed);

});

$(span#sp_span2).click(function () {
$(span#span2).slideToggle(slideSpeed);
$(span.contentSpan:not(#span2)).slideUp(slideSpeed);});

--

and so on for each separate content span. What the above code does is:
for example, when toggle span 1 is clicked on, content span 1 opens if
it is not open, and if content span 2 or 3 is open, that content span
is closed and content span 1 is opened. (If that doesn't make sense, I
apologize, and a download-able example can be found 
here:http://willhostforfood.com/access.php?fileid=76513)

This method works perfectly fine, but to make it easier for me to add
more content spans, I would like to use a for loop that will
automatically enter all that for me.

What I would like to do in my jQuery is use an array that will contain
the IDs of all the different content spans I want to have displayed on
the page. Then, a for loop will enter the appropriate information
(identical to the code above). I've tried many things, but I cannot
get this to work. Here's kind of what I have:

--
sections=new Array(span1,span2,span3);

for (i=0;isections.length-1;i+=1) {
$(span#+sections[i]).click(function() {
$(span#+sections[i]).slideToggle(slideSpeed);
//$(span.contentSpan:not(attr('id')==sections[i])).slideUp
(slideSpeed);});
}

--

That doesn't work, though. What I need to do is get the value of
sections[i] and use that in the element bit of the code.

Any ideas? If you need more information, please ask.

Thanks!
Blake- Hide quoted text -

   - Show quoted text -


[jQuery] Re: Listnav Umlauts and special chars

2009-07-26 Thread Jack Killpatrick


Hi, you can set the not found wording using the noMatchText option. 
I'm planning on adding handling for special chars in the near future, 
I've got feedback from a few people on that, just need to think it out a 
little bit more.


Glad you like the plugin. If you have it used in a public place, mind 
sharing the link? I'd like to take a look.


Thanks,
Jack

sixtyseven wrote:

Oh, and of course the not found sentence should be a variable, too.

This is a real fantastic plugin, I used it to make a faq section for a
site, by combining it with a simple div display-switch. Works like a
charm, except the umlauts/specialchar problem.

  





[jQuery] Re: Listnav Umlauts and special chars

2009-07-26 Thread Jack Killpatrick


Good idea making All a variable. You're the 2nd person in the last few 
days who had a need for that.


And thanks for your thoughts on the special chars. As I mentioned in my 
other email a few minutes ago, I'll be adding support for that, I just 
need to think it through a bit more. It seems like it would be nice to 
have them automatically appear in the navigation, but that means losing 
control over how many things are in the nav, and therefore how wide it 
will be on the page (which could result in wrapping). One idea is to 
lump them into an other listnav item, but that doesn't seem very good, 
either. Another is to add a new row to the nav for dynamically adding 
nav links for special chars. Or the other could be a dropdown (but 
then it's items are out of view, which reduces the ability to quickly 
visually scan the list).


Offhand, I don't know if there's an easy way (or whether it really makes 
sense logically to a user) to degrade chars to their nearest neighbor. 
I don't know enough about other languages to know.


Thanks,
Jack

sixtyseven wrote:

I ran into a problem when having umlauts as first letter in the li
tag. They will not be shown, until I add them to the letters array.
IMHO the better way would be to have a function, that degrades the
letter to the next near neighbor, i.e. if it is ü, make it to u, if
it's é make it to e, etc. Do you have any Idea how to achieve this?
Such a function would make the listnav more multilingual. While
speaking of this, perhaps you could make the word All a variable,
too.

Same thing with special chars like *,# etc. How about adding them into
a group of its own? Probably one could handle it like this: If the
first letter is neither a number nor a letter, it must be a special
char.

Hope I could explain the problem, my english is not that good.

Greetings from Germany

André

  





[jQuery] Re: Setting identical events to multiple elements using a for loop

2009-07-26 Thread Blake

I'm sorry for posting yet again, but it appears I may be able to use a
for loop. Here is what I have (jQuery):

--
for (i=0;isections.length-1;i++) {
$(span#sp_+sections[i]).click(function() {
$(span#+sections[i]).slideToggle(slideSpeed);
$(span.contentSpan:not(#+sections[i]+)).slideUp(slideSpeed);
});
}
--

However (I have three spans), whenever I click on toggle span 1 or 2,
the contents of content span 3 are shown, and nothing happens when I
click on toggle span 3.

A working example of this can be found here:
http://willhostforfood.com/?Action=downloadfileid=76633

On Jul 26, 10:36 am, Blake stickynote...@gmail.com wrote:
 Oh, and...can I use a for loop to give me the result I want?

 On Jul 26, 10:33 am, Blake stickynote...@gmail.com wrote:

  Okay, it seems to work well. Here is the jQuery that I have now:

  --
  $('span[id^=sp_span]').click(function(){
  var spanID = $(this).attr('id').split('_')[1];
  $('#'+spanID).slideToggle(slideSpeed);
  $('span.contentSpan:not(#'+spanID+')').slideUp(slideSpeed);});

  --

  First of all - what does the [1] on line 2 do? Why do [0] and [2] not
  work?

  On Jul 26, 9:58 am, FrenchiINLA mamali.sohe...@gmail.com wrote:

   sorry i got a typo error, the corrent code is:
   $('span[id^=sp_span]').

   On Jul 26, 8:39 am, FrenchiINLA mamali.sohe...@gmail.com wrote:

in your case you can use:
$('span[id^sp_span]') to get all span with id starting with sp_span
then you can get the id when is clicked

$('span[id^sp_span]').click(function(){
var spanID = $(this).attr('id').split('_')[1] ;will give you span1,
span2 etc
$('#'+spanID).slideToggle(slideSpeed);

});

On Jul 25, 4:37 pm, Blake stickynote...@gmail.com wrote:

 On my site, I have some click-able spans (will be referred to as
 toggle spans) that show or hide other spans (that contain the content
 I want on my site; will be referred to as content spans). The layout
 of these spans is like this:

 --
 span id=sp_span1Span 1/span - span id=sp_span2Span 2/span
 - span id=sp_span3Span 3/span

 span class=contentSpan id=span1
 pSpan 1 content./p
 /span

 span class=contentSpan id=span2
 pSpan 2 content./p
 /span

 span class=contentSpan id=span3
 pSpan 3 content./p
 /span
 --

 Then, in my jQuery I have something like this:

 --
 slideSpeed=1000;

 $(span#sp_span1).click(function () {
 $(span#span1).slideToggle(slideSpeed);
 $(span.contentSpan:not(#span1)).slideUp(slideSpeed);

 });

 $(span#sp_span2).click(function () {
 $(span#span2).slideToggle(slideSpeed);
 $(span.contentSpan:not(#span2)).slideUp(slideSpeed);});

 --

 and so on for each separate content span. What the above code does is:
 for example, when toggle span 1 is clicked on, content span 1 opens if
 it is not open, and if content span 2 or 3 is open, that content span
 is closed and content span 1 is opened. (If that doesn't make sense, I
 apologize, and a download-able example can be found 
 here:http://willhostforfood.com/access.php?fileid=76513)

 This method works perfectly fine, but to make it easier for me to add
 more content spans, I would like to use a for loop that will
 automatically enter all that for me.

 What I would like to do in my jQuery is use an array that will contain
 the IDs of all the different content spans I want to have displayed on
 the page. Then, a for loop will enter the appropriate information
 (identical to the code above). I've tried many things, but I cannot
 get this to work. Here's kind of what I have:

 --
 sections=new Array(span1,span2,span3);

 for (i=0;isections.length-1;i+=1) {
 $(span#+sections[i]).click(function() {
 $(span#+sections[i]).slideToggle(slideSpeed);
 //$(span.contentSpan:not(attr('id')==sections[i])).slideUp
 (slideSpeed);});
 }

 --

 That doesn't work, though. What I need to do is get the value of
 sections[i] and use that in the element bit of the code.

 Any ideas? If you need more information, please ask.

 Thanks!
 Blake- Hide quoted text -

- Show quoted text -


[jQuery] Re: Superfish drowdown doesn't close (IE 7 + IE 8 tested)

2009-07-26 Thread conlabz-cs


Thanks...

It works fine for me!



Charlie Tomlinson wrote:
 
 
 
 
 
 
 
 try changing animation option for height to 'show' 
 
 $('ul.sf-menu').superfish({ 
 nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;
 nbsp;nbsp;nbsp; animation: {opacity:'show', height:'show'}, 
 nbsp;nbsp;nbsp; nbsp;nbsp;nbsp; nbsp;nbsp;nbsp;
 nbsp;nbsp;nbsp; dropShadows: false 
 nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp; }); 
 
 you still get a slidedown effect and can also add option speed: 
 
 conlabz-cs wrote:
 
   
 On one of our websites I'm using a horizontal superfish menu. It works
 fine
 in FF and Safari, but I have a problem with the dropdown in IE 7 and IE 8.
 It doesn't close if I got to another menu entry. I tried to look for a
 solution, but had no chance to find it... I guess that the problem is in
 the
 javascript files. I don't think that it is a CSS problem.
 
 You can try to look at: www.trassenheide.net . Here you can see my
 problem.
 
 Thanks...
   
 
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Superfish-drowdown-doesn%27t-close-%28IE-7-%2B-IE-8-tested%29-tp24662728s27240p24668814.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] jQuery and multiple forms in page

2009-07-26 Thread Ayah

Hello!
i need help with one thing, i have a list with words generaded via
mysql.
And i want to have an x in the end of every word, so i can easily
delete one in my list.
And ofc i wants some fadeOut effect on it.
I made it work but only with one, not with a whole list of words.

So tired to make a function of it, but it dosent work.

eg.
ul
   liWord 1 (x)/li
   liWord 2 (x)/li
   liWord 3 (x)/li
/ul

script
function removeSearchword()
{
var sokord_id = $(#sokord_id).val();
var register_id = $(#register_id).val();
var sokordet = $(#sokordet).val();



$.post(?=base_url()?index.php/adminpanel/testformremove,
{ sokord_id: sokord_id, register_id: 
register_id },
function(data){
$(#searchword_+ 
sokordet).slideUp(normal, function() {

$(#searchword_+ 
sokordet).before('');
});
}
);
return false;
}
/script

HTML
div id=searchword_list
div id=searchword_foo
?=form_open('')?
div style=display:none
?=form_input('sokord_id', '3', 
'id=sokord_id')?
?=form_input('register_id', '1', 
'id=register_id')?
?=form_input('sokordet', 'foo', 
'id=sokordet')?
/div
foo a href= 
onclick=removeSearchword()x/a

?=form_close()?
/div
  /div

is there some that can help me? :)


[jQuery] Re: accessing iframe content

2009-07-26 Thread mkmanning

Is your iframe on the same domain? If not, you can't do this.

On Jul 25, 10:39 am, kknaru isai...@gmail.com wrote:
 hi there, i just started working with iframes and i'm stucked :D

 so...i have this code inside a html file:

 iframe id=myframe
          ptext/p
 /iframe

 what i'm trying to do is to grab that paragraph text(using jquery).

 by now i tried something like this:

 $(#myframe).contents().find(p).html();

 butwith no result :(

 does anyone know the answer?


[jQuery] Re: accessing iframe content

2009-07-26 Thread brian

try this:
iframe.contents().find('body p').html()

On Sun, Jul 26, 2009 at 3:39 PM, mkmanningmichaell...@gmail.com wrote:

 Is your iframe on the same domain? If not, you can't do this.

 On Jul 25, 10:39 am, kknaru isai...@gmail.com wrote:
 hi there, i just started working with iframes and i'm stucked :D

 so...i have this code inside a html file:

 iframe id=myframe
          ptext/p
 /iframe

 what i'm trying to do is to grab that paragraph text(using jquery).

 by now i tried something like this:

 $(#myframe).contents().find(p).html();

 butwith no result :(

 does anyone know the answer?


[jQuery] jQuery + Ajax request

2009-07-26 Thread Ayah

Hello!
Im trying to build a AJAX request with jQuery,
the function should work like this.
I have a list of words like this.
[code]
ul id=searchword_ul
 li id=searchword_kuken
 ?=form_open('adminpanel/testformremove')?
 div style=display:none
 ?=form_input('sokord_id', '3', 'id=sokord_id')?

 ?=form_input('register_id', '1',
'id=register_id')?
 ?=form_input('sokordet', 'kuken',
'id=sokordet')?
 /div
 kuken a href= id=removeSearchwordx/a
?=form_close()?

 /li
 li id=searchword_test
 ?=form_open('adminpanel/testformremove')?
 div style=display:none
 ?=form_input('sokord_id', '3', 'id=sokord_id')?

 ?=form_input('register_id', '1',
'id=register_id')?
 ?=form_input('sokordet', 'test',
'id=sokordet')?
 /div
 test a href= id=removeSearchwordx/a
 ?=form_close()?
 /li
 /ul
  /div
[/code]

and a Javascript like this
[code]
$(#removeSearchword).click(function(){
var sokord_id = $(#sokord_id).val();
var register_id = $(#register_id).val();
var sokordet = $(#sokordet).val();


$.post(?=base_url()?index.php/adminpanel/
testformremove,
   { sokord_id: sokord_id, register_id: register_id },
   function(data){
$(#searchword_+ sokordet).slideUp
(normal, function() {

$(#searchword_+ sokordet).before('');
});
}
);
return false;
});
[/code]

The problem im having, is that i can only press the x (remove) link
on the first one, not on the next one. Nothing happens when i press
the secound x.

Why is that?


[jQuery] jQuery Form Validation

2009-07-26 Thread Tuppers360

Hi there just wondering if I can get some help from you guys?

I have some code as per:

// validate signup form on keyup and submit
var validator = $('form').validate({
event: 'keyup',
rules: {
'%= ddlRank.UniqueID %': {
required: true
},
'%= txtSurname.UniqueID %': {
minlength: 2,
required: true
},
'%= txtForename.UniqueID %': {
minlength: 2,
required: true
},
'%= ddlGender.UniqueID %': {
required: true
},
'%= txtBirthDate.UniqueID %': {
required: true,
custEmailVal: true
}

}, //end rules
messages: {
'%= txtSurname.UniqueID %': {
minlength: jQuery.format(Enter at least {0}
characters),
required: This field is required
},
'%= txtForename.UniqueID %': {
minlength: jQuery.format(Enter at least {0}
characters),
required: This field is required
},
'%= ddlGender.UniqueID %': {
required: This field is required
},
'%= txtBirthDate.UniqueID %': {
required: This field is required
}
}, //end messages
// specifying a submitHandler prevents the default
submit, good for the demo
submitHandler: function() {
alert(submitted!);
}, //end submitHandler
// set this class to error-labels to indicate valid
fields
success: function(label) {
// set nbsp; as text for IE
label.html(nbsp;).addClass(checked);
$('label.checked').addClass('alt');
//$('form :input')
//.filter('.required').prev
('label.checked').find('span').hide();
}, //end success function(label)
invalidHandler: function(form, validator) {
var errors = validator.numberOfInvalids();
if (errors) {
var message = errors == 1
? 'You missed 1 field. It has been
highlighted'
: 'You missed ' + errors + ' fields. They have
been highlighted';
$('div/div')
.attr({
'id': 'submitError',
'class': 'warning'
})
.insertBefore('#newuserForm');
$(div#submitError).html(message);
$(div#submitError).show();
$('form :input')
.filter('.required').prev('label').find
('span').hide();
} else {
$(div#submitError).hide();
}
} //end invalidHandler
}); //end validate all

my html is an ordered list and the within each li tag I have this
structure:

label for=txtSurname id=lblSurname
Surname:span(required)/span
/label
input name=txtSurname type=text
id=txtSurname class=inputText required /

What I want to happen is when I have input two characters into the
field so that it validates is to hide the span containing the word
required. I cant seem to find it though! I am not sure if am am right
though in using the success function with the argument label?? Can
anyone see how i ould possibly get around this?

I have had sucess with using the invalidHandler hiding the span but I
cant hide it on only the one span at a time on the fly.

Hope I explained myself!

Tuppers




[jQuery] Superfish - Tabbing through menu when it's a nested ul causes the menu to disappear

2009-07-26 Thread Jeremy

I'm doing some accessibility testing with superfish.  I have the sf-
menu ul as the child of another list item.  After tabbing through the
entire sf-menu, it disappears.  Any suggestions?

It is nested as follows.
ul - li - ul sf-menu


[jQuery] Background Work Plugin

2009-07-26 Thread spiralni

Hello,

I have  a task I want to execute in the background in order to not
block the browser whilst executing the task.

Do you know any plugin for this purpose?

Regards


[jQuery] FF 3.5.1 and MSIE 6.0 provide different objects as This

2009-07-26 Thread Gnosos

Hi,

Although this came up in the context of developing a plugin, I think
it's a more general issue. So I'm posting it on this list.

I am developing a plugin to be called from a web page. The call looks
like:

  $(window).resize(function() {
$(window).myPlugin();
});

Then in the plugin, I have a standard return this.each, followed by
three alerts:

 var key;
 var value;
 return this.each(function(key,value)
{
alert('In the loop');
alert('Key = ' + key);
alert('Value= ' + value);

Now the funny thing is that in Firefox 3.5.1 the third alert returns
Value= [object Window] whereas it returns Value=[object] in MSIE
6.0.

I thought jQuery is setting the value, so I don't understand why the
browsers differ in their behavior. Is this normal? Is there a reason
for this difference other than Micro$oft's non-standard ways? What's
the best way to deal with the problem, since I want to distinguish
between resizing a window and other resizes.

Thanks.


[jQuery] Re: Galleria: Transition effects and image loading when using custom thumbnails

2009-07-26 Thread oswaldcobblepot

Forgot to mention that I am also primarily seeing this effect when
doing a reload in Firefox and overriding the cache (cmd + shift + R),
but am also seeing it when viewing the site for the first time in
Safari as well.  It actually looks like it happens on the Galleria
demo site too (http://devkick.com/lab/galleria/demo_01.htm)... is this
just the way it has to work, or has anyone found a way around it?

On Jul 26, 5:19 pm, oswaldcobblepot oswald.cobble...@gmail.com
wrote:
 Hi everyone,

 I've implemented a photo gallery using Galleria and jCarousel on my
 site, and have chosen to use custom thumbnails instead of having
 Galleria generate them for me from the source images.

 As far as I can tell, there may be an advantage in conserving
 bandwidth with this method, but the page also degrades to a nice set
 of thumbnails that link to the larger images (which is very nice,
 IMO).

 Everything works beautifully, however when viewing this gallery for
 the first time, instead of the large image fading in nicely as it does
 in the Galleria demo, it almost kind of slides the image into view
 like it's rendering pieces of it as it loads in the container.  This
 is definitely an effect i would like to avoid, but I also thought that
 one of the benefits of Galleria was that it pre-loaded images in the
 background, right?  So why does my gallery appear to be loading these
 images on-demand?

 Here's a link to the page in question:  http://bit.ly/jn2LI

 Thank you guys very much in advance for any help you may be able to
 provide!


[jQuery] Galleria: Transition effects and image loading when using custom thumbnails

2009-07-26 Thread oswaldcobblepot

Hi everyone,

I've implemented a photo gallery using Galleria and jCarousel on my
site, and have chosen to use custom thumbnails instead of having
Galleria generate them for me from the source images.

As far as I can tell, there may be an advantage in conserving
bandwidth with this method, but the page also degrades to a nice set
of thumbnails that link to the larger images (which is very nice,
IMO).

Everything works beautifully, however when viewing this gallery for
the first time, instead of the large image fading in nicely as it does
in the Galleria demo, it almost kind of slides the image into view
like it's rendering pieces of it as it loads in the container.  This
is definitely an effect i would like to avoid, but I also thought that
one of the benefits of Galleria was that it pre-loaded images in the
background, right?  So why does my gallery appear to be loading these
images on-demand?

Here's a link to the page in question:  http://bit.ly/jn2LI

Thank you guys very much in advance for any help you may be able to
provide!




[jQuery] Re: jQuery / CSS: element jump around on .animate()

2009-07-26 Thread Ralph Holzmann

Hey,

The jumpiness is because all of your images start with a css display of 
'inline', and while they animate, they have a css display of 'block', 
and when the animation is finished, it gets set back to a display of 
'inline'

Can I ask what the desired functionality is? Do you just want to zoom a 
clicked image?



jezmck wrote:
 Hi Gang,

 If you have a look at http://webcam.jezmckean.com/ and click on an
 image you will see what I mean.

 It's as if the image is converted to a div while animating.

 Any ideas anyone?
   



[jQuery] clueTip - moveable/dragable

2009-07-26 Thread derek

i've been using the awesome plugin clueTip, and i was wondering if
anyone has any experience making the sticky pop ups move-able?  as in,
i'd like to be able to drag the popup from one point on the screen to
another.


[jQuery] Rich Text Editor plugin

2009-07-26 Thread Daniel Bueno

Hi,

I need  to put a rich text editor in a textarea.
Is there any way to do this with jQuery?


Thanks,
Daniel Bueno


[jQuery] Google setOnLoadCallback jQuery $(window).load()

2009-07-26 Thread Micky Hulse

Hello,

This does not seem to work:

// http://code.google.com/apis/ajaxlibs/documentation/
google.load(jquery, 1);
function OnLoad() {
$(window).load(function () { alert('foo'); }
}
google.setOnLoadCallback(OnLoad);

What am I doing wrong?

Thank you!

Cheers,
M


[jQuery] Re: Google setOnLoadCallback jQuery $(window).load()

2009-07-26 Thread mhulse

Agh, syntax error:

Fixed:

$(window).load(function() { alert('foo'); });

Is this the proper way to call $(window).load() using setOnLoadCallback
()?

Thanks!
M

On Jul 26, 2:43 pm, Micky Hulse rgmi...@gmail.com wrote:
 Hello,

 This does not seem to work:

 //http://code.google.com/apis/ajaxlibs/documentation/
 google.load(jquery, 1);
 function OnLoad() {
         $(window).load(function () { alert('foo'); }}

 google.setOnLoadCallback(OnLoad);

 What am I doing wrong?

 Thank you!

 Cheers,
 M


[jQuery] Re: jQuery Form Validation

2009-07-26 Thread FrenchiINLA

how about

$('input[type=text]').keyup(function() {

if ($(this).val().length == 2) {
$(this).prev().find('span').empty();
}
});


On Jul 26, 10:36 am, Tuppers360 tuppers...@sky.com wrote:
 Hi there just wondering if I can get some help from you guys?

 I have some code as per:

 // validate signup form on keyup and submit
             var validator = $('form').validate({
                 event: 'keyup',
                 rules: {
                     '%= ddlRank.UniqueID %': {
                         required: true
                     },
                     '%= txtSurname.UniqueID %': {
                         minlength: 2,
                         required: true
                     },
                     '%= txtForename.UniqueID %': {
                         minlength: 2,
                         required: true
                     },
                     '%= ddlGender.UniqueID %': {
                         required: true
                     },
                     '%= txtBirthDate.UniqueID %': {
                         required: true,
                         custEmailVal: true
                     }

                 }, //end rules
                 messages: {
                     '%= txtSurname.UniqueID %': {
                         minlength: jQuery.format(Enter at least {0}
 characters),
                         required: This field is required
                     },
                     '%= txtForename.UniqueID %': {
                         minlength: jQuery.format(Enter at least {0}
 characters),
                         required: This field is required
                     },
                     '%= ddlGender.UniqueID %': {
                         required: This field is required
                     },
                     '%= txtBirthDate.UniqueID %': {
                         required: This field is required
                     }
                 }, //end messages
                 // specifying a submitHandler prevents the default
 submit, good for the demo
                 submitHandler: function() {
                     alert(submitted!);
                 }, //end submitHandler
                 // set this class to error-labels to indicate valid
 fields
                 success: function(label) {
                     // set nbsp; as text for IE
                     label.html(nbsp;).addClass(checked);
                     $('label.checked').addClass('alt');
                     //$('form :input')
                     //        .filter('.required').prev
 ('label.checked').find('span').hide();
                 }, //end success function(label)
                 invalidHandler: function(form, validator) {
                     var errors = validator.numberOfInvalids();
                     if (errors) {
                         var message = errors == 1
                         ? 'You missed 1 field. It has been
 highlighted'
                         : 'You missed ' + errors + ' fields. They have
 been highlighted';
                         $('div/div')
                             .attr({
                                 'id': 'submitError',
                                 'class': 'warning'
                             })
                             .insertBefore('#newuserForm');
                         $(div#submitError).html(message);
                         $(div#submitError).show();
                         $('form :input')
                             .filter('.required').prev('label').find
 ('span').hide();
                     } else {
                         $(div#submitError).hide();
                     }
                 } //end invalidHandler
             }); //end validate all

 my html is an ordered list and the within each li tag I have this
 structure:

 label for=txtSurname id=lblSurname
                         Surname:span(required)/span
                     /label
                     input name=txtSurname type=text
 id=txtSurname class=inputText required /

 What I want to happen is when I have input two characters into the
 field so that it validates is to hide the span containing the word
 required. I cant seem to find it though! I am not sure if am am right
 though in using the success function with the argument label?? Can
 anyone see how i ould possibly get around this?

 I have had sucess with using the invalidHandler hiding the span but I
 cant hide it on only the one span at a time on the fly.

 Hope I explained myself!

 Tuppers


[jQuery] Using jQuery to automatically convert plain-text URLs to links

2009-07-26 Thread Blake

On my site, I would like to have jQuery automatically convert all
plain-text URLs to links.

For example, if I have the following in the BODY tag of my Web page:

Go to http://groups.google.com to go to the Google Groups home page.

I want it to be converted in to this:

Go to a href=http://groups.google.com;http://groups.google.com/a
to go to the Google Groups home page.

I'm sure the prepend() and append() functions will be used, but how do
I tell jQuery how to pick URLs out of the Web page, if they are not
surrounded by separate tags? I'm sure if each URL was in a SPAN tag it
would be much easier.

Any ideas?

Thanks,
stickynote427


[jQuery] Re: Rich Text Editor plugin

2009-07-26 Thread helpfulMike

Hi Daniel,
Not sure if this is what you need, but I used..

I needed a very light editor, so used the one by Batiste Bieler
http://batiste.dosimple.ch/blog/2007-09-11-1/


It loads a rte via iframe.
Then I accessed as follows
   iframe = $('iframe.rte-zone')[0];
   var $R = function(sel, newContent){
return $('body', $(sel).contents()).html(newContent || 
undefined);
   };


Code in the form...
textarea name=fcopy id=fcopy class=rte-zoneMY CONTENT
HERE/textarea
script type=text/javascript src=../js/jquery.rte.js/script
script type=text/javascript
$('.rte-zone').rte(../css/rte.css, ../img/ico/);
/script

css I used to stylise..
.frameBody
{
font-family:sans-serif;
font-size:12px;
margin:0;
width:100%;
height:100%;
}

.frameBody p
{
border:1px #bbb solid;
padding:2px;
}
.rte-zone
{
width:100%;
margin:0;
padding:0 5px;
border:1px #999 solid;
clear:both;
height:200px;
display:block;
background:#e0e0e0;
}
.rte-toolbar{ overflow:hidden; }
.rte-toolbar a, .rte-toolbar a img {
border:0;
color:#6CC;
}

.rte-toolbar p {
float:left;
margin:0;
padding-right:5px;
}

hope it helps,
thx
Mike


On Jul 27, 1:42 am, Daniel Bueno bueno1...@gmail.com wrote:
 Hi,

 I need  to put a rich text editor in a textarea.
 Is there any way to do this with jQuery?

 Thanks,
 Daniel Bueno


[jQuery] Re: Rich Text Editor plugin

2009-07-26 Thread DANIEL BUENO
Hi Mike,
Thanks for your help.
I'll test your sugestion.
Now I'm testing the HtmlBox plugin from
http://remiya.com/cms/projects/jquery-plugins/htmlbox/.
Thank you

*
Daniel Ribeiro Bueno
Bacharel em Ciência da Computação
Desenvolvimento de Sistemas
E-mail: bueno1...@gmail.com
Site: www.buenodf.net
*


On Sun, Jul 26, 2009 at 8:09 PM, helpfulMike bodybrilli...@gmail.comwrote:


 Hi Daniel,
 Not sure if this is what you need, but I used..

 I needed a very light editor, so used the one by Batiste Bieler
 http://batiste.dosimple.ch/blog/2007-09-11-1/


 It loads a rte via iframe.
 Then I accessed as follows
   iframe = $('iframe.rte-zone')[0];
   var $R = function(sel, newContent){
return $('body', $(sel).contents()).html(newContent
 || undefined);
   };


 Code in the form...
textarea name=fcopy id=fcopy class=rte-zoneMY CONTENT
 HERE/textarea
script type=text/javascript src=../js/jquery.rte.js/script
 script type=text/javascript
$('.rte-zone').rte(../css/rte.css, ../img/ico/);
 /script

 css I used to stylise..
 .frameBody
 {
font-family:sans-serif;
font-size:12px;
margin:0;
width:100%;
height:100%;
 }

 .frameBody p
 {
border:1px #bbb solid;
padding:2px;
 }
 .rte-zone
 {
width:100%;
margin:0;
padding:0 5px;
border:1px #999 solid;
clear:both;
height:200px;
display:block;
background:#e0e0e0;
 }
 .rte-toolbar{ overflow:hidden; }
 .rte-toolbar a, .rte-toolbar a img {
border:0;
color:#6CC;
 }

 .rte-toolbar p {
float:left;
margin:0;
padding-right:5px;
 }

 hope it helps,
 thx
 Mike


 On Jul 27, 1:42 am, Daniel Bueno bueno1...@gmail.com wrote:
  Hi,
 
  I need  to put a rich text editor in a textarea.
  Is there any way to do this with jQuery?
 
  Thanks,
  Daniel Bueno



[jQuery] Re: Using jQuery to automatically convert plain-text URLs to links

2009-07-26 Thread brian

$(function()
{
var re = 
/(https?:\/\/(([-\w\.]+)+(:\d+)?(\/([\w/_\.]*(\?\S+)?)?)?))/ig;
$('#foo').html($('#foo').html().replace(re, 'a href=$1 
title=$1/a'));
});

If you want the link text with the 'http://' bit, use 'a href=$1
title=$2/a'

There are scads of URL regexps floating around online. This one works
for me but YMMV.

On Sun, Jul 26, 2009 at 6:45 PM, Blakestickynote...@gmail.com wrote:

 On my site, I would like to have jQuery automatically convert all
 plain-text URLs to links.

 For example, if I have the following in the BODY tag of my Web page:

 Go to http://groups.google.com to go to the Google Groups home page.

 I want it to be converted in to this:

 Go to a href=http://groups.google.com;http://groups.google.com/a
 to go to the Google Groups home page.

 I'm sure the prepend() and append() functions will be used, but how do
 I tell jQuery how to pick URLs out of the Web page, if they are not
 surrounded by separate tags? I'm sure if each URL was in a SPAN tag it
 would be much easier.

 Any ideas?

 Thanks,
 stickynote427


[jQuery] unsubscribe

2009-07-26 Thread Mike




  

[jQuery] why is mouseleave triggering when i enter a child, when i have slidedown

2009-07-26 Thread iceangel89

i am trying to develop my own accordion/sliding menu.

i found that seem to trigger when i am sliding down an inner menu.
since its inner, my mouse definately has not left #mainnav

my test page http://iceangel89.5gigs.net/test.html

without that annoying test alert http://iceangel89.5gigs.net/test_1.html

i also noticed that it triggers when i enter the 4th Link which
triggers the slidedown of an inner ul. when i disable the sliding
effects, and make inner uls display notmally, when i move in and out
of child elem's no such problem

$(#mainnav).mouseleave(function() {
alert(mouseleave #mainnav);
});

more complete source:

$(function() {
$(#mainnav  li  a).hover(mouseOver);
$(#mainnav).mouseleave(function() {
alert(mouseleave #mainnav);
});
});
function mouseOver() {
$(this).next(ul).slideDown(fast, function() {
$(li:has(ul)  a, this).hover(mouseOver);
});
}

#mainnav, #mainnav ul {
list-style: none;
padding: 0;
margin: 0;
background: #bbb;
}
#mainnav ul {
display: none;
margin: 5px 10px;
}
#mainnav a {
display: block;
padding: 5px 10px;
margin: 2px 0;
background: yellow;
}

ul id=mainnav
lia href=#Test/a/li
lia href=#Test/a/li
lia href=#Test/a/li
li
a href=#Test/a
ul
lia href=#Test/a/li
li
a href=#Test 1/a
ul
lia href=#Test/a/li
lia href=#Test/a/li
lia href=#Test/a/li
/ul
/li
lia href=#Test/a/li
/ul
/li
lia href=#Test/a/li
lia href=#Test/a/li
/ul



[jQuery] Re: why is mouseleave triggering when i enter a child, when i have slidedown

2009-07-26 Thread Charlie





did you even read reply to earlier thread you started on this before
you started a new thread with exact same thing? 

http://groups.google.com/group/jquery-en/browse_thread/thread/a13aeb0acf13ba73/b3242e5068c69dbf?lnk=gstq=iceangel89#b3242e5068c69dbf

iceangel89 wrote:

  i am trying to develop my own accordion/sliding menu.

i found that seem to trigger when i am sliding down an "inner" menu.
since its "inner", my mouse definately has not left #mainnav

my test page http://iceangel89.5gigs.net/test.html

without that annoying test alert http://iceangel89.5gigs.net/test_1.html

i also noticed that it triggers when i enter the 4th "Link" which
triggers the slidedown of an inner ul. when i disable the sliding
effects, and make inner uls display notmally, when i move in and out
of child elem's no such problem

$("#mainnav").mouseleave(function() {
alert("mouseleave #mainnav");
});

more complete source:

$(function() {
$("#mainnav  li  a").hover(mouseOver);
$("#mainnav").mouseleave(function() {
alert("mouseleave #mainnav");
});
});
function mouseOver() {
$(this).next("ul").slideDown("fast", function() {
$("li:has(ul)  a", this).hover(mouseOver);
});
}

#mainnav, #mainnav ul {
list-style: none;
padding: 0;
margin: 0;
background: #bbb;
}
#mainnav ul {
display: none;
margin: 5px 10px;
}
#mainnav a {
display: block;
padding: 5px 10px;
margin: 2px 0;
background: yellow;
}

ul id="mainnav"
lia href=""Test/a/li
lia href=""Test/a/li
lia href=""Test/a/li
li
a href=""Test/a
ul
lia href=""Test/a/li
li
a href=""Test 1/a
ul
lia href=""Test/a/li
lia href=""Test/a/li
lia href=""Test/a/li
/ul
/li
lia href=""Test/a/li
/ul
/li
lia href=""Test/a/li
lia href=""Test/a/li
/ul


  






[jQuery] Re: accessing iframe content

2009-07-26 Thread kknaru

after many tries i managed to solve the problem with this code:

$(#myframe).load(function(){

   $(this).contents().find(p).text();
});



[jQuery] Re: $(document).ready script appears to not run in IE?

2009-07-26 Thread Billy

Thank you for that hint - I changed the CSS to display:inline, and the
script now works fine on IE. :D

On Jul 21, 1:13 am, amuhlou amysch...@gmail.com wrote:
 I don't know if this is part of the issue or not, but IE7 does not
 have support for the display:table; property.

 See quirksmode to see what properties it does support (not 
 many):http://www.quirksmode.org/css/display.html

 On Jul 20, 2:44 am, Billy mail.billy...@gmail.com wrote:

  Hello all,

  I'm relatively new to jQuery, and I'm having some trouble making a
  selected tbody display in IE. It seems to work fine in FireFox, and
  Chrome.

  See here:

 http://wwwdev.latrobe.edu.au/nursing/ProspectiveStudents/Postgraduate...

  I've looked up various fora, but the only things I can find seem to
  relate to earlier versions of jQuery. We're running jQuery-min.1.3.2
  on this site.

  The relevant parts of the code which run in FF/Chrome, but appear to
  not run in IE:

  script language=javascript type=text/javascript
  $(document).ready(function()
  {
      //...
          $('#questionTable tbody:first').addClass('selected');

     //...

  });

  /script

  Relevant CSS associated with this:

  style
  #questionTable tbody {
          display: none;}

  #questionTable tbody.selected {
          display:table;}

  /style

  Help?

  Thanks in advance,

  Billy


[jQuery] .hover(function(){removeClass('rounded {top}')});

2009-07-26 Thread marksimon

Not sure why this doesn't work to remove the rounded corners on hover-
out. The corners are set on the first hover, but they aren't turning
off. Any ideas?
function docorners(){
//alert('doing corners');
$('.rounded ').corners();
  }

$(document).ready(function(){
$('#navlist li a').hover(
function(){
$(this).addClass('rounded {top}');
docorners();
},
function(){
$(this).removeClass('rounded {top}');;
docorners();
}
);
});


[jQuery] Content Loads then Javascript

2009-07-26 Thread Mutual Designs

How do I prevent the content loading on my website before the
Javascript loads. It seems that all of my Javascript is loading in the
head of my page, but the content all shows before being modified by
the javascript.

http://boomer-living.com/wp/

Any suggestions?


[jQuery] jQuery plugin - not having to call multiple times

2009-07-26 Thread DMS

I'm working on a plugin that basically creates form elements, it's
called like this:

$('#form').formBuilder({
type: 'select',
id: 'selectBox',
cssClass: 'form-item',
name: 'select',
});


This would then append a select box within the form.  If I want to add
more inputs, I have to repeat this code.

I was wondering if there is a way that I could call it like this:

$('#form').formBuilder({
type: 'select',
id: 'selectBox',
cssClass: 'form-item',
name: 'select',
},{
type: 'select',
id: 'selectBox2',
cssClass: 'form-item',
name: 'select',
});

So that I don't have to repeat $('#form').formBuilder for every item,
as it's redundant.

Any help would be great! Thank you.



[jQuery] validate

2009-07-26 Thread Bibin

Hi,
 I am new to jquery and wanted to use jauery validate plugin in my
project. But I have seen that jquery displays errors as inline
messages.But in order to remain backward compatibility in my project,
I have to show the error messages as an alert, ie all error messages
aggregated into a single message.Is there any way by which I can
customise this in the plugin.I think I can get a hanlde of all the
error messages,and publish it as an alert, rather modifying the dom to
show as inline messages.Any pointer into this will be helpful. Thanks
in advance


[jQuery] Unable to get the latest text/value inside a textarea

2009-07-26 Thread JC

Now, I was not expecting this. You can get the text inside the
textarea using something like:

alert($('#id_of_textarea').text());

That works, but if you bind it with an event, let’s say onkeyup — you
will never get the “latest” text inside the textarea. This was a
complete surprise to me. The best way to do it would be to use the attr
(’value’)

In the example below CustomerNotes is a textarea and it doesn't matter
how I try to get the current value I end up getting the old value.  I
have tried using $(#..).val() and $(#..).text.

Any suggestions or advice would be greatly appreciated

Thanks,
Joel

code
$(#save_forecast).die(click);
$(#save_forecast).live(click, function() {
$.ajax({
type: 'POST',
url: '/core/forecasts/SaveComputeForecast',
data: { request.Id: %=Model.Id %,
request.StartDate: $(#StartDate).val(),
request.EndDate: $(#EndDate).val(),
request.ResourceAmountRequested: $
(#ResourceAmountRequested).val(),
request.OS: $(#OS).val(),
request.MemorySizeInGb: $(#MemorySizeInGb).val
(),
request.CustomerNotes: $(#CustomerNotes).text
()
},
beforeSend: function() {
},
success: function(data, textStatus) {
$(#forcast_content).fadeOut('slow', function() {
$(#forcast_content).html(centerForecast
saved/center);
$(#forcast_content).fadeIn('slow');
$.PopulateCurrentComputeForecastTable();
});
},
complete: function() {
}
});
/code


[jQuery] Form mailing script

2009-07-26 Thread Jason

Hi,

I am new to jquery and have just created a contact form using the
validation plugin and jquery.  Everything works fine so far.  My only
issue is how do I submit this form to an email, I don't have any
scripts etc and need a pretty secure way to do it.

I also need to be able to customise the script to accept some other
fields. The biggest bugbear for me is that I have a select box with
different email destinations and need to send the mail to the one that
is selected by the user.  I want to have the value passed into the
processing script to select the correct email address so I am not
publishing it on the web.

Has anyone done this and willing to give me some help and examples.

regards

Jason


[jQuery] Re: mouseleave triggering prematurely?

2009-07-26 Thread iceangel89

sorry abt the dbl post, i see my profile and the post wasnt there so i
thought maybe i didnt post it. or something.

anyway. the reason why i nest the hover() - which i changed to
mouseover already - is because i want to attach the event to inner li
a's after the slidedown. so i dont get the effect u see
http://iceangel89.5gigs.net/test_2.html

ok maybe i need to see how others develop such accordion menus. i
think maybe my design is wrong. when u move ur mouse down. it opens
the 3rd link ok. continue till it exits that menu. it slides up, in
doing so, triggers the slide down of another menu. as it slides, ur
mouse (at the same spot) may trigger an inner slidedown. sometimes,
depending on the dist, as 2 menu are animating at the same time, 1/2
way thru, the mouse leaves the menu being animated ... so ... the menu
slides up again ... i think u may get what i mean. maybe i must try a
horizontal opening menu instead

On Jul 26, 11:34 pm, Charlie charlie...@gmail.com wrote:
 take a closer look at how hover function works. It requires *two* functions 
 called. You are also embedding a hover function within a hover function 
 (mouseover) then calling the mouseover function within 
 itselfhttp://docs.jquery.com/Events/hover
 try this and see if this is the effect you want
  $(function() {
     $(#mainnav  li  a).mouseover(function() {
                      
 $(this).next(ul).slideDown(fast).addClass(open);  
     });
                
                 $(#mainnav).mouseleave(function() {
                     $(.open).slideUp(fast)
                  });
     });iceangel89wrote:i am trying to develop my own 
 accordion/sliding menu. (as a side qn, any good ones that can be easily 
 customized/skinned?) i found that seem to trigger when i am sliding down an 
 inner menu. since its inner, my mouse definately has not left #mainnav my 
 test pagehttp://iceangel89.5gigs.net/test.htmlwithout that annoying test 
 alerthttp://iceangel89.5gigs.net/test_1.html$(#mainnav).mouseleave(function()
  { alert(mouseleave #mainnav); }); more complete source: $(function() { 
 $(#mainnav  li  a).hover(mouseOver); $(#mainnav).mouseleave(function() 
 { alert(mouseleave #mainnav); }); }); function mouseOver() { 
 $(this).next(ul).slideDown(fast, function() { $(li:has(ul)  a, 
 this).hover(mouseOver); }); } #mainnav, #mainnav ul { list-style: none; 
 padding: 0; margin: 0; background: #bbb; } #mainnav ul { display: none; 
 margin: 5px 10px; } #mainnav a { display: block; padding: 5px 10px; margin: 
 2px 0; background: yellow; } ul id=mainnav lia href=#Test/a/li 
 lia href=#Test/a/li lia href=#Test/a/li li a 
 href=#Test/a ul lia href=#Test/a/li li a href=#Test 
 1/a ul lia href=#Test/a/li lia href=#Test/a/li lia 
 href=#Test/a/li /ul /li lia href=#Test/a/li /ul /li 
 lia href=#Test/a/li lia href=#Test/a/li /ul


[jQuery] Re: Form mailing script

2009-07-26 Thread Donny Kurnia


Jason wrote:

Hi,

I am new to jquery and have just created a contact form using the
validation plugin and jquery.  Everything works fine so far.  My only
issue is how do I submit this form to an email, I don't have any
scripts etc and need a pretty secure way to do it.


You should use a server side scripting language for that. There are may 
options available: PHP, RubyonRails, ASP.NET, Coldfusion, etc. jQuery is 
just a client side scripting language to enhancethe user experience. The 
flow of data still the same: user fill the form, form submitted, a 
server script receive the data and proceess it, ex: sending it to an email.



I also need to be able to customise the script to accept some other
fields. The biggest bugbear for me is that I have a select box with
different email destinations and need to send the mail to the one that
is selected by the user.  I want to have the value passed into the
processing script to select the correct email address so I am not
publishing it on the web.


You can handle that with a simple if in the server side.


Has anyone done this and willing to give me some help and examples.

regards

Jason



--
Donny Kurnia
http://blog.abifathir.com
http://hantulab.blogspot.com
http://www.plurk.com/user/donnykurnia