[jQuery] Re: Making internet explorer behave with jquery

2007-07-10 Thread Klaus Hartl


Luke wrote:

Basically what I'm trying to do is apply a .text and a .textFocus to
certain elements. for example: input and input:focus, respectively. So
what I've done is this:

I am not concerned with the focus portion at this point... only with
applying the correct class to the correct elements. For some reason ie
just won't comply.
Javascript:
$(function(){

$('[EMAIL PROTECTED]text]').addClass('textinput');

});


and the css

CSS:
form input[type=text],

form input[type=password],

form textarea,

form .textinput {

border: 1px solid #666;

padding: 2px;

}


For some reason this does not work. The class .textinput is not being
applied to the element in this case. I know that jquery is selecting
the correct elements (from testing it). I also tried this, and it
works, but I don't want to have to define my textinput classes twice,
that would be totally lame. Sad

CSS:
form input[type=text],

form input[type=password],

form textarea {

border: 1px solid #666;

padding: 2px;

}

form .textinput {

border: 1px solid #666;

padding: 2px;

}


Does anybody know why this might be happening?



IE 6 does not understand the attribute selectors and therefore skips the 
whole rule. So you cannot group them together and need to define the 
rules twice like in your second example.



--Klaus


[jQuery] making ajax calls in jqmodal window. Possible?

2007-07-10 Thread Jack Killpatrick


Hi All,

Anyone know if it's possible to make ajax calls from inside a jqModal 
popup window that was loaded via ajax? I have code like this:


   $(document).ready( function() {
   $('#userSwitcher').hide();
  
   $('#userSwitcher').jqm({

   trigger:'a.jqmTrigger',
   ajax:'/pos2/purchase/quick_change.cfm',
   target:$('#users'),
   modal:true,
   onShow:function(h){
   h.w.show();
   }
   });
   });

a id=aUserSwitcher href=## class=jqmTriggerSwitch/a

div id=userSwitcher class=jqmWindow style=width:600px;height:500px
   div id=users/div
/div

and have included jqModal.js and jqModal.css in the calling page, then 
in the quick_change.cfm file I'm doing additional ajax calls:


   var url = something.html
   $.get( url, function(template){
   etc

but that $.get() never fires AND the userSwitcher div loads up real 
quick, then the whole page goes white and goes nowhere: it just spins.


Bug? Is this possible via jqModal? I'm pretty sure I had something like 
this working with the thickbox plugin a few months ago, but the 
jquery.com site was down earlier tonight when I went fishing for the 
latest code to try to use, so I tried using jqModal.


TIA,
Jack







[jQuery] Re: Syntactic sugar for checking whether an element exists

2007-07-10 Thread Fil


jQuery is a language and as such requires you to read at least a bit
of documentation or examples before starting. Maybe .is() and .length
should be more prominently visible in the doc, but I see no point in
adding the .exists() and .hasClass() cruft to the (beautiful) jQuery
code.

-- Fil


[jQuery] Re: Scroller ticker...

2007-07-10 Thread Sam Collett

Not quite the same as it fades in rather than scrolls. Sliding could
be done if you replace fadeOut with slideUp and fadeIn with slideDown

Example:
http://www.texotela.co.uk/code/jquery/newsticker/slide/

On Jul 9, 5:21 pm, Sean Catchpole [EMAIL PROTECTED] wrote:
 I like newsticker: http://www.texotela.co.uk/code/jquery/newsticker/

 ~Sean



[jQuery] [Firefox Bug] Text flicker

2007-07-10 Thread Rob

I'm getting an animation bug where all text on the page flickers
slightly during a fade() animation. I can't seem to find the specific
reason this appears but I'll keep trying. Any ideas or am I beating a
dead horse?

Btw I'm using Firefox v2.0.0.4 on OS X.



[jQuery] Re: Getting the next span

2007-07-10 Thread jmbJq

Thanks Sean, I ended up using the second one as a basis.  Here's what
I ended up with:

$(~ span:first, this);

This gives me the single next span, just like I wanted.



On Jul 9, 9:12 pm, Sean Catchpole [EMAIL PROTECTED] wrote:
  $('#span1').bind('click', function() { return $(this).next(span); });
 or
 $('#span1').bind('click', function() { return $(~ span,this); });

 ~Sean



[jQuery] Re: Syntactic sugar for checking whether an element exists

2007-07-10 Thread Felix Geisendörfer

 But I don't think we disagree at all. I wasn't talking about .get() with no
 arguments, but rather .get(n) and .size(), which are just slower synonyms
 for [n] and .length.
Yeah I agree with you on that. I just read: 'we should get rid of the 
get() function' and freaked : p

-- Felix
--
My Blog: http://www.thinkingphp.org
My Business: http://www.fg-webdesign.de


Michael Geary wrote:
 There's no reason at all to stick with .get(n) and .size()
 now that the array-like jQuery object allows the 
 simpler and more efficient [n] and .length.
   

   
 I disagree. Whenever you need to sort the elements in an
 ul or something then you'll have to use the Array.sort() 
 function, so you need to do $('ul li').get().sort(...). Here 
 is an example of where I needed this functionality: 
 http://bin.cakephp.org/view/1632218532

 It's not a big deal that I have to call get(), but it would 
 be a big problem if it wasn't there!
 

 That's a good point about .get() with no arguments - it gives you a genuine
 Array object which can be quite useful.

 But I don't think we disagree at all. I wasn't talking about .get() with no
 arguments, but rather .get(n) and .size(), which are just slower synonyms
 for [n] and .length.

 -Mike


   


[jQuery] Re: Syntactic sugar for checking whether an element exists

2007-07-10 Thread Felix Geisendörfer

   if ($('#someID')) {
 // something matched the selector
   }
See, and there you go making a wrong assumption that beginners are much 
more likely to run into. !![] is evaluating to true and so is a jQuery 
object that has not matched any items. I'm not blaming you for it, it's 
counter-intuitive (if you don't know objects always evaluate to true) 
but that's how JS works.  So an exists() function could could probably 
help people avoiding this mistake.

(Your other example where using [0] is a workable solution however)

-- Felix
--
My Blog: http://www.thinkingphp.org
My Business: http://www.fg-webdesign.de


RobG wrote:
 On Jul 10, 4:50 am, Sean Catchpole [EMAIL PROTECTED] wrote:
   
 I believe that learning jquery returns an array like object is more
 useful than creating a .exists() function.
 

 It seems to me that the most common reason for testing if an element
 exists is to use it later, so why not:

   var element;
   if ( (element=$('#someID')[0]) ) {
 /* element exists */
   } else {
 /* damn... */
   }

 Another idea is that if the seletor doesn't select any elements,
 return null (as does getElementById() in that case):

   if ($('#someID')) {
 // something matched the selector
   }

 but that may not be backward compatible.  Of what use is an empty
 jQuery object?


 --
 Rob


   


[jQuery] Return attribute content from XPath match //[EMAIL PROTECTED]'banner']/@alt

2007-07-10 Thread [EMAIL PROTECTED]

with something like..
img id=banner alt=This is a banner /

//[EMAIL PROTECTED]'banner']/@alt would return This is a banner. Doing it this
way does not work, but is valid in XPather 
https://addons.mozilla.org/en-US/firefox/addon/1192
Is there another way to do this in JQuery (I am currently just looping
the return and extracting the attribute if set)?



[jQuery] Re: Syntactic sugar for checking whether an element exists

2007-07-10 Thread Felix Geisendörfer
 In fact, if you find yourself doing a lot of if(something exists) {
 ... } else { ...}, you might want to consider trying to move some of
 your code into a plugin.
The target audience for an exists() function would be new comers to 
jQuery. Those are generally a little scared about writing their own 
'plugin' even so there isn't much to be scared about I think and I'm 
just making this assumption here ; ).

Anyway, there are situations where plugins are not enough. For example 
if you have to modify other elements in case a certain screen element 
exists then a plugin won't really help you a lot unless it's very 
app-specifc.

-- Felix
--
My Blog: http://www.thinkingphp.org
My Business: http://www.fg-webdesign.de


Erik Beeson wrote:

 In fact, if you find yourself doing a lot of if(something exists) {
 ... } else { ...}, you might want to consider trying to move some of
 your code into a plugin. Most jQuery functions/plugins already deal
 with the if(exists)... part by simply not executing if nothing is
 selected. If you really want the 'else' part, you could imagine a
 simple plugin, something like (untested):

 $.fn.ifEmpty = function(f) {
  if(this.length == 0) f.apply(this);
  return this;
 }

 And use it like this:

 $('#foo').show().ifEmpty(function() {
  alert(foo doesn't exist);
 });

 Which would show the element with ID foo, or show an alert if the
 element doesn't exist. Equivalent to:

 var $foo = $('#foo');
 if($foo.length  0) {
  $foo.show();
 } else {
  alert(foo doesn't exist);
 }

 Just an idea.

 --Erik


 On 7/9/07, Erik Beeson [EMAIL PROTECTED] wrote:
  Another idea is that if the seletor doesn't select any elements,
  return null (as does getElementById() in that case):
  ...
  but that may not be backward compatible.  Of what use is an empty
  jQuery object?

 An empty jQuery object doesn't break chainability:

 $('#foo').hide();

 Will hide the element with ID foo if it exists. Otherwise, it does
 nothing. If null were returned, that would generate a javascript
 error, so you would have to always check for the existence of the
 element if you wanted to be sure you didn't generate an error.

 This is one of the sweetest features of jQuery.

 --Erik




[jQuery] flash of unstyled content...Safari...hide() problems

2007-07-10 Thread hughesfleming

I have been going through the tutorials and following many of the
examples here to try and get an introduction to jquery,
I have added the following code to my site but I am running into
problems with Safari.

script type=text/javascript
 $(document).ready(function() {
$(dd:not(:first)).css ('display', 'none');
$(dt a).click(function(){
$(dd:visible).slideUp(fast);
$(this).parent().next().slideDown(slow);  
return false;
});
});
/script


 script type=text/Javascript
 $(document).ready(function() {
  $('.fulltext').css ('display', 'none');
  $('h3').click(function() {
 $(.fulltext).css('display','none');
 $(this).parent().next().fadeIn(500);
 return false;
 });
 });
/script

Essentially the first hide() or in this case css('display',none) is
causing the the 'fouc' in Safari and I can't figure out how to get
around it other than to look for another solution. Unfortunately
sometimes everything just works but it never lasts.

my site is http://italartnet.com and jquery (latest version) is active
on the index and artists section. Any suggestions on a workaround
would be most welcome.

Kind regards,

Alex Fleming



[jQuery] Re: Return attribute content from XPath match //[EMAIL PROTECTED]'banner']/@alt

2007-07-10 Thread Klaus Hartl


[EMAIL PROTECTED] wrote:

with something like..
img id=banner alt=This is a banner /

//[EMAIL PROTECTED]'banner']/@alt would return This is a banner. Doing it this
way does not work, but is valid in XPather 
https://addons.mozilla.org/en-US/firefox/addon/1192
Is there another way to do this in JQuery (I am currently just looping
the return and extracting the attribute if set)?


jQuery supports (some) XPath for selecting things, but not the whole 
Spec. Try:


var alt = $('#banner').attr('alt');

Looping is pointless because an id is supposed to be unique in a 
document. Also I think the CSS selector syntax should be faster then 
your generic approach.




--Klaus



[jQuery] Re: validation pluging work in FireFox but Not in Internet Explorer

2007-07-10 Thread WebolizeR

any suggestion about this,please

On Jul 9, 10:56 am, WebolizeR [EMAIL PROTECTED] wrote:
 Hi;

 I've used the jQuery's official validation plugin (http://
 bassistance.de/jquery-plugins/jquery-plugin-validation/), your can see
 the page in here (http://nexus.di-tasarim.com/index.php?
 option=com_nexusact=coursestask=viewAppid=1)

 The main difference between the orginal code and mine is,I used a
 table based layout for form only, it is not cause any error in FireFox
 but in Internet Explorer is fails.

 And also I put the same tableless code from orginal examples, it also
 fails in Internet Explorer.

 What's problem, please help...

 tHanks...



[jQuery] Re: Text flicker

2007-07-10 Thread tlob

url?

On 10 Jul., 05:47, Rob [EMAIL PROTECTED] wrote:
 I'm getting an animation bug where all text on the page flickers
 slightly during a fade() animation. I can't seem to find the specific
 reason this appears but I'll keep trying. Any ideas or am I beating a
 dead horse?

 Btw I'm using Firefox v2.0.0.4 on OS X.



[jQuery] Thickbox Reloaded

2007-07-10 Thread Txt.Vaska


Bonjour:

I haven't seen any talk about Thickbox Reloaded since mid-May. And I  
noticed that Thickbox 3 is out now. Is Thickbox Reloaded still  
happening?


The alpha files I got my hands on didn't work in  
Safari...but...yeah...it's an Alpha.


Any word, hint, suggestion...when the beta might happen for it?

;)


[jQuery] .trigger(click) // don't work? [newbie]

2007-07-10 Thread GianCarlo Mingati

HI,
i have these line on document.ready and using jquery-1.1.3.pack.js
(no, not 1.1.3.1):

$(function(){
$('#chiamacap').trigger('click');


$(a#chiamacap).bind(click, 
function(){
alert(hi);
});
});


The book says that you can simulate a click by using the trigger()
method.
If i click the #chiamacap link it runs an alert. wow ;-)
But by applying trigger() to $('#chiamacap') on load does not work.
What am i doing wrong?
GC



[jQuery] Re: Syntactic sugar for checking whether an element exists

2007-07-10 Thread Felix Geisendörfer
 jQuery is a language
It was a library last time I checked ; ).
 and as such requires you to read at least a bit
 of documentation or examples before starting.
Why? For me the sweetest thing about using jQuery has been it's 
intuitiveness right out of the box. When I started I just looked at some 
initial code samples (fancy API pages weren't around back then or I 
didn't know about them) and then was virtually able to 'guess' the 
jQuery functions I needed. Need to add a class? Hmm let me try 
addClass() - works, yeah! Now I want to remove an element from the DOM - 
oh remove() it is! So now I just need to check whether this element 
exists. Hm - exists() produces a fatal error. Let me search the docs:

* 
http://docs.jquery.com/Special:Search?search=element+existsfulltext=Search
  
http://docs.jquery.com/Special:Search?search=element+existsfulltext=Search
* 
http://www.google.com/search?q=site%3Adocs.jquery.com%20element%20existshl=en
  
http://www.google.com/search?q=site%3Adocs.jquery.com%20element%20existshl=en

At this point I would need to actually post to the group or read the 
complete API docs in detail to find that is() is the answer to the 
problem. Same goes for hasClass() I think.
 Maybe .is() and .length
 should be more prominently visible in the doc, but I see no point in
 adding the .exists() and .hasClass() cruft to the (beautiful) jQuery
 code. 
I think is() is beautiful as well and there is nothing wrong with 
.length. However both pose a certain barrier for something new-comers 
will possibly try to do quite often.

-- Felix
--
My Blog: http://www.thinkingphp.org
My Business: http://www.fg-webdesign.de


Fil wrote:

 jQuery is a language and as such requires you to read at least a bit
 of documentation or examples before starting. Maybe .is() and .length
 should be more prominently visible in the doc, but I see no point in
 adding the .exists() and .hasClass() cruft to the (beautiful) jQuery
 code.

 -- Fil



[jQuery] Re: flash of unstyled content...Safari...hide() problems

2007-07-10 Thread hughesfleming

I seem to have fixed the problem. Perhaps it is too early to tell but
things are much better.

Alex Fleming



[jQuery] Re: Syntactic sugar for checking whether an element exists

2007-07-10 Thread Felix Geisendörfer
 What about

 Array.prototype.sort.apply( $('li') );

 Not sue if that'll work... 
I think that could work, but it's breaking chainability so I think the 
array plugin mentioned by Jörn earlier is a better alternative. However 
since I all I need is sort(), I actually am fine with using get() that 
one time.

-- Felix
--
My Blog: http://www.thinkingphp.org
My Business: http://www.fg-webdesign.de


Klaus Hartl wrote:

 Felix Geisendörfer wrote:
 Felix, not to worry, there's nothing wrong at all with using .length 
 - and it is obviously faster than a function call.
 I figured that by now. I think Matt was much better at explaining why 
 I think an alternative exists() function is useful - it simply is the 
 most intuitive thing a new jQuery user looks for. I also agree with 
 his hasClass argument. I love the is() function, but I would have 
 taken me a long time to find it if I my question was phrased Who can 
 I determine if an element has a certain class.is() is more powerful 
 but not nearly as intuitive as hasClass would be for new users.
 In the earliest versions of jQuery, the jQuery object was not an 
 array, but had a private array object that you accessed using 
 .get(n) and .size(). The only reason those functions still exist is 
 for compatibility with old code.
  
 There's no reason at all to stick with .get(n) and .size() now that 
 the array-like jQuery object allows the simpler and more efficient 
 [n] and .length.
 I disagree. Whenever you need to sort the elements in an ul or 
 something then you'll have to use the Array.sort() function, so you 
 need to do $('ul li').get().sort(...). Here is an example of where I 
 needed this functionality: http://bin.cakephp.org/view/1632218532

 It's not a big deal that I have to call get(), but it would be a big 
 problem if it wasn't there!


 What about

 Array.prototype.sort.apply( $('li') );

 Not sue if that'll work...


 --Klaus



[jQuery] append reformting the content i send it

2007-07-10 Thread Terry B

wtf?  I have specific html i want added to a div so I use append to
add it.  fine it works but it is formatting the code and making it
unusable.  how do i prevent append from doing this?



[jQuery] Re: Syntactic sugar for checking whether an element exists

2007-07-10 Thread Fil



jQuery is a language

It was a library last time I checked ; ).


yeah, well, it can be many things to many people; we all agree it's
code. I think it's art, too


Why? For me the sweetest thing about using jQuery has been it's intuitiveness 
right out of the box.


ok, so next time i want to code something in jquery i'll just write
$(make coffee) ?

No, there are things that are intuitive **once you've understood the
basics**. IOW intuitiveness is based on your assumptions and your
knowledge. Why would you assume that .hasClass() exists? And not,
e.g., isMemberOf() or .classMatches() ? It must depend of what you're
already familiar with before you switch to jQuery.

For me (and I really mean not speaking for everyone) it's more
intuitive if there is an internal logic that I can understand; adding
stuff that is redundant is merely adding cruft, and hence
counter-intuitive.

That's why I wanted to add my I don't agree message -- though I
understand and respect your position, I don't share it.

-- Fil


[jQuery] Re: .trigger(click) // don't work? [newbie]

2007-07-10 Thread Dan G. Switzer, II

HI,
i have these line on document.ready and using jquery-1.1.3.pack.js
(no, not 1.1.3.1):

$(function(){
   $('#chiamacap').trigger('click');



$(a#chiamacap).bind(click,
function(){
   alert(hi);
   });
});


The book says that you can simulate a click by using the trigger()
method.
If i click the #chiamacap link it runs an alert. wow ;-)
But by applying trigger() to $('#chiamacap') on load does not work.
What am i doing wrong?

You're triggering the click action before binding the click behavior. You
need to bind the behavior before you can trigger it.

-Dan



[jQuery] Re: Thickbox Reloaded

2007-07-10 Thread Jökull

I've got a 2/3 rewrite of thickbox that is a lot more flexible. I've
tested it on Safari, IE6 and Firefox. Anyone interested?

On Jul 10, 11:56 am, Txt.Vaska [EMAIL PROTECTED] wrote:
 Bonjour:

 I haven't seen any talk about Thickbox Reloaded since mid-May. And I
 noticed that Thickbox 3 is out now. Is Thickbox Reloaded still
 happening?

 The alpha files I got my hands on didn't work in
 Safari...but...yeah...it's an Alpha.

 Any word, hint, suggestion...when the beta might happen for it?

 ;)



[jQuery] Re: JQuery - CrossBrowser? - Script not working in Firefox

2007-07-10 Thread Dan G. Switzer, II

Ok, so you da man when it comes to this AutoCompleter?  I did try
the page from FF and it definitely worked.  Would you mind looking at
the code?

function findValue(li) {
   if( li == null ) return alert(No match!);

   // if coming from an AJAX call, let's use the CityId as the value
   if( !!li.extra ) var sValue = li.extra[0];

   // otherwise, let's just display the value in the text box
   else var sValue = li.selectValue;

   oItmDesc = document.getElementById(ItmDesc);
   oItmDesc.innerHTML = li.extra[0];
   oOnHandQty = document.getElementById(OnHandQty);
   oOnHandQty.innerHTML = li.extra[1]
   oPrice = document.getElementById(Price);
   oPrice.innerHTML = li.extra[2]
// alert(The value you selected was:  + sValue);
}

There's nothing that jumps out as something that wouldn't work in FF.
However, you obviously have an error somewhere in your code. I'd recommend
installing the Firebug plug-in for FF--it'll really allow you to dig deep
into what's going on (you'll be able to run traces, see the results from
AJAX calls, etc.)

