[jQuery] Re: Canceling an animation

2007-11-02 Thread Gordon

To abort before the animation starts you'd use slearTimeout.  In the
case where the animation has already started you'd use $
(selector).stop ()

On Nov 2, 12:17 am, S. Robert James [EMAIL PROTECTED] wrote:
 I have an animation that runs after a delay:

 setTimeout(function(){$(.mbox).fadeIn('slow');},500);

 If I need to cancel it, how do I this?
 I would like to cancel it regardless of whether it is still in the
 initial setTimeout of 500ms, or has already started to fadeIn.



[jQuery] IE JSON eval problem

2007-11-02 Thread mngd

Hi,

The following code works in FF but generates errors in IE6.
I'm completely stumped - any feedback appreciated...



script type=text/javascript

var menuitems = {
  home : home.html
}

function openPage(item) {

  // this is what I need to do, works in FF
  alert(menuitems.eval(item)[0]);

  // this works in IE and FF - returns 'home'
  // (without the quotes)
  alert(item);

  // this works in FF - returns 'home.html' (without quotes)
  // generates error in IE6 - 'Object doesn't support this
  // property or method'
  alert(menuitems.eval(item));

}

/script

h1Using eval on a JSON array in IE6/h1

a href=javascript:openPage('home')home/a





[jQuery] Re: LiveQuery (Discuss Please)

2007-11-02 Thread Richard D. Worth
A slight correction to give credit where it is due:
Malsuphttp://www.malsup.com/jquery/has written some great plugins
(BlockUI, Cycle, Form, etc.), but Dimensions
and Live Query are both by Brandon Aaron http://blog.brandonaaron.net/.

- Richard

On 11/2/07, resetstudio [EMAIL PROTECTED] wrote:


 I think this is a great plugin.
 Malsup makes me happy already with his dimensions plugin (ok it is not
 perfect, all the divs that are containing floats return 0px as height
 then i have to use float:left on the container to discard this
 problem), and this livequery, wow, is what i've looked for. Thnx a lot!




[jQuery] fadeOut behaving funny

2007-11-02 Thread stef

i have a page where a form is submitted to the same page, using php
(no ajax). if the query that writes the data to the db is successful
it sets $marker = 1;

in the head of my page i then i have the code below, which tries to
achieve the yellow fade technique: a message appears to indicate
success and then slowly fades out. problem is that with the code
below, it appears for just a split second and then abruptly
disappears. could anyone tell me why and how to get this to work?

? if ($marker == 1) { ?
script type=text/javascript
 $(document).ready(function(){
 $(#nav).after(span class='yellowFade'Homepage updated!/
span);
 $(span.yellowFade).fadeOut(slow);
 });
/script
? } ?



[jQuery] Re: Slickspeed from Mootools

2007-11-02 Thread Rey Bango


Hey Hector,

What the *initial* release of our tests (which was the motivation for 
SlickSpeed) did was to motivate all of the JS projects to improve the 
selector speeds. If you notice, some libraries really shine in FireFox 
because the use XPath for DOM selection while others, like jQuery, are 
optimized for IE, the dominant browser out there.


For the immediate future, we're comfortable with the speed of the jQuery 
selector engine and prefer to focus on enhancing other areas of the 
project (eg: documentation  jQuery UI).


Rey...

Pops wrote:

Whoa! Rey, what a different between IE and FF.

I am not interested in the half-truths in any of this, but rather what
does the test show to improve jQuery, if anything?

--
HLS

On Nov 1, 1:59 pm, Rey Bango [EMAIL PROTECTED] wrote:

Hi Prit,

Please do a search in the archives for this topic. Just as early as last
week, I posted a response to this.

Also, be sure to run the same test in IE so you can see totally
different results. My post goes into detail about that as well.

Thanks,

Rey...

prit wrote:

I have tried different javascript frameworks and I finally decided to
use jQuery because of the ease of use and all the good plugins
available.
But recently I noticed a websitehttp://mootools.net/slickspeed/which
compares 3 frameworks including jQuery. I ran the tests on that site
and noticed that they show jQuery as the slowest performer out of the
3 frameworks (Mootools, Prototype and jQuery).
Does anybody have comments on this ?
Thanks,
Prit





[jQuery] Re: Slickspeed from Mootools

2007-11-02 Thread Rey Bango


No problem Prit. We've just discussed this so many times and I thought 
it would be easier to ask that you do a search since there was ooo 
much discussion about this in the past.


Hopefully, you ran it in IE. I really do want you to see the speed 
difference.


Rey

prit wrote:

Thanks for the guidelines. I should have searched here and also
google. But your comments helped me. :)

On Nov 1, 4:03 pm, Pops [EMAIL PROTECTED] wrote:

Whoa! Rey, what a different between IE and FF.

I am not interested in the half-truths in any of this, but rather what
does the test show to improve jQuery, if anything?

--
HLS

On Nov 1, 1:59 pm, Rey Bango [EMAIL PROTECTED] wrote:


Hi Prit,
Please do a search in the archives for this topic. Just as early as last
week, I posted a response to this.
Also, be sure to run the same test in IE so you can see totally
different results. My post goes into detail about that as well.
Thanks,
Rey...
prit wrote:

I have tried different javascript frameworks and I finally decided to
use jQuery because of the ease of use and all the good plugins
available.
But recently I noticed a websitehttp://mootools.net/slickspeed/which
compares 3 frameworks including jQuery. I ran the tests on that site
and noticed that they show jQuery as the slowest performer out of the
3 frameworks (Mootools, Prototype and jQuery).
Does anybody have comments on this ?
Thanks,
Prit





[jQuery] Re: Custom function called in toogle()

2007-11-02 Thread Snook

 Calling toggle() runs event.preventDefault.
 Whatever you want the click to do, you need to code it yourself.

Ok, thanks.
I have tried different implementation of preventDefault, regarding
what I have found in this group. And probably I'm completely wrong
because no one works for me.

Here is what I have tried:

function myToggleShow(toggleElem, showHideElem){
  var showHide = $(showHideElem);
  $(toggleElem).toggle(
function(e){
e.eventDefault();
showHide.show('slow');
},
function(){ showHide.hide('slow'); }

  );
}

myToggleShow('#regime_lstd_c', '#regime_lstd');

Did I need an other plugin or library ?



[jQuery] Re: Selector for Toggled Element

2007-11-02 Thread studiobl

Neither that (nor some form of that) seems to work.


On Nov 1, 3:43 pm, motob [EMAIL PROTECTED] wrote:
 try $(table:hidden) or some form of that.

 On Nov 1, 2:30 pm, studiobl [EMAIL PROTECTED] wrote:



  Any suggestions on how to retrieve the display attribute of a toggled
  element?



[jQuery] Migrating from prototype to jquery

2007-11-02 Thread pytrade

I have the following code which will add error messages for ajax
requests and a busy indicator at the bottom of the page. How would I
migrate this to jquery? I've migrated from lightbox to thickbox and
auto complete to auto complete, without any problem. I had one problem
where the page would not reload in ie since the script tag was writing
to the dom before the page load was completed. That was fixed by
adding a defer='true' to the script tag.

I still have the following questions:

Question 1:

Ajax.Responders.register({
onCreate: function() {
$('headerPageError').innerHTML = 
Effect.Fade('headerPageError',{duration: 0.25, queue: 'end'});
if($('notification')  Ajax.activeRequestCount  0)
Effect.Appear('notification',{duration: 0.25, queue: 
'end'});
},
onComplete: function() {
if($('notification')  Ajax.activeRequestCount == 0)
Effect.Fade('notification',{duration: 0.25, queue: 'end'});
}
});

Question 2:

How would I do the following simple ajax request with jquery:

new Ajax.Updater(id_of_div_content_to_update, someurl).value,
{});

Question 3:

Will the $(some_id) continue to work with jquery?



[jQuery] Re: Slickspeed from Mootools

2007-11-02 Thread NccWarp9

hmmm.. I ran the test also and got that jQuery is the fastest

final time (less is better)  MooTools:5073ms  Prototype:5740ms  jQuery:
2915 ms

On Nov 1, 6:25 pm, prit [EMAIL PROTECTED] wrote:
 I have tried different javascript frameworks and I finally decided to
 use jQuery because of the ease of use and all the good plugins
 available.

 But recently I noticed a websitehttp://mootools.net/slickspeed/which
 compares 3 frameworks including jQuery. I ran the tests on that site
 and noticed that they show jQuery as the slowest performer out of the
 3 frameworks (Mootools, Prototype and jQuery).

 Does anybody have comments on this ?

 Thanks,
 Prit



[jQuery] Help understanding bind and adding to the DOM.

2007-11-02 Thread Charles Sexton

Hello everyone,

From this thread: 
http://groups.google.com/group/jquery-dev/browse_thread/thread/22c0b936d2060dc4/
I now know what I need to accomplish, however I do not understand how
it works. Would someone be able to explain simply how to add data to
the DOM?
I had a quick look at Live Query as I thought it would be simple to
use (i.e. just include it and everything works), but I don't find it
to be simple at all. Maybe I will once I understand the concept.

Many thanks



[jQuery] Re: LiveQuery (Discuss Please)

2007-11-02 Thread resetstudio

I think this is a great plugin.
Malsup makes me happy already with his dimensions plugin (ok it is not
perfect, all the divs that are containing floats return 0px as height
then i have to use float:left on the container to discard this
problem), and this livequery, wow, is what i've looked for. Thnx a lot!



[jQuery] Re: How to pull details info into master page (php/mysql)

2007-11-02 Thread Dave Buchholz - I-CRE8

Thanks Yehuda,

Regards,


Dave Buchholz
I-CRE8
http://www.i-cre8.co.uk
Skype ID: I-CRE8

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Yehuda Katz
Sent: 02 November 2007 01:19
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: How to pull details info into master page (php/mysql)




Sent from my iPhone

On Nov 1, 2007, at 5:29 PM, Dave Buchholz - I-CRE8 [EMAIL PROTECTED] 
  wrote:


 I now have this working using the following code:

 $(document).ready(function() {
  $('#view a').click(function() {
  $('#show-details').hide();
  $.get($(this).attr(href), {}, function(data) {
$('#show-details').html(data).fadeIn(slow);
});
return false;
  });
 });

$(#show-details).load(this.href, function() { $(this).fadeIn 
(slow) });



 Are there any glaring errors in my implementation that in my lack of
 experience I would not see ?

 Regards,


 Dave Buchholz
 I-CRE8
 http://www.i-cre8.co.uk
 Skype ID: I-CRE8


 -Original Message-
 From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED]  
 On
 Behalf Of Dave Buchholz - I-CRE8
 Sent: 31 October 2007 23:58
 To: jquery-en@googlegroups.com
 Subject: [jQuery] Re: How to pull details info into master page (php/ 
 mysql)



 Adrian,

 Yes manID will be different for each link, I have put up a page

