[jQuery] Re: bug in id selector?

2009-01-22 Thread spinnach

I believe that it will function as intended if you escape the dot,
like so:
$(#test2\.3)

although I've tried now in Firebug and it seems you have to escape the
slash too, like so (don't know why, is it because of Firebug, or?):
$(#test2\\.3)

Cheers,
Dennis.

On Jan 22, 5:21 pm, finn.herp...@marfinn-software.de
finn.herp...@marfinn-software.de wrote:
 Sounds good.

 Too bad my ids are given by an external xml-file. But since I wrote a
 workaround to replace all . in the ids with _ it's fine for me ;).

 Thanks

 Cheers

 On Jan 22, 4:13 pm, Liam Potter radioactiv...@gmail.com wrote:

  jQuery will read it as id test2 with the class 3

  While periods are allowed in the attribute I would advise against them,
  as it's not just jQuery that could struggle with them but most CSS as
  well, as #test2.3 with again read as id test2 with the class 3.

  Finn Herpich wrote:
   Hi everyone,

   the attached example-code shows a problem I encountered today (firebug
   needed).

   If an id-attribute contains dots, like
   p id=test2.3/p
    jQuery isn't able to find it.
   If the dots are replaced by underscores everything works fine.

   Afaik there is no limitation for the id which prohibit dots as a used
   symbol, so I guess this is a bug or for some reason not wanted?

   Cheers


[jQuery] [sites using jQuery] adobe.com

2008-09-22 Thread spinnach


dunno if anybody noticed, but adobe is using jQuery on some of their pages:

http://opensource.adobe.com/wiki/display/site/Projects

dennis.


[jQuery] Re: Can jQuery do this?

2008-04-18 Thread spinnach


maybe i'm looking at a different page than you, but isn't this page in 
flash :) ?


dennis.

Andy Matthews wrote:


It looks like all they're doing is to display a DIV when the select a
phone dropdown is clicked. That div contains a multi-select box, with
associated images. There's nothing built in to jQuery to this completely,
but jQuery could make doing this quite simple. 


-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of sutra
Sent: Thursday, April 17, 2008 7:02 PM
To: jQuery (English)
Subject: [jQuery] Can jQuery do this?


In this site, at the left column, the Model Number, when you click on Select
a Phone, the dropdown stay and you can hover through each phone model with
viewable thumbnails.

http://www.nokiausa.com/A4409001

thanks!
sutra







[jQuery] Re: [tooltip] Looping and variable tooltip setup

2008-02-23 Thread spinnach


derek,

i haven't thoroughly examined how bodyHandler works but i think 
something like this should work, provided that your html structure won't 
change:


$('div[id^=tt]').tooltip({
  bodyHandler: function(){
return $(this).next().html();
  }
});

if your html structure will change, you could do something like this:

$('div[id^=tt]').tooltip({
  bodyHandler: function(){
var id = 'tb' + this.id.substr(2);
return $('#'+id).html();
  }
});

although i'd recommend using classes instead of id's, to avoid 
cluttering your html (and then using something in the lines of the first 
example, only instead of $('div[id^=tt]') you could use $('div.tt'), and 
of course, putting a tt class on the 'item' divs ) ..


dennis.

derek wrote:


Greetings,

After evaluating several different javascript tooltip libraries I've
settled on the jQuery 'Tooltip' plug-in, however I'm having one minor
issue getting something working.

I'm trying to setup a series of pairs of tooltip triggers/bodies using
a generic naming system so that it's easily enable through CGI
scripts.

To test I have two sets of triggers/bodies that look like this:

table
tr
td
div id=tt0Item 1/div
div id=tb0 class=tbItem 1's Tooltip/div
/td
td
div id=tt1Item 2/div
div id=tb1 class=tbItem 2's Tooltip/div
/td
/tr
/table

Where the div with the 'tt?' ids are the tooltip triggers and the
'tb?' ids are the associated tooltip bodies.

Now, if for each pair I add the following jQuery script the results
are fine:

$(function() {
$(#tt0).tooltip({bodyHandler: function(){return $
(#tb0).html();}});
$(#tt1).tooltip({bodyHandler: function(){return $
(#tb1).html();}});
});

I get the appropriate tooltip bodies when the mouse hovers over the
triggers.
The pages that will be generated however will have dozens of tooltips
and to have one of these for each would end up causing a lot of
overhead in the output, so to alleviate this output overhead I'd like
to have a loop that will dynamically perform that.  Currently I have
the following code:

$(function() {
var tc = $('[id^=tt]').size();
for (var i = 0; i  tc; i++) {
var tt = #tt + i;
var tb = #tb + i;
$(tt).tooltip({bodyHandler: function(){return $
(tb).html();}});
}
});

This does create tooltips for the two triggers, however both of them
have the tooltip body from 'tb1', I've verified that the values for
the 'tt' and 'tb' variables are correct during the loop, and
the .text() values from the bodies also show the correct values.
Is there something I'm missing from this, or am I going about this the
wrong way?

I would appreciate any comments or suggestions!

Thanks,
Derek R.





[jQuery] Re: [tooltip] Looping and variable tooltip setup

2008-02-23 Thread spinnach


derek,

i'm not sure if there are any speed advantages (in both cases jquery has 
to loop through all divs on the page to find the ones you need - either 
by class or by id, so there probably is none) but by using classes your 
keeping your html cleaner..


as a rule, things that repeat on a page or through out the site, and 
have the same purpose, should use classes, and things which are specific 
and more important should use id's.. or at least, that's the how i do it 
:)..


dennis.

derek wrote:


dennis,

Thanks for the help, both of your examples work great.
I also tried substituting in a class 'tt' in place of the individual
ids and that seems to work good as well.
Is there any speed advantage to this method?  I'll probably end up
using this method instead as it seems more elegant.

Thanks again!

Derek R.

On Feb 23, 8:16 am, spinnach [EMAIL PROTECTED] wrote:

derek,

i haven't thoroughly examined how bodyHandler works but i think
something like this should work, provided that your html structure won't
change:

$('div[id^=tt]').tooltip({
   bodyHandler: function(){
 return $(this).next().html();
   }

});

if your html structure will change, you could do something like this:

$('div[id^=tt]').tooltip({
   bodyHandler: function(){
 var id = 'tb' + this.id.substr(2);
 return $('#'+id).html();
   }

});

although i'd recommend using classes instead of id's, to avoid
cluttering your html (and then using something in the lines of the first
example, only instead of $('div[id^=tt]') you could use $('div.tt'), and
of course, putting a tt class on the 'item' divs ) ..

dennis.

derek wrote:


Greetings,
After evaluating several different javascript tooltip libraries I've
settled on the jQuery 'Tooltip' plug-in, however I'm having one minor
issue getting something working.
I'm trying to setup a series of pairs of tooltip triggers/bodies using
a generic naming system so that it's easily enable through CGI
scripts.
To test I have two sets of triggers/bodies that look like this:
table
tr
td
div id=tt0Item 1/div
div id=tb0 class=tbItem 1's Tooltip/div
/td
td
div id=tt1Item 2/div
div id=tb1 class=tbItem 2's Tooltip/div
/td
/tr
/table
Where the div with the 'tt?' ids are the tooltip triggers and the
'tb?' ids are the associated tooltip bodies.
Now, if for each pair I add the following jQuery script the results
are fine:
$(function() {
$(#tt0).tooltip({bodyHandler: function(){return $
(#tb0).html();}});
$(#tt1).tooltip({bodyHandler: function(){return $
(#tb1).html();}});
});
I get the appropriate tooltip bodies when the mouse hovers over the
triggers.
The pages that will be generated however will have dozens of tooltips
and to have one of these for each would end up causing a lot of
overhead in the output, so to alleviate this output overhead I'd like
to have a loop that will dynamically perform that.  Currently I have
the following code:
$(function() {
var tc = $('[id^=tt]').size();
for (var i = 0; i  tc; i++) {
var tt = #tt + i;
var tb = #tb + i;
$(tt).tooltip({bodyHandler: function(){return $
(tb).html();}});
}
});
This does create tooltips for the two triggers, however both of them
have the tooltip body from 'tb1', I've verified that the values for
the 'tt' and 'tb' variables are correct during the loop, and
the .text() values from the bodies also show the correct values.
Is there something I'm missing from this, or am I going about this the
wrong way?
I would appreciate any comments or suggestions!
Thanks,
Derek R.






[jQuery] Re: is there a tab-indexer plugin?

2008-02-16 Thread spinnach


try this:

$('a').each(function(i,e){
  $(this).attr('tabindex', i);
});

dennis.

[EMAIL PROTECTED] wrote:


or does anyone know how to make one? Something that will incrementally
number the tabindexes for all the hrefs on a page? It's a shot in the
dark, but worth trying to save all that effort!
Cherry :)

http://jquery.cherryaustin.com





[jQuery] Re: How to define FireBug?

2008-02-14 Thread spinnach


try

if (window.console) {
  console.log(...);
}

dennis.

mtest wrote:


Hello all :)
If it possible to define Firebug? Install it or not? Like it possible
do whis browsers by command:

if ($.browser.safari) {
   alert(this is safari!);
}

maybe like this :))

if ($.extensions.firebug) {
   alert(FireBug is install!);
}

Thank you to attention,
and one more time sorry for my poor english:), but I try hard :)





[jQuery] Re: what editor do you use?

2008-02-13 Thread spinnach


..you mean notepad++ :)..

i'm using it also, great little app..

dennis.

Feijó wrote:
I changed my own a few weeks ago, now I'm using Editpad++ 
(http://sourceforge.net/projects/notepad-plus/)
its freeware, nice resources, like macros, quick-text, highlighted 
source, ...


and yours?

--

Feijó





[jQuery] Re: JQuery Event Fires Before Expected

2008-01-29 Thread spinnach


dunno if somebody answered this already, but you should remove the 
.change() call at the end of your chain, because it immediately triggers 
your change function, and thus firing your test alert..


dennis.

cnxmax wrote:


I'm trying something pretty basic in JQuery (I think).

I want to run a function that will make it so that every Input on the
page will run a function (in this case, alert) whenever the change
event happens for that element.

It does work, but for some reason the test alert also fires right
when I first run sasBindFormEvents(). Why is this? I only want the
test alert when something is typed and then the focus is removed
from the input.

CODE:


function sasBindFormEvents() {
$('input').change(function () {
  alert('test');
})
.change();
}







[jQuery] Re: How to get applet width and height in Firefox

2008-01-28 Thread spinnach


try this:
var appletWidth = $('#MyApplet').attr('width');

dennis.

Bastor wrote:


Hi,

I was trying to get an applet width and height using jquery and have
found this problem:



applet code=MyApplet.class archive=HelloApllet.jar id=MyApplet
width=80% height=80%


var appletWidth = $('MyApplet').width();

and in firefox got nothing but in IE works fine

I have googled but found nothing about that.

Sombody now why it does'nt work in FF ? And how can i get applet width
in FF ?

regards





[jQuery] [SITE ADDITION] pythonline.com

2008-01-11 Thread spinnach


seems that the pythons also recognized jquery as a quality product :)..

http://pythonline.com/

dennis.


[jQuery] Re: [SITE ADDITION] pythonline.com

2008-01-11 Thread spinnach


aaah, i see you have the machine that goes PING!

Andre Meyer wrote:
On Jan 11, 2008 12:39 PM, spinnach [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:



seems that the pythons also recognized jquery as a quality product :)..

http://pythonline.com/


of course http://cheeseshop.python.org/pypi/jquery ;-)

regards
andré




[jQuery] Re: IE 7 Problems - Won't load javascript - fine in FF 2+

2007-11-17 Thread spinnach


try changing the type=application/javascript to 
type=text/javascript, that should do the trick.


dennis.

Chris J. Lee wrote:

For some reason my website (http://hire.chrisjlee.net/) does not work
at all on IE 7. It refuses to read any of my javascripts while on
Firefox it's totally fine.  It's probably something simple that I'm
not thinking about. But I've looked it over for quite a while and
would like a pair of fresh eyes.

Anyone have any ideas

- Chris





[jQuery] Re: Flash and jQuery

2007-10-15 Thread spinnach


or you can use ExternalInterface, which can also be used to communicate 
between flash and js (both ways - flash to js and js to flash)..


dennis.

Brian Cherne wrote:
A word of caution about using getUrl in flash. If there is any way 
getUrl can be called before your page has finished loading, it may 
prevent your page from loading fully in IE.


This happened on a large web site I worked on a year ago. We never saw 
the problem in development because we were sitting on top of the dev 
servers and everything loaded quickly. But in production, the servers 
were across the country and the latency delayed loading just enough for 
a quick-on-the-draw SWF to call getUrl ... and anything after that call 
would cease to load in IE. The result looked like an intermittent/random 
web server issue (some css and/or images not loading). But it was the 
getUrl call. IE interpreted that call as if the user had clicked on a 
link that took them to another page... regardless of the fact that it 
was making a call to JavaScript that revealed a DHTML layer.


I understand there are a few other alternatives to getUrl... but I'm not 
familiar with them. On the example project above we ended up with a 
solution that removed the SWF - JavaScript call altogether.


If you're building a web application that requires significant SWF - 
JavaScript communication you may consider building an Adobe AIR 
application. They've built AIR so that SWF and JS can talk effortlessly.


Cheers,
Brian.

P.S. We now always use latency/bandwidth throttling during development 
to expose such issues... look at the application called Charles ... 
it's a local web proxy that can also be used to throttle your 
connection... http://www.xk72.com/charles/ http://www.xk72.com/charles/



On 10/5/07, *njsuperfreak* [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:



Sweet! Good Find Brett, and thanks Sam! I think I am definitely going
to experiment with this. looks interesting...

On Oct 4, 8:19 pm, Brett [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]  wrote:
  Interesting, I googled up and found an example of
this:http://www.quirksmode.org/js/flash_call.html
 
  Not jQuery as such in the demo, but any function you write can refer
  to jQuery.
 
  On Oct 5, 8:10 am, Sam Sherlock [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
 
   your flash would need to be wmode=transparent
 
   and you'd need to call a javascript function from within flash
that in turn
   calls the grey box function
 
   since jquery applies the onclick event to all anchors with a
class of
   greybox you'll need simluar code inside you function that you
call from
   flash.
 
   getURL('javascript:callGreyboxFromFlash()');
 
   - S
 
   On 04/10/2007, njsuperfreak  [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
 
Can Flash communicate with jQuery? I would like to use flash to
interact with jQuery like opening up a dialogbox using the
greybox.js
plugin. How would I go about doing that any ideas?
 
The code is activated by the class=greybox






[jQuery] jQuery bug, or ?

2007-10-01 Thread spinnach


this returns an error in IE7, works fine in firefox, is this a bug or 
something i overlooked ?


var $div = $('div class=fileinputs/div');

dennis.


[jQuery] Re: jQuery bug, or ?

2007-10-01 Thread spinnach


it's without any plugins or other code on the page, i have IE 
WebDeveloper v2 toolbar installed, and when i just type that in the 
console i get this error:


Error  Expected ')'  http://x.com/ (line 1)

dennis.


Benjamin Sterling wrote:

Spinnach,
That should work, I am using just that in a number of plugins, is there 
any other code on the page? Can you post the error?


On 10/1/07, *Giovanni Battista Lenoci * [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:



spinnach ha scritto:
 
  this returns an error in IE7, works fine in firefox, is this a bug or
  something i overlooked ?
 
  var $div = $('div class=/div');
Try

var $div = $('div/div');
$div.addClass('fileinputs');

Giovanni




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




[jQuery] Re: jQuery bug, or ?

2007-10-01 Thread spinnach


you should see x then :) ..

and sorry, but the error seems to be related to IE WebDeveloper, when 
typing the code in the console it didn't work.. when i put it in the 
head of the html file, it worked.. so thanks for your time, but it seems 
the problem was not related to jquery after all :) ..


dennis.

Benjamin Sterling wrote:

WOW... is x better then xxx :)

Two more questions:
Have you tried Giovanni's suggestion and does that give you the same error?

Can you post a live example?

On 10/1/07, *spinnach* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:


it's without any plugins or other code on the page, i have IE
WebDeveloper v2 toolbar installed, and when i just type that in the
console i get this error:

Error  Expected ')'   http://x.com/ (line 1)

dennis.


Benjamin Sterling wrote:
  Spinnach,
  That should work, I am using just that in a number of plugins, is
there
  any other code on the page? Can you post the error?
 
  On 10/1/07, *Giovanni Battista Lenoci * [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
  mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote:
 
 
  spinnach ha scritto:
   
this returns an error in IE7, works fine in firefox, is
this a bug or
something i overlooked ?
   
var $div = $('div class=/div');
  Try
 
  var $div = $('div/div');
  $div.addClass('fileinputs');
 
  Giovanni
 
 
 
 
  --
  Benjamin Sterling
  http://www.KenzoMedia.com
  http://www.KenzoHosting.com
  http://www.benjaminsterling.com http://www.benjaminsterling.com




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




[jQuery] Re: Closing a thickbox from within a Flash movie

2007-09-21 Thread spinnach


or even more simple (without the additional overhead of including the 
ExternalInterface class):


getURL(javascript:closeFunction());

dennis.

Benjamin Sterling wrote:

Gordon,
In your flash file you need to put:

import flash.external.*;

Then at the last frame put something like:

ExternalInterface.call(function(){\\code to close thickbox});

If that does not work, try creating a new function on the javascript 
side and call it like:


ExternalInterface.call('closeFunction');

On 9/21/07, *Gordon* [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]  wrote:



I have been asked to update a website that provides help to the user
by opening up Flash videos in popups when the user clicks a link.  The
Powers That be want them to open in the page itself, so I've decided
to use a thickbox that links to a HTML page with the flash movie
embedded in it.

This works well and the results are a definate improvement over the
popup windows, but I do have one question.  It may be desireable for
the thickbox to close itself when the video in the Flash player comes
to an end.  I was wondering, is there a way of triggering the Thickbox
to close itself when the player stops?




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




[jQuery] Re: ids of elements in a string

2007-09-21 Thread spinnach


no, but it's easy to build a simple plugin that does that:

jQuery.fn.allIDs = function(){
  var IDs = [];
  this.each(function(){
if (this.id) IDs.push(this.id);
  });
  return IDs;
}

and use like:
var IDs = $(.list li).allIDs()

the plugin returns an array, if you want a string you can do this (or 
change the return IDs in the plugin to return IDs.join(',') ):

var IDstring = IDs.join(',');

dennis.

[EMAIL PROTECTED] wrote:

hi, i think im blind :/
is there any jquery function or a short way to get a string with all
ids of elements?
for example

$(.list li).allids()

output something like that:
element1,element2,element3






[jQuery] Re: Better way of initializing a show() or hide() state

2007-09-19 Thread spinnach


one solution i've been using is dynamic css, which (before the page is 
loaded) adds css via javascript, so without js, the whole page will be 
displayed normally, and with js on, the css will be added and, in your 
case, hide the elements you want to be hidden..


http://www.bobbyvandersluis.com/articles/dynamicCSS.php

dennis.

Pops wrote:

Now that I finding myself doing the following in a few areas, I don't
quite like it for a finalization of the code.

Basically, for the most part, a good bit of my jQuery usage is to add
dynamic toggling of current views already established in various pages
in our package.

In some cases, I want the page to start with views not showing, and
others I want the views showing, and yet in others, I want some views
with common elements having maying the first element showing and the
rest hidden, etc.

I guess the beauty of jQuery is that you mark up pages with little to
no changes.  But in some cases, you also have to modify the pages.  I
am trying to avoid modifying pages.

Anyway, to illustrate one example,  I have one page with the
following:

$(document).ready(function(){
  //--
  // - Click title row to toggle the remaing table rows.
  //--
  var $f = $(.divTitle);
  //$f.next(div).hide();
  $f.click(function() {
 var $i = $(this).next(div:first).toggle();
 if ($i.is(:hidden)) {
 $(img:first,this).attr(src,images/closed.gif);
 } else {
 $(img:first,this).attr(src,images/open.gif);
 }
  });
  $f.click();
  //--
});

This handles existing html that has a patten like so:

H3FAQH3

p class=divTitle
img src=images/open.gif/nbsp;FAQ #1?/p

div
pblah, blah.p
/div

p class=divTitle
img src=images/open.gif/nbsp;FAQ #2/p

div
pblah, blah.p
/div

etc

Note: in the above, it is done so that in a non-JS browser (JS
disabled), the items will be open as it is shown now without jQuery
implemented into this particular page.

The issue is that is that the initial display is not snappy when the
connection is over the wire.   It also depends on the browser.

I guess I want to get a discussion of different ideas of how to make
it snappy, i.e, so that there no flipping of views.

Traditionally, in graphical or display UI, one trick is to hide the
whole thing until it is done and then turn it on.  That didn't seem to
work with the browser.

It sounds that I really need to use CSS more here if I want the
browser to render this display with little dynamic changes?

Is this a scenario where a element.ready() idea is appropiate? so
that its initial programmatic state can be establishing before the
rendering takes place?

Of course, if this gets too complicated, I will probably just end up
modifying the pages with appropiate style initial classes.  But jQuery
never stops to surprise me with what it can do, so if you have any
tips or suggestions here, I would love to here them.

TIA

--
HLS






[jQuery] Re: adding custom attr on html elements?

2007-09-19 Thread spinnach


you could always use the metadata plugin, and then have something like 
this (which validates):


a href=# class=test {arg1: 100, arg2: 100}test/a

you can find the metadata plugin on the jquery plugins page:
http://docs.jquery.com/Plugins

dennis.

Benjamin Sterling wrote:

Aljosa,
You can get away with doing that, not exactly sure if it will validate, 
but you can do what you are doing.


On 9/19/07, *Aljosa Mohorovic*  [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:



if i have a href=# class=test arg1=10 arg2=100test/a

$(a.test).click(function() {
  arg1 = $(this).attr('arg1');
  arg2 = $(this).attr('arg2');
  // code using args
});

is this acceptable way of using attr or should i avoid this?




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




[jQuery] Re: jQuary Ajax

2007-09-18 Thread spinnach


Hey Luka,

one way to do this would be to check in your somefile.php if it's an 
ajax or regular call, and if it's an ajax call just return the variable, eg:


?php
if(isset($_SERVER['HTTP_X_REQUESTED_WITH'])  
$_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {

  //ajax request
  print $var;
  exit();
} else {
//normal output
}
?

hope this makes some sense,
dennis.

luigi7up wrote:

Hello everyone,

Is it possible to send ajax call for somefile.php and get just value
of one php variable generated by that server

script?

Example:

$.post( blog.php?task=checkname,

 {ime:$(\#ime\).val()},
 function(msg){
 alert(msg);
   });

This ajax call will get whole page ( blog.php?task=checkname) as a
result but I want value of just one variable.

I know I could create a separate file ajaxCheck.php that would
return HTML I could reuse in my javaScript

but I want to solve this this way.

Im probbably using wrong method POST  GET. Should I be using jSON?!
How do I use it for this purposes

Thank you

Luka






[jQuery] Re: New plugin: Listify

2007-09-11 Thread spinnach


in the plugin settings you define hoverClass and cursorType, and never 
use it in the plugin later..


nice plugin, btw..

dennis.

Dylan Verheul wrote:

I've just release a little plugin that I wrote for use in a new
project. It gracefully upgrades tables that contain rows with a single
link to be a little more user friendly (enlarging the click area and
applying a hover class).

Since I'm using Thickbox, I also made sure it plays nice with Thickbox links.

Source and example are available here: http://www.dyve.net/jquery/?listify

-Dylan





[jQuery] Re: Validation Form problem

2007-08-11 Thread spinnach


you're missing a comma after 'event: keyup', it should be ' event: 
keyup,'


dennis.

debussy007 wrote:


Hi, I am trying to use the Validation plug-in but I have the following error
:

missing } after property list
[Break on this error] rules: {\n



Here is the simple code :

$(#form_contact).validate({
 event: keyup
 rules: {
lastname: required
 },
 messages: {
lastname: {
required: function(element, validator) {
return Indiquez votre nom de famille.
}
}
 }
});


Thank you for any help !




[jQuery] Re: Excluding an element part of a selection

2007-08-10 Thread spinnach


Dan G. Switzer, II wrote:

David,


  I have a question about selectors. First of all, I have the
following html:

div id=content
a href=# input type=checkbox
name=option1
value=Novedad1 Novedad 1: HOla holaaa /a

/div


  As you can see, I have a div an inside it a link which has a
checkbox an text.


 Well, what I would like to do is to associate a click event when the
user clicks on the link, but with an exception: This event should
raise when the user clicks anywhere on the link excepts on the
checkbox that it is inside the link.


What's are you trying to do with the UI?

It looks like you might be trying to emulate the functionality already
built-in to the label / tag.

The label / associates it's children items to a specific field. This makes
it so clicking on the contents of the label / tag to act as if the field
it's had been clicked.

For example:

label for=idOption1
  input type=checkbox name=option1 id=idOption1 value=Novedad1 / 
  Novedad 1: HOla holaaa

/label

If you click on the text Novedad 1: HOla holaaa the browser will behave as
if you clicked on the checkbox itself.

-Dan




just as a side-note, this does not work in ie6..

dennis.


[jQuery] Re: Excluding an element part of a selection

2007-08-10 Thread spinnach


Dan G. Switzer, II wrote:

Denis,


label for=idOption1
  input type=checkbox name=option1 id=idOption1 value=Novedad1

/

  Novedad 1: HOla holaaa
/label

If you click on the text Novedad 1: HOla holaaa the browser will behave

as

if you clicked on the checkbox itself.

-Dan

just as a side-note, this does not work in ie6..


Say what? It works fine for me:
http://www.pengoworks.com/workshop/jquery/field.plugin.htm

All the checkbox and radio elements on the page use label elements.

-Dan




yes, sorry, it works if you include the for= bit.. if you leave it out 
(and write it like this, which is also 100% valid), clicking on the 
label won't work in ie6.. not sure about ie7.. in firefox it works:


label
  Name
  input type=checkbox name=option id=option value=value /
/label

dennis.


[jQuery] Re: Excluding an element part of a selection

2007-08-10 Thread spinnach


you could try something like this:

$('#content a').click(function (event){
  if (!$(event.target).is('input:checkbox')) {
//do something..
  }
});

p.s. i'm not sure if it's valid to have a checkbox inside a link ?

dennis.


Rob Desbois wrote:
I'm not sure how to do this as it stands - I've never been particularly 
au fait with text nodes and how to work with them.
However, a possible solution is to put the text next to the checkbox in 
a span and then attach the click event to that.


--rob


On 8/9/07, *David Garcia Ortega* [EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED] wrote:



Hi JQueriers,

   I have a question about selectors. First of all, I have the
following html:

div id=content
a href=# input
type=checkbox name=option1
value=Novedad1 Novedad 1: HOla holaaa /a

/div


   As you can see, I have a div an inside it a link which has a
checkbox an text.


  Well, what I would like to do is to associate a click event when the
user clicks on the link, but with an exception: This event should
raise when the user clicks anywhere on the link excepts on the
checkbox that it is inside the link.


  To be honest I don't know how to do it. I've been googling and
JQuering but I've not foud anything useful. I've read about not but
I think that it is not useful in this case.


   What I have in .js file is:

$('#content a').click( function ()
{
//code
}
);


   I would like this click event to raise when the user clicks
anywhere on the link excepts on the checkbox.


  Any ideas? Thank in advance!!




--
Rob Desbois
Eml: [EMAIL PROTECTED] mailto:[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] [SITE SUBMISSION] logitech.com socwall.com

2007-08-05 Thread spinnach


i recently came across these sites that use jquery:

http://www.logitech.com
http://www.socwall.com - Social Wallpapering

dennis.




[jQuery] Re: IS condition true like an if statement?

2007-08-03 Thread spinnach


try it like this, .is() returns true or false so you have to use it in 
an if statement:


$(a.saveConfig).click(function() {
  if ($('div.detail').is(':visible')) alert('Hey this works');
});

dennis.

Pete wrote:

I'm trying to create a link that when clicked will produce an alert if
there are any visible divs (all .detail divs are hidden by default).
I have the following function but it doesn't seem I'm doing it
correctly; nothing happens regardless of the visibility status of the
divs.

$(a.saveConfig).click(function() {
$('div.detail').is(':visible'), (function () {
alert('Hey this works');

 });
 });


Is there a better way to do an if statement using JQuery selectors or
is there something I'm missing in my code?






[jQuery] Re: Two words for Jquery

2007-08-01 Thread spinnach


Jolly good ?

Tane Piper wrote:

Bloody Brilliant!

(I wonder how many other 2 word ways there are to describe jQuery)

On 8/1/07, Richard D. Worth [EMAIL PROTECTED] wrote:

Here here.

- Richard


On 8/1/07, kiwwwi [EMAIL PROTECTED] wrote:

jQuery Rocks!!

oh... possibly will add two more words;

Thank you :)

I'm not the best scripter and jquery has simply allowed me to
accomplish with my own personal site so much more than I would
have otherwise attempted.  You people behind jquery are genious and
your work is great, thanks.

Kiwwwi.











[jQuery] Re: textarea maxlength plugin

2007-08-01 Thread spinnach


this could be related to the issue i was having with maxlength, try 
changing the source code to $([EMAIL PROTECTED]) (with a capitol 
L), and this.getAttribute('maxLength') ..


dennis.

bdee1 wrote:


i have not tried it with an older version of jquery yet but i tried using IE7
and the latest version of firefox.  the demo page on your site does work in
both browsers but when i uploaded the example page to my site it did not
work on textareas.


Burobjorn wrote:


Thats strange, could you try to use it with the older included jQuery 
version? Do you get an error? Which browser are you using? Does it work 
in the demo?


grtz
BjornW




thanks - thats exactly what i had in mind - downloaded it and tried it
and it
works well for text fields but for soem reason it does nto work on
textareas.  any ideas?  i am using jquery 1.1.3.1



Burobjorn wrote:

Yes, I have created such a plugin. Its still in alpha, but do check it
out:

http://www.burobjorn.nl/code/textlimiter/

All the best,

grtz
BjornW


bdee1 wrote:

does anyone know of a jquery plugin that would allow me to set a
maxlength
attribute on a textarea?











[jQuery] ..selector bug..

2007-07-31 Thread spinnach


i think i've come across a tiny bug in jquery 1.1.3.1, 
$('[EMAIL PROTECTED]) return an empty array, although there is such a 
textarea in the dom.. also $('textarea').attr('maxlength') returns 
nothing also.. this worked before in 1.1.2 ...


and i know this is invalid xhtml, but we had a need for such a thing in 
the backend, to limit the number of chars users can input..


dennis.


[jQuery] Re: ..selector bug..

2007-07-31 Thread spinnach


it works that way.. how come ?

dennis.

John Resig wrote:

What if you do @maxLength and .attr('maxLength') ?

--John

On 7/31/07, spinnach [EMAIL PROTECTED] wrote:

i think i've come across a tiny bug in jquery 1.1.3.1,
$('[EMAIL PROTECTED]) return an empty array, although there is such a
textarea in the dom.. also $('textarea').attr('maxlength') returns
nothing also.. this worked before in 1.1.2 ...

and i know this is invalid xhtml, but we had a need for such a thing in
the backend, to limit the number of chars users can input..

dennis.







[jQuery] Re: ..selector bug..

2007-07-31 Thread spinnach


cool, thanks!

dennis.

John Resig wrote:

It's just one of those things - some properties get the camelcase
formatting - maxLength is one of them.

--John

On 7/31/07, spinnach [EMAIL PROTECTED] wrote:

it works that way.. how come ?

dennis.

John Resig wrote:

What if you do @maxLength and .attr('maxLength') ?

--John

On 7/31/07, spinnach [EMAIL PROTECTED] wrote:

i think i've come across a tiny bug in jquery 1.1.3.1,
$('[EMAIL PROTECTED]) return an empty array, although there is such a
textarea in the dom.. also $('textarea').attr('maxlength') returns
nothing also.. this worked before in 1.1.2 ...

and i know this is invalid xhtml, but we had a need for such a thing in
the backend, to limit the number of chars users can input..

dennis.









[jQuery] [SITE ADDITION] socwall.com - social wallpapering..

2007-07-13 Thread spinnach


just saw this site which uses jquery, i'm not affiliated with it in any 
way, just noticed it..


http://www.socwall.com - social wallpapering

dennis.


[jQuery] [SITE SUBMISSION] www.pharmaconnectme.com

2007-07-05 Thread spinnach


http://www.pharmaconnectme.com - the first international network created 
by pharmacy students for all their friends in pharmacy..


jQuery 1.1.3.1
plugins used: thickbox, form plugin, accordion, jquery flash, and 
various others, some custom made, some that i probably forgot to mention..


dennis.


[jQuery] Re: [SITE SUBMISSION] www.pharmaconnectme.com

2007-07-05 Thread spinnach


thanks rey, glad you like it..

dennis.

Rey Bango wrote:


Nice look site spinnach. I really like the flyout div that appears next 
to each bloggers pic. Very nice.


I've added it to the list.

spinnach wrote:


http://www.pharmaconnectme.com - the first international network 
created by pharmacy students for all their friends in pharmacy..


jQuery 1.1.3.1
plugins used: thickbox, form plugin, accordion, jquery flash, and 
various others, some custom made, some that i probably forgot to 
mention..


dennis.







[jQuery] Re: 1.1.3 and Interface

2007-07-03 Thread spinnach


is there any release date for the UI known yet maybe ?

dennis.

Larry Garfield wrote:
With all due respect to the Interface devs, please let UI be better documented 
with better code demos. :-)  I could never get more than basic stuff actually 
working with Interface. :-(


On Tuesday 03 July 2007, Gilles (Webunity) wrote:

If you'd read the release notes, you'd see that the interface package
is no longer in development, possibly only bug fixes. The new UI
package is going to replace interface in the future.

On Jul 2, 8:08 pm, Jeffrey Kretz [EMAIL PROTECTED] wrote:

I am thrilled to see the 1.1.3 release.

One question, my main project makes heavy use of Interface.  Is this
project still being developed?  Can we expect any updates to it?  Or
changes that take advantage of the 1.1.3 event/animation improvements?

JK







[jQuery] Re: Selecting the first TD of every Row

2007-06-30 Thread spinnach


what about:

$('tr').each(function(){
  $('td:first', this).addClass('tomas');
});

dennis.

[EMAIL PROTECTED] wrote:

I've tried the method Mehmet but still no success with this goal
(select every first TD on every TR.
Maybe im doing something wrong, but can someone assure if this code is
in fact correct?

Regards!

On Jun 10, 10:40 am, Mehmet AVSAR [EMAIL PROTECTED] wrote:

$(tr).each(function() {
$(TD, $(this)).get(0).addClass(tomas)

});

On Jun 8, 6:40 pm, Karl Swedberg [EMAIL PROTECTED] wrote:


$('trtd').addClass(tomas);

actually, that willselectall td elements that are children of a
tr element -- in other words, all td elements.
Try this instead:
$('td:first-child').addClass('tomas');
That selects all td elements that are thefirstchild of their
parent element.
This works equally well:
$('td:nth-child(1)').addClass('tomas');
* Note: :nth-child(n) is the only 1-based jQuery selector, since it
is solely based on the CSS pseudo-class, which is also 1-based.
--Karl
_
Karl Swedbergwww.englishrules.comwww.learningjquery.com
On Jun 8, 2007, at 12:28 PM, Alexandre Plennevaux wrote:

$('trtd').addClass(tomas);
-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery-
[EMAIL PROTECTED] On
Behalf Of jorgeBadaBing
Sent: vendredi 8 juin 2007 16:14
To: jQuery (English)
Subject: [jQuery] Selecting thefirstTDofeveryRow
I have been looking online at the documentation and don't seen to
have any
luck find a way of doing this.
So far I can do this:
$(td:first).addClass(tomas);
Which applies a class to thefirsttdit founds in the table.
How can Iselectthefirsttdforeverytr?
Help will be much appreciated.
Thanks!
Ce message Envoi est certifié sans virus connu.
Analyse effectuée par AVG.
Version: 7.5.472 / Base de données virus: 269.8.11/838 - Date:
7/06/2007
14:21- Hide quoted text -

- Show quoted text -







[jQuery] Re: Remove Parent not working in IE6

2007-06-20 Thread spinnach


you should use classes instead of id's, since it's invalid html to have 
more elements with the same id on the same page.. the way you're doing 
it binds the click event to only the first element found on page (since 
the id must be unique)..


change the id=trash to class=trash and $('#trash') to $('a.trash') 
and it should work..


dennis.

G[N]Urpreet Singh wrote:

Hi guys,
I cannot remove the parent of an element in IE6.  The behavior in IE6 
is that only the first of the parents is getting removed and then it 
stops working.


Here is the code...

script type=text/javascript src=libs/jquery.js/script
script type=text/javascript
$(document).ready(function() {
$(#trash).click(
function()
{
$(this).parent().remove();
}
);
});
/script
body
div id=container
divThis is div 1 span id=trashDel/span/div
divThis is div 2 span id=trashDel/span/div
divThis is div 3 span id=trashDel/span/div
divThis is div 4 span id=trashDel/span/div
/div



Any ideas??
--
Gurpreet Singh




[jQuery] Re: ANN: CFJS 1.1.6 Released

2007-06-14 Thread spinnach


no header here also, it 404's..

dennis.

Christopher Jordan wrote:
Andy is the header not showing up correctly for you? It appears fine for 
me. I checked it in FF 2.0.0.4 and IE6. If it's not showing up for other 
folks properly, I'd like to know so I can correct it. Thanks!


Chris

Andy Matthews wrote:

Chris...
 
Your blog header image's path is wrong. Just wanted to let you know. 
You're probably referencing images/custom/BlogTitle.gif everywhere 
in your code, even though the server has subfolders because of Ray's 
BlogCFC code.
 
Make sure to change your references to /images/custom/BlogTitle.gif 
and you'll be good.



*From:* jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] 
*On Behalf Of *Christopher Jordan

*Sent:* Thursday, June 14, 2007 2:45 PM
*To:* jQuery Mailing List
*Subject:* [jQuery] ANN: CFJS 1.1.6 Released

Just wanted to let any interested folks know that CFJS 1.1.6 has been 
released. As always, the latest version is available from the SVN 
repository on RIAForge.org. I've also blogged about the changes 
http://cjordan.us/index.cfm/2007/6/14/CFJS-Ver-116-Released.


Cheers everyone!
Chris
--
http://www.cjordan.us


--
http://www.cjordan.us





[jQuery] Re: mouseover/mouseout vs. hover

2007-06-14 Thread spinnach


charlie,

(un)fortunately you'll have to do a bit of jquery magic, and i'd suggest 
using the hover method, where you define two functions, one for when 
mouse on, on for mouse off, like so:


$('div').hover(function(){
  //do your mouseover magic, eg:
  $(this).addClass('hover');
}, function() {
  //mouseoff magic
  $(this).removeClass('hover');
});

and all methods in jquery work in all browsers..

dennis.

Charlie Concepcion wrote:

I'm new to jQuery and I have to say I love it! I hate javascript but
now I like it cuz of query.  Anyways enough of that :)

I'm a CSS developer also. I know that the :hover pseudo element
doesn't work in IE 6 so I always have to use javascript using
mouseover/mouseout events.

My question is, in jQuery is hover using the CSS or using acting as a
backend mouseover event?

Final question... what should i use hover or mouseover... making sure
it works on IE7, Firefox and IE6.

Thanks!






[jQuery] Re: Macrumors running live udpates of WWDC

2007-06-12 Thread spinnach


nothing works as expected on my box (xp+sp2), google is broken, and text 
doesn't display on most of the pages (it only actually appeared on one 
page - google.com).. and there's no text in the menus.. it seems like 
they rushed this beta a bit..


dennis.

Felix Geisendörfer wrote:
On an (un)related note: Is anybody having rendering quirks with the 
Safari 3 beta on Win XP? I just noticed that a couple sites of mine that 
I thought would render well in Safari are messed up. Even Google Ads 
seems to be affected.


Anybody with similar problems?

-- Felix

PS: Click on the link below for thinkingphp.org to see what I mean.
--
http://www.thinkingphp.org
http://www.fg-webdesign.de


Klaus Hartl wrote:


Mike Alsup wrote:
I'm *really* excited to be able to run Safari on Windows, but has 
anyone used this beta?  I've never seen anything render so slowly.  
It's entirely unusable on my XP box.




It is also totally annoying that you can't run Safari 3 beta and 2 
side by side on a Mac... grrr, Apple is making the same mistakes as 
Microsoft.


Am I missing something?


-- Klaus





[jQuery] Re: jquery.us

2007-05-19 Thread spinnach


do, did, done..

joomlafreak wrote:

Done dna done!

On May 19, 11:22 am, jazzle [EMAIL PROTECTED] wrote:

done++; // or done += 1;



John Resig wrote:


Well, that's just weird; definitely trying to make $ with adwords.
This is the type of thing that you can ban a site for.
Here's what everyone can do:
1) Go to the site and click Ads by Google in the Adsense block.
2) Click the Send Google your thoughts on the site or the ads you
just saw link on the subsequent page.
3) Check The site is hosting/distributing my copyrighted content
3) Click Also Report a Violation? and check the website
4) Complete the form and submit it.
We'll have this guy banned in no time.
--John

--
View this message in 
context:http://www.nabble.com/jquery.us-tf3776075s15494.html#a10697753
Sent from the JQuery mailing list archive at Nabble.com.







[jQuery] [OT] dedicated hosting in europe

2007-05-15 Thread spinnach


sorry about this being completely off topic, but can anyone recommend 
some good hosting provider (which offers dedicated servers), but located 
in europe ? we're building a pretty big portal and since all of the 
users will be from europe it would be great if the server was in europe 
also..


thanks, i apologize again for this being completely ot..

dennis.


[jQuery] Re: [OT] dedicated hosting in europe

2007-05-15 Thread spinnach


thanks, benjamin, didn't know about that forum..

dennis.

Benjamin Sterling wrote:
Dennis, check out webhostingtalk.com http://webhostingtalk.com they 
have a pretty good recommendation section.  or at least had.  Did not 
see that section just now, but you can ask in the forum there.


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




[jQuery] Re: Threshold for saving textarea content with AJAX

2007-05-14 Thread spinnach


just as a side note, to be totally unobtrusive and to separate your js 
from the rest of the content, you could do something like this:


$(document).ready(function(){
$('#notepad').bind('keyup', notepadSave).bind('keydown', notepadClear);
});

that way all your javascript stays in the js file, not mixed with the 
rest of the html..


dennis.

[EMAIL PROTECTED] wrote:

Excellent, works great without the hassle of the way i mentioned
before

If anyone's interested, be my guest

--
HTML
--
textarea cols=89 rows=6 id=notepad onkeyup=notepadSave()
onkeydown=notepadClear()/textarea


--
JavaScript
--
var notepad;
function notepadSave() {
notepad=setTimeout(function() {
$.post(ajax.php,{
page: notepad,
notepad: encodeURI($('#notepad').val())
});
},3000);
}

function notepadClear() {
clearTimeout(notepad);
}






[jQuery] ..animation question..

2007-05-13 Thread spinnach


is there a way to perform multiple animations with one interval (to 
animate multiple elements at once), so the animation would be as smooth 
as possible? i saw that mootols has a function that does this 
(Fx.Elements), so it would be really cool to have something like this in 
jquery.. i need this for a menu i'm currently building (an accordion 
variation - but with mouseover, something similar to the mootols menu on 
their homepage), and since there are multiple setintervals (one for each 
element), the elements move up and down (because not all animations 
start and end at the same time)..