One thing I would recommend do in the above code is making use of jQuery.
You're going back to DOM methods and missing out on the benefits of jQuery.
The following could be re-written:

   oItmDesc = document.getElementById(ItmDesc);
   oItmDesc.innerHTML = li.extra[0];
   oOnHandQty = document.getElementById(OnHandQty);
   oOnHandQty.innerHTML = li.extra[1]
   oPrice = document.getElementById(Price);
   oPrice.innerHTML = li.extra[2]

To:

$(#ItmDesc).html(li.extra[0]);
$(#OnHandQty).html(li.extra[1]);
$(#Price).html(li.extra[2]);

Not only is this a lot less code, it'll also make sure your code is cross
browser compatible.

-Dan



[jQuery] Re: Thickbox Reloaded

2007-07-10 Thread Klaus Hartl


Txt.Vaska wrote:


Bonjour:

I haven't seen any talk about Thickbox Reloaded since mid-May. And I 
noticed that Thickbox 3 is out now. Is Thickbox Reloaded still happening?


The alpha files I got my hands on didn't work in 
Safari...but...yeah...it's an Alpha.


Any word, hint, suggestion...when the beta might happen for it?

;)



I consider it nearly beta, I only need to cleanup and fix a few styles 
before announcing. It actually is in heavy use for my project and it 
works cross browser. I just need to move over some styles...




--Klaus


[jQuery] Re: Using AutoCompleter, how do you pass parameters

2007-07-10 Thread Dan G. Switzer, II

Now if I could only make sense of that page.  g  So you wrote that
mod to the original AutoCompleter by Dylan V and now you and this
other guy Joern are working on it?  Sorry, just trying to understand
who's who.  What should I download from that page?

Not that the who's who really matters that much, but the story is as
follows. 

Dylan Verheul released the original Autocomplete plug-in. It did most of
what I needed, but was missing several crucial parts that I needed so I
fixed a few bugs and added the handful of features I needed.

Jörn Zaefferer liked what I did, but wanted to implement a few more features
(such as multiple selections,) so he started re-writing my mod (it's almost
a completely re-write now) to add new features and streamline the code. When
I can, I help Jörn out with the project.

As for what you should download, I'd recommend grabbing all the code and
playing around with it. It's a completely re-write and we know some of the
new features are not finished (multiple select items don't work completely
the way we'd like to see them work.)

-Dan

On Jul 9, 8:49 am, Dan G. Switzer, II [EMAIL PROTECTED]
wrote:
 One other thing:  If the user does not actually select an item from
 the list and, instead, just tabs out of the field - perhaps because
 the item that was put into the textbox via the quick-fill was the one
 he wanted - then the code to populate other fields does not fire.  How
 can I get that code to fire?  (The code below does not fire)

 Yeah, that looks like a bug. Development of this code branch has actually
 stopped and been replaced with:

 http://dev.jquery.com/browser/trunk/plugins/autocomplete

 It looks like this issue is resolved in the latest code base.

 -Dan




[jQuery] Re: Release: Tooltip plugin 1.1

2007-07-10 Thread R. Rajesh Jeba Anbiah

On Jul 9, 2:33 am, Jörn Zaefferer [EMAIL PROTECTED] wrote:
 R.RajeshJebaAnbiahwrote:   Another thing, you're bundling your site's style 
 in zip file.

 Are you referring to the demo files? If so, that is intentional. If not,
 could you clarify that?

http://jquery.bassistance.de/tooltip/jquery.tooltip.zip /
jquery.tooltip.css

This file has the style for the demo/site too. I'd rather prefer it
contain only the tooltip related styles and can possibly add another
style say demo.css for demo related styles.

FWIW, I hate Arial font like anything; when I added
jquery.tooltip.css, I have noticed that all the fonts have changed to
Arial. With FireBug, I have noticed that the jquery.tooltip.css's
style takes precedence for body tag.

Another thing, the id=tooltip is quite common thing, so it could
have been jqtooltip or so.

--
  ?php echo 'Just another PHP saint'; ?
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/



[jQuery] display: block forcing blocks to jump in FF

2007-07-10 Thread R. Rajesh Jeba Anbiah

Say like (note the display: inline):
div id=barspan id=foo style=display: inlinefoo/span./
div

Do animation on $('#foo'), can notice a jump in FF. This is because,
jQuery is toggling with display none to block and vice-versa; but
doesn't apply display: inline. Is there any workarounds? or advices?
TIA

--
  ?php echo 'Just another PHP saint'; ?
Email: rrjanbiah-at-Y!comBlog: http://rajeshanbiah.blogspot.com/



[jQuery] Re: Using AutoCompleter, how do you pass parameters

2007-07-10 Thread Dylan Verheul


Just my $0.02:
I'd recommend going with Jörn's rewrite, UNLESS you need the
mustMatch option which doesn't yet work in his version.
Jörn's version is much more likely to be updated than mine and (I
assume) Dan's, and Jörn did a more than excellent job.

I'm switching jobs on August 1, and my new job actually needs me to do
jQuery stuff (everything I did up to now was in my spare time), so I
hope to be more active as of then.

Dylan

On 7/10/07, Dan G. Switzer, II [EMAIL PROTECTED] wrote:


Now if I could only make sense of that page.  g  So you wrote that
mod to the original AutoCompleter by Dylan V and now you and this
other guy Joern are working on it?  Sorry, just trying to understand
who's who.  What should I download from that page?

Not that the who's who really matters that much, but the story is as
follows.

Dylan Verheul released the original Autocomplete plug-in. It did most of
what I needed, but was missing several crucial parts that I needed so I
fixed a few bugs and added the handful of features I needed.

Jörn Zaefferer liked what I did, but wanted to implement a few more features
(such as multiple selections,) so he started re-writing my mod (it's almost
a completely re-write now) to add new features and streamline the code. When
I can, I help Jörn out with the project.

As for what you should download, I'd recommend grabbing all the code and
playing around with it. It's a completely re-write and we know some of the
new features are not finished (multiple select items don't work completely
the way we'd like to see them work.)

-Dan

On Jul 9, 8:49 am, Dan G. Switzer, II [EMAIL PROTECTED]
wrote:
 One other thing:  If the user does not actually select an item from
 the list and, instead, just tabs out of the field - perhaps because
 the item that was put into the textbox via the quick-fill was the one
 he wanted - then the code to populate other fields does not fire.  How
 can I get that code to fire?  (The code below does not fire)

 Yeah, that looks like a bug. Development of this code branch has actually
 stopped and been replaced with:

 http://dev.jquery.com/browser/trunk/plugins/autocomplete

 It looks like this issue is resolved in the latest code base.

 -Dan





[jQuery] Re: Using AutoCompleter, how do you pass parameters

2007-07-10 Thread Dan G. Switzer, II

Just my $0.02:
I'd recommend going with Jörn's rewrite, UNLESS you need the
mustMatch option which doesn't yet work in his version.
Jörn's version is much more likely to be updated than mine and (I
assume) Dan's, and Jörn did a more than excellent job.

As I alluded to in my message, I've stopped development of my plug-in to
help out Jörn. 



[jQuery] Re: .trigger(click) // don't work? [newbie]

2007-07-10 Thread GianCarlo Mingati


;-)...
ehm thanks...
now it works.
It was sufficent to cut and paste it after the click behaviuor
experimenting... experimenting...
ciao
grazie
GC



[jQuery] Re: Thickbox Reloaded

2007-07-10 Thread Alexandre Plennevaux

I am always! 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Jökull
Sent: mardi 10 juillet 2007 13:40
To: jQuery (English)
Subject: [jQuery] Re: Thickbox Reloaded


I've got a 2/3 rewrite of thickbox that is a lot more flexible. I've tested
it on Safari, IE6 and Firefox. Anyone interested?

On Jul 10, 11:56 am, Txt.Vaska [EMAIL PROTECTED] wrote:
 Bonjour:

 I haven't seen any talk about Thickbox Reloaded since mid-May. And I 
 noticed that Thickbox 3 is out now. Is Thickbox Reloaded still 
 happening?

 The alpha files I got my hands on didn't work in 
 Safari...but...yeah...it's an Alpha.

 Any word, hint, suggestion...when the beta might happen for it?

 ;)