http://www.i-cre8.co.uk/webassist/dataassist-master-detail-page-using-jquery
 /manufacturer_Results.php showing what happens which is basically a  
 blank
 page after I click the view link containing the manID link.

 I must be doing something wrong somewhere

 Regards,


 Dave Buchholz
 I-CRE8
 http://www.i-cre8.co.uk
 Skype ID: I-CRE8



 -Original Message-
 From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED]  
 On
 Behalf Of Adrian Lynch
 Sent: 31 October 2007 21:51
 To: jQuery (English)
 Subject: [jQuery] Re: How to pull details info into master page (php/ 
 mysql)


 manID will be different for each link? Then don't put any PHP code  
 in the
 jQuery code, instead just access the links href:

 $(document).ready(function () {
$(.view-man).click(function () {
$(#show-detail).load($(this).attr(href));
return false;
});
 });

 Adrian




[jQuery] Re: clueTips hangs on FF with $ signs in the ajax data.

2007-11-02 Thread Karl Swedberg

Hi,

I might need to see a test page to identify what's wrong, because I  
wasn't able to replicate the problem. I stuck some $$$ in a file and  
pulled it into a cluetip just fine. What type of data are you pulling  
in? Is it html or xml or json? If it's not html, make sure to set it  
with ajaxSettings: {dataType: 'xml'} or whatever it is.


You might also want to try changing the ajaxProcess option. Other  
than that, the clueTip just uses jQuery's $.ajax() pretty much out of  
the box.



--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Nov 1, 2007, at 6:06 PM, vwRiver wrote:



I am playing the clueTips  and get this problem:

I tried to get the content via ajax, but there are $ signs in the
content. The clueTip works fine on IE+XP and Konqueror+Linux, but it
hangs if there are $ signs in the ajax data. otherwise, it is just
fine.

How to deal with this? Thanks a lot.

VW





[jQuery] Re: Canceling an animation

2007-11-02 Thread Yehuda Katz
You could always wrap it up in a plugin like deferred(fadeIn, 500) that
exposes a stopDeferred() method and handles both cases.

On 11/2/07, Gordon [EMAIL PROTECTED] wrote:


 To abort before the animation starts you'd use slearTimeout.  In the
 case where the animation has already started you'd use $
 (selector).stop ()

 On Nov 2, 12:17 am, S. Robert James [EMAIL PROTECTED] wrote:
  I have an animation that runs after a delay:
 
  setTimeout(function(){$(.mbox).fadeIn('slow');},500);
 
  If I need to cancel it, how do I this?
  I would like to cancel it regardless of whether it is still in the
  initial setTimeout of 500ms, or has already started to fadeIn.




-- 
Yehuda Katz
Web Developer | Procore Technologies
(ph)  718.877.1325


[jQuery] Re: IE JSON eval problem

2007-11-02 Thread Michael Geary

That code shouldn't work in any browser. The fact that it works in Firefox
is actually considered a bug, which I believe is being fixed in 3.0.

eval() is supposed to be a method of the window object (i.e. a global
function). It isn't supposed to be available as a method of every object.

What is the purpose of the eval()? And what is the [0] for in your first
eval? I don't see an array in the code, nor any apparent reason to use
eval().

Would this be the code you're looking for?

   function openPage( item ) {
  alert( menuitems[item] );
   }

-Mike

 From: mngd
 
 The following code works in FF but generates errors in IE6.
 I'm completely stumped - any feedback appreciated...
 
 
 
 script type=text/javascript
 
 var menuitems = {
   home : home.html
 }
 
 function openPage(item) {
 
   // this is what I need to do, works in FF
   alert(menuitems.eval(item)[0]);
 
   // this works in IE and FF - returns 'home'
   // (without the quotes)
   alert(item);
 
   // this works in FF - returns 'home.html' (without quotes)
   // generates error in IE6 - 'Object doesn't support this
   // property or method'
   alert(menuitems.eval(item));
 
 }
 
 /script
 
 h1Using eval on a JSON array in IE6/h1
 
 a href=javascript:openPage('home')home/a
 
 



[jQuery] Re: LiveQuery (Discuss Please)

2007-11-02 Thread Jonathan Sharp
I'd cast my vote for leaving it out of core for now. The beauty of jQuery is
the leaness of the core. I've had my eye on LiveQuery for quite some time
but haven't had a chance to put it into practice for our enterprise toolkit.
Performance is a major concern but of greater issue is the inconsistency
within our organization for jQuery code. I fear too many developers would
just use it as a replacement for bind and with the level of dom manipulation
that we do the performance hit would be too much.

Again let me state that this is not reflective of jQuery or LiveQuery but
the browser limitations and the sheer size of data we internally have
to deal with on a single page.

I would theorize that the majority of jQuery users have onReady event
binding. For those that have dom manipulation it's probably pretty light and
thus the benefit of LiveQuery isn't realized.

Cheers,
-Jonathan


On 10/31/07, Yehuda Katz [EMAIL PROTECTED] wrote:

 So as far as I'm concerned, livequery is the biggest advance in jQuery
 since its inception (no, I am not its author). I'm trying to understand why
 it's having such a slow rate of adoption.

 it solves this problem:
 $(div.klass).draggable();
 $(#foo).load(url, function() { $(div.klass).draggable(); });


 beautifully, as you now only need to do:


 $(div.klass).livequery(function() { $(this).draggable() });
 $(#foo).load(url);


 Obviously, that was only a simple example. The more general case, wanting
 to bind some event handler to a selector regardless of when it appears on
 the page, is extremely common. So again, I'm trying to understand why the
 rate of adoption has been so slow. Any thoughts?

 --
 Yehuda Katz
 Web Developer | Procore Technologies
 (ph)  718.877.1325


[jQuery] Re: select text for LI

2007-11-02 Thread Jonathan Sharp
I'm sure there's a more elegant solution but you could do something like:

// Untested
var about = $( 'selector for the li' ).clone().find('
ul').remove().end().html();

Cheers,
-Jonathan


On 11/2/07, sawmac [EMAIL PROTECTED] wrote:


 I'm trying to select text inside list items. I'm using
 jQuery's .text( ) method. Unfortunately, that returns the text of all
 children as well. That means for a nested list like this

 ul
 liindex.html/li
 liabout
ul
  liindex.html/li
  limore.html/li
/ul
 /li
 /ul

 $('li').eq(1).text() returns
 'about
   index.html
   more.html'

 I just want to retrieve about not the text from the child list
 items. Any ideas on how to do that?

 thanks




[jQuery] Re: LiveQuery (Discuss Please)

2007-11-02 Thread Jack Killpatrick
I 2nd Dan's idea. What has made me wary about dipping into using 
LiveQuery is:


1. loss of an element of control, compared to just calling a helper 
function at the right time to rebind events
2. concern about overhead, since (as I understand it), it's watching for 
DOM changes and hence maybe not rebinding things in as efficient a 
manner as I would want. This concern could just come from not knowing 
(or having looked at) how it works under the covers, but I'd have to 
make time for that, to ease my concerns
3. concern about possibly rebinding things that I don't want rebound, so 
I'd have to write code to prevent it, ending up with around as much code 
as just rebinding via my helper function


- Jack

Dan G. Switzer, II wrote:

I think what I'd be more interested is having a method that would allow me
to really easily *manually* re-apply effects/events to a jQuery object.

For example:
$('li') 
.cache('some.name', function(){ 
// use the helper function hover to bind a mouseover and mouseout event 
$(this) 
.hover(function() { 
$(this).addClass('hover'); 
}, function() { 
$(this).removeClass('hover'); 
}); 
});


Now you could do:
$('li').applyCache('some.name');

Something like that would definitely save me some coding. (I'd allow a
manual cache key, just so you could re-use the chain on other selectors.)

The benefit is you don't have the overhead of having to constantly monitor
the DOM, but you have an easy way to re-apply a bunch of commands to a
selector.

Right now I just use helper functions--which isn't hard, just not very
jQueryish. :)

Too bad there's no way to programmatically know the jQuery chain. It would
be really sweet to be able to do:

$('li')
	.hover(function() { 
		$(this).addClass('hover'); 
	}, function() { 
		$(this).removeClass('hover'); 
	})

.cache('some.name');

And have the cache() method be aware of all the methods called in the
current chain.

-Dan

  

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of tlphipps
Sent: Thursday, November 01, 2007 9:22 AM
To: jQuery (English)
Subject: [jQuery] Re: LiveQuery (Discuss Please)


I'd like to second this opinion.  I'm using livequery more and more,
but there are plenty of places where I DON'T use it, so not having it
in the core would still be my preference.

On Nov 1, 5:53 am, James Dempster [EMAIL PROTECTED] wrote:


My less than one pence worth would be I love and use the plugin, but I
don't think it should be included into jQuery core, I would
like to see jQuery core stay light and fresh. There's nothing wrong
with adding LiveQuery yourself, either just add another js file to
your html or append all the plugins you want to the same js file.

/James

On Nov 1, 2:04 am, Yehuda Katz [EMAIL PROTECTED] wrote:

  

So as far as I'm concerned, livequery is the biggest advance in jQuery


since


its inception (no, I am not its author). I'm trying to understand why


it's


having such a slow rate of adoption.

it solves this problem:

$(div.klass).draggable();
$(#foo).load(url, function() { $(div.klass).draggable(); });

beautifully, as you now only need to do:

$(div.klass).livequery(function() { $(this).draggable() });

$(#foo).load(url);

Obviously, that was only a simple example. The more general case,


wanting to


bind some event handler to a selector regardless of when it appears on


the


page, is extremely common. So again, I'm trying to understand why the


rate


of adoption has been so slow. Any thoughts?

--

Yehuda Katz
Web Developer | Procore Technologies
(ph)  718.877.1325





  




[jQuery] Re: How do you do Client/Server interaction? (CakePHP/JSON/jQuery)

2007-11-02 Thread Tane Piper

Just to let you all know, I've put up a tutorial explaining it a bit more here:
http://digitalspaghetti.me.uk/2007/11/02/developing-a-persistent-javascript-variable-with-cakephp-12-jquery/

Please feel free to comment as it probably could be improved upon.

On 02/11/2007, Tane Piper [EMAIL PROTECTED] wrote:
 Well, what would you know!  Having written out what I wanted to get,
 and by simply applying a little brainpower, I came up with the
 solution.  What I did was write a CakePHP component and helper.  First
 off, here is the component:

 ?php
 class JsonComponent extends Component {
 var $json_for_layout = array();
 function addToJSON($add = array()){
 $this-json_for_layout = array_merge($this-json_for_layout, 
 $add);
 }
 function getJSON() {
 return $this-json_for_layout;
 }
 }
 ?

 What this component does is allows me to pass in arrays to a global
 array in the controller, json_for_layout.  Every time I call this from
 a controller, it add's to the array.  The next step is in my
 beforeRender() function in my AppController, I do this:

 $this-set('json_for_layout', $this-Json-getJSON());

 This sets my view variable.  I then need to actually generate the JSON
 and output it to a var:

 ?php
 class JsonHelper extends JavascriptHelper {
 function renderJSON($data, $varname = 'Pastemonkey'){
 $json = json_encode($data);
 $output = $this-codeBlock('var ' . $varname . ' = ' . $json 
 . ';');
 return $output;
 }
 }
 ?

 Now, what I do is inside my header, I echo this out to the view:

 ?php e($json-renderJSON($json_for_layout));?

 And thats it!  Check your DOM tab in firebug to see the global object
 now available.

 For example, if I pass in my sitename, I can simply call it with:

 Pastemonkey.sitename

 Hope this helps out a few people, and I intend to write a more
 thorough blog about it tomorrow.

 On 01/11/2007, Tane Piper [EMAIL PROTECTED] wrote:
  Apologies for the cross posting here, but I myself am at a bit of a
  crossroads in my applications development, and I'd like to take the
  time to put out this email in the hopes that it generates some good
  discussion, and can maybe teach me a few things.
 
  A little background first to my issues.  I am developing my
  application at the moment (pastemonkey.org) and it's being built on
  CakePHP and jQuery.  At the moment, I'm using a lot of CakePHP's built
  in stuff to generate my HTML, and I'm using jQuery to do some simple
  Ajax stuff and some DOM manipulation.
 
  Where I am at a crossroads is how to do my client/server interaction
  with JSON.  For example, I have the facility in place for inline
  comments.  When you see a paste, you can double click on each line to
  create and view the comments.  When you create one, there is code that
  generates the comment and enters the line number and paste ID.
 
  To display this, what I do is create an array of the line numbers, and
  generate JSON using PHP's inbuilt functions.  So an array like this
  ('1', '2', '10', '15') becomes [1, 2, 10, 15].  What I then do
  is pass this to the view, and do this:
 
  ?php e($javascript-codeBlock('var lines = eval(' . $comment_lines . 
  ')'));?
 
  So what this does is it outputs
 
  var lines = eval( [1, 2, 10, 15]);
 
  I then have this function in my core javascript file:
 
  $('.geshi-output-view ol li').each(function(i){
  i++;
  $(this).attr('id', i);
  if ($.inArray(i, lines) != -1) {
  $(this).attr('style','').addClass('hasComment');
  }
  });
 
  What I am doing here is expecting there to already be a variable set
  called lines, and I check each line's ID (based on offset + 1) to see
  if it's in the JSON array, and if it does apply the class.
 
  It presents two issues - first it's ugly.  It means I always have to
  have the javascript helper line above in any view I want to use it in,
  and I also expect the variable to be there (in the case of the view it
  always should be).  I'm wondering if anyone know a much nicer, more
  global way to handle this?
 
  For example, Is there any way in PHP to generate a global object?  For
  example a Pastemonkey object that I can attach to.  e.g:
 
  Pastemonkey.Settings.sitename
  Pastemonkey.Comments[0]
  Pastemonkey.User.Colour.Header
  etc
 
  I'm basically looking for the cleanest way to handle persistent data
  from my server side that I can use client side with jQuery.
 
  Thanks
 
  --
  Tane Piper
  Blog - http://digitalspaghetti.me.uk
  AJAX Pastebin - http://pastemonkey.org
 
  This email is: [ ] blogable [ x ] ask first [ ] private
 


 --
 Tane Piper
 Blog - http://digitalspaghetti.me.uk
 AJAX Pastebin - http://pastemonkey.org

 This email is: [ ] blogable [ x ] ask first [ ] private



-- 
Tane Piper
Blog - http://digitalspaghetti.me.uk
AJAX Pastebin - http://pastemonkey.org

This email is: [ ] blogable [ x ] ask first [ ] private


[jQuery] Re: SuperFish Menu Flash

2007-11-02 Thread rolfsf


I don't have an easy answer for you, but it seems like you've tried a couple
different techniques and haven't completely removed the old ones. For
example, you've got both the original suckerfish javascript (sfhover) and
superfish ( which is a jquery implementation of the suckerfish menu). You're
also calling bgiframe, but you haven't linked the bgiframe script... but I
think superfish has it's own implementation of the bgiframe technique. So
you might want to start by cleaning up a little.



gracetec wrote:
 
 
 Hi all,
 
 I have been testing the SuperFish menu and and very impressed with
 it's features. However, when I included a Flash slideshow my menu no
 longer can be seen. I have followed all advise I can find on forums
 re: CSS z-index values and setting  still to no effect.
 I would be grateful for any further help as I don't wish to change the
 menu at this stage.
 
 View the menu here: http://rican.ictirl.com/home/menu.htm
 
 regards,
 gracetec
 
 
 

-- 
View this message in context: 
http://www.nabble.com/SuperFish-Menu---Flash-tf4738569s27240.html#a13551553
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Slickspeed from Mootools

2007-11-02 Thread sgrover

Just for laughs I ran that test in Konqueror 3.5.6.  EVERY SINGLE TEST 
FAILED for both MooTools and Prototype.  Every single test passed for 
jQuery.  And here I thought jQuery would have at least a few failures 
seeing as Konqueror isn't the best supported browser for these types of 
libraries.. :)

S.. The end results say it best for me:

final time (less is better)
MooTools:  25
Prototype: 25
jQuery:630

Sseeing as every test failed for MooTools and Prototype, the 25 ms 
value has absolutely NO meaning at all.  Yet less is better according to 
the test.  So, the test is obviously flawed in some ways.

 From my perspective.  I don't care at all if something takes 20ms vs 
5ms.  Because this time value is on the CLIENT machine, not the server 
or a reflection of network latency.  Therefore, the obvious answer is 
that if it feels too slow, that client needs to upgrade their box.  This 
test does not even come close to accurately testing times for a high 
volume network.  It is ONLY testing the speeds of the different 
selectors ON THE CLIENT.  And the effectiveness of those selectors 
(what's with the different number of matches for div:contains(CELIA) 
under firefox??).

And with that, I'm done for the night (3:15am here, need sleep.. :)

Shawn

Rey Bango wrote:
 
 Hi Prit,
 
 Please do a search in the archives for this topic. Just as early as last 
 week, I posted a response to this.
 
 Also, be sure to run the same test in IE so you can see totally 
 different results. My post goes into detail about that as well.
 
 Thanks,
 
 Rey...
 
 prit wrote:
 I have tried different javascript frameworks and I finally decided to
 use jQuery because of the ease of use and all the good plugins
 available.

 But recently I noticed a website http://mootools.net/slickspeed/ which
 compares 3 frameworks including jQuery. I ran the tests on that site
 and noticed that they show jQuery as the slowest performer out of the
 3 frameworks (Mootools, Prototype and jQuery).

 Does anybody have comments on this ?

 Thanks,
 Prit




[jQuery] Re: select text for LI

2007-11-02 Thread Andy Matthews

never mind. I just ran a validate on that snippet of code and yours is the
valid markup. 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of sawmac
Sent: Friday, November 02, 2007 10:55 AM
To: jQuery (English)
Subject: [jQuery] select text for LI


I'm trying to select text inside list items. I'm using jQuery's .text( )
method. Unfortunately, that returns the text of all children as well. That
means for a nested list like this

ul
  liindex.html/li
  liabout
ul
  liindex.html/li
  limore.html/li
/ul
  /li
/ul

$('li').eq(1).text() returns
'about
   index.html
   more.html'

I just want to retrieve about not the text from the child list items. Any
ideas on how to do that?

thanks




[jQuery] Re: select text for LI

2007-11-02 Thread Andy Matthews

Isn't that invalid HTML? Should it be this instead?

ul
  liindex.html/li
  liabout/li
  ul
liindex.html/li
limore.html/li
  /ul
/ul 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of sawmac
Sent: Friday, November 02, 2007 10:55 AM
To: jQuery (English)
Subject: [jQuery] select text for LI


I'm trying to select text inside list items. I'm using jQuery's .text( )
method. Unfortunately, that returns the text of all children as well. That
means for a nested list like this

ul
  liindex.html/li
  liabout
ul
  liindex.html/li
  limore.html/li
/ul
  /li
/ul

$('li').eq(1).text() returns
'about
   index.html
   more.html'

I just want to retrieve about not the text from the child list items. Any
ideas on how to do that?

thanks




[jQuery] select text for LI

2007-11-02 Thread sawmac

I'm trying to select text inside list items. I'm using
jQuery's .text( ) method. Unfortunately, that returns the text of all
children as well. That means for a nested list like this

ul
  liindex.html/li
  liabout
ul
  liindex.html/li
  limore.html/li
/ul
  /li
/ul

$('li').eq(1).text() returns
'about
   index.html
   more.html'

I just want to retrieve about not the text from the child list
items. Any ideas on how to do that?

thanks



[jQuery] SuperFish Menu Flash

2007-11-02 Thread gracetec

Hi all,

I have been testing the SuperFish menu and and very impressed with
it's features. However, when I included a Flash slideshow my menu no
longer can be seen. I have followed all advise I can find on forums
re: CSS z-index values and setting param name=wmode
value=transparent / still to no effect.
I would be grateful for any further help as I don't wish to change the
menu at this stage.

View the menu here: http://rican.ictirl.com/home/menu.htm

regards,
gracetec



[jQuery] Re: clueTips hangs on FF with $ signs in the ajax data.

2007-11-02 Thread vwRiver

Thanks, Karl.

We have  jquery.js running on our server, but it comes from the
designer  and I can not see the version info in the JS file.

I downloaded the latest one and used it for testing. It works just
fine.

--vw



[jQuery] Re: Effects Issue

2007-11-02 Thread dacoder

figured it out, stupid me had the display block and none applied when
fadeIn and FadeOut already are setting this

On Nov 2, 7:59 am, dacoder [EMAIL PROTECTED] wrote:
 Not sure if I explained myself to clearly but really all it is, is the
 fact that my fadeIn and fadeOut effects were working with jQuery 1.1.2
 but not with 1.1.4. If anyone knows why this might be happening that
 would be great, I've searched around and haven't found to many other
 situations like this except for some that I'm not sure are pertaining
 to this.



[jQuery] Re: LiveQuery (Discuss Please)

2007-11-02 Thread rolfsf


I'd like to second Lee Hinde-3's comment. From a beginner's perspective, I
don't really get it. I mean, when I read the description when it was first
announced, I sensed that it was something great, and I've been wanting to
use it, but I really don't understand enough about it and when to use it...
or not use it. As a designer, jQuery has been liberating, allowing me to do
things with javascript I never could before... but I'm very aware of the
fact that my javascript knowledge is very shallow, and LiveQuery is a plugin
that seems rooted in a deeper topic than I'm comfortable with... hence, I
haven't touched it. Maybe Karl Swedberg could take up the topic at
LearningJquery.com?





Lee Hinde-3 wrote:
 
 
 Since this is an evangelism discussion, I'd suggest that LiveQuery
 page doesn't explain the problem it solves. And your sample takes two
 lines of code and reduces it to two lines of code. That's not, in and
 of itself, compelling.
 
 A lot of us beginners don't get what itch is getting scratched. The
 specific suggestion would be to update the Live Query page with an
 introduction as to why the plug-in is useful, with an emphasis on DOM
 changes via Ajax calls.
 
 

-- 
View this message in context: 
http://www.nabble.com/LiveQuery-%28Discuss-Please%29-tf4729081s27240.html#a13551243
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Star rating plugins

2007-11-02 Thread Michael Price


Hi all,
Have a feeling a little later on I'm going to be doing a reviews system 
for a client of ours. Naturally I wish to use jQuery and if it's a five 
star system, use one of the star rating plugins. Which would people 
recommend, that work with jQuery 1.2.x?


All suggestions appreciated! :)

Regards,
Michael Price



[jQuery] Re: Effects Issue

2007-11-02 Thread dacoder


Not sure if I explained myself to clearly but really all it is, is the
fact that my fadeIn and fadeOut effects were working with jQuery 1.1.2
but not with 1.1.4. If anyone knows why this might be happening that
would be great, I've searched around and haven't found to many other
situations like this except for some that I'm not sure are pertaining
to this.



[jQuery] Re: Ajax 'drop-down' menu using jQuery [amateur cry for help]

2007-11-02 Thread Vladimir

Thanks anyway :D

On Oct 30, 10:19 pm, polyrhythmic [EMAIL PROTECTED] wrote:
 Vlad, there's no simple solution for what you're asking.  There are
 plenty of drop-down menu jQuery plugins, but you'll have to adapt one
 to make it look like you want.  A plugin is not really necessary for
 that menu, however.  Investigate how to use jQuery's slideDown and
 slideUp effects at docs.jquery.com .

 Charles
 doublerebel.com

 On Oct 30, 7:00 am, Vladimir [EMAIL PROTECTED] wrote:

  Hi, I really need this... I found an very interesting menu wixh is
  usng Ajax, but I thought that I could just find some plug in for that
  and that will be it, but NO... Here is a sample of that kind of 
  menuhttp://foliage-for-blogger.blogspot.com/

  {pull button is needed to be clicked}

  Can somebodyhelpme... I'm searching for plug-in that willhelpme to
  do that with jQuery...

  [sorry for bad English, and amateur questions :D ]



[jQuery] Re: IE JSON eval problem

2007-11-02 Thread mngd

Of course - how obvious, silly me, I'm new to JSON and had a mental
block about the eval thing.
The [0] you mentioned shouldn't have been there, I was simplifying my
code before posting and forgot to remove it.

Thanks!

On Nov 2, 3:58 pm, Michael Geary [EMAIL PROTECTED] wrote:
 That code shouldn't work in any browser. The fact that it works in Firefox
 is actually considered a bug, which I believe is being fixed in 3.0.

 eval() is supposed to be a method of the window object (i.e. a global
 function). It isn't supposed to be available as a method of every object.

 What is the purpose of the eval()? And what is the [0] for in your first
 eval? I don't see an array in the code, nor any apparent reason to use
 eval().

 Would this be the code you're looking for?

function openPage( item ) {
   alert( menuitems[item] );
}

 -Mike

  From: mngd

  The following code works in FF but generates errors in IE6.
  I'm completely stumped - any feedback appreciated...

  

  script type=text/javascript

  var menuitems = {
home : home.html
  }

  function openPage(item) {

// this is what I need to do, works in FF
alert(menuitems.eval(item)[0]);

// this works in IE and FF - returns 'home'
// (without the quotes)
alert(item);

// this works in FF - returns 'home.html' (without quotes)
// generates error in IE6 - 'Object doesn't support this
// property or method'
alert(menuitems.eval(item));

  }

  /script

  h1Using eval on a JSON array in IE6/h1

  a href=javascript:openPage('home')home/a

  



[jQuery] Problem with Jorn's autocomplete plugin

2007-11-02 Thread Peter Bengtsson


I've tried deploying this but I'm having problems.
http://jquery.bassistance.de/autocomplete/

The problem I have is that when I select an item from the autocomplete 
dropdown my input is reset with the value of that one only.

So, if I start typing
Stockholm, Copenhagen, Hels and then it offers me Helsinki in the 
dropdown-thing; when I then select the Helsinki alternative, 
everything else in the inbox box is replaced with just Helsinki.


Here's what I've got in terms of code:

$(#id_free_tags).autocomplete('getFreeTagSuggestion', {
multiple: true,
matchContains: true,
formatItem: formatItem,
formatResult: formatResult
   });

input name=free_tags id=id_free_tags value= /

The only obvious difference I can see is that I'm using jQuery 1.2.1 and 
the examples on  http://jquery.bassistance.de/autocomplete/ uses jQuery 
1.1.2


Any ideas anyone?

--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com


[jQuery] Re: popping up an image

2007-11-02 Thread GianCarlo Mingati

try tickbox
http://jquery.com/demo/thickbox/

On Nov 2, 9:09 am, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
 Hi,

 I tried the lightbox and like it, but it has some problem with my
 page, so can't be used. I'm looking for something very simple: show a
 image in a modal window when user click a link, any easy way to do
 that? thanks.

 A.C.



[jQuery] popping up an image

2007-11-02 Thread [EMAIL PROTECTED]

Hi,

I tried the lightbox and like it, but it has some problem with my
page, so can't be used. I'm looking for something very simple: show a
image in a modal window when user click a link, any easy way to do
that? thanks.

A.C.



[jQuery] Validation plugin broken in IE6?

2007-11-02 Thread Josh Nathanson


Hey all,

It seems that either the Validation plugin is broken in IE6, or I am going 
crazy.  I set up very simple test cases:


http://www.igigi.com/tests/testvalidate.html (with email validation)
On IE6, JS alert errors are thrown which appear to be related to the email 
regex.


http://www.igigi.com/tests/testvalidate2.html (no email validation)
On IE6, no error message is placed after the field when the field is not 
filled out.


Both of these examples work exactly as expected on Firefox.

I am just hoping someone else out there with IE6 can confirm this behavior 
for me, or point out something I am doing wrong in my configuration.


-- Josh




[jQuery] Linking rows on a dynamically generated table

2007-11-02 Thread Kyril Revels

Hi All --

I'm a bit new to Jquery, but I've been using it for the past few days
and have really come to take a shining to it.  However, recently I've
run into an issue when trying to build a table w/ different links
specified on each row.

Here's my code:

for (var i = 0; i  surveys.length; i++) {
var cells = new Array(4);
var row = document.createElement ( 'tr' );
var sid = surveys[i].survey_id;

for(var j = 0; j  cells.length; j++)
cells[j] = document.createElement( 'td' );

$(cells[0]).append(surveys[i].survey_name);
$(cells[1]).append(sid);
$(cells[2]).append(surveys[i].created_date);
$(cells[3]).append(surveys[i].completed_date);
$
(row).append(cells[0]).append(cells[1]).append(cells[2]).append(cells[3])
.click(function(){
window.location.href = '/view?id=' + sid;
});

$('#history-table').append(row)
}

What seems to happen is that each call to the .click() event sets a
handler for all rows instead of the one row element that I'm
specifying, and so each row links to the last URL generated instead of
each row pointing to a different URL.

Am I missing something here?



[jQuery] Re: Performing a function if an element is present

2007-11-02 Thread Karl Swedberg

Hi Ezra,

This is the perfect place for such questions.

You can test for the existence of an element like this (for example):

if ( $('#someid').length ) {

 // do your thing ...

}


--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Nov 2, 2007, at 1:50 PM, Ezra B. Gildesgame wrote:



Hello,

I'm getting started with jQuery and have read several tutorials, but
would appreciate clarification:

How can I create a simple conditional statement to check for the
presence of a certain element on a page, such as an anchor with a
certain class or id, and then perform a function?

I hope that this is an appropriate place to ask this question. If it
is not, I would appreciate any direction as to where might be more
appropriate.

Thank you!

Ezra Gildesgame





[jQuery] Advanced Problem - Any takers? (Repost - didn't seem to show up)

2007-11-02 Thread ja

I'm dynamically inserting html into a page that only contains an
image. Such as...
html
 body
 img src=http://my_domain.com/my_image.jpg/
 /body
/html

my script has a large amount of html that i want to insert. the html
is stored in a variable . Such as..
var my_var = divHI/div;
(the actual html is much larger and more complicated than my example)

I then have..
$('body').append(my_var);

which you would think would insert the html into the page. it doesn't,
instead it just inserts it as text. The source in Firebug is now...
html
 body
 img src=http://my_domain.com/my_image.jpg/
 DIVdivHI/div
 /body
/html

NOTE: that extra div that's all CAPS, isn't a typo. jquery inserts
that for some reason and I don't know why.
The page doesn't render the divHI/div as html, it displays it as
plain text.
If I use the same code on a page that has some more to it, like
google's homepage, the extra DIV isn't there and my html gets
inserted properly (not as text).

any clues as to why? is this a bug? am I missing some aspect of web
pages when they are only images?
Thanks in advanced for your help.
Josh



[jQuery] Re: Slickspeed from Mootools

2007-11-02 Thread prit

Rey,

I did notice the speed difference in IE. Its amazing to see how
mootools performs almost the same or even a little less faster than
jQuery. I never imagined that the speed would vary this much with the
browser.

Thanks for pointing this out. :) Again I am a newbie, trying out all
kinds of stuff (javascript libraries, plugins - i love jQuery, linux
versions, bsd versions :) ). Have never been a hardcore programmer
except on the mainframes.

Prit



[jQuery] cluetip + rounded corners + arrows

2007-11-02 Thread johnsverre

Hello!

I finally ended up with cluetip for my needs, but have been sitting
here the whole day trying to figure out how to use arrows and rounded
corners (in need of 4 backgrounds + 1 arrow at the same time). Any
ideas on the approach?

tried to modify the rounded-template, but sides keep disappearing etc

- John Sverre



[jQuery] Re: LiveQuery (Discuss Please)

2007-11-02 Thread Brandon Aaron

I'd argue that it actually provides you more control over the element
in the sense that you will know when it is initially added or removed
from the DOM.

It is actually pretty smart about how it watches for DOM changes.
Thanks to jQuery's architecture this is all possible with very little
initial overhead. For example if you had the following chain:

$('...').css('...').attr('...').append('...');

Live Query wouldn't run until after the append was done even though
the css and attr methods are also monitored. It also doesn't apply
just to chains. The above could also be broken apart and Live Query
still wouldn't run until after the append was done.

$('...').css('...');
$('...').attr('...');
$('...').append('...');

The performance issues come about when you are selecting _lots_ of
elements with several Live Queries. It has the same performance
concerns as you would with regular jQuery selectors. For example to
increase performance give it a context.

$('div', '#myDynamicArea').livequery('...')

That will obviously run faster than just $('div').livequery('...').

As with all performance concerns ... don't get caught up in pre-
optimizations. After the app is built use profiling and experiment
with selectors to find the areas that are actually slowing you down.

Finally, Live Query will never bind a particular event to an element
more than once. In fact it _only_ binds the event (or calls the
callback) once per a newly matched element.

Live Query's main purpose is to solve a _very_ common problem in AJAX
development ... the need to rebind events to elements added to the DOM
after the initial page load. It does this _very_ well and on most
common uses there will be absolutely no noticeable performance hit.

--
Brandon Aaron

On Nov 2, 12:26 pm, Jack Killpatrick [EMAIL PROTECTED] wrote:
 I 2nd Dan's idea. What has made me wary about dipping into using
 LiveQuery is:

 1. loss of an element of control, compared to just calling a helper
 function at the right time to rebind events
 2. concern about overhead, since (as I understand it), it's watching for
 DOM changes and hence maybe not rebinding things in as efficient a
 manner as I would want. This concern could just come from not knowing
 (or having looked at) how it works under the covers, but I'd have to
 make time for that, to ease my concerns
 3. concern about possibly rebinding things that I don't want rebound, so
 I'd have to write code to prevent it, ending up with around as much code
 as just rebinding via my helper function

 - Jack

 Dan G. Switzer, II wrote:

  I think what I'd be more interested is having a method that would allow me
  to really easily *manually* re-apply effects/events to a jQuery object.

  For example:
  $('li')
  .cache('some.name', function(){
  // use the helper function hover to bind a mouseover and mouseout event
  $(this)
  .hover(function() {
  $(this).addClass('hover');
  }, function() {
  $(this).removeClass('hover');
  });
  });

  Now you could do:
  $('li').applyCache('some.name');

  Something like that would definitely save me some coding. (I'd allow a
  manual cache key, just so you could re-use the chain on other selectors.)

  The benefit is you don't have the overhead of having to constantly monitor
  the DOM, but you have an easy way to re-apply a bunch of commands to a
  selector.

  Right now I just use helper functions--which isn't hard, just not very
  jQueryish. :)

  Too bad there's no way to programmatically know the jQuery chain. It would
  be really sweet to be able to do:

  $('li')
 .hover(function() {
 $(this).addClass('hover');
 }, function() {
 $(this).removeClass('hover');
 })
 .cache('some.name');

  And have the cache() method be aware of all the methods called in the
  current chain.

  -Dan

  -Original Message-
  From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
  Behalf Of tlphipps
  Sent: Thursday, November 01, 2007 9:22 AM
  To: jQuery (English)
  Subject: [jQuery] Re: LiveQuery (Discuss Please)

  I'd like to second this opinion.  I'm using livequery more and more,
  but there are plenty of places where I DON'T use it, so not having it
  in the core would still be my preference.

  On Nov 1, 5:53 am, James Dempster [EMAIL PROTECTED] wrote:

  My less than one pence worth would be I love and use the plugin, but I
  don't think it should be included into jQuery core, I would
  like to see jQuery core stay light and fresh. There's nothing wrong
  with adding LiveQuery yourself, either just add another js file to
  your html or append all the plugins you want to the same js file.

  /James

  On Nov 1, 2:04 am, Yehuda Katz [EMAIL PROTECTED] wrote:

  So as far as I'm concerned, livequery is the biggest advance in jQuery

  since

  its inception (no, I am not its author). I'm trying to understand why

  it's

  having such a slow rate of 

