[jQuery] Re: Get rid of "long-running script dialog box" ?

2009-09-21 Thread Jonathan Vanherpe (T & T NV)

Machin Pouet wrote:

Hello all,

I'd like to know if you have a way to disable the long-running script 
dialog boxes, as one can see many in this article :

http://www.nczonline.net/blog/2009/01/05/what-determines-that-a-script-is-long-running/

I can hardly "split my processing into smaller chunks", and cannot ask 
clients to tweak their browsers or registry !


I hope my call for help is in the right section, shouldn't it be the 
case, I apologize, but would appreciate any link to a potential solution.


Looking forward to hear back from you,

sincerely,

S.

From the article you linked:

Brendan Eich, creator of JavaScript, is quoted as saying, "[JavaScript] 
that executes in whole seconds is probably doing something wrong..."


And who are we do argue with him? You're probably using javascript for 
something you shouldn't use it for, or you have some kind of infinite 
loop. Could you give us an idea as to what exactly you're doing?


Jonathan

--
www.tnt.be    *Jonathan Vanherpe*
jonat...@tnt.be  - www.tnt.be 
 - tel.: +32 (0)9 3860441




[jQuery] Smart Banner Modification Needed

2009-09-21 Thread MauiMan2

On the site I am almost finished developing at
http://www.murphytx-online.com/murphy/eating-out-american.php I am
using the "Smart Banner" jQuery script from
http://www.webresourcesdepot.com/smart-floating-banners/

This script keeps the content of the two sidebars always visible as
the visitor scrolls down through the main content. However at any time
other than when it's at its beginning position it is too low. I
realize it is being kept at its starting position but when it doesn't
need to be there I am trying to get it to stay at the top of the
viewable area (with a little padding, of course).

This is especially important to get worked out for monitors with a
lower resolution because on those monitors some of the sidebar content
is *never* seen but is always below the viewable area.

I have made several attempts to fix this and I figured each attempt
would either: a) fix it, or, b) throw everything completely out of
whack. But oddly enough each of my attempts had no affect whatsoever.

Thanks in advance for any help.


[jQuery] Re: Browser sniffing - the correct way?

2009-09-21 Thread Mike McNally

PNG graphics with alpha channels are not an exotic luxury.  For a
broad spectrum of site design approaches - basically anything
involving interesting backgrounds or varying page components over
which dynamic content may be rendered - not having PNG support means
scrapping the design or going to an enormous amount of trouble to do
appropriate GIF versions of border/frame images.

I applaud anybody that decides to make the effort and live within
tight 9-year-old design constraints in order to support IE.  (I think
mobile browsers are a totally separate issue - it's a matter of
opinion, but I definitely feel that for a host of usability reasons
far beyond this or that CSS feature, a good application design for
mobile use is likely to be much different than that for a
desktop/laptop.  Note that I said "application" design, because that's
what I do; content-oriented websites may be different, but I admit
ignorance.) I also understand the frustration and the pragmatics.


On Mon, Sep 21, 2009 at 9:48 PM, RobG  wrote:
>
>
>
> On Sep 22, 1:30 am, Mike McNally  wrote:
>> Advice to "never" use browser detection is good advice, but in my
>> experience it's simply impossible to follow. The bad behaviors of old
>> IE browsers - behaviors that are, in effect, bugs, and therefore not
>> "features" that obey any particular logic - are numerous and
>> pervasive.  Facile advice like "avoid troublesome features"
>> constitutes a grim curse on site design: "don't do anything that
>> doesn't work reliably in IE6" is what that amounts to, and I think
>> that's terrible.
>
> There are, and will always be, features that are available in some
> browsers but not others. An evaluation must be made whether a
> particular feature supported by certain browsers is worth having so
> badly that it is OK to offer a lesser experience, or even deny access,
> to users of other browsers. Are transparent PNG images *that*
> important? Is there *no* other option? Is javascript the only, or
> best, solution?
>
> A common fix for the PNG issue is to use conditional comments to sniff
> for IE and insert a different stylesheet that replaces the PNG images
> with others.
>
> That solution suits some (I guess it suits IE users at least), but if
> the replacement images are OK for IE users, they are probably fine for
> others too. And at the same time life has been made better for every
> browser that doesn't support transparent PNG images (there are likely
> a number of mobile browsers that don't support them either).
>
> There are always those who wish to push the boundaries of what can be
> done on the web, good for them. However, for everyday business web
> sites, simpler is better and flashiness just distracts from the job at
> hand. In a few years time, well look back at accordions, carousels,
> show/hide effects and such much the same way as we look at blink and
> marquee elements now. They are annoying distractions that rarely add
> to the functionality or usefulness of a site.
>
> For example, here's the home page of my ISP:
>
> http://www.iinet.net.au/customers/ >
>
> The primary purpose of this page is to allow their customers to login
> to the site.
>
> You'll note that the focus is automatically put in the login field. A
> username can be entered, tab pressed, then a password, but it is
> impossible to navigate to the toolbox button without using a mouse.
> Whoever designed it was clever enough to create those wonderful
> buttons (which always leave me wondering which is on and which is off)
> but was incapable of maintaining keyboard navigation supported
> natively by every desktop browser since Netscape 1.0.
>
> So you can see that I have a slight bias when functionality is
> restricted just because someone decided to poorly implement a pretty
> UI component. :-)
>
> Similarly, the second set of login links at the top are impossible to
> use without a pointing device - they can't be selected with a tab key.
> The page is spectacularly bad at the one function it is supposed to
> perform. And they don't use transparent PNGs anywhere! ;-p
>
> The point here is not necessarily to build every site to the lowest
> common denominator, but to not deliberately do things that break
> functionality that has been available in just about every browser for
> a very long time. Javascript and CSS should enhance the user
> experience, not break it.
>
>
> --
> Rob



-- 
Turtle, turtle, on the ground,
Pink and shiny, turn around.


[jQuery] Re: Browser sniffing - the correct way?

2009-09-21 Thread RobG



On Sep 22, 1:30 am, Mike McNally  wrote:
> Advice to "never" use browser detection is good advice, but in my
> experience it's simply impossible to follow. The bad behaviors of old
> IE browsers - behaviors that are, in effect, bugs, and therefore not
> "features" that obey any particular logic - are numerous and
> pervasive.  Facile advice like "avoid troublesome features"
> constitutes a grim curse on site design: "don't do anything that
> doesn't work reliably in IE6" is what that amounts to, and I think
> that's terrible.

There are, and will always be, features that are available in some
browsers but not others. An evaluation must be made whether a
particular feature supported by certain browsers is worth having so
badly that it is OK to offer a lesser experience, or even deny access,
to users of other browsers. Are transparent PNG images *that*
important? Is there *no* other option? Is javascript the only, or
best, solution?

A common fix for the PNG issue is to use conditional comments to sniff
for IE and insert a different stylesheet that replaces the PNG images
with others.

That solution suits some (I guess it suits IE users at least), but if
the replacement images are OK for IE users, they are probably fine for
others too. And at the same time life has been made better for every
browser that doesn't support transparent PNG images (there are likely
a number of mobile browsers that don't support them either).

There are always those who wish to push the boundaries of what can be
done on the web, good for them. However, for everyday business web
sites, simpler is better and flashiness just distracts from the job at
hand. In a few years time, well look back at accordions, carousels,
show/hide effects and such much the same way as we look at blink and
marquee elements now. They are annoying distractions that rarely add
to the functionality or usefulness of a site.

For example, here's the home page of my ISP:

http://www.iinet.net.au/customers/ >

The primary purpose of this page is to allow their customers to login
to the site.

You'll note that the focus is automatically put in the login field. A
username can be entered, tab pressed, then a password, but it is
impossible to navigate to the toolbox button without using a mouse.
Whoever designed it was clever enough to create those wonderful
buttons (which always leave me wondering which is on and which is off)
but was incapable of maintaining keyboard navigation supported
natively by every desktop browser since Netscape 1.0.

So you can see that I have a slight bias when functionality is
restricted just because someone decided to poorly implement a pretty
UI component. :-)

Similarly, the second set of login links at the top are impossible to
use without a pointing device - they can't be selected with a tab key.
The page is spectacularly bad at the one function it is supposed to
perform. And they don't use transparent PNGs anywhere! ;-p

The point here is not necessarily to build every site to the lowest
common denominator, but to not deliberately do things that break
functionality that has been available in just about every browser for
a very long time. Javascript and CSS should enhance the user
experience, not break it.


--
Rob


[jQuery] Re: Some homebrewn jQuery functionalities

2009-09-21 Thread Cecil Westerhof

2009/9/21 Giovanni Battista Lenoci :
>
> Cecil Westerhof ha scritto:
>>
>> 2009/9/21 Cecil Westerhof :
>>
>>>
>>> - a way to automatically notify people that they should enable JavaScript
>>>
>>
>> The way that I did this was that start the body with:
>>  
>>  For best results JavaScript must be enabled!!!
>>  
>>
>
> There's the noscript tag for this, with your way search engines will
> register this as the main heading of your page... I don't think this is
> desiderable :-)

I was to smart for my own good. I like DRY very much. That is way I
used this solution. But when this will generate a problem in search
engines, then I can better need to change the title on two places.


-- 
Cecil Westerhof


[jQuery] Re: Some homebrewn jQuery functionalities

2009-09-21 Thread Cecil Westerhof

2009/9/21 Liam Potter :
> You'd be better off just removing the div entirely.
>
> $(document).ready(function()
>        $("#needJavaScript").remove();
> );

That was what I did first. I wanted to be to smart I am afraid. But
the noscript suggestion of Giovanni is even better.

-- 
Cecil Westerhof


[jQuery] Re: Some homebrewn jQuery functionalities

2009-09-21 Thread Cecil Westerhof

2009/9/21 Cecil Westerhof :
> - Increase/Decrease text (has a little problem in Firefox)

False alarm. Is a problem of that particulair Firefox. Other Firefox
does not have the problem. Is a bit strange.
The problem was even bigger with MIE8, but maybe that is also only
that instance. Need to test it with other MIE's.


> - Show/Hide content (has a little problem in Opera and Konqueror)

If the button is at the end of the screen, the text is shown 'out of
sight'. Is there a way to get the shown text shown in the window?

-- 
Cecil Westerhof


[jQuery] Re: can't create objects inside getJSON

2009-09-21 Thread cerberos

Thanks, it works. Is there a reason why the object notation I used
doesn't work?


[jQuery] validate - if "other" checked --> require input box

2009-09-21 Thread ripcurlksm


I have a "How did you hear about us?" with a series of checkboxes that is
working great, however there is an option for "Other", where they can fill
out their answer.

I want to modify the script so if the checkbox for Other is selected, they
are required to fill in the input box.

I have this working here, but I cant get the input box to be required if
"other" is selected:
http://psylicyde.com/misc/jquery-validate/demo/test.html
-- 
View this message in context: 
http://www.nabble.com/validate---if-%22other%22-checked---%3E-require-input-box-tp25530536s27240p25530536.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Accessing functions inside $(document).ready()

2009-09-21 Thread Matthew

Ok thanks MorningZ. I've taken a different approach. I'm just binding
the onClick logic to the button within the .ready() block.