Ce message Envoi est certifié sans virus connu.
Analyse effectuée par AVG.
Version: 7.5.476 / Base de données virus: 269.10.2/893 - Date: 9/07/2007
17:22
 


[jQuery] Re: Thickbox Reloaded

2007-07-10 Thread Txt.Vaska


I consider it nearly beta, I only need to cleanup and fix a few  
styles before announcing. It actually is in heavy use for my  
project and it works cross browser. I just need to move over some  
styles...


--Klaus



Cool, that's good news. I think I saw the current build over at Plazes?

I'm ready to put this thing through some testing on a few different  
things whenever you get it out the door.


Cheers


[jQuery] Re: Thickbox Reloaded

2007-07-10 Thread Alexandre Plennevaux

Hi Klaus,

I personally am looking very much forward to your implementation. I like its
design much more than TB3, with all due respect to the script that converted
me to jquery.

Just an encouragement ;)


Alexandre

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Klaus Hartl
Sent: mardi 10 juillet 2007 13:46
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Thickbox Reloaded


Txt.Vaska wrote:
 
 Bonjour:
 
 I haven't seen any talk about Thickbox Reloaded since mid-May. And I 
 noticed that Thickbox 3 is out now. Is Thickbox Reloaded still happening?
 
 The alpha files I got my hands on didn't work in 
 Safari...but...yeah...it's an Alpha.
 
 Any word, hint, suggestion...when the beta might happen for it?
 
 ;)
 

I consider it nearly beta, I only need to cleanup and fix a few styles
before announcing. It actually is in heavy use for my project and it works
cross browser. I just need to move over some styles...



--Klaus

Ce message Envoi est certifié sans virus connu.
Analyse effectuée par AVG.
Version: 7.5.476 / Base de données virus: 269.10.2/893 - Date: 9/07/2007
17:22
 



[jQuery] Re: announcement: jQuery-based generic board game interface

2007-07-10 Thread Andy Matthews

Can you explain (ever so briefly) how this would be used? Is it merely a way
to quickly place pieces on an existing board? 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of John Resig
Sent: Monday, July 09, 2007 9:41 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: announcement: jQuery-based generic board game
interface


Stephan -

Great work! I could definitely see how this would be useful.

--John

On 7/9/07, Stephan Beal [EMAIL PROTECTED] wrote:

 Hiya!

 The jQ site says that this list is the place to make announcements, 
 so here it goes...

 The past couple of days i've been working on an application for 
 playtesting new boardgames (a long-time hobby of mine), and it's now 
 at a point where it mostly does what i want. With only about 175 
 lines of JS code (plus about 3 times that amount of HTML, PHP, and 
 CSS), i'm still slapping my forehead over simple it is to do complex 
 DOM-related tasks using jQuery. i didn't have to use the standard DOM 
 API a single time, and had no problem finding a jQuery function to do 
 everything i needed/wanted to do.

 Here it is, in any case:

 http://wanderinghorse.net/gaming/bpi/

 (BPI is a working title meaning Boardgame Prototyping Interface)

 There are, of course, many more potential features to add, but it is 
 currently suitable for its purpose: setting up and playtesting new 
 boardgame designs without having to print out the boards and pieces.

 Caveat: it's only been tested in Firefox 2.0.0.4 and Konqueror 3.5.7, 
 but it does not work 100% correctly in Konqueror because in jQ 1.1.3.1 
 the dblclick() callbacks are never triggered in that browser (a bug 
 report has been filed).

 :D






[jQuery] Re: Thickbox Reloaded

2007-07-10 Thread Joel Birch


On 11/07/2007, at 12:25 AM, Alexandre Plennevaux wrote:

Hi Klaus,

I personally am looking very much forward to your implementation. I  
like its
design much more than TB3, with all due respect to the script that  
converted

me to jquery.

Just an encouragement ;)


Alexandre


Ditto! Still very much looking forward to TB Reloaded.

Joel Birch.


[jQuery] Re: Thickbox Reloaded

2007-07-10 Thread Sam Collett

Perhaps it needs a new name as well (rather than just 'Thickbox
Reloaded'), because it does function slightly differently to Thickbox?

On Jul 10, 2:32 pm, Joel Birch [EMAIL PROTECTED] wrote:
 On 11/07/2007, at 12:25 AM, Alexandre Plennevaux wrote:

  Hi Klaus,

  I personally am looking very much forward to your implementation. I
  like its
  design much more than TB3, with all due respect to the script that
  converted
  me to jquery.

  Just an encouragement ;)

  Alexandre

 Ditto! Still very much looking forward to TB Reloaded.

 Joel Birch.



[jQuery] Re: announcement: jQuery-based generic board game interface

2007-07-10 Thread weepy

Another Jquery based board game that I'm putting into beta :

http://64squar.es

It's an online realtime chess game with drag and drop pieces.




On Jul 10, 2:31 pm, Andy Matthews [EMAIL PROTECTED] wrote:
 Can you explain (ever so briefly) how this would be used? Is it merely a way
 to quickly place pieces on an existing board?

 -Original Message-
 From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On

 Behalf Of John Resig
 Sent: Monday, July 09, 2007 9:41 PM
 To: jquery-en@googlegroups.com
 Subject: [jQuery] Re: announcement: jQuery-based generic board game
 interface

 Stephan -

 Great work! I could definitely see how this would be useful.

 --John

 On 7/9/07, Stephan Beal [EMAIL PROTECTED] wrote:

  Hiya!

  The jQ site says that this list is the place to make announcements,
  so here it goes...

  The past couple of days i've been working on an application for
  playtesting new boardgames (a long-time hobby of mine), and it's now
  at a point where it mostly does what i want. With only about 175
  lines of JS code (plus about 3 times that amount of HTML, PHP, and
  CSS), i'm still slapping my forehead over simple it is to do complex
  DOM-related tasks using jQuery. i didn't have to use the standard DOM
  API a single time, and had no problem finding a jQuery function to do
  everything i needed/wanted to do.

  Here it is, in any case:

 http://wanderinghorse.net/gaming/bpi/

  (BPI is a working title meaning Boardgame Prototyping Interface)

  There are, of course, many more potential features to add, but it is
  currently suitable for its purpose: setting up and playtesting new
  boardgame designs without having to print out the boards and pieces.

  Caveat: it's only been tested in Firefox 2.0.0.4 and Konqueror 3.5.7,
  but it does not work 100% correctly in Konqueror because in jQ 1.1.3.1
  the dblclick() callbacks are never triggered in that browser (a bug
  report has been filed).

  :D



[jQuery] 2 beginner question

2007-07-10 Thread tlob

Hello

First very simple question: why ist this not allowed?
[code]

$(document).ready(
var isplaying = false;
//something else
);

[/code]
and this is?
var isplaying = false;
$(document).ready(
//do something else
);

[/code]

==
Second Question. When I load this page in FF, Firebug gives my 1
Error: missing ) after argument list });\n (Line28)

[code]
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;

html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en
head
titleSiggi Bucher: Photographin/title
meta name=description content=Siggi Bucher - Photographin 
aus
Leidenschaft /
meta http-equiv=Content-type 
content=text/html;charset=UTF-8 /
link rel=stylesheet href=screen.css type=text/css
media=screen /
script type=text/javascript 
src=inc/jquery-1.1.3.1.pack.js/
script
script type=text/javascript
var isplaying = false;