[jQuery] Performing a function if an element is present

2007-11-02 Thread Ezra B. Gildesgame

Hello,

I'm getting started with jQuery and have read several tutorials, but
would appreciate clarification:

How can I create a simple conditional statement to check for the
presence of a certain element on a page, such as an anchor with a
certain class or id, and then perform a function?

I hope that this is an appropriate place to ask this question. If it
is not, I would appreciate any direction as to where might be more
appropriate.

Thank you!

Ezra Gildesgame



[jQuery] Re: Performing a function if an element is present

2007-11-02 Thread Josh Nathanson
Also, keep in mind that in many cases, you do not need to check for the 
existence of something as you might if you were using straight up JS.  If you 
try to run a jQuery method on an empty jQuery object, it will not error.  For 
example:

$(#mydiv).show();

If #mydiv is not found, the jQuery object will be empty, and show() will not 
execute.

-- Josh


  - Original Message - 
  From: Karl Swedberg 
  To: jquery-en@googlegroups.com 
  Sent: Friday, November 02, 2007 11:52 AM
  Subject: [jQuery] Re: Performing a function if an element is present


  Hi Ezra,


  This is the perfect place for such questions. 


  You can test for the existence of an element like this (for example):


  if ( $('#someid').length ) {


   // do your thing ...


  }





  --Karl
  _
  Karl Swedberg
  www.englishrules.com
  www.learningjquery.com






  On Nov 2, 2007, at 1:50 PM, Ezra B. Gildesgame wrote:




Hello,


I'm getting started with jQuery and have read several tutorials, but
would appreciate clarification:


How can I create a simple conditional statement to check for the
presence of a certain element on a page, such as an anchor with a
certain class or id, and then perform a function?


I hope that this is an appropriate place to ask this question. If it
is not, I would appreciate any direction as to where might be more
appropriate.


Thank you!


Ezra Gildesgame





[jQuery] Re: Form Valdation Issues

2007-11-02 Thread Gonzo

Something like this should work:

function checkRadio() {
var checked = false;
$('input.amount').each(function() {
if ($(this).is(':checked')) {
checked = true;
return false;
}
});
return checked;
}

Inside your each function, you are querying for new input elements,
instead of checking the current element.  Also, your checkRadio()
function isn't returning a result.

Two other notes:
1) Your radio buttons should be grouped by name, so you should be able
to use $('input[name=amount]) instead of assigning a class to them.
2) The validation plugin should handle this already just by using
{required: true}