dennis.


[jQuery] Re: need help with sliding and targeting

2007-05-13 Thread spinnach


Christoph,

i also feel this way about the group :)..

as for the answer, it would be heplful if you could post an example 
page, but if i understand you correctly, your code should look something 
like this (i changed some other things to be more 'jquery'-like)..


$('.BTT').click(function(){$('#pageTop').ScrollTo(800);return false});

$(.toggleBtn).toggle(function(){
if($('#'+this.rel).css('display') == none){
$(# + this.rel).slideDown(500);
$(this).html((-) minimize);
return;
};
$('#pageTop').ScrollTo(800);
$(this).html((+)expand);
  $(# + this.rel).slideUp(500);
},
function(){
 if($('#'+this.rel).css('display') == block){
$('#pageTop').ScrollTo(800);
$(# + this.rel).slideUp(500);
$(this).html((+)expand);
return
};
$(this).html((-) minimize);
$(# + this.rel).slideDown(500);
});

all of this is untested, and maybe i didn't understand you correctly so 
it might not work..


dennis.

Christoph wrote:

This is my first post.  Great group you have here.

Please understand that I know nothing about JavaScript, but I am
trying to learn.  I am loving this tuff a lot.

I have a setup/animation that I am working on from a developer. (asked
for his permission to use it and said go for it)

Anyways here is the script and question.

How can I get the (-)minimize link to return to the #pageTop anchor
like in the BTT link?  I would like everything to still work how it is
setup, I would just like the page to scroll to the anchor when the
minimize button is clicked..


$('.BTT').click(function(){$('#pageTop').ScrollTo(800);return false});

$(.toggleBtn).toggle(function(){
if(document.getElementById(this.rel).style.display == none){$(# +
this.rel).slideDown(500);this.innerHTML = (-) minimize;return};
this.innerHTML = (+)expand;

$(# + this.rel).slideUp(500);
  },function(){
 if(document.getElementById(this.rel).style.display == block){$(#
+ this.rel).slideUp(500); this.innerHTML = (+)expand;return};
 this.innerHTML = (-) minimize;
$(# + this.rel).slideDown(500);


  });

}
);

Thanks in advance!







[jQuery] Re: Threshold for saving textarea content with AJAX

2007-05-13 Thread spinnach


one way to do this would be with a timeout, although a bit different 
than you explained it.. start a timeout onkeyup, and clear it onkeydown, 
so after stopping typing the timeout won't be cleared and 5 seconds 
later the function will run..


dennis.

[EMAIL PROTECTED] wrote:

Confusing title, but what I'm looking for can't really be summed up in
a sentence [ bonus points if you can ].

Basically I have a onkeyup binded to a textarea, and the function
the onkeyup calls sends the data to the server to be saved.  I'm
wondering if a method to only send the data when you stop typing
exists.  So basically you can be typing a paragraph quickly, and it
*won't* call the function, but once you stop typing [say 5 seconds
after the last key up], the function is called.  What I think would be
the best [and possibly only] way to  achieve this, is to check the
last time the function was called, and do a setTimeout() for 5
seconds, and when this check function is called again, it clears the
timeout and starts it again.  Is there any other way?






[jQuery] Re: Return a reference to the root DOM object

2007-05-11 Thread spinnach


yes, all of what you said is correct.. an alternative way to access a 
single dom element would be $(p#thisIsMyParagraph).get(0) (both ways 
to access the dom element are correct).. just one advice, it's much 
faster to find the element with just the id, without the tag,.. because 
when writing the tag, jquery has to look through all the paragraphs to 
find the one with the 'thisIsMyParagraph' id..


dennis.

Pogo wrote:

This is the simplest of ideas, but I'm new to jQuery (I probably
shouldn't admit that), and I want to know, when working with the power
of the $ how does one return a reference.  I hope I'm saying this
correctly.  Allow me to illustrate:

Let's say one grabs a paragraph with the ID thisIsMyParagraph

Using CSS traversing, like thus: $(p#thisIsMyParagraph)

Yes?  With me?

Now jQuery provides a whole library to then work with that paragraph.
For example, if I wanted to hide the paragraph, go like thus: $
(p#thisIsMyParagraph).hide();

Correct?

Now, HERE'S THE QUESTION.  What if I want to call native functions to
the DOM object behind the scenes.  The obvious way is to go: var
element = document.createElement(thisIsMyParagraph);

I understand that one way of doing the same thing in jQuery is to
reference it thus: var element = $(p#thisIsMyParagraph)[0];

IS THIS CORRECT?  Is there a more correct way, or is this the only
way?

Just trying to understand.  Thanks.






[jQuery] Re: Error: $(document).ready is not a function

2007-05-10 Thread spinnach


that also won't work if prototype overwrote jquery's $ function..

jQuery(function() {

});

would work..

dennis.

Fabyo Guimaraes wrote:

or

$(function() {

});

2007/5/10, John Resig [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]:


It sounds like Prototype is overwriting jQuery's $ function. If you
want to continue using the two libraries together, you'll need to
refer to jQuery's $ function as 'jQuery', like so:

jQuery(document).ready(function(){
  //..
});

More information about this setup can be found here:
http://docs.jquery.com/Using_jQuery_with_Other_Libraries
http://docs.jquery.com/Using_jQuery_with_Other_Libraries

Hope this helps!

--John

On 5/10/07, [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] wrote:
 
  I'm mentally retarded, or something.
 
  I'm getting this error:
 
  Error: $(document).ready is not a function
 
  I am also using rico and prototype, maybe some sort of conflict?
 
  I'm new to jQuery, like, I just started 30 minutes ago, and I can't
  get past this silly hurdle, any suggestions?
 
 






[jQuery] Re: Delay mouseover trigger - how?

2007-05-10 Thread spinnach


there is a plugin that does exactly what you need, hoverintent..
http://cherne.net/brian/resources/jquery.hoverIntent.html

dennis.

joomlafreak wrote:

Mouseover is a very sensitive trigger and if a page/section has many
triggers for mouseover they all inevitably register the event on
mouseover and kill the show. I want to achieve a way of triggering the
mouseover event only if the mouseover happens for a little longer and
cancel the event otherwise. I feel many people would have felt the
need of having this at some point.

Say the mouseover even will register only if the mouseover happens for
0.5 second and if not the event is cancelled or not triggered. I have
thought on this but could not come up with a nice enough way of doing
it. Does anyone have any idea as to how I can do it.

thanks






[jQuery] Re: hasClass

2007-04-17 Thread spinnach


you could use the .is() function:

$(element).is('.bar');

or if you need to access only elements with the .bar class you could use
$('.bar').whatever()... $('div.bar') would be faster if you need only 
the divs with the .bar class..


dennis.

Geoffrey Knutzen wrote:

How can I test if an element has a specific class?
If I have 
div class=foo bar


How can I check if the element has class=bar

Seems like it should be easy, but I am having troubles. 


Thanks
-Geoff






[jQuery] Re: find.click vs bind(click)

2007-04-17 Thread spinnach


are the pages you load complete html pages (along with the head and body 
and all of that)? if yes, the pages you load through the .load function 
should contain only the html you want to load in the '#jobinfo' div.. if 
you're using php, jquery sets a header ('HTTP_X_REQUESTED_WITH') when 
doing ajax calls, so you can check if it's an ajax call or a regular call:


if ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') {
  do_ajax_stuff();
} else {
  do_html_stuff();
}

dennis.

Shelane Enos wrote:

So I'm trying this:

$j(function(){
bindEdit = function(){
$j('#edit').bind(click, function(){
var linkval = $j(this).attr(href);
$j('#jobinfo').load(linkval, function(){
bindEdit();
});
return false;
});
}
bindEdit();
});

Which to me says bind an onclick function to an a tag with ID 'edit'.  Read
the value of it's href (pages are dynamically loaded an hrefs change).  Load
the link into the div id jobinfo and now call bindEdit to bind the click
event to the edit link on the newly loaded page.  Return false so it doesn't
follow the link as a normal link.

OK, so it doesn't work.  The page loads normally instead of into the div via
ajax and I get too much recursion errors in the console.

Am I doing something wrong here?


On 4/17/07 9:57 AM, spinnach [EMAIL PROTECTED] wrote:


.bind('click') is faster because you bind it directly to the element,
.find() must first find the element inside the #jobinfo element and then
bind the appropriate event..

there is no difference between .bind('click') and .click(), .click is
just an alias for .bind('click').. and if i'm not mistaken, .click was
taken out of the core since 1.1 (i may be wrong, i know some aliases
were removed, but not sure which - so i just use .bind for everything :))..

dennis.

Shelane Enos wrote:

What is the difference, advantage/disadvantage of these different methods:

bindEdit = function(){
$j('#edit').bind(click, function(){
var linkval = $(this).attr(href);
$j('#jobinfo').load(linkval, function(){
bindEdit();
});
return false;
});
}

bindEdit = function(){
$j('#jobinfo').find('#edit').click(function(){
var linkval = $(this).attr(href);
$j('#jobinfo').load(linkval, function(){
bindEdit();
});
return false;
});
}













[jQuery] Re: selector for ATTR is empty

2007-04-12 Thread spinnach


you could try something like this (since filter accepts a function):

$('#content [EMAIL PROTECTED]').filter(
function(index){
return (this.alt  this.alt.length  0);
}
).each(...

dennis.

Olaf Bosch wrote:


Hi All,
where i release a Seloctor of all images with not empty ALT, this select
all with ALT:

$('#content [EMAIL PROTECTED]').each(function(){

i will the function work when ALT not empty

Thanks





[jQuery] Re: THICKBOX doesnt work when on line...why?

2007-04-05 Thread spinnach


could you provide a link to the page ?

dennis.

helpshelps wrote:


i have a problem implementing jquery and thickbox in my site, and i can't
understand the reason, because, the off-line site is perfectly working with
all the libraries and visualize the thickbox, but when i upload it on my
linux serve, it does not display the thick box but the plain html releated
page. ANyone can help please?