$(document).ready(

$(#gomusic).click(function() {
if(!isplaying) {
popUp(sound.html);
$(#gomusic).text(sound off);
$(#gomusic).attr(href,#);
var isplaying = true;
} else {
sound.close();

$(#gomusic).text(sound on);
var isplaying = false;
}
return false;
});

function popUp(url) {

sound=window.open(url,'soundbumbam','height=50,width=150');
window.focus();
return false;
}

);

/script
/head

body
div id=left



div id=sound
a href=javascript:popUp('sound.html'); 
id=gomusicsound on/
a
/div

/div
/body
/html
[/code]



[jQuery] Re: Google Maps like interface with JQuery

2007-07-10 Thread Tane Piper


Here is the code for what I am working on right now.  It's nowhere
complete, but I'm looking to build a fully functional application for
jQuery and Google Maps.

/*
* Google Map Application (GMApp)
* Author: Tane Piper ([EMAIL PROTECTED])
* Website: http://digitalspaghetti.tooum.net
* Licensed under the MIT License:
http://www.opensource.org/licenses/mit-license.php
*
* === Changelog ===
* Version 0.1
* + Initial Version
*/


jQuery.gmapp = {

build : function(settings) {

/* Default Settings*/   
settings = jQuery.extend({
maptype: G_HYBRID_TYPE,
center: [55.958858,-3.162302],
zoom: 12,
control: small,
showtype: true,
showoverview: true,
infoarea: #gmapp-info
},settings);

if (GBrowserIsCompatible())
{
return this.each(function(){
var map = new GMap2 (this);
var geocoder = new GClientGeocoder();
var infoarea = settings.infoarea;

map.setCenter(new
GLatLng(settings.center[0],settings.center[1]),settings.zoom,settings.maptype);

switch(settings.control)
{
case small:
map.addControl(new 
GSmallMapControl());
break;
case large:
map.addControl(new 
GLargeMapControl());
break;
default:
map.addControl(new 
GSmallMapControl());
}

if (settings.showtype == true){
map.addControl(new GMapTypeControl());
}
if (settings.showoverview == true){
map.addControl(new 
GOverviewMapControl());
}

/* Seach for the lat  lng of our address*/
jQuery('#findaddress').bind('click', function(){

jQuery.gmapp.searchAddress(jQuery('#Address').attr('value'), map,
geocoder);
}); 
});
}
},

searchAddress : function(address,map,geocoder) {
geocoder.getLatLng(
address,
function(point){
if (!point) {
alert(address +  not found);
} else {
map.setCenter(point,12);
var marker = new GMarker(point, {draggable: 
true});
map.addOverlay(marker);
marker.openInfoWindowHtml(Lat:  + point.lat() +  
Lng:  + point.lng());
GEvent.addListener(marker, dragend, 
function(){
mylocation = marker.getPoint();
marker.openInfoWindowHtml(Latitude:  + 
mylocation.lat() + br
/Longitude:  + mylocation.lng());
});

}
});
},
}

jQuery.fn.gmapp = jQuery.gmapp.build;


To use it, create your div area and specify the width and height.  Then do

$('#yourdiv').gmapp(); to activate.
At the moment, you can create a form with a field id=Address and a
submit button id=findaddress.  This will then geocode any address
you type in and center the map on it, adding a marker.  You can then
drag the marker around and it will give you the lat  lng position.

At the moment, thats pretty much all it does.  I'm working on version
0.2 just now with more functionality for my application, but I'm happy
to share it.

On 7/9/07, Pete [EMAIL PROTECTED] wrote:


Hi All,

Does anyone know of a Google Maps like interface implemented using
JQuery?

The only real requirement is that a user can zoom in/out. On zoom, a
new image is properly loaded in terms of zoom and user expected
location.

If not, could you point me to a couple functions within JQuery that
would be a good starting point for this type of project?

Cheers,
Pete





--
Tane Piper
http://digitalspaghetti.tooum.net

This email is: [ ] blogable [ x ] ask 

[jQuery] Re: announcement: jQuery-based generic board game interface

2007-07-10 Thread Stephan Beal

On Jul 10, 3:31 pm, Andy Matthews [EMAIL PROTECTED] wrote:
 Can you explain (ever so briefly) how this would be used? Is it merely a way
 to quickly place pieces on an existing board?

That's basically it - a generic game board and generic game pieces.
Just as when you and i play a board game together, a HUMAN has to
interpret the game rules (which, in the case of games being playtested/
prototyped, are always changing).

This is basically an ultra-lite version of a C++ app i wrote some
years ago called QUB (the Q Universal Boardgame):

http://qub.sourceforge.net/screenshots/

That project is now defunct, as it grew too large to maintain (it was
taking 30 minutes to compile after each significant code change). My
goal with this app is to provide the most basic of functionality which
QUB provided, and to do so via an AJAX/AHAH framework.

When designing new boardgames it is often convenient to throw a few
pieces onto a board and just play around with some ideas. That is what
QUB was for, and that's what this JS app is for.




[jQuery] Re: 2 beginner question

2007-07-10 Thread tlob

cheers! I'm such a beginner.
http://i.somethingawful.com/cliff/ihateyou/page-262/3.jpg

On 10 Jul., 15:55, John Resig [EMAIL PROTECTED] wrote:
 You have to add an extra wrapper function in .ready(), like so:

  $(document).ready(function(){
// your code
  });

 On 7/10/07, tlob [EMAIL PROTECTED] wrote:



  Hello

  First very simple question: why ist this not allowed?
  [code]

  $(document).ready(
  var isplaying = false;
  //something else
  );

  [/code]
  and this is?
  var isplaying = false;
  $(document).ready(
  //do something else
  );

  [/code]

  ==
  Second Question. When I load this page in FF, Firebug gives my 1
  Error: missing ) after argument list });\n (Line28)

  [code]
  !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
  http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;

  html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en
  head
  titleSiggi Bucher: Photographin/title
  meta name=description content=Siggi Bucher - 
  Photographin aus
  Leidenschaft /
  meta http-equiv=Content-type 
  content=text/html;charset=UTF-8 /
  link rel=stylesheet href=screen.css type=text/css
  media=screen /
  script type=text/javascript 
  src=inc/jquery-1.1.3.1.pack.js/
  script
  script type=text/javascript
  var isplaying = false;

  $(document).ready(

  $(#gomusic).click(function() {
  if(!isplaying) {
  popUp(sound.html);
  $(#gomusic).text(sound 
  off);
  
  $(#gomusic).attr(href,#);
  var isplaying = true;
  } else {
  sound.close();
  
  $(#gomusic).text(sound on);
  var isplaying = 
  false;
  }
  return false;
  });

  function popUp(url) {
  
  sound=window.open(url,'soundbumbam','height=50,width=150');
  window.focus();
  return false;
  }

  );

  /script
  /head

  body
  div id=left

  div id=sound
  a href=javascript:popUp('sound.html'); 
  id=gomusicsound on/
  a
  /div

  /div
  /body
  /html
  [/code]



[jQuery] Re: announcement: jQuery-based generic board game interface

2007-07-10 Thread Andy Matthews

Fun. I assume by boardgames you're talking about Catan, WH10k and that sort
of thing and not Risk or Monopoly? 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Stephan Beal
Sent: Tuesday, July 10, 2007 8:45 AM
To: jQuery (English)
Subject: [jQuery] Re: announcement: jQuery-based generic board game
interface


On Jul 10, 3:31 pm, Andy Matthews [EMAIL PROTECTED] wrote:
 Can you explain (ever so briefly) how this would be used? Is it merely 
 a way to quickly place pieces on an existing board?

That's basically it - a generic game board and generic game pieces.
Just as when you and i play a board game together, a HUMAN has to interpret
the game rules (which, in the case of games being playtested/ prototyped,
are always changing).

This is basically an ultra-lite version of a C++ app i wrote some years ago
called QUB (the Q Universal Boardgame):

http://qub.sourceforge.net/screenshots/

That project is now defunct, as it grew too large to maintain (it was taking
30 minutes to compile after each significant code change). My goal with this
app is to provide the most basic of functionality which QUB provided, and to
do so via an AJAX/AHAH framework.

When designing new boardgames it is often convenient to throw a few pieces
onto a board and just play around with some ideas. That is what QUB was for,
and that's what this JS app is for.





[jQuery] SITE SUBMISSION: 64squar.es

2007-07-10 Thread Rey Bango


Added:

http://64squar.es - an online realtime chess game with drag and drop pieces.





[jQuery] Re: Thickbox Reloaded

2007-07-10 Thread Klaus Hartl


Sam Collett wrote:

Perhaps it needs a new name as well (rather than just 'Thickbox
Reloaded'), because it does function slightly differently to Thickbox?


Thickbox Reloaded was just a working title for me (it was supposed to 
become TB 3 at that time), but now that there is an official TB 3, I'm 
fine with that and quite a few people already adopted that name. But I'm 
all open.


Functionality doesn't differ too much from Thickbox though - the main 
difference being the chainability and type auto detection.




--Klaus


[jQuery] Re: Syntactic sugar for checking whether an element exists

2007-07-10 Thread Felix Geisendörfer
 ok, so next time i want to code something in jquery i'll just write
 $(make coffee) ? 
Haha, now I'm questioning your ambition. This is the holy grail of all 
programming, it's almost blasphemy to make fun of it ; ).
 For me (and I really mean not speaking for everyone) it's more
 intuitive if there is an internal logic that I can understand;
Ok, I guess in this case the only language we share is jQuery ; ). 
Intuition irrational by definition, see: 
http://www.google.com/search?q=define:intuition.
 No, there are things that are intuitive **once you've understood the
 basics**. IOW intuitiveness is based on your assumptions and your
 knowledge. Why would you assume that .hasClass() exists? And not,
 e.g., isMemberOf() or .classMatches() ? It must depend of what you're
 already familiar with before you switch to jQuery. 
I agree with you that people will try to use stuff they know from other 
libraries first before falling back to intuition. So what would be two 
of the most popular ones to expect?

Mootools:

* includes a hasClass() function:
  http://docs.mootools.net/Native/Element.js#Element.hasClass
* includes a remove() function:
  http://docs.mootools.net/Native/Element.js#Element.remove

Prototype:

* includes a hasClassName() function:
  http://www.prototypejs.org/api/element#method-hasclassname
* includes a remove() function:
  http://www.prototypejs.org/api/element/remove

To be fair. Neither Mootools nor Prototype seem to include an exists() 
function. This however could also be traced back by the fact that they 
do not share the jQuery philosophy in terms of advocating their CSS 
selector engine as a) their main element retrieval method and b) don't 
use it as a wrapper for chainability.

Anyway I can see your argument about how an exists() function would be 
redundant. jQuery has a lot of convenience wrappers for things, but 
$.fn.exists = function(){return !!this.length}; would be the smallest 
and least functional one. Same is almost true for hasClass (return 
this.is('.'+class));. This is where you can convince me with a 
rational/scientific argument that those functions aren't needed. 
However, as you said this library is more then just code, it's art. And 
this is why I'm emphasizing those new functions: They empower the artist 
(who does not read the complete docs before getting started) and don't 
hurt the scientists 

What a rant ... haha

Anyway, interesting discussion and good arguments,
-- Felix
--
My Blog: http://www.thinkingphp.org
My Business: http://www.fg-webdesign.de


Fil wrote:

 jQuery is a language
 It was a library last time I checked ; ).

 yeah, well, it can be many things to many people; we all agree it's
 code. I think it's art, too

 Why? For me the sweetest thing about using jQuery has been it's 
 intuitiveness right out of the box.

 ok, so next time i want to code something in jquery i'll just write
 $(make coffee) ?

 No, there are things that are intuitive **once you've understood the
 basics**. IOW intuitiveness is based on your assumptions and your
 knowledge. Why would you assume that .hasClass() exists? And not,
 e.g., isMemberOf() or .classMatches() ? It must depend of what you're
 already familiar with before you switch to jQuery.

 For me (and I really mean not speaking for everyone) it's more
 intuitive if there is an internal logic that I can understand; adding
 stuff that is redundant is merely adding cruft, and hence
 counter-intuitive.

 That's why I wanted to add my I don't agree message -- though I
 understand and respect your position, I don't share it.

 -- Fil