Thanks again for all the help!

Cheers
Matthew

On Sep 22, 10:39 am, MorningZ  wrote:
> Mike's suggestion indeed is the rest of it...  i was just trying to
> get you past the fact that until $(document).ready fires, you can't do
> anything with code inside there yet
>
> On Sep 21, 8:28 pm, Matthew  wrote:
>
> > @MonringZ: I just tried the brilliant testing website! I just wanted
> > to double check; so because Action1() is wrapped inside the ready()
> > function it esentially is processed as the page loads and then
> > basically disappears/become unavailable. I took your example further
> > and added a button with an onClick to call Action1() and it doesn't
> > work. 
>
> > So this must be Mike suggested binding it to the body so that it's
> > available globally.
>
> > Cheers
> > Matthew
>
> > On Sep 22, 10:20 am, Matthew  wrote:
>
> > > Hi guys
>
> > > Thanks for the great feedback. MorningZ was right on the money with my
> > > scenario. I'm incorporating a js file of a photo gallery which was
> > > built by some else and all the code is wrapped in the $(document).ready
> > > () function.
>
> > > So it looks like you all seem to agree that all the methods inside
> > > this function are not available globally so I'm going to have to re-
> > > factor the code in the js file. I'm not to sure why the developer
> > > wrapped it all in the ready() function but I'll have to painfully pull
> > > it apart now... nothing's ever easy is it :)
>
> > > Cheers
> > > Matthew
>
> > > On Sep 22, 10:09 am, Mike McNally  wrote:
>
> > > > Well "Action1" is a local function to that jQuery "ready" function, so
> > > > it's *never* going to be available as a global function.
>
> > > > A couple of options:
>
> > > > 1) Turn your wannabe-global functions into jQuery plugins
>
> > > > 2) Explicitly add your functions to the window object
> > > >       window['Action1'] = function() { ... };
>
> > > > 3) Bind your functions as event handlers on the "body" object (or 
> > > > whatever)
> > > >       $('body').bind('Action1', function() { ... });
>
> > > >       
>
> > > >       
> > > >          
> > > >              $('body').trigger('Action1'); 
>
> > > > On Mon, Sep 21, 2009 at 7:03 PM, MorningZ  wrote:
>
> > > > > Do you have like this:
>
> > > > > External js file "code.js":
>
> > > > > $(document).ready(function() {
> > > > >       function Action1() {
> > > > >          // do stuff
> > > > >       }
> > > > > });
>
> > > > > Html file "index.htm":
>
> > > > > 
> > > > >    
> > > > >       
> > > > >    
> > > > >    
> > > > >         ... some html here ...
> > > > >         Action1()
> > > > >         ... some html here ...
> > > > >    
> > > > > 
>
> > > > > if so, then "Action1" isn't defined yet (and it won't be until *all*
> > > > > the HTML is spit out to the browser) and not available to use.
>
> > > > > see this quick example:
>
> > > > >http://jsbin.com/edovi/edit
>
> > > > > the alert of "Run Action1" happens *before* the document is ready, and
> > > > > as a result, the event getting wired up
>
> > > > > On Sep 21, 7:11 pm, Matthew  wrote:
> > > > >> Hi all
>
> > > > >> I've got a js file where all the functions are wrapped inside $
> > > > >> (document).ready(). I want to call one of the function from within 
> > > > >> the
> > > > >> HTML but it says that the function "is not defined". Any ideas?
>
> > > > >> Cheers
> > > > >> Matthew
>
> > > > --
> > > > Turtle, turtle, on the ground,
> > > > Pink and shiny, turn around.


[jQuery] Re: Accessing functions inside $(document).ready()

2009-09-21 Thread MorningZ

Mike's suggestion indeed is the rest of it...  i was just trying to
get you past the fact that until $(document).ready fires, you can't do
anything with code inside there yet

On Sep 21, 8:28 pm, Matthew  wrote:
> @MonringZ: I just tried the brilliant testing website! I just wanted
> to double check; so because Action1() is wrapped inside the ready()
> function it esentially is processed as the page loads and then
> basically disappears/become unavailable. I took your example further
> and added a button with an onClick to call Action1() and it doesn't
> work. 
>
> So this must be Mike suggested binding it to the body so that it's
> available globally.
>
> Cheers
> Matthew
>
> On Sep 22, 10:20 am, Matthew  wrote:
>
> > Hi guys
>
> > Thanks for the great feedback. MorningZ was right on the money with my
> > scenario. I'm incorporating a js file of a photo gallery which was
> > built by some else and all the code is wrapped in the $(document).ready
> > () function.
>
> > So it looks like you all seem to agree that all the methods inside
> > this function are not available globally so I'm going to have to re-
> > factor the code in the js file. I'm not to sure why the developer
> > wrapped it all in the ready() function but I'll have to painfully pull
> > it apart now... nothing's ever easy is it :)
>
> > Cheers
> > Matthew
>
> > On Sep 22, 10:09 am, Mike McNally  wrote:
>
> > > Well "Action1" is a local function to that jQuery "ready" function, so
> > > it's *never* going to be available as a global function.
>
> > > A couple of options:
>
> > > 1) Turn your wannabe-global functions into jQuery plugins
>
> > > 2) Explicitly add your functions to the window object
> > >       window['Action1'] = function() { ... };
>
> > > 3) Bind your functions as event handlers on the "body" object (or 
> > > whatever)
> > >       $('body').bind('Action1', function() { ... });
>
> > >       
>
> > >       
> > >          
> > >              $('body').trigger('Action1'); 
>
> > > On Mon, Sep 21, 2009 at 7:03 PM, MorningZ  wrote:
>
> > > > Do you have like this:
>
> > > > External js file "code.js":
>
> > > > $(document).ready(function() {
> > > >       function Action1() {
> > > >          // do stuff
> > > >       }
> > > > });
>
> > > > Html file "index.htm":
>
> > > > 
> > > >    
> > > >       
> > > >    
> > > >    
> > > >         ... some html here ...
> > > >         Action1()
> > > >         ... some html here ...
> > > >    
> > > > 
>
> > > > if so, then "Action1" isn't defined yet (and it won't be until *all*
> > > > the HTML is spit out to the browser) and not available to use.
>
> > > > see this quick example:
>
> > > >http://jsbin.com/edovi/edit
>
> > > > the alert of "Run Action1" happens *before* the document is ready, and
> > > > as a result, the event getting wired up
>
> > > > On Sep 21, 7:11 pm, Matthew  wrote:
> > > >> Hi all
>
> > > >> I've got a js file where all the functions are wrapped inside $
> > > >> (document).ready(). I want to call one of the function from within the
> > > >> HTML but it says that the function "is not defined". Any ideas?
>
> > > >> Cheers
> > > >> Matthew
>
> > > --
> > > Turtle, turtle, on the ground,
> > > Pink and shiny, turn around.


[jQuery] Re: Accessing functions inside $(document).ready()

2009-09-21 Thread Matthew

@MonringZ: I just tried the brilliant testing website! I just wanted
to double check; so because Action1() is wrapped inside the ready()
function it esentially is processed as the page loads and then
basically disappears/become unavailable. I took your example further
and added a button with an onClick to call Action1() and it doesn't
work. 

So this must be Mike suggested binding it to the body so that it's
available globally.

Cheers
Matthew

On Sep 22, 10:20 am, Matthew  wrote:
> Hi guys
>
> Thanks for the great feedback. MorningZ was right on the money with my
> scenario. I'm incorporating a js file of a photo gallery which was
> built by some else and all the code is wrapped in the $(document).ready
> () function.
>
> So it looks like you all seem to agree that all the methods inside
> this function are not available globally so I'm going to have to re-
> factor the code in the js file. I'm not to sure why the developer
> wrapped it all in the ready() function but I'll have to painfully pull
> it apart now... nothing's ever easy is it :)
>
> Cheers
> Matthew
>
> On Sep 22, 10:09 am, Mike McNally  wrote:
>
> > Well "Action1" is a local function to that jQuery "ready" function, so
> > it's *never* going to be available as a global function.
>
> > A couple of options:
>
> > 1) Turn your wannabe-global functions into jQuery plugins
>
> > 2) Explicitly add your functions to the window object
> >       window['Action1'] = function() { ... };
>
> > 3) Bind your functions as event handlers on the "body" object (or whatever)
> >       $('body').bind('Action1', function() { ... });
>
> >       
>
> >       
> >          
> >              $('body').trigger('Action1'); 
>
> > On Mon, Sep 21, 2009 at 7:03 PM, MorningZ  wrote:
>
> > > Do you have like this:
>
> > > External js file "code.js":
>
> > > $(document).ready(function() {
> > >       function Action1() {
> > >          // do stuff
> > >       }
> > > });
>
> > > Html file "index.htm":
>
> > > 
> > >    
> > >       
> > >    
> > >    
> > >         ... some html here ...
> > >         Action1()
> > >         ... some html here ...
> > >    
> > > 
>
> > > if so, then "Action1" isn't defined yet (and it won't be until *all*
> > > the HTML is spit out to the browser) and not available to use.
>
> > > see this quick example:
>
> > >http://jsbin.com/edovi/edit
>
> > > the alert of "Run Action1" happens *before* the document is ready, and
> > > as a result, the event getting wired up
>
> > > On Sep 21, 7:11 pm, Matthew  wrote:
> > >> Hi all
>
> > >> I've got a js file where all the functions are wrapped inside $
> > >> (document).ready(). I want to call one of the function from within the
> > >> HTML but it says that the function "is not defined". Any ideas?
>
> > >> Cheers
> > >> Matthew
>
> > --
> > Turtle, turtle, on the ground,
> > Pink and shiny, turn around.


[jQuery] Re: Accessing functions inside $(document).ready()

2009-09-21 Thread Matthew

Hi guys

Thanks for the great feedback. MorningZ was right on the money with my
scenario. I'm incorporating a js file of a photo gallery which was
built by some else and all the code is wrapped in the $(document).ready
() function.

So it looks like you all seem to agree that all the methods inside
this function are not available globally so I'm going to have to re-
factor the code in the js file. I'm not to sure why the developer
wrapped it all in the ready() function but I'll have to painfully pull
it apart now... nothing's ever easy is it :)

Cheers
Matthew

On Sep 22, 10:09 am, Mike McNally  wrote:
> Well "Action1" is a local function to that jQuery "ready" function, so
> it's *never* going to be available as a global function.
>
> A couple of options:
>
> 1) Turn your wannabe-global functions into jQuery plugins
>
> 2) Explicitly add your functions to the window object
>       window['Action1'] = function() { ... };
>
> 3) Bind your functions as event handlers on the "body" object (or whatever)
>       $('body').bind('Action1', function() { ... });
>
>       
>
>       
>          
>              $('body').trigger('Action1'); 
>
>
>
> On Mon, Sep 21, 2009 at 7:03 PM, MorningZ  wrote:
>
> > Do you have like this:
>
> > External js file "code.js":
>
> > $(document).ready(function() {
> >       function Action1() {
> >          // do stuff
> >       }
> > });
>
> > Html file "index.htm":
>
> > 
> >    
> >       
> >    
> >    
> >         ... some html here ...
> >         Action1()
> >         ... some html here ...
> >    
> > 
>
> > if so, then "Action1" isn't defined yet (and it won't be until *all*
> > the HTML is spit out to the browser) and not available to use.
>
> > see this quick example:
>
> >http://jsbin.com/edovi/edit
>
> > the alert of "Run Action1" happens *before* the document is ready, and
> > as a result, the event getting wired up
>
> > On Sep 21, 7:11 pm, Matthew  wrote:
> >> Hi all
>
> >> I've got a js file where all the functions are wrapped inside $
> >> (document).ready(). I want to call one of the function from within the
> >> HTML but it says that the function "is not defined". Any ideas?
>
> >> Cheers
> >> Matthew
>
> --
> Turtle, turtle, on the ground,
> Pink and shiny, turn around.


