[jQuery] Catching event with stopped propagation

2009-10-08 Thread errant
Is it possible to somehow catch event, if it's propagation was stopped? $('span').click(function(e) { e.stopPropagation(); }); Maybe there are some kind of global handler? Like: Event.registerHandler('click', function(e) { alert('thanks'); }); There should be no additional code for regular han

[jQuery] Re: A filter question

2009-04-20 Thread errant
$('div:hidden[rel=2]'); The :hidden selector is tricky in 1.3.2, so you may get third div in result too. Check http://docs.jquery.com/Selectors/hidden. On 21 апр, 08:45, "David .Wu" wrote: > If I have 5 div, have the same name but different rel, > > > > > > > > how to find out the div whic

[jQuery] Re: preloading a div

2009-04-13 Thread errant
"In computer programming, a callback is executable code that is passed as an argument to other code." - http://en.wikipedia.org/wiki/Callback_(computer_science) This will probably work for you: $("#div").fadeOut(function(){ $("#div").load(url, function() { $("#div").fadeIn(); }); }); h

[jQuery] Re: Very Small Script Not Working in IE 7

2009-03-16 Thread errant
Hi. First, make sure events are attached to elements and firing ( $ (".sidebar a").mouseover(function(){ alert(this) }; or smth like this). Second, there are nice method called hover: http://docs.jquery.com/Events/hover#overout which combines mouseover and mouseout. On 16 мар, 10:12, DLee wrote:

[jQuery] Re: Best way to define funtions in external js !?

2009-03-16 Thread errant
Hi. Have you tried not passing $ into function calls? $ is global variable, so it's available in every function defined after jquery code. On 16 мар, 08:46, syuji wrote: > Hi there, > > I've just dived into jquery and now I'd like to know what's the best > way to define functions in external js.

[jQuery] Re: Alter URI, but do not load a new page

2009-03-13 Thread errant
I think location.hash is just what you need. On 13 мар, 13:33, Cinnamon wrote: > Hello everyone, > > I was wondering if it is possible to alter the URI without loading a > new page. For example, when jQuery records a click on a link, it not > only slides down a certain div, but also alters the U

[jQuery] Re: Click function dosen't work, after append new html data.

2009-03-11 Thread errant
That's because events are binded to existing elements. If you're using 1.3.x, take a look at "live" method: http://docs.jquery.com/Events/live#typefn. With previous versions, livequery plugin may be helpful: http://docs.jquery.com/Plugins/livequery On 11 мар, 09:25, sure wrote: > Hi all, >    

[jQuery] Re: How can I use VAR str into json object

2009-03-10 Thread errant
var str = 'hello'; var json = {}; json[str] = 'wassup'; alert(json.hello); Ask google about dot and square bracket notations for more info. On 10 мар, 08:15, "gordiany...@gmail.com" wrote: > var str = "hello"; > var json = { > str: "123" > > } > > I know this is not jquery question , but I don'

[jQuery] Re: Losing event handlers when appending same element multiple times

2009-01-27 Thread errant
wouldn't > > > > > > > necessarily be what you would want. > > > > > > > > On Jan 27, 10:15 am, Eric Garside wrote: > > > > > > > > > > Perhaps there should be an optional boolean passed to the > > > > &

[jQuery] Re: Losing event handlers when appending same element multiple times

2009-01-27 Thread errant
emented with 1.3 > > Instead, try using a living event: > > >     >     >     >     >     > > > $('ul li span').live('click', function(){ >    // ... > > }); > > $('ul li').append('Click

[jQuery] Re: Read request parameters with jQuery?

2009-01-27 Thread errant
Try this plugin: http://projects.allmarkedup.com/jquery_url_parser/ Hermanussen: > I'd like to know if it is possible to get the request parameters on a > page using jQuery. It can be done using regular JavaScript (like so: > http://blog.pothoven.net/2006/07/get-request-parameters-through.html),

[jQuery] [jQuery 1.3.1] Losing event handlers when appending same element multiple times

2009-01-27 Thread errant
Here is the code: HTML: JS: $(function(){ var handle = $('Click me'); handle.click(function() { alert('Thanks'); }); $('ul li').append(handle); }); With jQuery 1.2.6, each time I click on any list

[jQuery] Re: jQuery help

2008-12-25 Thread errant
Try this one: $('#photo' + photo.id).click(function() { $('#photo' + photo.id).css('border-color','#777'); }); On 25 дек, 01:17, adam wrote: > I'm trying to change the border color of an image using it's id with > jquery > ( photo['id'] is passed in from a previous function ) > the id's of t