[jQuery] Re: 2 beginner question

2007-07-10 Thread John Resig


You have to add an extra wrapper function in .ready(), like so:

$(document).ready(function(){
  // your code
});

On 7/10/07, tlob [EMAIL PROTECTED] wrote:


Hello

First very simple question: why ist this not allowed?
[code]

$(document).ready(
var isplaying = false;
//something else
);

[/code]
and this is?
var isplaying = false;
$(document).ready(
//do something else
);

[/code]

==
Second Question. When I load this page in FF, Firebug gives my 1
Error: missing ) after argument list });\n (Line28)

[code]
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;

html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en
head
titleSiggi Bucher: Photographin/title
meta name=description content=Siggi Bucher - Photographin 
aus
Leidenschaft /
meta http-equiv=Content-type content=text/html;charset=UTF-8 
/
link rel=stylesheet href=screen.css type=text/css
media=screen /
script type=text/javascript 
src=inc/jquery-1.1.3.1.pack.js/
script
script type=text/javascript
var isplaying = false;

$(document).ready(

$(#gomusic).click(function() {
if(!isplaying) {
popUp(sound.html);
$(#gomusic).text(sound off);
$(#gomusic).attr(href,#);
var isplaying = true;
} else {
sound.close();
$(#gomusic).text(sound 
on);
var isplaying = false;
}
return false;
});

function popUp(url) {

sound=window.open(url,'soundbumbam','height=50,width=150');
window.focus();
return false;
}

);

/script
/head

body
div id=left



div id=sound
a href=javascript:popUp('sound.html'); 
id=gomusicsound on/
a
/div

/div
/body
/html
[/code]




[jQuery] Re: Syntactic sugar for checking whether an element exists

2007-07-10 Thread Nicolas Hoizey

 Anyway I can see your argument about how an exists() function would  
 be redundant. jQuery has a lot of convenience wrappers for things,  
 but $.fn.exists = function(){return !!this.length}; would be the  
 smallest and least functional one. Same is almost true for hasClass  
 (return this.is('.'+class));. This is where you can convince me  
 with a rational/scientific argument that those functions aren't  
 needed. However, as you said this library is more then just code,  
 it's art. And this is why I'm emphasizing those new functions: They  
 empower the artist (who does not read the complete docs before  
 getting started) and don't hurt the scientists 

There could be a jConvenient plugin then that would add convenient  
wrapper such as exists or hasClass.

I'm not sure it should contain makeCoffee through... ;-)


-Nicolas

-- 
Nicolas Brush HOIZEY
Clever Age   : http://www.clever-age.com/
Gastero Prod : http://www.gasteroprod.com/
Photos : http://www.flickr.com/gp/[EMAIL PROTECTED]/M1c002




[jQuery] Link with hover and a div

2007-07-10 Thread Jens Peter Möller

Hi,

I wan't to show a div on an mouseover at a link, like a tooltip.
Parts of my Code:

function jpmTip_init() {
$(a).hover(
function(event) {
$('div.jpmTipDIV').remove();
jpmTip_show(this, event.pageX, event.pageY);
},
function() {
window.setTimeout($('div#jpmTipDIV').remove(), 200);
}
);
}


function jpmTip_show(obj, mouseX, mouseY) {

   $(body).append(div id='jpmTipDIV' ...  /div);
   $(div#jpmTipDIV).show();

return false;
}


This works fine. But I wan't the div not to be removed, when the user
set's the mouse
on the div. I think, I should use other methods than hover. But I have
no Idea.
Cann anyone help please? And sorry for my bad english.

kind regards
JPM



[jQuery] Re: append reformting the content i send it

2007-07-10 Thread Rob Desbois

What is the content you are trying to add...?

On 7/10/07, Terry B [EMAIL PROTECTED] wrote:



wtf?  I have specific html i want added to a div so I use append to
add it.  fine it works but it is formatting the code and making it
unusable.  how do i prevent append from doing this?





--
Rob Desbois
Eml: [EMAIL PROTECTED]
Tel: 01452 760631
Mob: 07946 705987
There's a whale there's a whale there's a whale fish he cried, and the
whale was in full view.
...Then ooh welcome. Ahhh. Ooh mug welcome.


[jQuery] Re: announcement: jQuery-based generic board game interface

2007-07-10 Thread Stephan Beal

On Jul 10, 4:04 pm, Andy Matthews [EMAIL PROTECTED] wrote:
 Fun. I assume by boardgames you're talking about Catan, WH10k and that sort
 of thing and not Risk or Monopoly?

There's no reason Risk or Monopoly couldn't be played, provided a way
can be worked out to handle things like game-specific cards.
By handle i mean bring into play. In principal cards are the same
as pieces - a graphic, or even a text-based widget. However, doing
things like keeping cards secret (in Risk) would be next to impossible
in this interface. Monopoly, on the other hand, could be adequately
simulated provided that:

a) several players don't mind sitting around the same computer screen.

b) you have a big enough screen/resolution that you can fit the board,
all playing cards, etc., on the screen. While fitting on the screen
is not a technical requirement, it eases usability greatly.

c) you write a bit of code to shuffle the Chance of Community Chest
cards and dole them out as needed (could be a simple button click).

In principal, any game which can be represented by simple pieces and/
or cards, and does not have any secret data associated with each
player, can be represented by a generic boardgaming interface such as
this one. Some changes may need to be made to accommodate the change
of media, compared to a a physical game board and cards, but that
normally isn't a problem. With fancy JS/CSS code you could even
simulate the look/feel of real Monopoly cards (for example) by using
embedded window-like widgets.

:)



[jQuery] Re: Convert XMLDocument to text

2007-07-10 Thread João Araújo

Hi, I'm new to jQuery.
I have this problem:

I am using php to produce html. Them a would like to manipulate that
html with jQuery. jQuery is not handling de html written with php. Any
help?
Thank you

On Jul 7, 3:35 am, [EMAIL PROTECTED] [EMAIL PROTECTED]
wrote:
 Heh, hours of searching, and the minute after you post your question
 you find the answer... :)

 var x = (new XMLSerializer()).serializeToString(xmlobject);

 On Jul 7, 11:26 am, [EMAIL PROTECTED] [EMAIL PROTECTED]
 wrote:

  I have received an XMLDocument object through an Ajax call and has
  subsequently changed some of the nodes in the object. I now want to
  convert it to a plain text string so I can pass it on as a parameter.

  Is there any way in jQuery to do this?



[jQuery] Re: announcement: jQuery-based generic board game interface

2007-07-10 Thread Stephan Beal

On Jul 10, 3:39 pm, weepy [EMAIL PROTECTED] wrote:
 Another Jquery based board game that I'm putting into beta :

 http://64squar.es

 It's an online realtime chess game with drag and drop pieces.

Wow! Great! Those features are still a long way away (if ever) as far
as my mini-project goes, but it's great to see that someone actually
has accomplished it. If i do decide to go that extra mile, i will
certainly poke around your code to see how you've done it.

:D



[jQuery] too much recursion (sound PopUp)

2007-07-10 Thread tlob

Hello

I finaly managed to finish my job. Only with your help.

http://siggibucher.com/preview/soundtest.html

But when I click the sound on link, Firebug is complaining about
too much recursion window.focus();
I have no idea, was this is, or should I change something?



THX in advance!
tom



[jQuery] Re: 2 beginner question

2007-07-10 Thread Jake McGraw


Answer both of your questions:

Use:
$(document).ready(function() { /* ... */ });

Not:
$(document).ready( /* ... */ );

- jake

On 7/10/07, tlob [EMAIL PROTECTED] wrote:


Hello

First very simple question: why ist this not allowed?
[code]

$(document).ready(
var isplaying = false;
//something else
);

[/code]
and this is?
var isplaying = false;
$(document).ready(
//do something else
);

[/code]

==
Second Question. When I load this page in FF, Firebug gives my 1
Error: missing ) after argument list });\n (Line28)

[code]
!DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd;

html xmlns=http://www.w3.org/1999/xhtml; xml:lang=en
head
titleSiggi Bucher: Photographin/title
meta name=description content=Siggi Bucher - Photographin 
aus
Leidenschaft /
meta http-equiv=Content-type content=text/html;charset=UTF-8 
/
link rel=stylesheet href=screen.css type=text/css
media=screen /
script type=text/javascript 
src=inc/jquery-1.1.3.1.pack.js/
script
script type=text/javascript
var isplaying = false;