[jQuery] Re: Accessing functions inside $(document).ready()

2009-09-21 Thread Lord Gustavo Miguel Angel


hi!
please write here you code.

Thanks.

--
From: "Matthew" 
Sent: Monday, September 21, 2009 8:11 PM
To: "jQuery (English)" 
Subject: [jQuery] Accessing functions inside $(document).ready()



Hi all

I've got a js file where all the functions are wrapped inside $
(document).ready(). I want to call one of the function from within the
HTML but it says that the function "is not defined". Any ideas?

Cheers
Matthew 


[jQuery] Re: Accessing functions inside $(document).ready()

2009-09-21 Thread Mike McNally

Well "Action1" is a local function to that jQuery "ready" function, so
it's *never* going to be available as a global function.

A couple of options:

1) Turn your wannabe-global functions into jQuery plugins

2) Explicitly add your functions to the window object
  window['Action1'] = function() { ... };

3) Bind your functions as event handlers on the "body" object (or whatever)
  $('body').bind('Action1', function() { ... });

  


  
 
 $('body').trigger('Action1'); 



On Mon, Sep 21, 2009 at 7:03 PM, MorningZ  wrote:
>
> Do you have like this:
>
> External js file "code.js":
>
> $(document).ready(function() {
>       function Action1() {
>          // do stuff
>       }
> });
>
>
> Html file "index.htm":
>
> 
>    
>       
>    
>    
>         ... some html here ...
>         Action1()
>         ... some html here ...
>    
> 
>
> if so, then "Action1" isn't defined yet (and it won't be until *all*
> the HTML is spit out to the browser) and not available to use.
>
> see this quick example:
>
> http://jsbin.com/edovi/edit
>
> the alert of "Run Action1" happens *before* the document is ready, and
> as a result, the event getting wired up
>
>
> On Sep 21, 7:11 pm, Matthew  wrote:
>> Hi all
>>
>> I've got a js file where all the functions are wrapped inside $
>> (document).ready(). I want to call one of the function from within the
>> HTML but it says that the function "is not defined". Any ideas?
>>
>> Cheers
>> Matthew



-- 
Turtle, turtle, on the ground,
Pink and shiny, turn around.


[jQuery] Re: Accessing functions inside $(document).ready()

2009-09-21 Thread MorningZ

Do you have like this:

External js file "code.js":

$(document).ready(function() {
   function Action1() {
  // do stuff
   }
});


Html file "index.htm":



   


 ... some html here ...
 Action1()
 ... some html here ...



if so, then "Action1" isn't defined yet (and it won't be until *all*
the HTML is spit out to the browser) and not available to use.

see this quick example:

http://jsbin.com/edovi/edit

the alert of "Run Action1" happens *before* the document is ready, and
as a result, the event getting wired up


On Sep 21, 7:11 pm, Matthew  wrote:
> Hi all
>
> I've got a js file where all the functions are wrapped inside $
> (document).ready(). I want to call one of the function from within the
> HTML but it says that the function "is not defined". Any ideas?
>
> Cheers
> Matthew


[jQuery] Re: Accessing functions inside $(document).ready()

2009-09-21 Thread Jeffrey Kretz

It isn't necessary to define the functions inside the document.ready.

Just code which is being executed.

Example:

function Do_Something()
{
   ///
}

function Do_Something_Else()
{
   ///
}

$(document).ready(function(){

   Do_Something();

});

JK
-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Matthew
Sent: Monday, September 21, 2009 4:11 PM
To: jQuery (English)
Subject: [jQuery] Accessing functions inside $(document).ready()


Hi all

I've got a js file where all the functions are wrapped inside $
(document).ready(). I want to call one of the function from within the
HTML but it says that the function "is not defined". Any ideas?

Cheers
Matthew



[jQuery] Accessing functions inside $(document).ready()

2009-09-21 Thread Matthew

Hi all

I've got a js file where all the functions are wrapped inside $
(document).ready(). I want to call one of the function from within the
HTML but it says that the function "is not defined". Any ideas?

Cheers
Matthew


[jQuery] Re: Nested Sort

2009-09-21 Thread MorningZ

First off, there is a dedicated jQuery UI mailing list (http://
groups.google.com/group/jquery-ui?hl=en&lnk=), the guys who do the
code all post/help in there

Second, you may want to show the wiring up of the sort functionality,
something may be incorrect with it

On Sep 21, 3:05 pm, Logan Bailey  wrote:
> I'm using the sort UI nested, so you have
>
> 
>
> 
>     Stuff 1
>     Stuff 2
>     Stuff 3
> 
>
> 
>     Stuff a
>     Stuff b
>     Stuff c
> 
>
> 
>
> In ff, it allows me the ability to sort list1 vs list2 as well as the
> contents from list 1 within itself and with in list 2.   Only IE, when
> i try to drag and drop the contents of one of the list it drags teh
> entire list as well.  Is there a work around to this.


[jQuery] Re: position of js code

2009-09-21 Thread MorningZ

You'll find people will debate either way, and to be honest, you
aren't going to find a definitive answer

Do what works for you


On Sep 21, 4:59 pm, Theodoro  wrote:
> one doubts that where ever I put my js code inside the block  or
> out ... Does anybody know any good tutorial explanatory label it?


[jQuery] Validating Submit from Image Button (Validate)

2009-09-21 Thread Dakuwan

I am having the following issue, when I try using an image to post I
cannot get the validation to run.  When I click the button the form
submits and nothing is checked.  I've been searching all over the web
and cant find any help.  One way of coding doesnt work and the other
does.  I have included both below.  I'd really appreciate the help.

This code doesnt work:
$().ready(function() {

var container = $('div.container');

var validator = $("#CustForm").validate({
errorContainer: container,
wrapper: 'li',
meta: "validate",
rules: {
credit_card: {
required: function(element) {
return $("#payment_type").val() == 
'credit'
}
}
card_month: {
required: function(element) {
return $("#payment_type").val() == 
'credit'
}
}
card_year: {
required: function(element) {
return $("#payment_type").val() == 
'credit'
}
}
card_number_ccard: {
required: function(element) {
return $("#payment_type").val() == 
'credit'
}
}

}
});

$('#CustForm input:image#nextButton').click(function() {
 return $('CustForm').valid();
});

});

If I do this however it does work.  I have to have the rules run
because based on the payment type selected certain fields become
required.

$().ready(function() {

var container = $('div.container');

var validator = $("#CustForm").validate();

$('#CustForm input:image#nextButton').click(function() {
 return $('CustForm').valid();
});

});

This is my button code:


Thanks for the help.


[jQuery] Nested Sort

2009-09-21 Thread Logan Bailey

I'm using the sort UI nested, so you have




Stuff 1
Stuff 2
Stuff 3



Stuff a
Stuff b
Stuff c





In ff, it allows me the ability to sort list1 vs list2 as well as the
contents from list 1 within itself and with in list 2.   Only IE, when
i try to drag and drop the contents of one of the list it drags teh
entire list as well.  Is there a work around to this.


[jQuery] jQuery(window).width() not registering sizes lower than 497 in Firefox.

2009-09-21 Thread indigo0086

I'm working on implementing a menu and need to have information when
the menu size is larger than the width of the window.  The problem is
that pas a certain point, jQuery("body").width() keeps registering
497, despite being much smaller than that.  Has anyone had this issue


[jQuery] Bug? Jumping show/hide in Chrome and Safari

2009-09-21 Thread Merlin

Hi there,

I am building a simple show/hide list with the help of jquery. It
works great on IE and Firefox but in Chrome and Safari the closing
menuitems shift the whole menu to the left for a second and then back
to its origin. I have about 20 menüitems that each hold about 5
submenü items. The goal is to show the 5 items only on mouseover on
the menüitems and then hide it once the mouse moves away.

Here is the code:

$(document).ready(function(){
//Hide all subsubmenus
   $(".subcategories").css("display","none");
});



Geschenke

Any idea on how to fix this? I found a relevant post that refers to a
bug in jquery but the workaround does not work for me and I also tried
the nightly build which also did not help.
http://tommcfarlin.com/2009/01/08/the-problem-with-jquery-hide-safari-and-chrome/

Thank you for any help!!

Regards, Merlin


[jQuery] position of js code

2009-09-21 Thread Theodoro

one doubts that where ever I put my js code inside the block  or
out ... Does anybody know any good tutorial explanatory label it?


[jQuery] Re: parsers[i] is undefined

2009-09-21 Thread Macsig

got it.
FYI the issue is related to a inner-table



On Sep 20, 5:27 pm, macsig  wrote:
> Hello guys,
> I have hard time to use tablesorter 2.0 with a javascript div update.
> I have tried it in several ways (using default Rails rjs file or all
> jquery call) but the result is the same: I get parsers[i] is
> undefined.
>
> Here what i would like to achieve: I have a list of states
> (California, Florida, Texas ...) and when I click one of them I would
> like to display in a div a table with the projects located in that
> state. So I fetch the projects in my controller and I update the div
> content, after that I call tablesorter initializer.
>
> Below you may find 2 of the solutions I tried
>
> 1 - call within the rjs file
> page.replace_html :detail, :partial => "list", :locals => { :projects
> => @projects }
> page<<"jQuery('.p_table').tablesorter({ sortList: [[0,0]] }); "
>
> 2- call within the view (complete)
> link_to_remote state, :url => display_projects_path(:state =>
> state), :method => :get,
> :complete => "jQuery('.p_table').tablesorter({ headers: { 0: { sorter:
> false }, 1: {sorter: true }, 2: { sorter: true }, 3: { sorter: true },
> 4: { sorter: true }, 5: { sorter: true }}});"
>
> Any ideas why I get the parsers error?
>
> THANKS and have a nice day
>
> Sig


[jQuery] Re: Load external content into popup

2009-09-21 Thread MorningZ

Guessing by his usage of a  and a ".load()" call, his intent most
definitely is not to call a separate browser window

Back to the original code, what kind of object is ".Id_Field" ?  seems
like it's a hyperlink since you are "return false"-ing at the end, but
if that's the case then ".va()" isn't going to get something from an
 tag