On Nov 1, 11:56 am, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
 Hi There,
 I could use some jquery help here.  This probably something very
 simple that I'm missing.  I started using jquery a few weeks ago so
 please bear with me.

 In a nut shell, when a user submits the form (form id=register), I
 want it check to make sure they have selected a radio button
 (class=amount).  If they forgot, I want it turn the #billing id (h2
 id=billing) red.   I have server side validation working using PHP.
 This is more of a visual indicator. I'm using the validate.js plug-in
 and jquery 1.2.1.  Any help would be great!

 $(document).ready(function() {
 $(#register).submit( function() {
 checkRadio();
 });

 function checkRadio() {
 $('input.amount').each(function() {
 if ($('input:unchecked')) {
 $(#billing).css('color', '#658300').show();
 return true;
 } else {
 $(#billing).css('color', '#C60006').show();
 return false;
 }
 });
 //close function
 };

 });



[jQuery] Re: Advanced Problem - Any takers?

2007-11-02 Thread Karl Swedberg

Hi there,

Instead of this:


var my_var = divHI/div;


try this:

var my_var = $(divHI/div);


Hope that helps.

--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Nov 2, 2007, at 1:53 PM, ja wrote:



I'm dynamically inserting html into a page that only contains an
image. Such as...
html
 body
  img src=http://my_domain.com/my_image.jpg/
 /body
/html

my script has a large amount of html that i want to insert. the html
is stored in a variable . Such as..
var my_var = divHI/div;
(the actual html is much larger and more complicated than my example)

I then have..
$('body').append(my_var);

which you would think would insert the html into the page. it doesn't,
instead it just inserts it as text. The source in Firebug is now...
html
 body
  img src=http://my_domain.com/my_image.jpg/
  DIVdivHI/div
 /body
/html

NOTE: that extra div that's all CAPS, isn't a typo. jquery inserts
that for some reason and I don't know why.
The page doesn't render the divHI/div as html, it displays it as
plain text.
If I use the same code on a page that has some more to it, like
google's homepage, the extra DIV isn't there and my html gets
inserted properly (not as text).

any clues as to why? is this a bug? am I missing some aspect of web
pages when they are only images?
Thanks in advanced for your help.
Josh





[jQuery] Text Flickering/Distorting with Drop Down Menu (Superfish Javascript)

2007-11-02 Thread Keith

The rollovers and drop down items on my menu are causing the text on
my site to distort and move. Not only the text in the menu, but also
text underneath it, which I don't understand at all. Right now I am
using the Superfish menu and the problem mainly occurs in Firefox:
http://www.keithmuth.net/centennial/tests/

Please let me know if there is a fix for this, it is really
distracting and looks terrible. I've been told that it is the way
Firefox handles the alpha channel, but wasn't sure if there is a
solution. Also, if anyone has another horizontal menus like this one,
please let me know. I could do it in CSS but would like to have a nice
slide and/or fade transition like the Superfish menu offers.

Thanks,
Keith



[jQuery] Re: SuperFish Menu Flash

2007-11-02 Thread gracetec

Hi rolfsf,

Thanks for your response.
I have re-checked all the code against a working example and the only
difference appears to be the way in which the flash file is embedded.

It works for this code:

object classid=clsid:D27CDB6E-AE6D-11cf-96B8-44455354
codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab#version=6,0,29,0 width=590 height=173 style=margin:
0px; padding: 0px;
param name=movie value=test.swf
param name=quality value=highparam name=WMode
value=Transparent
embed src=test.swf quality=high wmode=transparent
pluginspage=http://www.macromedia.com/go/getflashplayer;
type=application/x-shockwave-flash width=590 height=173/embed
  /object

But not for:

script type=text/javascript
var so = new SWFObject(slideshow.swf, gallery, 590, 174, 6,
#00);
so.write(flashcontent);
/script

Although I changed the code in the file:

http://rican.ictirl.com/home/flashdetect.js to match it still doesn't
display.
Any more thoughts?



[jQuery] Advanced Problem - Any takers?

2007-11-02 Thread ja

I'm dynamically inserting html into a page that only contains an
image. Such as...
html
 body
  img src=http://my_domain.com/my_image.jpg/
 /body
/html

my script has a large amount of html that i want to insert. the html
is stored in a variable . Such as..
var my_var = divHI/div;
(the actual html is much larger and more complicated than my example)

I then have..
$('body').append(my_var);

which you would think would insert the html into the page. it doesn't,
instead it just inserts it as text. The source in Firebug is now...
html
 body
  img src=http://my_domain.com/my_image.jpg/
  DIVdivHI/div
 /body
/html

NOTE: that extra div that's all CAPS, isn't a typo. jquery inserts
that for some reason and I don't know why.
The page doesn't render the divHI/div as html, it displays it as
plain text.
If I use the same code on a page that has some more to it, like
google's homepage, the extra DIV isn't there and my html gets
inserted properly (not as text).

any clues as to why? is this a bug? am I missing some aspect of web
pages when they are only images?
Thanks in advanced for your help.
Josh



[jQuery] Re: SuperFish Menu Flash

2007-11-02 Thread Anthony Leboeuf(Worcester Wide Web)


Hi, it works because you used the :

param name=WMode
value=Transparent

wmode=transparent


You need this for elements to appear above the flash movie.


-Tony


gracetec wrote:

Hi rolfsf,

Thanks for your response.
I have re-checked all the code against a working example and the only
difference appears to be the way in which the flash file is embedded.

It works for this code:

object classid=clsid:D27CDB6E-AE6D-11cf-96B8-44455354
codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab#version=6,0,29,0 width=590 height=173 style=margin:
0px; padding: 0px;
param name=movie value=test.swf
param name=quality value=highparam name=WMode
value=Transparent
embed src=test.swf quality=high wmode=transparent
pluginspage=http://www.macromedia.com/go/getflashplayer;
type=application/x-shockwave-flash width=590 height=173/embed
  /object

But not for:

script type=text/javascript
var so = new SWFObject(slideshow.swf, gallery, 590, 174, 6,
#00);
so.write(flashcontent);
/script

Although I changed the code in the file:

http://rican.ictirl.com/home/flashdetect.js to match it still doesn't
display.
Any more thoughts?


  




[jQuery] Re: select text for LI

2007-11-02 Thread Jeffrey Kretz

Unfortunately, the text method by default returns the text of the element
and all its children (not just on lists but all types of elements).

This is similar to the IE method innerText.  It's a bit roundabout, but
maybe you could grab the innerHTML and then regex out the child contents.

Regex doesn't handle nested elements very well, but if you remove the LIs
first then the ULs it seems to work.  Here is a sample:

$(document).ready(function()
{
  $('li').each(function(i)
{
  var html = $(this).html();
  var text =
html.replace(/li[\s\S]+?\/li/gi,'').replace(/ul[\s\S]+?\/ul/gi,'');
  alert(text);
});
});

It worked on my test page, but I'm not sure if it will handle multiple
levels of nested lists properly.

If you're sure that your content will never have any brackets in it, you
could you this real greedy regex instead:

  var text = html.replace(/[\s\S]+/gi,'');

JK

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Andy Matthews
Sent: Friday, November 02, 2007 9:52 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: select text for LI


Isn't that invalid HTML? Should it be this instead?

ul
  liindex.html/li
  liabout/li
  ul
liindex.html/li
limore.html/li
  /ul
/ul 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of sawmac
Sent: Friday, November 02, 2007 10:55 AM
To: jQuery (English)
Subject: [jQuery] select text for LI


I'm trying to select text inside list items. I'm using jQuery's .text( )
method. Unfortunately, that returns the text of all children as well. That
means for a nested list like this

ul
  liindex.html/li
  liabout
ul
  liindex.html/li
  limore.html/li
/ul
  /li
/ul

$('li').eq(1).text() returns
'about
   index.html
   more.html'

I just want to retrieve about not the text from the child list items. Any
ideas on how to do that?

thanks





[jQuery] Re: cluetip + rounded corners + arrows

2007-11-02 Thread Karl Swedberg

Hi John

Actually, you can't have arrows with the rounded-corners theme. The  
arrows option just sets the background-position property of div  
id=cluetip so that the background image for whatever image is  
specified in the stylesheet. This conflicts with the position set for  
that div's background image which is used for one of the rounded  
corners.


This problem is no doubt due to a really bad decision on my part. I  
didn't think through enough how people might want to mix and match  
design elements, and as a result I didn't include enough divs as  
hooks for the theming.


I'm going to have to rethink the way all of this is handled. I'm  
sorry for the inconvenience this may have caused.



--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Nov 2, 2007, at 1:27 PM, johnsverre wrote:



Hello!

I finally ended up with cluetip for my needs, but have been sitting
here the whole day trying to figure out how to use arrows and rounded
corners (in need of 4 backgrounds + 1 arrow at the same time). Any
ideas on the approach?

tried to modify the rounded-template, but sides keep disappearing etc

- John Sverre





[jQuery] Re: clueTips hangs on FF with $ signs in the ajax data.

2007-11-02 Thread Karl Swedberg
ah, glad to know that it's working with latest jquery.js. thanks for  
following up!



--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Nov 2, 2007, at 12:18 PM, vwRiver wrote:



Thanks, Karl.

We have  jquery.js running on our server, but it comes from the
designer  and I can not see the version info in the JS file.

I downloaded the latest one and used it for testing. It works just
fine.

--vw





[jQuery] Re: SuperFish Menu Flash

2007-11-02 Thread Olivier Percebois-Garve


You definitely need to include bgiframe, because without you have errors,
and therefore the swfobject code cannot run.

gracetec wrote:

Hi rolfsf,

Thanks for your response.
I have re-checked all the code against a working example and the only
difference appears to be the way in which the flash file is embedded.

It works for this code:

object classid=clsid:D27CDB6E-AE6D-11cf-96B8-44455354
codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/
swflash.cab#version=6,0,29,0 width=590 height=173 style=margin:
0px; padding: 0px;
param name=movie value=test.swf
param name=quality value=highparam name=WMode
value=Transparent
embed src=test.swf quality=high wmode=transparent
pluginspage=http://www.macromedia.com/go/getflashplayer;
type=application/x-shockwave-flash width=590 height=173/embed
  /object

But not for:

script type=text/javascript
var so = new SWFObject(slideshow.swf, gallery, 590, 174, 6,
#00);
so.write(flashcontent);
/script

Although I changed the code in the file:

http://rican.ictirl.com/home/flashdetect.js to match it still doesn't
display.
Any more thoughts?


  




[jQuery] Guess who is using jquery, too?

2007-11-02 Thread dfd

Take a look at the source from http://code.google.com
:-)

Regards, frank



[jQuery] Re: Guess who is using jquery, too?

2007-11-02 Thread Glen Lipka
Hard to read their code.
Seems like really like its browser detection capabilities.  They use that
alot.

Glen

On Nov 2, 2007 2:16 PM, dfd [EMAIL PROTECTED] wrote:


 Take a look at the source from http://code.google.com
 :-)

 Regards, frank




[jQuery] Re: Guess who is using jquery, too?

2007-11-02 Thread Tane Piper

Not only that, but this:

http://google-code-updates.blogspot.com/2007/11/my-how-weve-grown.html

And we're pleased to use jQuery, the wonderful open source JavaScript
library (not ours, we're just fans), to help power each page.

On 02/11/2007, dfd [EMAIL PROTECTED] wrote:

 Take a look at the source from http://code.google.com
 :-)

 Regards, frank




-- 
Tane Piper
Blog - http://digitalspaghetti.me.uk
AJAX Pastebin - http://pastemonkey.org

This email is: [ ] blogable [ x ] ask first [ ] private


[jQuery] Re: Advanced Problem - Any takers?

2007-11-02 Thread ja

Karl,

Thanks for the help, but it didn't seem to work. Any other
suggestions?

Josh

On Nov 2, 1:49 pm, Karl Swedberg [EMAIL PROTECTED] wrote:
 Hi there,

 Instead of this:

  var my_var = divHI/div;

 try this:

 var my_var = $(divHI/div);

 Hope that helps.

 --Karl
 _
 Karl Swedbergwww.englishrules.comwww.learningjquery.com

 On Nov 2, 2007, at 1:53 PM, ja wrote:



  I'm dynamically inserting html into a page that only contains an
  image. Such as...
  html
   body
img src=http://my_domain.com/my_image.jpg/
   /body
  /html

  my script has a large amount of html that i want to insert. the html
  is stored in a variable . Such as..
  var my_var = divHI/div;
  (the actual html is much larger and more complicated than my example)

  I then have..
  $('body').append(my_var);

  which you would think would insert the html into the page. it doesn't,
  instead it just inserts it as text. The source in Firebug is now...
  html
   body
img src=http://my_domain.com/my_image.jpg/
DIVdivHI/div
   /body
  /html

  NOTE: that extra div that's all CAPS, isn't a typo. jquery inserts
  that for some reason and I don't know why.
  The page doesn't render the divHI/div as html, it displays it as
  plain text.
  If I use the same code on a page that has some more to it, like
  google's homepage, the extra DIV isn't there and my html gets
  inserted properly (not as text).

  any clues as to why? is this a bug? am I missing some aspect of web
  pages when they are only images?
  Thanks in advanced for your help.
  Josh



[jQuery] Re: Advanced Problem - Any takers?

2007-11-02 Thread ja

Karl,

I just tried your suggestion, still no luck. Any other ideas?

Josh

On Nov 2, 1:49 pm, Karl Swedberg [EMAIL PROTECTED] wrote:
 Hi there,

 Instead of this:

  var my_var = divHI/div;

 try this:

 var my_var = $(divHI/div);

 Hope that helps.

 --Karl
 _
 Karl Swedbergwww.englishrules.comwww.learningjquery.com

 On Nov 2, 2007, at 1:53 PM, ja wrote:



  I'm dynamically inserting html into a page that only contains an
  image. Such as...
  html
   body
img src=http://my_domain.com/my_image.jpg/
   /body
  /html

  my script has a large amount of html that i want to insert. the html
  is stored in a variable . Such as..
  var my_var = divHI/div;
  (the actual html is much larger and more complicated than my example)

  I then have..
  $('body').append(my_var);

  which you would think would insert the html into the page. it doesn't,
  instead it just inserts it as text. The source in Firebug is now...
  html
   body
img src=http://my_domain.com/my_image.jpg/
DIVdivHI/div
   /body
  /html

  NOTE: that extra div that's all CAPS, isn't a typo. jquery inserts
  that for some reason and I don't know why.
  The page doesn't render the divHI/div as html, it displays it as
  plain text.
  If I use the same code on a page that has some more to it, like
  google's homepage, the extra DIV isn't there and my html gets
  inserted properly (not as text).

  any clues as to why? is this a bug? am I missing some aspect of web
  pages when they are only images?
  Thanks in advanced for your help.
  Josh



[jQuery] Re: Advanced Problem - Any takers?

2007-11-02 Thread Mike Alsup

 Karl,

 Thanks for the help, but it didn't seem to work. Any other
 suggestions?

 Josh


It sure works for me

htmlhead
script type=text/javascript src=jquery-1.2.1.js/script
script type=text/javascript
var my_var = divThis text is appended!/div;

$(function() {
$('body').append(my_var);
});
/script
/head
body
img src=http://jquery.com/images/book-learning.png/
/body
/html


[jQuery] Re: Advanced Problem - Any takers?

2007-11-02 Thread abba bryant


Can you post the html you are trying to append? It sounds like you might have
found a bug but seeing as how I can append fine with the simple samples
given there might be some sort of problem in your appended markup that is
triggering it.


ja-6 wrote:
 
 
 Karl,
 
 Thanks for the help, but it didn't seem to work. Any other
 suggestions?
 
 Josh
 
 On Nov 2, 1:49 pm, Karl Swedberg [EMAIL PROTECTED] wrote:
 Hi there,

 Instead of this:

  var my_var = divHI/div;

 try this:

 var my_var = $(divHI/div);

 Hope that helps.

 --Karl
 _
 Karl Swedbergwww.englishrules.comwww.learningjquery.com

 On Nov 2, 2007, at 1:53 PM, ja wrote:



  I'm dynamically inserting html into a page that only contains an
  image. Such as...
  html
   body
 http://my_domain.com/my_image.jpg 
   /body
  /html

  my script has a large amount of html that i want to insert. the html
  is stored in a variable . Such as..
  var my_var = divHI/div;
  (the actual html is much larger and more complicated than my example)

  I then have..
  $('body').append(my_var);

  which you would think would insert the html into the page. it doesn't,
  instead it just inserts it as text. The source in Firebug is now...
  html
   body
 http://my_domain.com/my_image.jpg 
DIVdivHI/div
   /body
  /html

  NOTE: that extra div that's all CAPS, isn't a typo. jquery inserts
  that for some reason and I don't know why.
  The page doesn't render the divHI/div as html, it displays it as
  plain text.
  If I use the same code on a page that has some more to it, like
  google's homepage, the extra DIV isn't there and my html gets
  inserted properly (not as text).

  any clues as to why? is this a bug? am I missing some aspect of web
  pages when they are only images?
  Thanks in advanced for your help.
  Josh
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Advanced-Problem---Any-takers--tf4739677s27240.html#a13556911
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: How do you do Client/Server interaction? (CakePHP/JSON/jQuery)

2007-11-02 Thread abba bryant


You can do all of this with requestHandler component ( to check if an action
is 'requested' by another view or element, router::parseExtensions ( to
manage automatic template switching for requests mapped with a .js file
extension ); view::requestAction ( to actually request the json ) and the
javascript helper ( check out the inline parameter on the $javascript-link
function and the json encoding and json decoding function also )

I generally set up the router to handle .xml and .js requests. To use much
of ext you need to return json a lot. I then map the js layouts and /js view
subfolders to certain actions. In those actions I use requestAction to grab
the data I want from whatever controller - there is an excellent bakery
article by gwoo on reusable elements. read that if you havent. -
http://bakery.cakephp.org/articles/view/creating-reusable-elements-with-requestaction
- You can request the action complete with its mapped extension following
any parameters you might have even. IE /users/profile/1.js

If I need the js for certain objects ALL THE TIME I set an element up that
uses requestAction if no data is passed to it or my passed data instead to
request the JSON I need. I might even be inclined to put these reusable
parameterized json elements in their own
elements/json/controller_name/action_name folders.

Using the $plugin variable in the various cache functions ( this is usually
blank - resulting in double underscore cache filenames ) you can even cache
the results of each requestAction with more granularity ( a few more bakery
reads -
http://bakery.cakephp.org/articles/view/optimizing-your-cakephp-elements-and-views-with-caching
- and -
http://bakery.cakephp.org/articles/view/cache-elements-individually-for-each-user
)

There is a ton you can do with requestAction and the router alone. Let me
know if you have questions or need samples on implementation.



[EMAIL PROTECTED] wrote:
 
 
 Hey Tane - check out cake's JavascriptHelper::object()
 
 On Nov 1, 6:00 pm, Tane Piper [EMAIL PROTECTED]
 wrote:
 Well, what would you know!  Having written out what I wanted to get,
 and by simply applying a little brainpower, I came up with the
 solution.  What I did was write a CakePHP component and helper.  First
 off, here is the component:

 ?php
 class JsonComponent extends Component {
 var $json_for_layout = array();
 function addToJSON($add = array()){
 $this-json_for_layout =
 array_merge($this-json_for_layout, $add);
 }
 function getJSON() {
 return $this-json_for_layout;
 }}

 ?

 What this component does is allows me to pass in arrays to a global
 array in the controller, json_for_layout.  Every time I call this from
 a controller, it add's to the array.  The next step is in my
 beforeRender() function in my AppController, I do this:

 $this-set('json_for_layout', $this-Json-getJSON());

 This sets my view variable.  I then need to actually generate the JSON
 and output it to a var:

 ?php
 class JsonHelper extends JavascriptHelper {
 function renderJSON($data, $varname = 'Pastemonkey'){
 $json = json_encode($data);
 $output = $this-codeBlock('var ' . $varname . ' = ' .
 $json . ';');
 return $output;
 }}

 ?

 Now, what I do is inside my header, I echo this out to the view:

 ?php e($json-renderJSON($json_for_layout));?

 And thats it!  Check your DOM tab in firebug to see the global object
 now available.

 For example, if I pass in my sitename, I can simply call it with:

 Pastemonkey.sitename

 Hope this helps out a few people, and I intend to write a more
 thorough blog about it tomorrow.

 On 01/11/2007, Tane Piper [EMAIL PROTECTED] wrote:



  Apologies for the cross posting here, but I myself am at a bit of a
  crossroads in my applications development, and I'd like to take the
  time to put out this email in the hopes that it generates some good
  discussion, and can maybe teach me a few things.

  A little background first to my issues.  I am developing my
  application at the moment (pastemonkey.org) and it's being built on
  CakePHP and jQuery.  At the moment, I'm using a lot of CakePHP's built
  in stuff to generate my HTML, and I'm using jQuery to do some simple
  Ajax stuff and some DOM manipulation.

  Where I am at a crossroads is how to do my client/server interaction
  with JSON.  For example, I have the facility in place for inline
  comments.  When you see a paste, you can double click on each line to
  create and view the comments.  When you create one, there is code that
  generates the comment and enters the line number and paste ID.

  To display this, what I do is create an array of the line numbers, and
  generate JSON using PHP's inbuilt functions.  So an array like this
  ('1', '2', '10', '15') becomes [1, 2, 10, 15].  What I then do
  is pass this to the view, and do this:

  ?php e($javascript-codeBlock('var lines = eval(' . 

[jQuery] Re: Advanced Problem - Any takers?

2007-11-02 Thread Karl Swedberg

On Nov 2, 2007, at 5:42 PM, Mike Alsup wrote:



Karl,

Thanks for the help, but it didn't seem to work. Any other
suggestions?

Josh



It sure works for me

htmlhead
script type=text/javascript src=jquery-1.2.1.js/script
script type=text/javascript
var my_var = divThis text is appended!/div;

$(function() {
$('body').append(my_var);
});
/script
/head
body
img src=http://jquery.com/images/book-learning.png/
/body
/html


Hey Mike,

That's a dandy image you put in there. ;-)


--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com







[jQuery] Re: Advanced Problem - Any takers?

2007-11-02 Thread Mike Alsup

 Hey Mike,

 That's a dandy image you put in there. ;-)


Just seeing if you were paying attention, Karl!


[jQuery] Re: Advanced Problem - Any takers?

2007-11-02 Thread arpowers


from your example it looks like it is adding it .. as HTML to the page... 
I assume by 'text' you mean escaped... but your example shows it as not
being escaped..

the mystery DIV element is new to me and I'm sure is causing the problem.

My guess is that its a problem with the HTML in your variable... are your
quotes escaped?





ja-6 wrote:
 
 
 I'm dynamically inserting html into a page that only contains an
 image. Such as...
 html
  body
http://my_domain.com/my_image.jpg 
  /body
 /html
 
 my script has a large amount of html that i want to insert. the html
 is stored in a variable . Such as..
 var my_var = divHI/div;
 (the actual html is much larger and more complicated than my example)
 
 I then have..
 $('body').append(my_var);
 
 which you would think would insert the html into the page. it doesn't,
 instead it just inserts it as text. The source in Firebug is now...
 html
  body
http://my_domain.com/my_image.jpg 
   DIVdivHI/div
  /body
 /html
 
 NOTE: that extra div that's all CAPS, isn't a typo. jquery inserts
 that for some reason and I don't know why.
 The page doesn't render the divHI/div as html, it displays it as
 plain text.
 If I use the same code on a page that has some more to it, like
 google's homepage, the extra DIV isn't there and my html gets
 inserted properly (not as text).
 
 any clues as to why? is this a bug? am I missing some aspect of web
 pages when they are only images?
 Thanks in advanced for your help.
 Josh
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Advanced-Problem---Any-takers--tf4739677s27240.html#a13556844
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Cluetip takes elements title away

2007-11-02 Thread paazio

It seems that when trickering cluetip plugin:
$('p.latest a').cluetip({width:'400px'});

It empties the given elements title value.
This becomes a problem as I have thickbox also attached to the element
and clicking on it makes the title, thus caption of the thickbox
window undefined.

I have it in use here:
http://paazio.nanbudo.fi/martial-arts/nanbudo
The first icon from the left on the video link.

Perhaps the cluetip could be changed to copy the title instead of
cutting?

Paazio



[jQuery] Best Practice

2007-11-02 Thread Doug

Hello All, I am a newbie and am trying to learn jQuery. I created this
function:

function getRecord(id,URL){
jQuery(#ResultsTable
tr).filter(.selected).removeClass(selected);
jQuery(#+id).addClass(selected);
.

It goes on to return a record.

The first line above removes a highlighted (selected) rows in a table.
The next line highlights the currently selected row. This works but am
worried that it is not the best coding by using #ResultsTable tr and
that this type of naming become illegal in a future version of jQuery.

Any suggestions? Or is there a cleaner way to bind a selected row from
a master table to  detail record(s).



[jQuery] Re: Superfish, bgiframe, jQuery 1.2 issues...

2007-11-02 Thread rynoceris

Hey Joel,

Thank you so much!  I can't believe I forgot something that simple.
After putting that in, the menu now works perfectly across all browser
platforms.  Again, thank you so much for your help!

Ryan Ours



[jQuery] Re: select text for LI

2007-11-02 Thread Wizzud

_IF_ you only have text in your LIs then...

$('li').each(function(){
  alert($(this).html().match(/^([^]*)/)[0]);
});


On Nov 2, 5:35 pm, Jonathan Sharp [EMAIL PROTECTED] wrote:
 I'm sure there's a more elegant solution but you could do something like:

 // Untested
 var about = $( 'selector for the li' ).clone().find('
 ul').remove().end().html();

 Cheers,
 -Jonathan

 On 11/2/07, sawmac [EMAIL PROTECTED] wrote:



  I'm trying to select text inside list items. I'm using
  jQuery's .text( ) method. Unfortunately, that returns the text of all
  children as well. That means for a nested list like this

  ul
  liindex.html/li
  liabout
 ul
   liindex.html/li
   limore.html/li
 /ul
  /li
  /ul

  $('li').eq(1).text() returns
  'about
index.html
more.html'

  I just want to retrieve about not the text from the child list
  items. Any ideas on how to do that?

  thanks



[jQuery] Re: fadeOut behaving funny

2007-11-02 Thread Wizzud

Set the fadeOut duration to 3 seconds (.fadeOut(3000);). Does the same
thing still happen?

On Nov 2, 2:28 pm, stef [EMAIL PROTECTED] wrote:
 i have a page where a form is submitted to the same page, using php
 (no ajax). if the query that writes the data to the db is successful
 it sets $marker = 1;

 in the head of my page i then i have the code below, which tries to
 achieve the yellow fade technique: a message appears to indicate
 success and then slowly fades out. problem is that with the code
 below, it appears for just a split second and then abruptly
 disappears. could anyone tell me why and how to get this to work?

 ? if ($marker == 1) { ?
 script type=text/javascript
  $(document).ready(function(){
  $(#nav).after(span class='yellowFade'Homepage updated!/
 span);
  $(span.yellowFade).fadeOut(slow);
  });
 /script
 ? } ?



[jQuery] Re: Selector for Toggled Element

2007-11-02 Thread Wizzud

If you can't select it using an id ( $('#tableID') ) then there is
something invalid in your HTML (duplicate ids?).
If the table has a class and you can't find it using a class selector
then there is something else fundamentally wrong.

Can you give a bit more information? Like the table HTML, and maybe
the toggling code?
And I assume your IF statement is (will be) a simple if ( table is
hidden ) then { do something } else { do alternative }?

On Nov 2, 12:51 pm, studiobl [EMAIL PROTECTED] wrote:
 Neither that (nor some form of that) seems to work.

 On Nov 1, 3:43 pm, motob [EMAIL PROTECTED] wrote:

  try $(table:hidden) or some form of that.

  On Nov 1, 2:30 pm, studiobl [EMAIL PROTECTED] wrote:
   Any suggestions on how to retrieve the display attribute of a toggled
   element?



[jQuery] Re: Custom function called in toogle()

2007-11-02 Thread Wizzud

function myToggle(toggleElem, showHideElem){
  var showHide = $(showHideElem);
  $(toggleElem).toggle(
function(){ showHide.show('slow'); },
function(){ showHide.hide('slow'); } )
.each(function(){ this.checked = !this.checked; });
}

On Nov 2, 12:21 pm, Snook [EMAIL PROTECTED] wrote:
  Calling toggle() runs event.preventDefault.
  Whatever you want the click to do, you need to code it yourself.

 Ok, thanks.
 I have tried different implementation of preventDefault, regarding
 what I have found in this group. And probably I'm completely wrong
 because no one works for me.

 Here is what I have tried:

 function myToggleShow(toggleElem, showHideElem){
   var showHide = $(showHideElem);
   $(toggleElem).toggle(
 function(e){
 e.eventDefault();
 showHide.show('slow');
 },
 function(){ showHide.hide('slow'); }

   );

 }

 myToggleShow('#regime_lstd_c', '#regime_lstd');

 Did I need an other plugin or library ?



[jQuery] NEWS: Google Code Using jQuery

2007-11-02 Thread Rey Bango


While it was mentioned earlier, I found blog posts from Dion Almaer and 
DeWitt Clinton, both Google employees.


Dion:
http://almaer.com/blog/google-code-relaunches-new-redesign-using-jquery-great-video-content-and-more

DeWitt:
http://google-code-updates.blogspot.com/2007/11/my-how-weve-grown.html

jQuery Blog:
http://jquery.com/blog/

Rey...


[jQuery] Re: Cluetip takes elements title away

2007-11-02 Thread Wizzud

If it did not remove the title, the browser would show its own native
prompt as well as cluetip showing its version.

On Nov 2, 10:21 pm, paazio [EMAIL PROTECTED] wrote:
 It seems that when trickering cluetip plugin:
 $('p.latest a').cluetip({width:'400px'});

 It empties the given elements title value.
 This becomes a problem as I have thickbox also attached to the element
 and clicking on it makes the title, thus caption of the thickbox
 window undefined.

 I have it in use here:http://paazio.nanbudo.fi/martial-arts/nanbudo
 The first icon from the left on the video link.

 Perhaps the cluetip could be changed to copy the title instead of
 cutting?

 Paazio



[jQuery] Re: NEWS: Google Code Using jQuery

2007-11-02 Thread Benjamin Sterling
All I can say is... Wow.

This is a big deal, IMO.

On 11/2/07, Rey Bango [EMAIL PROTECTED] wrote:


 While it was mentioned earlier, I found blog posts from Dion Almaer and
 DeWitt Clinton, both Google employees.

 Dion:

 http://almaer.com/blog/google-code-relaunches-new-redesign-using-jquery-great-video-content-and-more

 DeWitt:
 http://google-code-updates.blogspot.com/2007/11/my-how-weve-grown.html

 jQuery Blog:
 http://jquery.com/blog/

 Rey...




-- 
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com
http://www.benjaminsterling.com


[jQuery] AjaxCFC and blockUI - event binding issue

2007-11-02 Thread Jack Killpatrick


Hi All,

I'm using AjaxCFC, which (at the time I pulled it down) came with 
jquery.block.js version:


/*
* jQuery blockUI plugin (by M. Alsup)
* Version 0.4 (12/27/2006)
* @requires jQuery v1.0
* @license: Free beer and free speech. Enjoy!
*/

The AjaxCFC code I have is used in a lot of places in my app, as is 
blockUI, but I've always had an issue where if I try to rebind event 
handlers to objects that are blocked using inline blocking (blocking on 
a div instead of the full page), the binding doesn't work: the events 
just simply don't get bound. The same events bind fine when the div is 
not being blocked. I've tried FF 2.0 and IE7.


Is/was this a known issue and does anyone know a workaround? If a newer 
version of blockUI is needed, is there any reason why it might conflict 
with AjaxCFC (kinda doubt it, but not sure)?


Thanks,
Jack




[jQuery] Re: Text Flickering/Distorting with Drop Down Menu (Superfish Javascript)

2007-11-02 Thread Joel Birch

It seems that you have found the workaround for this Mac Firefox issue
already, ie. setting opacity:.999 on the body element to force all the
text permanently into the lighter anti-aliasing mode. Good stuff.

Joel Birch.


[jQuery] Re: SuperFish Menu Flash

2007-11-02 Thread Joel Birch

On 03/11/2007, Olivier Percebois-Garve [EMAIL PROTECTED] wrote:
 You definitely need to include bgiframe, because without you have errors,
 and therefore the swfobject code cannot run.

...or remove the code that applies bgiframe to Superfish completely,
and don't include the bgiframe plugin. It seems that you may not be
needing it in this case.

To sum up: do add the swfObject code necessary to trigger wmode
transparent (see the swfObject docs to find out how), and also make
sure you are adding z-index to all the elements involved. Often you
need to add z-index to parent elements also - especially to avoid IE6
z-index bugs. Of course, everything you set z-index on also needs to
be positioned - position:relative is often the easiest way to ensure
that.

Joel Birch.


[jQuery] Re: NEWS: Google Code Using jQuery

2007-11-02 Thread Sean Catchpole

yay \o/

~Sean


[jQuery] Re: Best Practice

2007-11-02 Thread Sean Catchpole

I think you got the jist of it. Syntax looks just fine. The filter
isn't necessary, but I doubt it will be depreciated in future
releases.
   function getRecord(id,URL){
   jQuery(#ResultsTable tr .selected).removeClass(selected);
   jQuery(#+id).addClass(selected);
...

~Sean

On 11/2/07, Doug [EMAIL PROTECTED] wrote:

 Hello All, I am a newbie and am trying to learn jQuery. I created this
 function:

 function getRecord(id,URL){
 jQuery(#ResultsTable
 tr).filter(.selected).removeClass(selected);
 jQuery(#+id).addClass(selected);
 .

 It goes on to return a record.

 The first line above removes a highlighted (selected) rows in a table.
 The next line highlights the currently selected row. This works but am
 worried that it is not the best coding by using #ResultsTable tr and
 that this type of naming become illegal in a future version of jQuery.

 Any suggestions? Or is there a cleaner way to bind a selected row from
 a master table to  detail record(s).




[jQuery] Re: Best Practice

2007-11-02 Thread Joel Birch

On 03/11/2007, Sean Catchpole [EMAIL PROTECTED] wrote:
function getRecord(id,URL){
jQuery(#ResultsTable tr .selected).removeClass(selected);
jQuery(#+id).addClass(selected);
 ...
 ~Sean

I think Sean meant jQuery(#ResultsTable tr.selected)... ...without a
space between tr and .selected as you want the tr that has the class
selected, not .selected descendants of any tr within
#ResultsTable.

Joel Birch.