$(document).ready(

$(#gomusic).click(function() {
if(!isplaying) {
popUp(sound.html);
$(#gomusic).text(sound off);
$(#gomusic).attr(href,#);
var isplaying = true;
} else {
sound.close();
$(#gomusic).text(sound 
on);
var isplaying = false;
}
return false;
});

function popUp(url) {

sound=window.open(url,'soundbumbam','height=50,width=150');
window.focus();
return false;
}

);

/script
/head

body
div id=left



div id=sound
a href=javascript:popUp('sound.html'); 
id=gomusicsound on/
a
/div

/div
/body
/html
[/code]




[jQuery] Re: Convert XMLDocument to text

2007-07-10 Thread Richard D. Worth

On 7/10/07, João Araújo [EMAIL PROTECTED] wrote:



Hi, I'm new to jQuery.
I have this problem:

I am using php to produce html. Them a would like to manipulate that
html with jQuery. jQuery is not handling de html written with php. Any
help?
Thank you



It looks like you sent this messaging by clicking reply on a previous
thread. This makes it grouped under a different message subject (Convert
XMLDocument to text), which may prevent a lot of people from seeing it and
being able to help you. Recommend you compose a new message to
[EMAIL PROTECTED]

- Richard


[jQuery] Re: Syntactic sugar for checking whether an element exists

2007-07-10 Thread Alan Gutierrez


On Jul 9, 2007, at 3:05 PM, Matt Kruse wrote:



On Jul 9, 1:50 pm, Sean Catchpole [EMAIL PROTECTED] wrote:

I believe that learning jquery returns an array like object is more
useful than creating a .exists() function.


IMO, many people look for common sense methods that should exist in
jQuery, or at least as part of a standard and commonly-used plugin. An
exists() method seems like a reasonable candidate.

As another example, I think .hasClass() should exist, even though you
can do .is(.className) - simply because most people will look for a
method called hasClass rather than reading the docs and eventually
finding that .is() is the correct way to do it. It makes jQuery a
little more approachable and user-friendly if it has exactly what
you're looking for and expect, even though it may just be a wrapper
for the real underlying functionality.


I was pleased when jQuery got rid of all the pointless helper  
functions for CSS and simply went to name and value pairs for a css  
function. (IIRC).


--
Alan Gutierrez | [EMAIL PROTECTED] | http://blogometer.com/ | 504  
717 1428

Think New Orleans | http://thinknola.com/




[jQuery] Draggable from Interface plugin - Bug with IE6 [Solved]

2007-07-10 Thread jonathan.pasquier

Hello,

I have been struggling for the last hour because of a little problem
with the Draggable component of the Interface plug-in.
When I was dragging an element for the first time, everything was OK.
But as I tried to drag another element, the first element was moved
instead of the selected one (in fact, just clicking anywhere on the
page would move the first element).
I've found a workaround, so I put it here in case it would be useful
for someone:

$('.thumb').Draggable({
/*
your draggable config here
*/
onStop  : function() {jquery.iDrag.dragged = null}
});

Has anybody else met this behaviour?



[jQuery] Re: thickbox onload

2007-07-10 Thread João Araújo

Hi,

Any one knows how to center the thickbox inside the element it is
contained and not in the whole view port?

Thanks

On Jul 4, 3:43 am, Eric Crull [EMAIL PROTECTED] wrote:
 In another thread Felix Geisendorfer published a little plugin that he
 uses to rebind thickbox after the document has finished loading.  The
 line below starting tb_show calls the thickbox.  I'm sure you could
 easily use this as a starting point.

 Here's the original 
 thread:http://groups.google.com/group/jquery-en/browse_thread/thread/f0d3920...

 please note that in that thread, the command was TB_show, which will
 not work with the newer thickbox plug-in.

 $.fn.useThickbox =  function()
 {
 return this.click(function()
 {
 var t = this.title || this.name || null;
 var g = this.rel || false;
 tb_show(t,this.href,g);
 this.blur();
 return false;
 });

 }

 On Jul 3, 10:55 am, Anthony Leboeuf(Worcester Wide Web)

 [EMAIL PROTECTED] wrote:
  Hello,

  Is it possible to make thickbox onload instead of clicking a link? I
  need to load up a thickbox for login information. Thanks

  -Tony



[jQuery] Re: JQuery - CrossBrowser? - Script not working in Firefox

2007-07-10 Thread AtlantaGeek

Ok, thanks for those suggestions.  I'm only starting off with JQuery.
I hope to keep learning about it.  At present, the syntax is very
strange.

On Jul 10, 8:42 am, Dan G. Switzer, II [EMAIL PROTECTED]
wrote:
 Ok, so you da man when it comes to this AutoCompleter?  I did try
 the page from FF and it definitely worked.  Would you mind looking at
 the code?

 function findValue(li) {
 if( li == null ) return alert(No match!);

 // if coming from an AJAX call, let's use the CityId as the value
 if( !!li.extra ) var sValue = li.extra[0];

 // otherwise, let's just display the value in the text box
 else var sValue = li.selectValue;

 oItmDesc = document.getElementById(ItmDesc);
 oItmDesc.innerHTML = li.extra[0];
 oOnHandQty = document.getElementById(OnHandQty);
 oOnHandQty.innerHTML = li.extra[1]
 oPrice = document.getElementById(Price);
 oPrice.innerHTML = li.extra[2]
 //  alert(The value you selected was:  + sValue);
 }

 There's nothing that jumps out as something that wouldn't work in FF.
 However, you obviously have an error somewhere in your code. I'd recommend
 installing the Firebug plug-in for FF--it'll really allow you to dig deep
 into what's going on (you'll be able to run traces, see the results from
 AJAX calls, etc.)

 One thing I would recommend do in the above code is making use of jQuery.
 You're going back to DOM methods and missing out on the benefits of jQuery.
 The following could be re-written:

 oItmDesc = document.getElementById(ItmDesc);
 oItmDesc.innerHTML = li.extra[0];
 oOnHandQty = document.getElementById(OnHandQty);
 oOnHandQty.innerHTML = li.extra[1]
 oPrice = document.getElementById(Price);
 oPrice.innerHTML = li.extra[2]

 To:

 $(#ItmDesc).html(li.extra[0]);
 $(#OnHandQty).html(li.extra[1]);
 $(#Price).html(li.extra[2]);

 Not only is this a lot less code, it'll also make sure your code is cross
 browser compatible.

 -Dan- Hide quoted text -

 - Show quoted text -



[jQuery] Re: Return attribute content from XPath match //[EMAIL PROTECTED]'banner']/@alt

2007-07-10 Thread [EMAIL PROTECTED]

Well bad example, I will not be using it will the id attribute, and I
will be getting more the one results, so $().attr() will not work.

On Jul 10, 3:41 am, Klaus Hartl [EMAIL PROTECTED] wrote:
 [EMAIL PROTECTED] wrote:
  with something like..
  img id=banner alt=This is a banner /

  //[EMAIL PROTECTED]'banner']/@alt would return This is a banner. Doing it 
  this
  way does not work, but is valid in 
  XPatherhttps://addons.mozilla.org/en-US/firefox/addon/1192
  Is there another way to do this in JQuery (I am currently just looping
  the return and extracting the attribute if set)?

 jQuery supports (some) XPath for selecting things, but not the whole
 Spec. Try:

 var alt = $('#banner').attr('alt');

 Looping is pointless because an id is supposed to be unique in a
 document. Also I think the CSS selector syntax should be faster then
 your generic approach.

 --Klaus



[jQuery] Re: Return attribute content from XPath match //[EMAIL PROTECTED]'banner']/@alt

2007-07-10 Thread Klaus Hartl


[EMAIL PROTECTED] wrote:

Well bad example, I will not be using it will the id attribute, and I
will be getting more the one results, so $().attr() will not work.

On Jul 10, 3:41 am, Klaus Hartl [EMAIL PROTECTED] wrote:

[EMAIL PROTECTED] wrote:

with something like..
img id=banner alt=This is a banner /
//[EMAIL PROTECTED]'banner']/@alt would return This is a banner. Doing it this
way does not work, but is valid in 
XPatherhttps://addons.mozilla.org/en-US/firefox/addon/1192
Is there another way to do this in JQuery (I am currently just looping
the return and extracting the attribute if set)?

jQuery supports (some) XPath for selecting things, but not the whole
Spec. Try:

var alt = $('#banner').attr('alt');

Looping is pointless because an id is supposed to be unique in a
document. Also I think the CSS selector syntax should be faster then
your generic approach.

--Klaus





Ok, say you want an array that gathers all the alt attributes of the 
matched elements, you can use the $.map method:


var altAttrs = $.map( $('img'), function() { return this.alt; } );


--Klaus


[jQuery] Feature request: XPath attribute content selector

2007-07-10 Thread [EMAIL PROTECTED]

I need to be able to grab attribute content staight from XPath in the
form of //[EMAIL PROTECTED]'imageClass']/@id would return  the ids of anything
with the class name imageClass. I have not got the reg exp knowledge
to do this myself.



[jQuery] Re: Feature request: XPath attribute content selector

2007-07-10 Thread Scott Sauyet


[EMAIL PROTECTED] wrote:

I need to be able to grab attribute content staight from XPath in the
form of //[EMAIL PROTECTED]'imageClass']/@id would return  the ids of anything
with the class name imageClass. I have not got the reg exp knowledge
to do this myself.


I doubt this is likely to be added, as it doesn't return a set of DOM 
nodes, which is pretty central to JQuery.  But it's not hard to get them 
in code:


var ids = $.map($(.imageClass), function(item) {return item.id;});

Cheers,

  -- Scott



[jQuery] ProtoLoad

2007-07-10 Thread Glen Lipka

I noticed this new ajax loading script. http://aka-fotos.de/protoload/

It's based on Prototype, but if you look just at the relevant script:
http://aka-fotos.de/protoload/js/protoload.js

It's extremely small, but has a pretty nice feature set. (covering
individual items)
We have a few plugins that are similar to this, but maybe this is
inspirational to add a little something.

Glen


[jQuery] Re: Is there a way to READ the $.ajax settings?

2007-07-10 Thread Jörn Zaefferer


Stephan Beal wrote:

On Jul 9, 9:26 pm, Sean Catchpole [EMAIL PROTECTED] wrote:
  

$.ajaxSettings.async



That's exactly what i was looking for. Thanks :).

Do you happen to know if that's documented anywhere? i can find no
mention of it on the jquery site, and using the on-site search engine
returns (as usual) No page title matches.
  

http://docs.jquery.com/Ajax#Options
The first option :-)

--
Jörn Zaefferer

http://bassistance.de



[jQuery] Re: Random number of events required on page

2007-07-10 Thread Jörn Zaefferer


[EMAIL PROTECTED] wrote:

What I'm trying to figure out how to do is to have jQuery handle
multiple events on one page, that are pulled out a of a database (can
be any amount of numbers).

A good example of what I'm trying to do would be a large FAQ listing,
where each question is clickable, which after it is clicked, expands
the answer under it.

After doing all of the reading I've only found ways that unless I
manually specifiy each div differently, clicking on one question will
expand all of the answers. With a some what random amount of questions
on each page, how could I make it so that it could check each question
and expand each individual answer?
  
That basically sounds like a good use case for the accordion plugin: 
http://bassistance.de/jquery-plugins/jquery-plugin-accordion/


--
Jörn Zaefferer

http://bassistance.de



[jQuery] Re: validation pluging work in FireFox but Not in Internet Explorer

2007-07-10 Thread Jörn Zaefferer


WebolizeR wrote:

any suggestion about this,please
  
I get this warning when enabling strict warnings (via web developer 
toolbar) in Firefox:


trailing comma is not legal in ECMA-262 object initializers  }\n 
index.php (line 39)



--
Jörn Zaefferer

http://bassistance.de



[jQuery] Re: Release: Tooltip plugin 1.1

2007-07-10 Thread Jörn Zaefferer


R. Rajesh Jeba Anbiah wrote:

On Jul 9, 2:33 am, Jörn Zaefferer [EMAIL PROTECTED] wrote:
  

R.RajeshJebaAnbiahwrote:   Another thing, you're bundling your site's style in 
zip file.

Are you referring to the demo files? If so, that is intentional. If not,
could you clarify that?



http://jquery.bassistance.de/tooltip/jquery.tooltip.zip /
jquery.tooltip.css

This file has the style for the demo/site too. I'd rather prefer it
contain only the tooltip related styles and can possibly add another
style say demo.css for demo related styles.

FWIW, I hate Arial font like anything; when I added
jquery.tooltip.css, I have noticed that all the fonts have changed to
Arial. With FireBug, I have noticed that the jquery.tooltip.css's
style takes precedence for body tag.

Another thing, the id=tooltip is quite common thing, so it could
have been jqtooltip or so.
  

Good points, thanks a lot!

I'll seperate the demo and the plugin related styles into their own files.

Changing the default id would break existing code. Its used only in a 
single place, to making it an option would be easy. I find it convinient 
to just define styles for #tooltip.


What do you think?

--
Jörn Zaefferer

http://bassistance.de



[jQuery] Re: Using AutoCompleter, how do you pass parameters

2007-07-10 Thread Jörn Zaefferer


AtlantaGeek wrote:

Now if I could only make sense of that page.  g  So you wrote that
mod to the original AutoCompleter by Dylan V and now you and this
other guy Joern are working on it?  Sorry, just trying to understand
who's who.  What should I download from that page?
  
A somewhat stable version is here, complete with docs, demos and a 
convinient download package: 
http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/


On my own schedule validation 1.2 comes before any further work on 
autocomplete. Though once I'm there I'd like to finish all the stuff we 
added and make it an official plugin, ie. release 1.0 at last.


--
Jörn Zaefferer

http://bassistance.de



[jQuery] Re: Return attribute content from XPath match //[EMAIL PROTECTED]'banner']/@alt

2007-07-10 Thread Karl Swedberg

On Jul 10, 2007, at 1:06 PM, Klaus Hartl wrote:

Ok, say you want an array that gathers all the alt attributes of  
the matched elements, you can use the $.map method:


var altAttrs = $.map( $('img'), function() { return this.alt; } );


--Klaus



That's a good idea. Or, if you want to do stuff with the attribute,  
you could use an .each() method:


$('img').each(function() {
  var imgAlt = $(this).attr('alt');
  // do stuff
});


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






[jQuery] Re: ProtoLoad

2007-07-10 Thread John Resig


This is exactly what's done by blockUI:
http://www.malsup.com/jquery/block/#element

In fact, it's almost identical - I wonder if they got some inspiration
from blockUI?

--John

On 7/10/07, Glen Lipka [EMAIL PROTECTED] wrote:

I noticed this new ajax loading script. http://aka-fotos.de/protoload/

It's based on Prototype, but if you look just at the relevant script:
 http://aka-fotos.de/protoload/js/protoload.js

It's extremely small, but has a pretty nice feature set. (covering
individual items)
We have a few plugins that are similar to this, but maybe this is
inspirational to add a little something.

Glen



[jQuery] Re: announcement: jQuery-based generic board game interface

2007-07-10 Thread Jörn Zaefferer


Stephan Beal wrote:

b) you have a big enough screen/resolution that you can fit the board,
all playing cards, etc., on the screen. While fitting on the screen
is not a technical requirement, it eases usability greatly.
  
Sounds like the right application for surface computers: 
http://youtube.com/watch?v=CZrr7AZ9nCY


--
Jörn Zaefferer

http://bassistance.de



[jQuery] Re: ProtoLoad

2007-07-10 Thread Glen Lipka

I was sort of thinking like BlockUI Lite.  Block UI is 15K.  It does alot
more than this little thing does.
But sometimes you just need the little thing.