On Sep 21, 2:45 pm, Mike McNally  wrote:
> If by "popup page" you mean "separate browser window", then it's
> somewhat easier. You can have your server-side code return a complete
> HTML page instead of just a fragment, and then use "window.open()" to
> load that URL.
>
> On Mon, Sep 21, 2009 at 1:29 PM, evanbu...@gmail.com
>
>
>
>  wrote:
>
> > My function loads content from an external page
> > (field.details.preview.aspx) and loads it into a div named container.
> > I would like to load this external content into a popup page instead.
> > I'm not sure how to tackle this.  Thanks
>
> > 
> >    $(document).ready(function()
> >    {  $(".Id_Field").click(function()
> >       {
> >        strIdValue = $(this).val()
> >            $("#container").append('
> div>') > >            .load("field.details.preview.aspx?id_field="+strIdValue, > > function() > >            { > >                $("#container").slideDown("slow"); > > >            }); > >            return false; > >        }); > >    }); > > > > -- > Turtle, turtle, on the ground, > Pink and shiny, turn around.

[jQuery] Re: can't create objects inside getJSON

2009-09-21 Thread MorningZ

how about some different object notation?

$.getJSON(
 "http://domain.com/data";,
  function (data) {
   var state = {
 select: $("#id_state"),
 div: $("div_id_state"),
 children: $("#id_region,#id_destination")
   }

  //Do stuff with data
  }
);

what is $("div_id_state") supposed to select anyways?  do you have

 ..  in your markup?


On Sep 21, 3:02 pm, cerberos  wrote:
> why doesn't this work?
>
>     $.getJSON("http://domain.com/data";, function (data){
>
>       function Place(){}
>       var state = new Place();
>       state.select = $("#id_state");
>       state.div = $("div_id_state");
>       state.children = $("#id_region,#id_destination");
>
>      // do stuff with data here
>
>     }


[jQuery] Re: animation only when mouseover

2009-09-21 Thread Macsig

Thanks,
it stops the animation but now there is an other issue.
Is there a way to keep the same speed for the scrolling? I mean if I
set the duration up and down and I go down just, let us say, for 1/3
of the div when I scroll back up the animation is 3 times slower since
the duration is hardcoded.
The first idea I had is to determine where I'm in the div in order to
define a constant speed but I can find anything about that on scrollTo
documentation.
For instance, let us say I want to have 5000 as a duration for the
entire scrolling, when I'm 20% down I want to set the up speed =
5000x0.2 and down speed =5000x0.8. In this way the speed is constant.

THANKS



On Sep 21, 8:01 am, Robin Abony  wrote:
> Hello macsig!
>
> I haven't really had time to look into your problem, but after a quick
> look through the documentation i found 
> thishttp://docs.jquery.com/Effects/stop#clearQueuegotoEnd
>
> Perhaps that could work for you? I imagine something along the lines
> of :
>
> $('#down_button').mouseover(function(){
>                                 $('#text').scrollTo('100%', {axis:'y',
> duration: 5000});
>         }).mouseout(function(){
>                                 $('#text').stop();
>         });
>
> Give that a try!
>
> On 21 Sep, 03:49, macsig  wrote:
>
>
>
> > Hi there,
> > I'm trying to use scrollTo in oder to scroll vertically a div. I want
> > to use 2 anchors, one to go up and the other to go down and I need
> > that the effect works ONLY when the mouse is over the anchor (when I
> > move it out the animation has to stop).
>
> > How can I achieve so?
>
> > For instance the code below scrolls correctly down but it doesn't stop
> > until the end even if I move out the mouse.
>
> >         $('#down_button').mouseover(function(){
> >                                 $('#text').scrollTo('100%', {axis:'y', 
> > duration: 5000});
> >         }).mouseout(function(){ });
>
> > THANKS
>
> > Sig


[jQuery] Re: Doubts on Multiple selection employment

2009-09-21 Thread Karl Swedberg

I'd use a filter function. Something like this maybe:

$('#MyTable tr').filter(function() {
  return /^(Row(?!Header)|Line(?!Empty))/.test(this.id);
})

It's a kind of crazy regular expression, with negative lookaheads, but  
it works (as of JavaScript 1.5).


--Karl


Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Sep 21, 2009, at 10:32 AM, Erich Nascimento wrote:



Thank you MorningZ,

I seem to have managed to solve the problem, but I'd like to know
whether in Attribute Filters I could use more tha once the same
operator.
For exemple: to have two or more times the operator ^= to select
certain elements that iniciate with different IDs.

Perhaps that is possible and I'm not doing the right way.

Example:



 
   
   
   

   
   $(document).ready(function(){
   var ElementsArray = $("#MyTable tr[id^='Row'][id^='Line']
[id!='LineEmpty'][id!='RowHeader']");

   ElementsArray.each(function(i){
   alert($(this).text());
   })
   });


   

 
 
 
 
 Col1
 Col2
 
 
 A1
 B1
 
 
 A2
 B2
 
 
 A3
 B3
 
 
 A4
 B4
 
 
 xx
 yy
 
 
 


--
Thank you.




[jQuery] Re: Load external content into popup

2009-09-21 Thread Mike McNally

If by "popup page" you mean "separate browser window", then it's
somewhat easier. You can have your server-side code return a complete
HTML page instead of just a fragment, and then use "window.open()" to
load that URL.


On Mon, Sep 21, 2009 at 1:29 PM, evanbu...@gmail.com
 wrote:
>
> My function loads content from an external page
> (field.details.preview.aspx) and loads it into a div named container.
> I would like to load this external content into a popup page instead.
> I'm not sure how to tackle this.  Thanks
>
>
> 
>    $(document).ready(function()
>    {  $(".Id_Field").click(function()
>       {
>        strIdValue = $(this).val()
>            $("#container").append('
div>') >            .load("field.details.preview.aspx?id_field="+strIdValue, > function() >            { >                $("#container").slideDown("slow"); > >            }); >            return false; >        }); >    }); > > -- Turtle, turtle, on the ground, Pink and shiny, turn around.

[jQuery] Load external content into popup

2009-09-21 Thread evanbu...@gmail.com

My function loads content from an external page
(field.details.preview.aspx) and loads it into a div named container.
I would like to load this external content into a popup page instead.
I'm not sure how to tackle this.  Thanks



$(document).ready(function()
{  $(".Id_Field").click(function()
   {
strIdValue = $(this).val()
$("#container").append('
') .load("field.details.preview.aspx?id_field="+strIdValue, function() { $("#container").slideDown("slow"); }); return false; }); });

[jQuery] Re: problem when using inside a popup

2009-09-21 Thread Arun

How did you manage to get it in dialog. Im using Jquery UI 1.7.2
dialog for me the auto suggest layer displays behind the modal dialog
overlay. Please let me know how to acheive it?

On Sep 8, 1:11 pm, Kevin  wrote:
> Hello,
>
> When I usejquery.autocomplete.js on a field that lives inside 
> ajquerymodalpopup, theautocompletelist doesn't stick to the textbox
> when scrolling with the scrollwheel of the mouse.
> Anyone knows if this is a bug, or a configuration issue?
>
> best regards!
>
> Kevin


[jQuery] Re: Browser sniffing - the correct way?

2009-09-21 Thread Mike McNally

Another example, since I've just had to deal with it: try and use
"fadeIn()" and "fadeOut()" sometime when there's a transparent PNG
somewhere in the affected content. There's no
"fadedPngImagesLookTerrible()" predicate I can use.  How do I decide
what to do?  Should I just back off from what I think to be a good
design and get rid of my transparent PNG? Or should I instead just
forego fading for the deficient browsers and allow people using ones
that actually work to see the content the way I intended?  The latter
seems like a much better course of action, since no one user will
suffer (well, the IE user suffers but they should be used to that :-)
and I get to ship the design I intend.  The only way I know of to code
that is to explicitly detect the browser.  (If jQuery were to include
a "fadedPngImagesLookTerrible()" predicate, then that would at least
hide the sniffing from my code, but I suspect that the library itself
would have to sniff in order to provide the implementation.)


-- 
Turtle, turtle, on the ground,
Pink and shiny, turn around.


[jQuery] Re: malsup's corners: strange top nudges in IE6 and Opera

2009-09-21 Thread Mike Alsup

> I am playing with malsup's corners and I am getting strange nudges on
> both top corners in Opera, IE6 and Konquerer when applied to nested
> elements (to achieve a cornered border). I am using exactly the same
> code as on the demo page: "$(this).corner("round 8px").parent().css
> ('padding', '4px').corner("round 10px")".


If you're using the exact same code as the demo page and it looks
differently for you then perhaps it is due to fluid vs fixed size
divs.  The demo page uses fixed size divs for simplicity.

Screenshots are always good but links to running code are even
better!  :-)

Mike


[jQuery] Re: Get rid of "long-running script dialog box" ?

2009-09-21 Thread Mike Alsup

> I can hardly "split my processing into smaller chunks"

I'm sure that's not true.  If your script is running so long that it
causes the warning dialog to display then you must refactor it.


[jQuery] malsup's corners: strange top nudges in IE6 and Opera

2009-09-21 Thread KlausR

Dear all,

I am playing with malsup's corners and I am getting strange nudges on
both top corners in Opera, IE6 and Konquerer when applied to nested
elements (to achieve a cornered border). I am using exactly the same
code as on the demo page: "$(this).corner("round 8px").parent().css
('padding', '4px').corner("round 10px")".

Strangely this only appears when the radius is more than 10px and
div.outer's padding is less than 3px.

All corners are rounded, just at the top div.outer still seems to have
little develish horns. I can provide screenshots if s.o. is willing to
help.

Thanx for helping


[jQuery] Re: Grab a bunch of HTML and exhibit an excerpt - help

2009-09-21 Thread ldexterldesign

So I discovered how to use the gt() function today :]

It helped, as did this script (http://stackoverflow.com/questions/
1021306/using-jquery-to-limit-the-number-of-list-elements)

Thanks,

On Sep 21, 10:15 am, ldexterldesign  wrote:
> Easy guys,
>
> I've cobbled this script together to help me implement 'read more...'
> links on this site I'm developing:http://www.blowcreative.co.uk/blog/
>
> It does the job, but I lose all the mark-up in the process :[ It
> doesn't cater for a bunch of tags like , ,  etc. slice()
> ain't being too kind to me.
>
> // create a 'read more' link, and hide remaining text, if post content
> exceeds quota
> jQuery(function ($) {
>     // get total characters (including spaces) in content
>     $('.scrollable .scrollableItem').each(function () {
>         var totalContent = $(this).find('p').not('.wp-caption-
> text').not('.postmetadata').text();
>
>                 // remove all post content, but not the page content (.entry 
> p). we
> will put the appropriate content back later
>         $(this).find('p').not('.entry p').not('.wp-caption-text').not
> ('.postmetadata').remove(); // fix: breaks without an image caption,
> also needs support for multiple images and all other mce elements!
>
>                 // total characters allowed before cut off
>         var quota = 800;
>         // split totalContent into two parts
>         var arr = new Array(2);
>         arr[0] = totalContent.slice(0, [quota]);
>         arr[1] = totalContent.slice(quota, [totalContent.length]);
>
>         // set up post variables
>         var postTitle = $(this).parent().find('h2').text();
>         var postURL = $(this).parent().find('h2 a').attr('href');
>
>         // check if content exceeds quota. drop in appropriate content
> and insert 'read more' link
>         if (totalContent.length > quota) {
>             // set up post variables
>             var postTitle = $(this).parent().find('h2').text();
>             var postURL = $(this).find('h2 a').attr('href');
>             // only display 1st part of content
>             $(this).find('.postmetadata').before('' + arr[0] +
> ' Read
> more...'); // todo: would be better if orginal 's
> were retained, atm these are omitted at the array stage
>         } else {
>             // display all content
>             $(this).find('.postmetadata').before('' + totalContent
> + '');
>         };
>     });
>
> });
>
> Any tips would be awesome.
>
> Thanks,
> L


[jQuery] Re: Recommend a JS enabled/browser growler script/plug-in?

2009-09-21 Thread ldexterldesign

Cheers man. And the browser detection..?

Thanks,

On Sep 21, 5:14 pm, Liam Potter  wrote:
> use noscript and conditional comments.
>
> ldexterldesign wrote:
> > // This site works best with JavaScript enabled and not using Internet
> > Explorer. Take your pick of the others instead: Firefox, Google
> > Chrome, Safari, Opera...
>
> > Anyone? :P
> > Thanks,


[jQuery] Re: Recommend a JS enabled/browser growler script/plug-in?

2009-09-21 Thread Liam Potter


use noscript and conditional comments.

ldexterldesign wrote:

// This site works best with JavaScript enabled and not using Internet
Explorer. Take your pick of the others instead: Firefox, Google
Chrome, Safari, Opera...

Anyone? :P
Thanks,
  




[jQuery] Recommend a JS enabled/browser growler script/plug-in?

2009-09-21 Thread ldexterldesign

// This site works best with JavaScript enabled and not using Internet
Explorer. Take your pick of the others instead: Firefox, Google
Chrome, Safari, Opera...

Anyone? :P
Thanks,


[jQuery] Get rid of "long-running script dialog box" ?

2009-09-21 Thread Machin Pouet
Hello all,

I'd like to know if you have a way to disable the long-running script dialog
boxes, as one can see many in this article :
http://www.nczonline.net/blog/2009/01/05/what-determines-that-a-script-is-long-running/

I can hardly "split my processing into smaller chunks", and cannot ask
clients to tweak their browsers or registry !

I hope my call for help is in the right section, shouldn't it be the case, I
apologize, but would appreciate any link to a potential solution.

Looking forward to hear back from you,

sincerely,

S.


[jQuery] Re: Suggestions on form validtion

2009-09-21 Thread fu zhiping
Hi, Scott

I have just accessed the link you provided in your mail. It is fairly
interesting.
In fact, there is an collection about form validation in below site.
http://www.donotyet.com/2009/09/20/the-ultimate-collection-of-ajax-form-validation-plugins-controls/
may it give you some hints?


2009/9/21 Scott Haneda 

>
> Hello, I created this:
> http://dl.getdropbox.com/u/340087/Drops/09.20.09/form-e3ae8599-180653.html
>
> The basics are that jQuery will immediately hide a div that is the right
> most column.
> $('div.right').hide();
>
> I have three input elements that when focus is given, I take the next()
> element, which is the right div, and fade that in.
>
> On blur, I take the next element, and set it back to hidden.  This works
> well, and accomplishes what I want in as minimal code as I am able to hobble
> together.
>
> Next, I need to validate the fields, so working on "user" and "name" in
> this case, leaving "email" for later, since it will be more complex.
>
> If the string length of "user" is more than 1, I want to drop a new class
> to show to the right of the input.  It would say "OK" and change the
> background color to green.  If the string is less than 1, it would say
> "invalid" and change the background to red.
>
> Similar treatment to "name" and "email" of course, just different
> conditions.  Using string length of 1 for simplicity, I will probably do
> (foo >= 5) or something like that.
>
> I have not been able to get this to work, and I also do not want to add a
> lot of code for the validation.
>
> Suggestions on the correct process?  How is my current approach?
> --
> Scott * If you contact me off list replace talklists@ with scott@ *
>
>


[jQuery] Re: Autocomplete

2009-09-21 Thread Asa Carter

I suppose I could do that. thanks...

On Sep 21, 3:31 pm, Liam Potter  wrote:
> why not restyle the strong tag?
>
> Asa Carter wrote:
> > How do I use the highlight function in the auto complete plugin?
>
> > I wish to replace  with 
>
> > Thanks
>
> > Asa


[jQuery] tooltip

2009-09-21 Thread adir

I am jquery beginer,

I write my project using STRUTS 2 and Jquery

I'd like to know how can I add a ToolTip to some existing controller
such as Date Picker, stright forward.


if it looks like the below(jsp page):

<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>




 
Controllers Test



  



Second, What is the difference between remote and local
sj:tabbedpanel ?

thanks a lot


[jQuery] Re: AJAX search result filtering

2009-09-21 Thread chenja

Hi, Toaster

some examples in the below link may help you.
http://www.donotyet.com/2009/09/06/ajax-search-save-time-save-money/


On Sep 21, 1:00 am, Toaster  wrote:
> Hello
>
> I was thinking of having my search result filters affect data
> automatically without reloading the page. What would be the best
> approach to this? I was thinking of attaching  $.post();  to each
> filter checkbox or dropdown to submit that elements input then have
> the page update the results table.
>
> Something like this perhaps:
>
> -> use post to send single filter to a page that stores it in a
> session ( do this whenever a filter is changed)
> -> retrieve all stored filters in the session, fetch results and
> update page
>
> Would this be the best approach?
> I'd greatly appreciate some suggestions - thanks in advance


[jQuery] Re: Autocomplete

2009-09-21 Thread fu zhiping
Hi, Asa

If the link below may help you, it is my pleasure.
http://www.donotyet.com/2009/08/30/3-examples-of-facebook-like-autosuggestion/


2009/9/21 Asa Carter 

>
> How do I use the highlight function in the auto complete plugin?
>
> I wish to replace  with 
>
> Thanks
>
> Asa
>


[jQuery] (autocomplete) Issue with Plugin JQuery Dialog 1.7.2

2009-09-21 Thread Arun

Hi,
   We are using  autocomplete plugin with  Jquery
1.3 and Jquery UI 1.7.2. When the plugin is used with Jquery UI Modal
dialog we are getting auto suggest layer behind the modal layer. We
feel itz due to z-index of dialog. Please let us know if there any way
fix this issue.


[jQuery] Need help building a jQuery dropdown menu

2009-09-21 Thread sammahoney

Hi folks

I'm just starting out with jQuery. I want to make a simple 'ul'
dropdown menu to improve my understanding. The basic flow is this:

'ul.menu li ul' has display:none >> on hover of li, get & store height
of 'this' hidden ul >> set height of 'this' ul to 0 >> set display to
block >> animate height to original stored height

I know there are already some great plugins for dropdowns, but I
really want to roll my own to get a better understanding of jQuery.

So far I have managed the following, very badly done (see live version
here - http://jsbin.com/eduvi):

var $j = jQuery.noConflict();
$j(document).ready(function(){

// Get height of current hidden ul

$j("ul.menu li").hover(function() {
  getHeight($j("ul", this).height());
});
// Set height to 0px

$j('ul.menu li').hover(function() {
$j("ul", this).css({"height":"0px"});
});

// Set display to block

$j('ul.menu li').hover(function() {
$j("ul", this).css({"display":"block"});
});

// Animate height to stored height

$j('ul.menu li').hover(function getHeight(h) {
$j('ul:first', this).stop().animate({ "height" : "100%" } , 400 );
});

// Display height of current hidden ul

function getHeight(h) {
  $j("div.test").text("The height for the hidden ul is " + h +
"px."); }
  });

I'd like to know how do I get it to use the stored original height, in
place of that 100%.

And secondly, I'm sure this can all be condensed down to just a few
lines, but don't really have a clue how to do that yet.

Any help very much appreciated!


[jQuery] Re: Browser sniffing - the correct way?

2009-09-21 Thread Mike McNally

Advice to "never" use browser detection is good advice, but in my
experience it's simply impossible to follow. The bad behaviors of old
IE browsers - behaviors that are, in effect, bugs, and therefore not
"features" that obey any particular logic - are numerous and
pervasive.  Facile advice like "avoid troublesome features"
constitutes a grim curse on site design: "don't do anything that
doesn't work reliably in IE6" is what that amounts to, and I think
that's terrible.

Feature/behavior detection is definitely better than raw browser
sniffing, but (jQuery being a good example) any feature/behavior
detection system I've seen is limited to detecting what it's been made
to detect. For example: in IE6 and IE7, an absolutely-positioned block
with explicit "edge" style attributes ("top", "left", etc) is not
given a computed width.  That means that nested blocks can't use
"width: 50%" because there's nothing against which that "50%" can be
computed. For some layouts that's a very serious problem, and there's
nothing I can do with jQuery to detect that in the case that it
affects what my site code needs to do.  Here's another one: a click on
a button inside an anchor tag doesn't trigger the anchor's click
handler (in IE7).  I'm not sure how jQuery would handle that even if
it wanted to.



-- 
Turtle, turtle, on the ground,
Pink and shiny, turn around.


[jQuery] Re: How do you make text selectable when using IE browser?

2009-09-21 Thread amtames

Thank you for offering insight into this issue. Unfortunately, after
searching for this snippet of code 'document.onselectstart = function
() {return false;}'
I was not able to find anything. It does look like the .js file
culprit is named: jquery.ui.all.js

In it there is this: (I have tried deleting the whole thing, changing
text 'unselectable' to 'selectable' , off to on etc) with no
luck...any further suggestion or help would be appreciated.

/** Mouse Interaction Plugin **/

$.ui.mouse = {
_mouseInit: function() {
var self = this;

this.element
.bind('mousedown.'+this.widgetName, function(event) {
return self._mouseDown(event);
})
.bind('click.'+this.widgetName, function(event) {
if(self._preventClickEvent) {
self._preventClickEvent = false;
return false;
}
});

// Prevent text selection in IE
if ($.browser.msie) {
this._mouseUnselectable = 
this.element.attr('unselectable');
this.element.attr('unselectable', 'on');
}

this.started = false;
},

// TODO: make sure destroying one instance of mouse doesn't mess with
// other instances of mouse
_mouseDestroy: function() {
this.element.unbind('.'+this.widgetName);

// Restore text selection in IE
($.browser.msie
&& this.element.attr('unselectable', 
this._mouseUnselectable));
},

_mouseDown: function(event) {
// don't let more than one widget handle mouseStart
if (event.originalEvent.mouseHandled) { return; }

// we may have missed mouseup (out of window)
(this._mouseStarted && this._mouseUp(event));

this._mouseDownEvent = event;

var self = this,
btnIsLeft = (event.which == 1),
elIsCancel = (typeof this.options.cancel == "string" ? $
(event.target).parents().add(event.target).filter
(this.options.cancel).length : false);
if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
return true;
}

this.mouseDelayMet = !this.options.delay;
if (!this.mouseDelayMet) {
this._mouseDelayTimer = setTimeout(function() {
self.mouseDelayMet = true;
}, this.options.delay);
}

if (this._mouseDistanceMet(event) && 
this._mouseDelayMet(event)) {
this._mouseStarted = (this._mouseStart(event) !== 
false);
if (!this._mouseStarted) {
event.preventDefault();
return true;
}
}



On Sep 20, 10:27 pm, RobG  wrote:
> On Sep 19, 6:53 am, amtames  wrote:
>
> > Hi,
>
> > We recently had our site redeveloped by a professional firm. We
> > originally requested that users not be able to copy and paste text
> > from our site. This has created an outcry and we would like to have
> > text be selectable. I see that they achieved this by using jquery
> > which I am not familiar. I believe that I have found the snippet of
> > code that turns this ability off/on but I do not know how to write the
> > correct code to allow selection of text.
>
> You don't have to do anything to *allow* selection of text, you just
> have to stop trying to prevent it. The simple solution is to turn off
> javascript, but likely your users don't know how to do that.
>
> > This is an IE specific issue,
> > not a problem in Firefox.
>
> Look for something like:
>
>   document.onselectstart = function() {return false;}
>
> and remove it.
>
> --
> Rob


[jQuery] Re: some idea: jQuery ajax and URL length

2009-09-21 Thread MorningZ

How about switching to POST instead of GET ?  That would take care of
any issue

On Sep 21, 6:39 am, Rafal Zarajczyk  wrote:
> Hi
> Internet Explorer (in particular IE6) has some limit on maximum URL
> length. This is very hard to debugging if you don't know what to
> search for. Maybe jQuery could throw some self-explaining exception
> when URL is too long?
>
> Regards,


[jQuery] Re: Browser sniffing - the correct way?

2009-09-21 Thread Nick Fitzsimons

2009/9/21 RobG :
>
> On Sep 18, 1:32 am, ldexterldesign  wrote:
>
>> A
>> friend of mine just recommend:http://www.quirksmode.org/js/detect.html
>
> Don't use it. Don't even consider detecting specific browsers for
> javascript quirks. For HTML or CSS hacks, go to relevant forums. Often
> the best solution is to simply avoid troublesome features.
>

Also, take note of ppk's further comments linked to from that browser
detection page; although he wrote them quite a few years ago (as
evidenced by references to IE 3 and Navigator 2), they are good
advice: 

Regards,

Nick.
-- 
Nick Fitzsimons
http://www.nickfitz.co.uk/


[jQuery] After tab through menu - it disappears

2009-09-21 Thread Jeremy

I believe I found an accessibility issue with superfish.  I have the
"sf-
menu" ul as the child of another list item.  After tabbing through the
entire sf-menu, it disappears.  How might I fix this?

This is happening in both IE and firefox.

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


[jQuery] Re: help to simplify code

2009-09-21 Thread benoit v.

Just read that topic. Very nice effect, and nice && helpful code
improvements! You guys are great.

On Sep 21, 2:18 am, Karl Swedberg  wrote:
> Sure.
>
> // find all "a" elements within $navigation (which is a variable for $
> ('#navigation')
> $navigation.find('a')
> // bind two events to those links: mouseenter and mouseleave. pass the  
> event object as an argument to the anonymous function
>     .bind('mouseenter mouseleave', function(event) {
> // if the ID of the link starts with "nav" ...
>       if (this.id.indexOf('nav') === 0) {
> // store a string in the id variable. the string will be an id  
> selector of the corresponding element within #bodycopy.
> // the string starts with "#" and ends with the ID of the link without  
> the opening "nav"
> // for example, if the link's ID is "navservices," the id variable  
> will be "#services"
>         var id = '#' + this.id.replace(/^nav/,'');
> // trigger the event (either mouseenter or mouseleave) for the element  
> that matches the selector represented by id.
> // So, when the user's mouse enters ,  
> it will trigger mouseenter for .
> //And we've already bound mouseenter and mouseleave for those divs, so  
> we're all set.
>         $(id).trigger(event.type);
>       }
>     });
>
> --Karl
>
> 
> Karl Swedbergwww.englishrules.comwww.learningjquery.com
>
> On Sep 20, 2009, at 12:59 PM, alienfactory wrote:
>
>
>
> > Thanks Karl
>
> > That was more then i expected.
>
> > However the $navigation.find('a') section is a little over my head
> > could add a few comments to that one to help me understand it
>
> > Terry
>
> > On Sep 20, 8:49 am, Karl Swedberg  wrote:
> >> Here is another way you could do it:
>
> >> var bgColors = {
> >>    services: '#8ac2b7',
> >>    vision: '#9e97ca',
> >>    approach: '#e5b120',
> >>    team: '#cf1858'
>
> >> };
>
> >> var $navigation = $('#navigation');
>
> >> $('#bodycopy').children()
> >>    .bind('mouseenter', function() {
> >>      $(this).siblings().stop().fadeTo('slow', .2);
> >>      $navigation.stop().animate({backgroundColor: bgColors[this.id]},
> >> 500);
> >>    })
> >>    .bind('mouseleave', function() {
> >>      $(this).siblings().stop().fadeTo('slow', 1);
> >>      $navigation.stop().animate({backgroundColor: '#404040'}, 500);
> >>    });
>
> >> $navigation.find('a')
> >>    .bind('mouseenter mouseleave', function(event) {
> >>      if (this.id.indexOf('nav') === 0) {
> >>        var id = '#' + this.id.replace(/^nav/,'');
> >>        $(id).trigger(event.type);
> >>      }
> >>    });
>
> >> --Karl
>
> >> 
> >> Karl Swedbergwww.englishrules.comwww.learningjquery.com
>
> >> On Sep 20, 2009, at 10:51 AM, alienfactory wrote:
>
> >>> i was asking about javascript/jquery not html 101 but that is cool
> >>> though and yes that was snarky. LOL
>
> >>> No worries at least you are trying to help thanks
>
> >>> I dont see where you are fading the addtional div see link above for
> >>> sample
> >>> you focused on the navigavtion but i have 4 divs when mousing over  
> >>> one
> >>> of them the other divs should fadeout
>
> >>> How do you select additional div.
>
> >>> Many Thanks
>
> >>> On Sep 20, 4:17 am, "ryan.j"  wrote:
>  for fear of offending you further, i apologise in advance for  
>  posting
>  code. personally i'd be tempted to call 'test1(this)' on the
>  mouseover
>  and mouseout events and have it do something like...
>
>  function test1(t) {
>                  var c = $(t).css('background-color')
>                  var o = '1'
>                  if ( !$(t).hasClass('nav-active') )
>                          o = '.2'
>                  $('.nav-active').removeClass('nav-active')
>
>                  $(t).addClass('nav-active')
>                          .siblings()
>                          .stop()
>                          .fadeTo('slow', o);
>
>                  $('#navigation').stop()
>                          .animate({ backgroundColor: c }, 500);
>
>  }
>
>  this is literally back-of-fagpacket code, so clearly it could be
>  improved and/or tested. assigning a class just to track the opacity
>  state probably isn't the greatest idea ever but it does mean you  
>  have
>  easy access to the currently selected menu item.
>
>  On Sep 20, 11:25 am, "ryan.j"  wrote:
>
> > i wasn't being snarky mate, just that you phrased your question
> > like a
> > homework assignment!
>
> > besides, i thought i /was/ answering your question tbh :S
>
> > On Sep 20, 3:14 am, alienfactory  wrote:
>
> >> wow really! not sure what to say about that.
>
> >> Here is a development link to the actual 
> >> projecthttp://alienfactory.com/vision1/
> >> if any one would like to help out on the javascript jquery  
> >> question
> >> above
>
> >> Thanks in advance for any help


[jQuery] Re: animation only when mouseover

2009-09-21 Thread Robin Abony

Hello macsig!

I haven't really had time to look into your problem, but after a quick
look through the documentation i found this
http://docs.jquery.com/Effects/stop#clearQueuegotoEnd

Perhaps that could work for you? I imagine something along the lines
of :

$('#down_button').mouseover(function(){
$('#text').scrollTo('100%', {axis:'y',
duration: 5000});
}).mouseout(function(){
$('#text').stop();
});

Give that a try!

On 21 Sep, 03:49, macsig  wrote:
> Hi there,
> I'm trying to use scrollTo in oder to scroll vertically a div. I want
> to use 2 anchors, one to go up and the other to go down and I need
> that the effect works ONLY when the mouse is over the anchor (when I
> move it out the animation has to stop).
>
> How can I achieve so?
>
> For instance the code below scrolls correctly down but it doesn't stop
> until the end even if I move out the mouse.
>
>         $('#down_button').mouseover(function(){
>                                 $('#text').scrollTo('100%', {axis:'y', 
> duration: 5000});
>         }).mouseout(function(){ });
>
> THANKS
>
> Sig


[jQuery] Re: How do I extract a part of received data

2009-09-21 Thread Rodrigo Sebastián Alfonso
let's say you have "World" in data, you have to do this:

$("div").find("p").html($("div").find("p").html() + data);

so your html would look like:

HelloWorld


On Mon, Sep 21, 2009 at 11:49 AM, Frederik  wrote:

>
> Anyone has any idea ?
>
> I have tried this way.
> $("Hello").find("p").appendTo("#content");  //
> works... it append Hello
>
> I have tried it with all the content of data parameter
> $(data).appendTo("#content");  //works - add all the DOM received in
> Data
>
> The problem is when I try to extract a part of data, it does not work
> $(data).find("p").appendTo("#content"); // Does not find the Hello p> part
>
>
> Thanks in advance for your help
>
> On Sep 18, 10:34 am, Frederik  wrote:
> > Wrong syntax?  Please explain.
> >
> > I try to use this instruction found onhttp://www.visualjquery.com/:
> > jQuery(expression, context)
> >
> > > The core functionality of jQuery centers around this function.
> Everything in jQuery is based upon this, or uses this in some way. The most
> basic use of this function is to pass in an expression (usually consisting
> of CSS), which then finds all matching elements.
> >
> > > By default, if no context is specified, $() looks for DOM elements
> within the context of the current HTML document. If you do specify a
> context, such as a DOM element or jQuery object, the expression will be
> matched against the contents of that context
> >
> > > Example
> >
> > > Finds all div elements within an XML document from an AJAX response.
> > > jQuery Code
> >
> > > $("div", xml.responseXML);
> >
> > Please do not tell me this is because this is for XML data only. I
> > read Ajax request may return HTML data and will process it as well.
> > In fact, I already use $get() (an AJAX calling function) that return
> > HTML.
> >
> > On Sep 18, 8:07 am, lanxiazhi  wrote:
> >
> > > this :
> > > var elem = $('#section_news', data);
> > > is not the right syntax.
>



-- 
Rodrigo Alfonso


[jQuery] Re: Autocomplete

2009-09-21 Thread Liam Potter


why not restyle the strong tag?

Asa Carter wrote:

How do I use the highlight function in the auto complete plugin?

I wish to replace  with 

Thanks

Asa
  




[jQuery] Re: How do I extract a part of received data

2009-09-21 Thread Frederik

Anyone has any idea ?

I have tried this way.
$("Hello").find("p").appendTo("#content");  //
works... it append Hello

I have tried it with all the content of data parameter
$(data).appendTo("#content");  //works - add all the DOM received in
Data

The problem is when I try to extract a part of data, it does not work
$(data).find("p").appendTo("#content"); // Does not find the Hello part


Thanks in advance for your help

On Sep 18, 10:34 am, Frederik  wrote:
> Wrong syntax?  Please explain.
>
> I try to use this instruction found onhttp://www.visualjquery.com/:
> jQuery(expression, context)
>
> > The core functionality of jQuery centers around this function. Everything 
> > in jQuery is based upon this, or uses this in some way. The most basic use 
> > of this function is to pass in an expression (usually consisting of CSS), 
> > which then finds all matching elements.
>
> > By default, if no context is specified, $() looks for DOM elements within 
> > the context of the current HTML document. If you do specify a context, such 
> > as a DOM element or jQuery object, the expression will be matched against 
> > the contents of that context
>
> > Example
>
> > Finds all div elements within an XML document from an AJAX response.
> > jQuery Code
>
> > $("div", xml.responseXML);
>
> Please do not tell me this is because this is for XML data only. I
> read Ajax request may return HTML data and will process it as well.
> In fact, I already use $get() (an AJAX calling function) that return
> HTML.
>
> On Sep 18, 8:07 am, lanxiazhi  wrote:
>
> > this :
> > var elem = $('#section_news', data);
> > is not the right syntax.


[jQuery] Re: Some homebrewn jQuery functionalities

2009-09-21 Thread Giovanni Battista Lenoci


Cecil Westerhof ha scritto:

2009/9/21 Cecil Westerhof :
  

- a way to automatically notify people that they should enable JavaScript



The way that I did this was that start the body with:
  
  For best results JavaScript must be enabled!!!
  
  
There's the noscript tag for this, with your way search engines will 
register this as the main heading of your page... I don't think this is 
desiderable :-)



--
gianiaz.net - web solutions
via piedo, 58 - 23020 tresivio (so) - italy
+39 347 7196482 



[jQuery] Re: Doubts on Multiple selection employment

2009-09-21 Thread Erich Nascimento

Thank you MorningZ,

I seem to have managed to solve the problem, but I'd like to know
whether in Attribute Filters I could use more tha once the same
operator.
For exemple: to have two or more times the operator ^= to select
certain elements that iniciate with different IDs.

Perhaps that is possible and I'm not doing the right way.

Example:



  





$(document).ready(function(){
var ElementsArray = $("#MyTable tr[id^='Row'][id^='Line']
[id!='LineEmpty'][id!='RowHeader']");

ElementsArray.each(function(i){
alert($(this).text());
})
});




  
  
  
  
  Col1
  Col2
  
  
  A1
  B1
  
  
  A2
  B2
  
  
  A3
  B3
  
  
  A4
  B4
  
  
  xx
  yy
  
  
  


--
Thank you.


[jQuery] Re: JCarouselLite - pause scrolling

2009-09-21 Thread Steffan A. Cline

on 9/21/09 4:27 AM, dudal at jes...@dudal.com wrote:

> 
> Hi again
> 
> I have put up a minified version of the script:
> http://www.dudal.com/jquery/jquery.jcarousellite.pauseOnHover.min.js
> 
> The minifyer choked on a css "float" attribute in the original script.
> Seems that the minified version is working fine after quoting "float".
> 
> Best
> Jesper
> 

Thanks Jesper. I Googled around on Saturday until I found some notes talking
about the YUI compressor choking on that. I tried their instructions of
putting quotes around float and viola! It worked.

I tried it all and yes, it does work great!



> 
> On 19 Sep., 22:15, "Steffan A. Cline"  wrote:
>> on 9/18/09 7:49 AM,dudalat jes...@dudal.com wrote:
>> 
>> 
>> 
>> 
>> 
>>> Hey Steffan
>> 
>>> I'm glad you like it. I used to go with the "full" carousel version
>>> just for this feature, but then I looked into the code and found that
>>> it could be acomplished using only 3 lines of code or so. I posted it
>>> on Ganeshjis website hoping that he will include it in his official
>>> release.
>> 
>>> /Jesper
>> 
>>> On 18 Sep., 15:42, "Steffan A. Cline"  wrote:
 on 9/18/09 5:30 AM,dudalat jes...@dudal.com wrote:
>> 
> Hi Steffan
>> 
> I had the same problem and came up with the following modification:
> http://www.dudal.com/jquery/jquery.jcarousellite.pauseOnHover.js(not
> minified)
>> 
> Example config (notice pauseOnHover):
> $('#selector').jCarouselLite({
> auto: 2000,
> speed: 1500,
> visible: 1,
> circular: true,
> pauseOnHover: true
> });
>> 
> That ensures that the carousel will not advance when the mouse is over
> the carousel.
>> 
> I hope that helps.
>> 
 Yes, it does. Awesome! I tried to get a hold of the author to ask about
 this
 but he didn't answer the email. It would be nice to see your changes
 committed to this project.
>> 
 Thanks!!
>> 
> Best
> JesperDudal
> DudalWebdesign
> http://www.dudal.com
>> 
> On 7 Sep., 18:26, "Steffan A. Cline"  wrote:
>> on 9/6/09 11:54 PM, Jonathan Vanherpe (T & T NV) at jonat...@tnt.be
>> wrote:
>> 
>>> Steffan A. Cline wrote:
 on 8/28/09 5:37 PM, Steffan Cline at stef...@hldns.com wrote:
>> 
> I have a carousel that auto scrolls images. I was asked if there is a
> way
> to
> make it so that if you mouse over the carousel, it stops and when you
> mouse
> out, it starts up again.
>> 
> Is this possible?
>> 
 Anyone?
>> 
 Thanks
>> 
 Steffan
>> 
>>> The plain jcarousel has this option:
>>> http://sorgalla.com/projects/jcarousel/examples/static_auto.html
>> 
>>> Jonathan
>> 
>> Thanks. I saw that option but I have already integrated theliteversion :(
>> I hope the author of theliteversion speaks up.
>> 
>> Thanks
>> 
>> Steffan
>> 
 Thanks
>> 
 Steffan
>> 
>> Anyone able to minify this? It's finding syntax errors and saying that some
>> properties are wrong. Odd.
>> 
>> Suggestions are welcome.
>> 
>> Thanks
>> 
>> Steffan
>> 


Thanks

Steffan





[jQuery] Re: Doubts on Multiple selection employment

2009-09-21 Thread MorningZ

I don't see talk in the docs

http://docs.jquery.com/Selectors/attributeStartsWith#attributevalue

about using multiple of those in a single selector you may want to
seek a different approach  i'd try to help but your selector
doesn't make much sense

On Sep 21, 8:46 am, Erich Nascimento 
wrote:
> As stated in your documentation, it's possible to iniciate the
> selector with more than one filter of "^=" kind. But when I try to use
> that feature it doesn's seem to work. Should it work that way? May I
> actually use two or more filters of that kind (^=) in the same
> expression?
>
> var procsGrid = $("#GridProcedimentos tr[id^='jnGridRow']
> [id^='Grid_Linha'][id!='jnGridRowEmpty']");


[jQuery] Doubts on Multiple selection employment

2009-09-21 Thread Erich Nascimento

As stated in your documentation, it's possible to iniciate the
selector with more than one filter of "^=" kind. But when I try to use
that feature it doesn's seem to work. Should it work that way? May I
actually use two or more filters of that kind (^=) in the same
expression?

var procsGrid = $("#GridProcedimentos tr[id^='jnGridRow']
[id^='Grid_Linha'][id!='jnGridRowEmpty']");


[jQuery] Re: Browser sniffing - the correct way?

2009-09-21 Thread Sam Sherlock
>
> Often the best solution is to simply avoid troublesome features.


I think this article explains the concept well
http://www.alistapart.com/articles/testdriven
as simple as possible but not simpler

30,000 registered at TNL.net


that would be an awful lot to check; which is why checking is the user
supports the correct implementation of box model or cssFloat depending on
what your using is much smarter

- S


2009/9/21 RobG 

>
>
>
> On Sep 18, 1:32 am, ldexterldesign  wrote:
> [...]
> > This still leaves the issue of targeting browsers with JS/jQuery.
>
> You still seem to be missing the message: trying to compensate for
> browser quirks by detecting specific browsers is a flawed strategy.
> Browser detection is usually based on the user agent string, of which
> there are over 30,000 registered at TNL.net.
>
>
> > A
> > friend of mine just recommend:http://www.quirksmode.org/js/detect.html
>
> Don't use it. Don't even consider detecting specific browsers for
> javascript quirks. For HTML or CSS hacks, go to relevant forums. Often
> the best solution is to simply avoid troublesome features.
>
>
> --
> Rob


[jQuery] Autocomplete

2009-09-21 Thread Asa Carter

How do I use the highlight function in the auto complete plugin?

I wish to replace  with 

Thanks

Asa


[jQuery] Re: Some homebrewn jQuery functionalities

2009-09-21 Thread Liam Potter


You'd be better off just removing the div entirely.

$(document).ready(function()
$("#needJavaScript").remove();
);




Cecil Westerhof wrote:

2009/9/21 Cecil Westerhof :
  

- a way to automatically notify people that they should enable JavaScript



The way that I did this was that start the body with:
  
  For best results JavaScript must be enabled!!!
  

And in the $(document).ready(function() I had:
  $("#needJavaScript").text($('title').text());

But that does not work with MIE8.
When using:
  alert($('title').text());
I get an empty string. I know use:
  $("#needJavaScript").text($('title').html());
This works. Does anybody knows why the first does not work in MIE8?

  




[jQuery] Re: Some homebrewn jQuery functionalities

2009-09-21 Thread Cecil Westerhof

2009/9/21 Cecil Westerhof :
> - a way to automatically notify people that they should enable JavaScript

The way that I did this was that start the body with:
  
  For best results JavaScript must be enabled!!!
  

And in the $(document).ready(function() I had:
  $("#needJavaScript").text($('title').text());

But that does not work with MIE8.
When using:
  alert($('title').text());
I get an empty string. I know use:
  $("#needJavaScript").text($('title').html());
This works. Does anybody knows why the first does not work in MIE8?

-- 
Cecil Westerhof


[jQuery] Re: JCarouselLite - pause scrolling

2009-09-21 Thread dudal

Hi again

I have put up a minified version of the script:
http://www.dudal.com/jquery/jquery.jcarousellite.pauseOnHover.min.js

The minifyer choked on a css "float" attribute in the original script.
Seems that the minified version is working fine after quoting "float".

Best
Jesper



On 19 Sep., 22:15, "Steffan A. Cline"  wrote:
> on 9/18/09 7:49 AM,dudalat jes...@dudal.com wrote:
>
>
>
>
>
> > Hey Steffan
>
> > I'm glad you like it. I used to go with the "full" carousel version
> > just for this feature, but then I looked into the code and found that
> > it could be acomplished using only 3 lines of code or so. I posted it
> > on Ganeshjis website hoping that he will include it in his official
> > release.
>
> > /Jesper
>
> > On 18 Sep., 15:42, "Steffan A. Cline"  wrote:
> >> on 9/18/09 5:30 AM,dudalat jes...@dudal.com wrote:
>
> >>> Hi Steffan
>
> >>> I had the same problem and came up with the following modification:
> >>>http://www.dudal.com/jquery/jquery.jcarousellite.pauseOnHover.js(not
> >>> minified)
>
> >>> Example config (notice pauseOnHover):
> >>> $('#selector').jCarouselLite({
> >>> auto: 2000,
> >>> speed: 1500,
> >>> visible: 1,
> >>> circular: true,
> >>> pauseOnHover: true
> >>> });
>
> >>> That ensures that the carousel will not advance when the mouse is over
> >>> the carousel.
>
> >>> I hope that helps.
>
> >> Yes, it does. Awesome! I tried to get a hold of the author to ask about 
> >> this
> >> but he didn't answer the email. It would be nice to see your changes
> >> committed to this project.
>
> >> Thanks!!
>
> >>> Best
> >>> JesperDudal
> >>> DudalWebdesign
> >>>http://www.dudal.com
>
> >>> On 7 Sep., 18:26, "Steffan A. Cline"  wrote:
>  on 9/6/09 11:54 PM, Jonathan Vanherpe (T & T NV) at jonat...@tnt.be 
>  wrote:
>
> > Steffan A. Cline wrote:
> >> on 8/28/09 5:37 PM, Steffan Cline at stef...@hldns.com wrote:
>
> >>> I have a carousel that auto scrolls images. I was asked if there is a
> >>> way
> >>> to
> >>> make it so that if you mouse over the carousel, it stops and when you
> >>> mouse
> >>> out, it starts up again.
>
> >>> Is this possible?
>
> >> Anyone?
>
> >> Thanks
>
> >> Steffan
>
> > The plain jcarousel has this option:
> >http://sorgalla.com/projects/jcarousel/examples/static_auto.html
>
> > Jonathan
>
>  Thanks. I saw that option but I have already integrated theliteversion :(
>  I hope the author of theliteversion speaks up.
>
>  Thanks
>
>  Steffan
>
> >> Thanks
>
> >> Steffan
>
> Anyone able to minify this? It's finding syntax errors and saying that some
> properties are wrong. Odd.
>
> Suggestions are welcome.
>
> Thanks
>
> Steffan
>
> ---
> T E L  6 0 2 . 7 9 3 . 0 0 1 4 | F A X  6 0 2 . 9 7 1 . 1 6 9 4
> Steffan A. Cline  
> stef...@execuchoice.net                             Phoenix, 
> Azhttp://www.ExecuChoice.net                                 USA
> AIM : SteffanC          ICQ : 57234309
> YAHOO : Steffan_Cline   MSN : stef...@hldns.com
> GOOGLE: Steffan.Cline             Lasso Partner Alliance Member
> ---


[jQuery] some idea: jQuery ajax and URL length

2009-09-21 Thread Rafal Zarajczyk

Hi
Internet Explorer (in particular IE6) has some limit on maximum URL
length. This is very hard to debugging if you don't know what to
search for. Maybe jQuery could throw some self-explaining exception
when URL is too long?

Regards,


[jQuery] Re: Variable Lifetime

2009-09-21 Thread Mad-Halfling

Are there any issues with IE preserving these values?  Part of the
reason for my question is that I read somewhere (annoyingly, I can't
remember where, otherwise I would go back and double-check it) that IE
doesn't handle retaining these things well.

So would something like this be the way to go about using the
_javascript_ closures:-

using a function like

function SetupSortData() {
var sortField;
var sortOrder;
setSortField = function(field) { sortField = field; };
setSortOrder = function(order) { sortOrder = order; };
setSort = function(field, order) { sortField = field;
sortOrder = order; };
getSort = function() { return sortField + ' ' +
sortOrder; };
}

and calling it at $(document).ready to initialise it.  Then when the
sorting elements are clicked, we can call setSortField(value) and
setSortOrder(value) or setSort(value, value), retrieving the value in
the search function using getSort() ?

Thanks

MH


On Sep 20, 10:16 pm, Michael Geary  wrote:
> The reason you can't find any information about jQuery variables is that
> jQuery doesn't have variables! :-)
>
> You're talking about JavaScript, not jQuery. jQuery is not a language of its
> own, it's just a library of JavaScript code that you can use in your own
> JavaScript code.
>
> If you look for information about JavaScript variables you will have much
> better luck.
>
> So about those JavaScript variables... Fortunately for all of us, you don't
> have to use hidden input fields if you merely want to store data that will
> persist for the lifetime of your page. An ordinary global variable works
> fine for that.
>
> Also, you don't have to use global variables. Even *local* variables can
> easily outlive the function invocation that creates them. A trivial example:
>
> // When the '#test' button is clicked,
> // alert a number that increments each time
>
> $(document).ready( testSetup );
>
> function testSetup() {
>     var i = 0;
>     $('#test').click( function() {
>         alert( ++i );
>     });
>
> }
>
> Here I made testSetup() a separate named function instead of the anonymous
> inline function that is more commonly used, just to make it clear that it *
> is* a separate function.
>
> testSetup() runs once and then returns immediately. What happens to the
> variable i when the function returns? Does it go away? No, JavaScript uses a
> *closure* to preserve this variable. Later, when you click the button, it
> calls the click callback function that issues the alert. Note that this
> inner function can still reference the i variable, and it can increment it
> too. JavaScript keeps that variable in existence as long as it needs to.
>
> Closures are a truly wonderful feature. Read up on them if you want a better
> understanding of how a lot of jQuery and JavaScript code works.
>
> So, is there ever a case where you *would* need to use a hidden input field
> instead of a global or local variable? Yes! If you want to preserve data
> even if the user hits the refresh button (or keyboard equivalent) to reload
> the page. When that happens, all JavaScript code and data is wiped clean and
> reloaded. If you want to preserve state in this situation, you can use a
> hidden form field. Or depending on what you are trying to do, you can use
> the hash fragment in your URL (the part after the #), or perhaps a cookie.
>
> But to simply keep data around as long as your page is running and not
> reloaded, global or local variables are all you need.
>
> -Mike
>
> On Sun, Sep 20, 2009 at 12:52 PM, Mad-Halfling wrote:
>
>
>
>
>
> > Am I correct in thinking that variable in jquery are limited in scope
> > by their parent functions, and if I want to persist data during a
> > particular page's lifetime (thinking of a page that will exist for a
> > while, being updated by AJAX calls, etc) I need to put it in an input
> > control on that page - I am wanting to store data like sort-field for
> > an AJAX updated data grid, so that data will need to be persistent and
> > specific to that page, but I can't find any reference to global/page
> > variables in jquery, so I was assuming I would need to have some
> > hidden fields onthe page in which to store this data.
>
> > Cheers
>
> > MH- Hide quoted text -
>
> - Show quoted text -


[jQuery] Some homebrewn jQuery functionalities

2009-09-21 Thread Cecil Westerhof

At http://www.decebal.nl/testing.html I have some functionalities I
made with jQuery. Nothing world shocking, but maybe usefull for
others.
- a way to automatically notify people that they should enable JavaScript
- Table of content (with 'Go back to top')
- Increase/Decrease text (has a little problem in Firefox)
- Show/Hide content (has a little problem in Opera and Konqueror)

If someone has a solution for one of the problems or a comment: let me know.

-- 
Cecil Westerhof


[jQuery] how to display birthdate format behind the date textbox on edit/insert dialog

2009-09-21 Thread Ravi

hi...

I don't know whether jqgrid provides this or not?

but what my actual requirement is "I want to display format of date
like 'MM/DD/' behind my birthdate's textbox, so user will enter
proper date while he insert/update particular record from jqgrid.."

In short how to display format text in jqgrid's insert/edit dialog??

Thanks...

Regards.
Ravi Mori
Software Developer.


[jQuery] Grab a bunch of HTML and exhibit an excerpt - help

2009-09-21 Thread ldexterldesign

Easy guys,

I've cobbled this script together to help me implement 'read more...'
links on this site I'm developing: http://www.blowcreative.co.uk/blog/

It does the job, but I lose all the mark-up in the process :[ It
doesn't cater for a bunch of tags like , ,  etc. slice()
ain't being too kind to me.

// create a 'read more' link, and hide remaining text, if post content
exceeds quota
jQuery(function ($) {
// get total characters (including spaces) in content
$('.scrollable .scrollableItem').each(function () {
var totalContent = $(this).find('p').not('.wp-caption-
text').not('.postmetadata').text();

// remove all post content, but not the page content (.entry 
p). we
will put the appropriate content back later
$(this).find('p').not('.entry p').not('.wp-caption-text').not
('.postmetadata').remove(); // fix: breaks without an image caption,
also needs support for multiple images and all other mce elements!

// total characters allowed before cut off
var quota = 800;
// split totalContent into two parts
var arr = new Array(2);
arr[0] = totalContent.slice(0, [quota]);
arr[1] = totalContent.slice(quota, [totalContent.length]);

// set up post variables
var postTitle = $(this).parent().find('h2').text();
var postURL = $(this).parent().find('h2 a').attr('href');

// check if content exceeds quota. drop in appropriate content
and insert 'read more' link
if (totalContent.length > quota) {
// set up post variables
var postTitle = $(this).parent().find('h2').text();
var postURL = $(this).find('h2 a').attr('href');
// only display 1st part of content
$(this).find('.postmetadata').before('' + arr[0] +
' Read
more...'); // todo: would be better if orginal 's
were retained, atm these are omitted at the array stage
} else {
// display all content
$(this).find('.postmetadata').before('' + totalContent
+ '');
};
});
});

Any tips would be awesome.

Thanks,
L


[jQuery] How can i add Buttons?

2009-09-21 Thread Pesimist

hello everyone.
i have a problem. i wanna add left and right buttons but i couldn't i
have tried long time so really i need.

i am looking for like this for example:

Prev

or



i wanna put like this buttons. please help me.


[jQuery] Re: Can't assign jQuery jqModal to dynamically added links

2009-09-21 Thread Fumigator

I too am trying to get this to work.  I'm using live() instead of bind
().  Unfortunately, the problem is the content that is supposed to
load via ajax never makes it to the modal.  Any suggestions?

On Sep 2, 4:57 am, Liam Potter  wrote:
> Use live instead of bind
>
> $("#jqmodalbind").live("click", function(e){
>     alert('BindingJQModal');
>     $('#addnote').jqm({ajax: '@rel', trigger: '.addnotetrigger'});
>
> });
> neburton wrote:
> > I've been having problems gettingjqmodalmodal dialogs to display on
> > links added dynamically by client side code.  I've demonstrated the
> > problem at the following 
> > URL:http://www.neil-burton.co.uk/jqmodaltest/index.htm
>
> >jqModalplugin here -http://dev.iceburg.net/jquery/jqModal/
>
> > Any help would be appreciated


[jQuery] jQuery AJAX call undefined error with special characters

2009-09-21 Thread David.D

Hi,

I tried to make an AJAX call using jQuery, the data has special
characters, e.g "{'data':'test'}". It seems failed to pass this
data in the first place. It will work if i just pass
"{'data':'test'}". encodeURIComponent and JSON.stringify failed here
due to the special character "< > /".

Could anyone please help with it? Thanks.


$.ajax({
type: "POST",
url: "services.aspx",
data: "data=" + encodeURIComponent(JSON.stringify(obj)),
dataType: "text",
error: function(xhr, textStatus, errorThrown)   {
alert("ERROR"); },
success: function(data)
{

}
});


Regards,

David