Glen

On 7/10/07, Rey Bango [EMAIL PROTECTED] wrote:



LOL! That was the same thing I thought of when I saw it this morning.

Rey

John Resig wrote:

 This is exactly what's done by blockUI:
 http://www.malsup.com/jquery/block/#element

 In fact, it's almost identical - I wonder if they got some inspiration
 from blockUI?

 --John

 On 7/10/07, Glen Lipka [EMAIL PROTECTED] wrote:
 I noticed this new ajax loading script. http://aka-fotos.de/protoload/

 It's based on Prototype, but if you look just at the relevant script:
  http://aka-fotos.de/protoload/js/protoload.js

 It's extremely small, but has a pretty nice feature set. (covering
 individual items)
 We have a few plugins that are similar to this, but maybe this is
 inspirational to add a little something.

 Glen



--
BrightLight Development, LLC.
954-775- (o)
954-600-2726 (c)
[EMAIL PROTECTED]
http://www.iambright.com



[jQuery] Re: ProtoLoad

2007-07-10 Thread Rey Bango


LOL! That was the same thing I thought of when I saw it this morning.

Rey

John Resig wrote:


This is exactly what's done by blockUI:
http://www.malsup.com/jquery/block/#element

In fact, it's almost identical - I wonder if they got some inspiration
from blockUI?

--John

On 7/10/07, Glen Lipka [EMAIL PROTECTED] wrote:

I noticed this new ajax loading script. http://aka-fotos.de/protoload/

It's based on Prototype, but if you look just at the relevant script:
 http://aka-fotos.de/protoload/js/protoload.js

It's extremely small, but has a pretty nice feature set. (covering
individual items)
We have a few plugins that are similar to this, but maybe this is
inspirational to add a little something.

Glen





--
BrightLight Development, LLC.
954-775- (o)
954-600-2726 (c)
[EMAIL PROTECTED]
http://www.iambright.com


[jQuery] Re: ProtoLoad

2007-07-10 Thread Mike Alsup


Glen,

It's not fair to judge a plugin's file size from the raw source.  It's
like saying jQuery is 60K.  Many plugins, like blockUI and the form
plugin, have extensive commenting - complete with examples.  I think
blockUI packs down to 5K which is still larger than Protoload, but
nowhere near 15K.  jQuery's build system lets you min or pack the
plugins quite easily!  :-)

Mike


On 7/10/07, Glen Lipka [EMAIL PROTECTED] wrote:

I was sort of thinking like BlockUI Lite.  Block UI is 15K.  It does alot
more than this little thing does.
But sometimes you just need the little thing.

Glen


On 7/10/07, Rey Bango [EMAIL PROTECTED] wrote:

 LOL! That was the same thing I thought of when I saw it this morning.

 Rey

 John Resig wrote:
 
  This is exactly what's done by blockUI:
  http://www.malsup.com/jquery/block/#element
 
  In fact, it's almost identical - I wonder if they got some inspiration
  from blockUI?
 
  --John
 
  On 7/10/07, Glen Lipka  [EMAIL PROTECTED] wrote:
  I noticed this new ajax loading script. http://aka-fotos.de/protoload/
 
  It's based on Prototype, but if you look just at the relevant script:
   http://aka-fotos.de/protoload/js/protoload.js
 
  It's extremely small, but has a pretty nice feature set. (covering
  individual items)
  We have a few plugins that are similar to this, but maybe this is
  inspirational to add a little something.
 
  Glen
 
 

 --
 BrightLight Development, LLC.
 954-775- (o)
 954-600-2726 (c)
 [EMAIL PROTECTED]
 http://www.iambright.com





[jQuery] Re: ProtoLoad

2007-07-10 Thread Glen Lipka

Sorry, you are right.  I just did a quick size check, I didnt think about
the comments.
My bad.  mea culpa! :)

Glen

On 7/10/07, Mike Alsup [EMAIL PROTECTED] wrote:



Glen,

It's not fair to judge a plugin's file size from the raw source.  It's
like saying jQuery is 60K.  Many plugins, like blockUI and the form
plugin, have extensive commenting - complete with examples.  I think
blockUI packs down to 5K which is still larger than Protoload, but
nowhere near 15K.  jQuery's build system lets you min or pack the
plugins quite easily!  :-)

Mike


On 7/10/07, Glen Lipka [EMAIL PROTECTED] wrote:
 I was sort of thinking like BlockUI Lite.  Block UI is 15K.  It does
alot
 more than this little thing does.
 But sometimes you just need the little thing.

 Glen


 On 7/10/07, Rey Bango [EMAIL PROTECTED] wrote:
 
  LOL! That was the same thing I thought of when I saw it this morning.
 
  Rey
 
  John Resig wrote:
  
   This is exactly what's done by blockUI:
   http://www.malsup.com/jquery/block/#element
  
   In fact, it's almost identical - I wonder if they got some
inspiration
   from blockUI?
  
   --John
  
   On 7/10/07, Glen Lipka  [EMAIL PROTECTED] wrote:
   I noticed this new ajax loading script.
http://aka-fotos.de/protoload/
  
   It's based on Prototype, but if you look just at the relevant
script:
http://aka-fotos.de/protoload/js/protoload.js
  
   It's extremely small, but has a pretty nice feature set. (covering
   individual items)
   We have a few plugins that are similar to this, but maybe this is
   inspirational to add a little something.
  
   Glen
  
  
 
  --
  BrightLight Development, LLC.
  954-775- (o)
  954-600-2726 (c)
  [EMAIL PROTECTED]
  http://www.iambright.com
 





[jQuery] Re: Syntactic sugar for checking whether an element exists

2007-07-10 Thread Jonathan Chaffer


On Jul 9, 2007, at 23:57 , Erik Beeson wrote:



In fact, if you find yourself doing a lot of if(something exists) {
... } else { ...}, you might want to consider trying to move some of
your code into a plugin. Most jQuery functions/plugins already deal
with the if(exists)... part by simply not executing if nothing is
selected.


Along those lines, I especially like using .each() for this kind of  
logic:


$('#myId').each(function() {
  // do things with this here
});

The .each() functions as an if, automatically scales to multiple  
matches (often without planning for it), and as a bonus creates a  
little namespace in the function where you can declare local variables.

--
Jonathan Chaffer
Technology Officer, Structure Interactive




[jQuery] Re: WYSIWYG Editor in Jquery

2007-07-10 Thread Jean-Francois Hovinne

Hi Gurpreet,
It's a pity that you plan to abandon using WYMeditor because of sparse
documentation.
Please feel free to ask any questions/send feedback on the mailing-
list [1] or on the forum [2], we'll be glad to help.

Cheers,
jf

[1]: http://lists.wymeditor.org/
[2]: http://forum.wymeditor.org/

On Jul 3, 10:41 am, G[N]Urpreet Singh [EMAIL PROTECTED] wrote:
 Thanks guys,
 But I used WYMEDITOR (http://www.wymeditor.org/en/) for this project. Making
 it work was a pain primarily because of sparse documentation.




[jQuery] Re: ProtoLoad

2007-07-10 Thread Rey Bango


You have incurred the wrath of Alsup. Poor you! ;)

Glen Lipka wrote:
Sorry, you are right.  I just did a quick size check, I didnt think 
about the comments.

My bad.  mea culpa! :)

Glen

On 7/10/07, *Mike Alsup*  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
wrote:



Glen,

It's not fair to judge a plugin's file size from the raw source.  It's
like saying jQuery is 60K.  Many plugins, like blockUI and the form
plugin, have extensive commenting - complete with examples.  I think
blockUI packs down to 5K which is still larger than Protoload, but
nowhere near 15K.  jQuery's build system lets you min or pack the
plugins quite easily!  :-)

Mike


On 7/10/07, Glen Lipka [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
wrote:
  I was sort of thinking like BlockUI Lite.  Block UI is 15K.  It
does alot
  more than this little thing does.
  But sometimes you just need the little thing.
 
  Glen
 
 
  On 7/10/07, Rey Bango [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]  wrote:
  
   LOL! That was the same thing I thought of when I saw it this
morning.
  
   Rey
  
   John Resig wrote:
   
This is exactly what's done by blockUI:
http://www.malsup.com/jquery/block/#element
   
In fact, it's almost identical - I wonder if they got some
inspiration
from blockUI?
   
--John
   
On 7/10/07, Glen Lipka  [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
I noticed this new ajax loading script.
http://aka-fotos.de/protoload/
   
It's based on Prototype, but if you look just at the
relevant script:
  http://aka-fotos.de/protoload/js/protoload.js
   
It's extremely small, but has a pretty nice feature set.
(covering
individual items)
We have a few plugins that are similar to this, but maybe
this is
inspirational to add a little something.
   
Glen
   
   
  
   --
   BrightLight Development, LLC.
   954-775- (o)
   954-600-2726 (c)
   [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
   http://www.iambright.com
  
 
 




--
BrightLight Development, LLC.
954-775- (o)
954-600-2726 (c)
[EMAIL PROTECTED]
http://www.iambright.com


[jQuery] FishEye Math

2007-07-10 Thread Jeff (Gmail)

I am playing around the with great Interface plugins, the
http://interface.eyecon.ro/demos/fisheye.html in particular and was
wondering if anyone had played around with the code to allow for
different sized images to be used, rather than a single size?  Any
math wiz that could point me in the right direction would be greatly
appreciated.  In the meantime, I'll keep on with my own trial and
error.

Thanks!

*



[jQuery] Re: FishEye Math

2007-07-10 Thread John Farrar


I didn't like the implementation. It steals real estate before you are 
actually using the menu. I believe it should only respond AFTER your 
have triggered the space. Then if you move off it the trigger area 
should go back to just the menu and be dormant again.


John

Jeff (Gmail) wrote:

I am playing around the with great Interface plugins, the
http://interface.eyecon.ro/demos/fisheye.html in particular and was
wondering if anyone had played around with the code to allow for
different sized images to be used, rather than a single size?  Any
math wiz that could point me in the right direction would be greatly
appreciated.  In the meantime, I'll keep on with my own trial and
error.

Thanks!

*


  




[jQuery] Re: allow no more than 3 checkboxes checked

2007-07-10 Thread cfdvlpr

That works very well.  Could you also grey out the unchecked
checkboxes after 3 are checked?

 You can try this:
 $.fn.limit = function(n) {
   var self = this;
   this.click(function(){ return (self.filter(:checked).length=n); });}

 $(input:checkbox).limit(3);



[jQuery] Re: WYSIWYG Editor in Jquery

2007-07-10 Thread Tane Piper


Yea, that is pretty weak - if you have an issue with it, bring it up
an help develop it - thats the only way these things grow.


It's a pity that you plan to abandon using WYMeditor because of sparse
documentation.

--
Tane Piper
http://digitalspaghetti.tooum.net

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


[jQuery] IE7 and jQuery Corners.....

2007-07-10 Thread Jason

Howdy,


On a site I'm test designing I'm using jQuery and Corners, and it's
working great so far.  The problem I'm having with my site is IE7.  In
Firefox, it works great, all corners are the way I want them.  In IE7,
only the bottom is rounded. I need help..

http://www.jswindle.com/testing/trisha/


Thanks!



[jQuery] Element defined or not

2007-07-10 Thread Sebastián V. Würtz


Wich is the best way to know if a element for example a div is defined?

like in php

if ( empty($test) )

or

if ( isset($test) )


thx


[jQuery] Re: ProtoLoad

2007-07-10 Thread Mike Alsup


Wrath?  But I used a smiley!

Mike

On 7/10/07, Rey Bango [EMAIL PROTECTED] wrote:


You have incurred the wrath of Alsup. Poor you! ;)

Glen Lipka wrote:
 Sorry, you are right.  I just did a quick size check, I didnt think
 about the comments.
 My bad.  mea culpa! :)

 Glen

 On 7/10/07, *Mike Alsup*  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
 wrote:


 Glen,

 It's not fair to judge a plugin's file size from the raw source.  It's
 like saying jQuery is 60K.  Many plugins, like blockUI and the form
 plugin, have extensive commenting - complete with examples.  I think
 blockUI packs down to 5K which is still larger than Protoload, but
 nowhere near 15K.  jQuery's build system lets you min or pack the
 plugins quite easily!  :-)


[jQuery] Fwd: [jQuery] Re: allow no more than 3 checkboxes checked

2007-07-10 Thread Sean Catchpole

On 7/10/07, cfdvlpr [EMAIL PROTECTED] wrote:

That works very well.  Could you also grey out the unchecked
checkboxes after 3 are checked?


$.fn.limit = function(n) {
 var self = this;
 this.click(function(){
   (self.filter(:checked).length==n)?
 self.not(:checked).attr(disabled,true).addClass(disabled):
 self.not(:checked).attr(disabled,false).removeClass(disabled);
 });
}
$(input:checkbox).limit(3);

~Sean


[jQuery] Re: Element defined or not

2007-07-10 Thread Matt Stith

Try

if ($(selector).length0){
  //...
}

On 7/10/07, Sebastián V. Würtz [EMAIL PROTECTED] wrote:



Wich is the best way to know if a element for example a div is defined?

like in php

if ( empty($test) )

or

if ( isset($test) )


thx



[jQuery] Re: Element defined or not

2007-07-10 Thread Sean Catchpole

On 7/10/07, Sebastián V. Würtz [EMAIL PROTECTED] wrote:

Wich is the best way to know if a element for example a div is defined?


We get this question a lot. jQuery returns the DOM in an array like fashion.
This is standard:
if($(div).length) ...
or sometimes:
var div = $(div)[0];
if(div) ...


~Sean


[jQuery] Re: BlockUI, order of ops issue

2007-07-10 Thread Mike Alsup


traunic,

You'll need to put your sorting code in a setTimeout fn so that the
browser has time to render the block before you pin the cpu.  Try
something like this:

$(#entries).each(function(prntI,prnt){
  $.blockUI();
  setTimeout(function() {
  $(div.entry,prnt).sort(function(a,b){
  var x = $(span.foo,a).html();
  var y = $(span.foo,b).html();
  return ((x  y) ? -1 : ((x  y) ? 1 : 0));
  }).appendTo(prnt);
  $.unblockUI();
  }, 10);
});

Mike


On 7/10/07, traunic [EMAIL PROTECTED] wrote:


Earlier today I was looking at sorting code like this:

div id=entries
div class=entryspan class=foofoo1/spanspan
class=barbar1/span/div
div class=entryspan class=foofoo2/spanspan
class=barbar2/span/div

/div

And in implementing this realized that there can be a considerable
delay in the processing if the number of #entries div.entry is high.
So I wanted to use blockUI to let the user know the application is
working.  I tried this:

$(#entries).each(function(prntI,prnt){
$.blockUI();
$(div.entry,prnt).sort(function(a,b){
var x = $(span.foo,a).html();
var y = $(span.foo,b).html();
return ((x  y) ? -1 : ((x  y) ? 1 : 0));
}).appendTo(prnt);
$.unblockUI();
});

But do not see any messages.  If I add an alert after the $.blockUI();
before the sort, then everything works as expected (with the exception
of the unwanted alert).  Is there a way to block - sort - unblock?
I am using blockUI v1.26  jQuery v1.1.3.1

p.s. the sort thread that started this is:
http://groups.google.com/group/jquery-en/browse_frm/thread/e0d6c199552dd1f7




[jQuery] Re: Fwd: [jQuery] Re: allow no more than 3 checkboxes checked

2007-07-10 Thread Andy Matthews
Why add the class disabled Sean?

  _  

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Sean Catchpole
Sent: Tuesday, July 10, 2007 4:19 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Fwd: [jQuery] Re: allow no more than 3 checkboxes checked


On 7/10/07, cfdvlpr [EMAIL PROTECTED] wrote:
 That works very well.  Could you also grey out the unchecked
 checkboxes after 3 are checked?

$.fn.limit = function(n) {
  var self = this;
  this.click(function(){
(self.filter(:checked).length==n)?
  self.not(:checked).attr(disabled,true).addClass(disabled):
  self.not(:checked).attr(disabled,false).removeClass(disabled);
  }); 
}
$(input:checkbox).limit(3); 

~Sean 


[jQuery] Re: Fwd: [jQuery] Re: allow no more than 3 checkboxes checked

2007-07-10 Thread Jonathan Sharp

You're missing your return statement in this revised version (for the
noob's: which is needed to cancel the event)

-js


On 7/10/07, Sean Catchpole [EMAIL PROTECTED] wrote:


On 7/10/07, cfdvlpr [EMAIL PROTECTED] wrote:
 That works very well.  Could you also grey out the unchecked
 checkboxes after 3 are checked?

$.fn.limit = function(n) {
  var self = this;
  this.click(function(){
(self.filter(:checked).length==n)?
  self.not(:checked).attr(disabled,true).addClass(disabled):
  self.not(:checked).attr(disabled,false).removeClass(disabled);
  });
}
$(input:checkbox).limit(3);

~Sean



[jQuery] Re: ProtoLoad

2007-07-10 Thread Rey Bango


He hasn't. I've incurred it and your wrath leaves lasting effects. ;)

Mike Alsup wrote:


Oh my!  How could I have been so wrong?  I hope you've recovered!

Mike


On 7/10/07, Glen Lipka [EMAIL PROTECTED] wrote:

You used :-)  rather than :)

The nose adds wrath.  Plain as the nose on my face.

Glen


On 7/10/07, Mike Alsup [EMAIL PROTECTED] wrote:

 Wrath?  But I used a smiley!

 Mike

 On 7/10/07, Rey Bango [EMAIL PROTECTED] wrote:
 
  You have incurred the wrath of Alsup. Poor you! ;)
 




--
BrightLight Development, LLC.
954-775- (o)
954-600-2726 (c)
[EMAIL PROTECTED]
http://www.iambright.com


[jQuery] Re: BlockUI, order of ops issue

2007-07-10 Thread traunic

As you may have suspected this example is greatly simplified from what
I am working with.  My real div.entrys look more like:

div div class=entry
a href=# id=123
img src=/img/filename.jpg border=0 height=230 
width=176
/a
div class=createDateDIV
span class=labelSPANcreate date:/span
span class=valueSPAN11-29-2007/span
/div
div class=createDateIntDIV
span class=valueSPAN1196312400813/span
/div
div class=updateDateDIV
span class=labelSPANupdate date:/span
span class=valueSPAN01-01-2008/span
/div
div class=updateDateIntDIV
span class=valueSPAN1199163600828/span
/div
div class=createdByDIV
span class=labelSPANcreated by:/span
span class=valueSPANJohn Doe/span
/div
div class=imageNameDIV
span class=labelSPANimage name:/span
span class=valueSPANmy filename picture/span
/div
div class=sizeDIV
span class=labelSPANsize:/span
span class=valueSPANlarge/span
/div
/div

and my sorting looks more like:

$(#entries).each(function(prntI,prnt){
switch($(#myform div.displayOrderDIV input:checked).val()){
case createDate:
$(div.entry,prnt).sort(function(a,b){
var x = $(div.createDateIntDIV 
span.valueSPAN,a).html();
var y = $(div.createDateIntDIV 
span.valueSPAN,b).html();
return ((x  y) ? -1 : ((x  y) ? 1 : 0));
}).appendTo(prnt);
break;
case updateDate:
$(div.entry,prnt).sort(function(a,b){
var x = $(div.updateDateIntDIV 
span.valueSPAN,a).html();
var y = $(div.updateDateIntDIV 
span.valueSPAN,b).html();
return ((x  y) ? -1 : ((x  y) ? 1 : 0));
}).appendTo(prnt);
break;
case imageName:
$(div.entry,prnt).sort(function(a,b){
var x = $(div.imageNameDIV 
span.valueSPAN,a).html();
var y = $(div.imageNameDIV 
span.valueSPAN,b).html();
return ((x  y) ? -1 : ((x  y) ? 1 : 0));
}).appendTo(prnt);
break;
}
});

Clicking radio buttons resorts the thumbnails, and yes, it is horribly
slow.  Node tree navigation gets a little messy with this structure,
but I can tweak the nodes a bit to help that.  It makes sense that
would be quicker (I think I was letting jQuery make me lazy ;).  Any
other ideas would be greatly appreciated.

-wade


On Jul 10, 5:37 pm, Michael Geary [EMAIL PROTECTED] wrote:
 The browser doesn't render anything while you are running a script, only
 when the script stops. That's way alert() makes it work - it stops your
 script and gives the browser a chance to render. You could follow the
 blockUI() call with a 1 millisecond setTimeout call with the rest of your
 code inside the callback function.

 But wouldn't you rather have a faster sort? That sort function is going to
 be extremely slow. You may not need blockUI at all if the sort is fast
 enough.

 A question related to that: Is the .foo span always the first child element
 of each .entry div? There's one obvious speedup you can make if it is -
 a.firstChild.innerHTML instead of $('span.foo',a).html() - but also a much
 greater speedup by changing the sort algorithm. Let me know on that and I'll
 get back to you with a faster way to sort the entries - or maybe just the
 change above will be good enough.

 -Mike



  From: traunic

  Earlier today I was looking at sorting code like this:

  div id=entries
  div class=entryspan class=foofoo1/spanspan
  class=barbar1/span/div div class=entryspan
  class=foofoo2/spanspan class=barbar2/span/div 
  /div

  And in implementing this realized that there can be a
  considerable delay in the processing if the number of
  #entries div.entry is high.
  So I wanted to use blockUI to let the user know the
  application is working.  I tried this:

  $(#entries).each(function(prntI,prnt){
 $.blockUI();
 $(div.entry,prnt).sort(function(a,b){
 var x = $(span.foo,a).html();
 var y = $(span.foo,b).html();
 return ((x  y) ? -1 : ((x  y) ? 1 : 0));
 }).appendTo(prnt);
 $.unblockUI();
  });

  But do not see any messages.  If I add an alert after the
  $.blockUI(); before the sort, then everything works as
  expected (with the exception of the unwanted alert).  Is
  there a way to block - sort - unblock?
  I am using blockUI v1.26  jQuery v1.1.3.1

  p.s. the sort thread that started this 

[jQuery] Re: Fwd: [jQuery] Re: allow no more than 3 checkboxes checked

2007-07-10 Thread Sean Catchpole

On 7/10/07, Andy Matthews [EMAIL PROTECTED] wrote:

Why add the class disabled Sean?

In case someone wanted to change the CSS when it is disabled.

On 7/10/07, Jonathan Sharp [EMAIL PROTECTED] wrote:

You're missing your return statement in this revised version (for the

noob's: which is needed to cancel the event)
Which isn't needed because the checkbox is now disabled.

~Sean


[jQuery] NEWS: Digg uses jQuery to Build the Digg iPhone App

2007-07-10 Thread Rey Bango


Joe Stump and his crew over at Digg have really been pounding on jQuery 
lately and loving every minute of it. The latest to come out of 
Digg-ville is the new Digg iPhone web app. Main Digg-dude Kevin Rose 
talks about the new app on the Digg blog and sends out props to the 
jQuery team for their help.


Be sure to Digg it up!

http://digg.com/tech_news/Digg_iPhone_Beta_Live

Rey


[jQuery] Re: NEWS: Digg uses jQuery to Build the Digg iPhone App

2007-07-10 Thread Sean Catchpole


Cool news, thanks for the info Rey.

~Sean


[jQuery] Re: NEWS: Digg uses jQuery to Build the Digg iPhone App

2007-07-10 Thread Rey Bango


Anytime my man.

Sean Catchpole wrote:


Cool news, thanks for the info Rey.

~Sean



--
BrightLight Development, LLC.
954-775- (o)
954-600-2726 (c)
[EMAIL PROTECTED]
http://www.iambright.com


[jQuery] Issues with retrieving an object

2007-07-10 Thread [EMAIL PROTECTED]

$('#downloadable_' + songId + ' 
a').clone(true).appendTo('#downloadable_ ' + songId);


I checked, and downloadable_' + songId  is definitely an element.
Yet, this isn't working, it should, right?

That element will always only have one link in it and I want to clone
it and append it to it's parent (the element).



  1   2   >