[jQuery] Re: TableSorter + Validate problem

2008-12-05 Thread jsrobinson

Amazing, so simple, and it works!

Thank you!


[jQuery] Re: Hide a div on blur

2008-12-05 Thread Echilon

That sounds like it could work. Would you happen to have an example?

On Dec 6, 1:10 am, ricardobeat <[EMAIL PROTECTED]> wrote:
> The most common way is to apply a 'layer' DIV that covers the whole
> screen, right behind the div you're showing.
>
> - ricardo
>
> On Dec 5, 3:21 pm, Echilon <[EMAIL PROTECTED]> wrote:
>
> > I have a div which is shown when a AJAX callback is executed, but I
> > can't get it to hide again. I'm using some of the code from the
> > autocompleter and the div contains a . The code I have is 
> > athttp://pastebin.com/m4b7bf13c. I've left out everything but the
> > relevant parts. I thought I understood how the autocompleter hides the
> > menu when the user clicks elsewhere in the window but I can't get it
> > working.
>
> > Is there something I've missed out?


[jQuery] Re: click not triggering on safari (mac), chrome (windows)?

2008-12-05 Thread Karl Swedberg

Hi Dave,

It could be the return(false). Try removing that line and see what  
happens. You already have the e.preventDefault() in there anyway.


--Karl


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




On Dec 5, 2008, at 6:47 PM, dave wrote:



Hi jQueriers,

Bumped into an oddity on Safari and Chrome. I have a HTML page and I
want to intercept all  links and feed them through an ajax request
instead. So I first do this

$("a").bind("click",handleAjaxifiedLink);

which routes clicks to

function handleAjaxifiedLink(e) {
e.preventDefault();
loadPage(e.target.href);
return(false);
}

This works under IE and Firefox, but Chrome and Safari just seem to
ignore it. Am I missing something really obvious? I don't run Safari
and the debugger in chrome is unhelpful, to say the least.

Examples of code at http://dev.welovekaoru.client.tandot.co.uk/ and
http://dev.welovekaoru.client.tandot.co.uk/static/wlk.js .

TIA to any smart cookies!




[jQuery] Webdeveloper to WebDeveloper

2008-12-05 Thread Pedram

Dear folk ,
If you're interested on web development Articles which is updated and
has lots of new information.(Web developer to web developer)
 I have just started a Blog which contains
(jQuery ,Css,html,Php,Mysql,json,Ajax) take a look at it
http://www.pedramdev.com , this Blog gets the best articles out of the
web and also at the end of the week it has some conclusions enjoy it .
If any one is interested please let me know . [EMAIL PROTECTED] .

Sincerely Pedram .


[jQuery] Re: Nokia 95 AJAX problem

2008-12-05 Thread Alex Hempton-Smith
I have an iPhone 3G so I'd better chip-in here :P
The iPhone has "iPhone Safari" installed, which was forked somewhere
in-between Safari 2 and Safari 3 - meaning you have more CSS support that 2,
but less than 3.

The great Facebook web-app for the iPhone can be visited manually at [
http://iphone.facebook.com/], where you can see the extensive use of AJAX.
Therefore, AJAX does work on the iPhone and you can be pretty sure that if
it works in Safari it will *probably*, most likely, work on the iPhone. :)

Hope this helps,
Alex


On Fri, Dec 5, 2008 at 11:27 PM, nmiddleweek <[EMAIL PROTECTED]>wrote:

>
> Hello guys!
>
> I'm doing mobile web work and am using jQuery for AJAX callbacks...
>
> It all works nicely on my Vista Box using Safari, IE7, FF3 and Chrome
> and I've been testing it on my N95 browser which I think is Safari
> version 2.0 - www.cyscape.com  told me :)
>
> I've hit a problem with the AJAX calls on the N95, I'm getting a
> 'success' on the textStatus when using $('#hidden').load
> (url,"",callback(data, textStatus)) but the data part is null.
>
> On the other browsers it's returning the contents of the server
> response but the N95 is giving me a null.
>
> The contents of the $('#hidden').html() is not getting getting
> updated.
>
> I've also tried using jQuery.get(url,"",callback(data))  but the data
> value is null as well.
>
> I'm thinking that my N95 doesn't support AJAX calls or the jQuery
> implementation of it?
>
> Is there any way I can test this further?
>
> Does anyone know if AJAx works on the iPhone? I don't have one to
> test :(
>
>
> Thanks,
> N
>


[jQuery] Re: Hiding tooltips

2008-12-05 Thread Alex Hempton-Smith
Thanks for your help and patience Richard!I've made those changes and it all
works and looks a lot cleaner now.
Thanks again,
Alex


On Sat, Dec 6, 2008 at 1:44 AM, Richard D. Worth <[EMAIL PROTECTED]> wrote:

> I prefer $(this).data(...) to $.data(this, ... Other than that, it looks
> good.
>
> Ok, one minor thing. I would change:
>
> $(this).parent().append("" + title + "");
> $("#places ul li span").fadeIn();
>
> to (untested):
>
> $("" + title + "").appendTo($(this).parent()).fadeIn();
>
> - Richard
>
>
> On Fri, Dec 5, 2008 at 8:33 PM, Alex Hempton-Smith <
> [EMAIL PROTECTED]> wrote:
>
>> Obviously that code now has the presentational stuff for the tooltip
>>  I create and destroy.
>> Comments on that code would be great :)  This is my first go with
>> javascript at all so...
>>
>> -- Alex
>>
>>
>>
>> On Sat, Dec 6, 2008 at 1:31 AM, Alex Hempton-Smith <
>> [EMAIL PROTECTED]> wrote:
>>
>>> Ah I was just about to post about reading up on .data, here's my current
>>> code which works, will look through yours now to see if you do it better!
>>>
>>> $("#places ul li a").hover(function() {
>>>  var title = $(this).attr("title");
>>> jQuery.data(this, "titleText", title);
>>>  $(this).removeAttr("title")
>>> $(this).parent().append("" + title + "");
>>>  $("#places ul li span").fadeIn();
>>> }, function() {
>>> var title = jQuery.data(this, "titleText");
>>>  $(this).next("span").remove();
>>> $(this).attr({
>>> title: title
>>>  });
>>> });
>>>
>>> -- Alex
>>>
>>>
>>>
>>> On Sat, Dec 6, 2008 at 1:27 AM, Richard D. Worth <[EMAIL PROTECTED]>wrote:
>>>

 On Fri, Dec 5, 2008 at 8:22 PM, Alex Hempton-Smith <
 [EMAIL PROTECTED]> wrote:

> I'm using this code, and the "title" variable is a local variable in
> the hover-over function, and not able to be accessed from the next 
> function
> - therefore my tooltip has no content the next time I hover over:
> $("#places ul li a").hover(function() {
> var title = $(this).attr("title");
>  $(this).removeAttr("title")
> }, function() {
> $(this).attr({
>  title: title
> });
> });
>
> (I've removed my custom tooltip code for clarity and I'm just focussing
> on the title stuff here).
>
> Is there any way I could enclose the whole lot in a function and store
> the variable in an enclosing function perhaps?
>

 I recommend using .data():

 $("#places ul li a").hover(
   function() {
 var a = $(this);
 a.data("title", a.attr("title")).removeAttr("title");
   },
   function() {
 var a = $(this);
 a.attr({ title: a.data("title") });
 });

 For more info, see

 http://docs.jquery.com/Core/data

 - Richard


>>>
>>
>


[jQuery] Re: Hiding tooltips

2008-12-05 Thread Richard D. Worth
I prefer $(this).data(...) to $.data(this, ... Other than that, it looks
good.

Ok, one minor thing. I would change:

$(this).parent().append("" + title + "");
$("#places ul li span").fadeIn();

to (untested):

$("" + title + "").appendTo($(this).parent()).fadeIn();

- Richard

On Fri, Dec 5, 2008 at 8:33 PM, Alex Hempton-Smith <
[EMAIL PROTECTED]> wrote:

> Obviously that code now has the presentational stuff for the tooltip 
> I create and destroy.
> Comments on that code would be great :)  This is my first go with
> javascript at all so...
>
> -- Alex
>
>
>
> On Sat, Dec 6, 2008 at 1:31 AM, Alex Hempton-Smith <
> [EMAIL PROTECTED]> wrote:
>
>> Ah I was just about to post about reading up on .data, here's my current
>> code which works, will look through yours now to see if you do it better!
>>
>> $("#places ul li a").hover(function() {
>>  var title = $(this).attr("title");
>> jQuery.data(this, "titleText", title);
>>  $(this).removeAttr("title")
>> $(this).parent().append("" + title + "");
>>  $("#places ul li span").fadeIn();
>> }, function() {
>> var title = jQuery.data(this, "titleText");
>>  $(this).next("span").remove();
>> $(this).attr({
>> title: title
>>  });
>> });
>>
>> -- Alex
>>
>>
>>
>> On Sat, Dec 6, 2008 at 1:27 AM, Richard D. Worth <[EMAIL PROTECTED]>wrote:
>>
>>>
>>> On Fri, Dec 5, 2008 at 8:22 PM, Alex Hempton-Smith <
>>> [EMAIL PROTECTED]> wrote:
>>>
 I'm using this code, and the "title" variable is a local variable in the
 hover-over function, and not able to be accessed from the next function -
 therefore my tooltip has no content the next time I hover over:
 $("#places ul li a").hover(function() {
 var title = $(this).attr("title");
  $(this).removeAttr("title")
 }, function() {
 $(this).attr({
  title: title
 });
 });

 (I've removed my custom tooltip code for clarity and I'm just focussing
 on the title stuff here).

 Is there any way I could enclose the whole lot in a function and store
 the variable in an enclosing function perhaps?

>>>
>>> I recommend using .data():
>>>
>>> $("#places ul li a").hover(
>>>   function() {
>>> var a = $(this);
>>> a.data("title", a.attr("title")).removeAttr("title");
>>>   },
>>>   function() {
>>> var a = $(this);
>>> a.attr({ title: a.data("title") });
>>> });
>>>
>>> For more info, see
>>>
>>> http://docs.jquery.com/Core/data
>>>
>>> - Richard
>>>
>>>
>>
>


[jQuery] Re: Hiding tooltips

2008-12-05 Thread Alex Hempton-Smith
Obviously that code now has the presentational stuff for the tooltip 
I create and destroy.
Comments on that code would be great :)  This is my first go with javascript
at all so...

-- Alex


On Sat, Dec 6, 2008 at 1:31 AM, Alex Hempton-Smith <
[EMAIL PROTECTED]> wrote:

> Ah I was just about to post about reading up on .data, here's my current
> code which works, will look through yours now to see if you do it better!
>
> $("#places ul li a").hover(function() {
>  var title = $(this).attr("title");
> jQuery.data(this, "titleText", title);
>  $(this).removeAttr("title")
> $(this).parent().append("" + title + "");
>  $("#places ul li span").fadeIn();
> }, function() {
> var title = jQuery.data(this, "titleText");
>  $(this).next("span").remove();
> $(this).attr({
> title: title
>  });
> });
>
> -- Alex
>
>
>
> On Sat, Dec 6, 2008 at 1:27 AM, Richard D. Worth <[EMAIL PROTECTED]>wrote:
>
>>
>> On Fri, Dec 5, 2008 at 8:22 PM, Alex Hempton-Smith <
>> [EMAIL PROTECTED]> wrote:
>>
>>> I'm using this code, and the "title" variable is a local variable in the
>>> hover-over function, and not able to be accessed from the next function -
>>> therefore my tooltip has no content the next time I hover over:
>>> $("#places ul li a").hover(function() {
>>> var title = $(this).attr("title");
>>>  $(this).removeAttr("title")
>>> }, function() {
>>> $(this).attr({
>>>  title: title
>>> });
>>> });
>>>
>>> (I've removed my custom tooltip code for clarity and I'm just focussing
>>> on the title stuff here).
>>>
>>> Is there any way I could enclose the whole lot in a function and store
>>> the variable in an enclosing function perhaps?
>>>
>>
>> I recommend using .data():
>>
>> $("#places ul li a").hover(
>>   function() {
>> var a = $(this);
>> a.data("title", a.attr("title")).removeAttr("title");
>>   },
>>   function() {
>> var a = $(this);
>> a.attr({ title: a.data("title") });
>> });
>>
>> For more info, see
>>
>> http://docs.jquery.com/Core/data
>>
>> - Richard
>>
>>
>


[jQuery] Re: Hiding tooltips

2008-12-05 Thread Alex Hempton-Smith
Ah I was just about to post about reading up on .data, here's my current
code which works, will look through yours now to see if you do it better!

$("#places ul li a").hover(function() {
var title = $(this).attr("title");
jQuery.data(this, "titleText", title);
$(this).removeAttr("title")
$(this).parent().append("" + title + "");
$("#places ul li span").fadeIn();
}, function() {
var title = jQuery.data(this, "titleText");
$(this).next("span").remove();
$(this).attr({
title: title
});
});

-- Alex


On Sat, Dec 6, 2008 at 1:27 AM, Richard D. Worth <[EMAIL PROTECTED]> wrote:

>
> On Fri, Dec 5, 2008 at 8:22 PM, Alex Hempton-Smith <
> [EMAIL PROTECTED]> wrote:
>
>> I'm using this code, and the "title" variable is a local variable in the
>> hover-over function, and not able to be accessed from the next function -
>> therefore my tooltip has no content the next time I hover over:
>> $("#places ul li a").hover(function() {
>> var title = $(this).attr("title");
>>  $(this).removeAttr("title")
>> }, function() {
>> $(this).attr({
>>  title: title
>> });
>> });
>>
>> (I've removed my custom tooltip code for clarity and I'm just focussing on
>> the title stuff here).
>>
>> Is there any way I could enclose the whole lot in a function and store the
>> variable in an enclosing function perhaps?
>>
>
> I recommend using .data():
>
> $("#places ul li a").hover(
>   function() {
> var a = $(this);
> a.data("title", a.attr("title")).removeAttr("title");
>   },
>   function() {
> var a = $(this);
> a.attr({ title: a.data("title") });
> });
>
> For more info, see
>
> http://docs.jquery.com/Core/data
>
> - Richard
>
>


[jQuery] Re: Hiding tooltips

2008-12-05 Thread Richard D. Worth
On Fri, Dec 5, 2008 at 8:22 PM, Alex Hempton-Smith <
[EMAIL PROTECTED]> wrote:

> I'm using this code, and the "title" variable is a local variable in the
> hover-over function, and not able to be accessed from the next function -
> therefore my tooltip has no content the next time I hover over:
> $("#places ul li a").hover(function() {
> var title = $(this).attr("title");
>  $(this).removeAttr("title")
> }, function() {
> $(this).attr({
>  title: title
> });
> });
>
> (I've removed my custom tooltip code for clarity and I'm just focussing on
> the title stuff here).
>
> Is there any way I could enclose the whole lot in a function and store the
> variable in an enclosing function perhaps?
>

I recommend using .data():

$("#places ul li a").hover(
  function() {
var a = $(this);
a.data("title", a.attr("title")).removeAttr("title");
  },
  function() {
var a = $(this);
a.attr({ title: a.data("title") });
});

For more info, see

http://docs.jquery.com/Core/data

- Richard


[jQuery] Re: Hiding tooltips

2008-12-05 Thread Alex Hempton-Smith
I'm using this code, and the "title" variable is a local variable in the
hover-over function, and not able to be accessed from the next function -
therefore my tooltip has no content the next time I hover over:
$("#places ul li a").hover(function() {
var title = $(this).attr("title");
$(this).removeAttr("title")
}, function() {
$(this).attr({
title: title
});
});

(I've removed my custom tooltip code for clarity and I'm just focussing on
the title stuff here).

Is there any way I could enclose the whole lot in a function and store the
variable in an enclosing function perhaps?

-- Alex


On Sat, Dec 6, 2008 at 12:43 AM, Jörn Zaefferer <
[EMAIL PROTECTED]> wrote:

> Store the title in a variable, remove it from the element, and restore
> it on mouseout.
>
> Jörn
>
> On Sat, Dec 6, 2008 at 1:34 AM, Alex Hempton-Smith
> <[EMAIL PROTECTED]> wrote:
> > Hi all,
> > I'm using the "title" attribute to create my own custom tooltip, very
> simple
> > so it doesn't really need a plugin.
> > Everything works fine, except I would like to hide the default tooltip
> > (yellow on Windows). How would I go about this?
> > How do the tooltip plugins do it?
> >
> > Many thanks,
> > Alex
> >
>


[jQuery] Re: superfish and other jquery scripts conflict in IE 7

2008-12-05 Thread Joel Birch

Hello,

You have a trailing comma after 'dropShadows: true'. This may well be
causing the problem in IE.

Joel Birch


[jQuery] Re: Hide a div on blur

2008-12-05 Thread ricardobeat

The most common way is to apply a 'layer' DIV that covers the whole
screen, right behind the div you're showing.

- ricardo

On Dec 5, 3:21 pm, Echilon <[EMAIL PROTECTED]> wrote:
> I have a div which is shown when a AJAX callback is executed, but I
> can't get it to hide again. I'm using some of the code from the
> autocompleter and the div contains a . The code I have is 
> athttp://pastebin.com/m4b7bf13c. I've left out everything but the
> relevant parts. I thought I understood how the autocompleter hides the
> menu when the user clicks elsewhere in the window but I can't get it
> working.
>
> Is there something I've missed out?


[jQuery] Trouble with autocomplete and jquery

2008-12-05 Thread eyao

I am having a little trouble with an autocomplete feature and jquery.
I'm using the autocomplete plugin and what happens is if the user
types too fast, the list that is generated pops up too slow and
occasionally the user misses the fact that its an autocomplete field.
Is there a way to make the list of results show up instantaneously or
am I out of luck here?

Thanks!


[jQuery] click not triggering on safari (mac), chrome (windows)?

2008-12-05 Thread dave

Hi jQueriers,

Bumped into an oddity on Safari and Chrome. I have a HTML page and I
want to intercept all  links and feed them through an ajax request
instead. So I first do this

$("a").bind("click",handleAjaxifiedLink);

which routes clicks to

function handleAjaxifiedLink(e) {
e.preventDefault();
loadPage(e.target.href);
return(false);
}

This works under IE and Firefox, but Chrome and Safari just seem to
ignore it. Am I missing something really obvious? I don't run Safari
and the debugger in chrome is unhelpful, to say the least.

Examples of code at http://dev.welovekaoru.client.tandot.co.uk/ and
http://dev.welovekaoru.client.tandot.co.uk/static/wlk.js .

TIA to any smart cookies!


[jQuery] superfish and other jquery scripts conflict in IE 7

2008-12-05 Thread shenny

Hi,

I'm using superfish for this website i'm working on while using other
scripts that are all under jquery. Basically I have 3 sets of
navigation going on. 1. main navigation using superfish 2.sidebar
using spritefade 3.three huge panels that are links and do a simple
fade when hovered. I've put the superfish script last on the on window
ready function and as soon as i load it in IE, it disables the effect
of all the scripts. However, if i take out superfish script then the
effects of the other scripts come back. Here's the scripts i have
now:
http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/
jquery.min.js" type="text/javascript">

script src="js/superfish.js" type="text/javascript">


 $(document).ready(function(){
$('.categoryNav').sprites({
show: {opacity: 'show'},
hide: {opacity: 'hide'}
});
//
$('.fade').hover(function(){
$(this).fadeTo("slow", 0.25);
}, function(){
$(this).fadeTo("slow", 1);
});
//
$('ul.nav').superfish({
autoArrows: false,
dropShadows: true,

});
});





Could there be an internal script conflict and if so can this be fixed
so that all scripts are happy with each other? If you think it's other
things conflicting let me know and I can provide the scripts for
you.

Any help or input would certainly be appreciated :)



[jQuery] Re: Hiding tooltips

2008-12-05 Thread Jörn Zaefferer
Store the title in a variable, remove it from the element, and restore
it on mouseout.

Jörn

On Sat, Dec 6, 2008 at 1:34 AM, Alex Hempton-Smith
<[EMAIL PROTECTED]> wrote:
> Hi all,
> I'm using the "title" attribute to create my own custom tooltip, very simple
> so it doesn't really need a plugin.
> Everything works fine, except I would like to hide the default tooltip
> (yellow on Windows). How would I go about this?
> How do the tooltip plugins do it?
>
> Many thanks,
> Alex
>


[jQuery] Re: Hiding tooltips

2008-12-05 Thread Charlie Griefer
On Fri, Dec 5, 2008 at 4:34 PM, Alex Hempton-Smith <
[EMAIL PROTECTED]> wrote:

> Hi all,
> I'm using the "title" attribute to create my own custom tooltip, very
> simple so it doesn't really need a plugin.
>
> Everything works fine, except I would like to hide the default tooltip
> (yellow on Windows). How would I go about this?
> How do the tooltip plugins do it?
>
> Many thanks,
> Alex
>

hmm... now i'm curious to know how the plugins do it.  i might have to dig
into some cluetip code :)
off the top of my head (and i'm not saying this is the best way or even a
good way)... grab the title attribute, store it via the data() method, and
then set it to an empty string?

-- 
I have failed as much as I have succeeded. But I love my life. I love my
wife. And I wish you my kind of success.


[jQuery] Hiding tooltips

2008-12-05 Thread Alex Hempton-Smith
Hi all,
I'm using the "title" attribute to create my own custom tooltip, very simple
so it doesn't really need a plugin.

Everything works fine, except I would like to hide the default tooltip
(yellow on Windows). How would I go about this?
How do the tooltip plugins do it?

Many thanks,
Alex


[jQuery] sortable issue

2008-12-05 Thread Bhavin

Hi,

I am trying to find out element which are dragged & dropped on the
list in following method:

$("#example").sortable({
   //if i move "1" at second position then here i want array of
ids 2,1 sequence. ??
   // I tried selector but it gives me all the elements. ie.
2,1,3.
});








Can anyone help me on this?


[jQuery] Re: Help creating a special menu

2008-12-05 Thread ivanisevic82


Sorry for the double post...

I explain better what i want to do:

Did you see the menu in the tutorial I linked in the first post?

I'd like to have the SAME effect, but I want a fade trasition when the text
became form normal to unfocused.


ivanisevic82 wrote:
> 
> 
> Hi!
> Sorry for my english!
> I need help to create a special menu with jquery.
> In this menu, when I will be hover a "button", it remain the same, but
> all the other changes!
> 
> You can see a very basics and work in progress example in the orange
> menu here: www.ivanisevic82.com
> 
> 
> I used this tutorial:
> 
> http://www.3point7designs.com/blog/2007/12/22/advanced-css-menu-trick/
> 
> So, I created this menu with this code:
> 
> PHP:
> 
> 
>http://xxx.com Home 
>http://yyy.com Why a>
>http://ppp.com Web
> Design 
> 
> 
> CSS:
> 
> #main_nav {
> list-style: none;
> margin: 0;
> padding: 0;
> }
> 
> #main_nav li {
> float: left;
> list-style: none;
> }
> 
> #main_nav li a {
> text-indent: -99px;
> overflow: hidden;
> display: block;
> height: 80px;
> }
> 
> #home{ background: url(/media/1.jpg); width: 103px; }
> #why { background: url(/media/2.jpg); width: 103px; }
> #try { background: url(/media/3.jpg); width: 103px; }
> 
> #main_nav:hover li a#home { background-position: -206px; }
> #main_nav:hover li a#why { background-position: -206px; }
> #main_nav:hover li a#try { background-position: -206px; }
> 
> #home:hover { background: url(/media/1.jpg) 0 0 !important; }
> #why:hover { background: url(/media/2.jpg) 0 0 !important; }
> #try:hover { background: url(/media/3.jpg) 0 0 !important; }
> 
> 
> 
> 
> 
> Now what I'd like to do, is try to apply a fad-in / fade-out effect
> (with jquery) everytime a part of the menu has to change aspect.
> 
> I tried to build this js ofr jquery, but it doesn't works:
> 
> $(function(){
> $("#home").hover(
> function(){$("#main_nav:hover li a#webdesign").fadeIn('slow');},
> function(){$("#main_nav:hover li a#about").fadeIn('slow');});
> });
> 
> 
> Can you help me to build a js working for my project?
> 
> Thank you, bye!
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Help-creating-a-special-menu-tp20855490s27240p20864825.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Help creating a special menu

2008-12-05 Thread ivanisevic82


Sorry for the double post...

I explain better what i want to do:

Did you see the menu in the tutorial I linked in the first post?

I'd like to have the SAME effect, but I want a fade trasition when the text
became form normal to unfocused.


ivanisevic82 wrote:
> 
> 
> Hi!
> Sorry for my english!
> I need help to create a special menu with jquery.
> In this menu, when I will be hover a "button", it remain the same, but
> all the other changes!
> 
> You can see a very basics and work in progress example in the orange
> menu here: www.ivanisevic82.com
> 
> 
> I used this tutorial:
> 
> http://www.3point7designs.com/blog/2007/12/22/advanced-css-menu-trick/
> 
> So, I created this menu with this code:
> 
> PHP:
> 
> 
>http://xxx.com Home 
>http://yyy.com Why a>
>http://ppp.com Web
> Design 
> 
> 
> CSS:
> 
> #main_nav {
> list-style: none;
> margin: 0;
> padding: 0;
> }
> 
> #main_nav li {
> float: left;
> list-style: none;
> }
> 
> #main_nav li a {
> text-indent: -99px;
> overflow: hidden;
> display: block;
> height: 80px;
> }
> 
> #home{ background: url(/media/1.jpg); width: 103px; }
> #why { background: url(/media/2.jpg); width: 103px; }
> #try { background: url(/media/3.jpg); width: 103px; }
> 
> #main_nav:hover li a#home { background-position: -206px; }
> #main_nav:hover li a#why { background-position: -206px; }
> #main_nav:hover li a#try { background-position: -206px; }
> 
> #home:hover { background: url(/media/1.jpg) 0 0 !important; }
> #why:hover { background: url(/media/2.jpg) 0 0 !important; }
> #try:hover { background: url(/media/3.jpg) 0 0 !important; }
> 
> 
> 
> 
> 
> Now what I'd like to do, is try to apply a fad-in / fade-out effect
> (with jquery) everytime a part of the menu has to change aspect.
> 
> I tried to build this js ofr jquery, but it doesn't works:
> 
> $(function(){
> $("#home").hover(
> function(){$("#main_nav:hover li a#webdesign").fadeIn('slow');},
> function(){$("#main_nav:hover li a#about").fadeIn('slow');});
> });
> 
> 
> Can you help me to build a js working for my project?
> 
> Thank you, bye!
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Help-creating-a-special-menu-tp20855490s27240p20864815.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Using "window.location.hash" for URLs without plugin

2008-12-05 Thread Alex Hempton-Smith
Thanks, I ended up using a switch:
var page = location.hash;
switch(page)
{
case "#networks":
showPlaces();
break;
case "#about":
showAbout();
break;
case "#contact":
showContact();
break;
default:
showPlaces();
}

Works great for me.

Thanks again,
Alex

-- Alex


On Fri, Dec 5, 2008 at 5:57 PM, Andy Matthews <[EMAIL PROTECTED]>wrote:

>  location.hash is a property, so you'd just get it's value then compare
> that. Something like this might work:
>
> // get the hash
> var page = location.hash;
> // show the correct page
> $('#' + page).show();
>
>
>
> andy matthews
>
>
>  --
> *From:* jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] *On
> Behalf Of *Alex Hempton-Smith
> *Sent:* Friday, December 05, 2008 11:48 AM
> *To:* jquery-en@googlegroups.com
> *Subject:* [jQuery] Using "window.location.hash" for URLs without plugin
>
> Hi,
> I'm trying to use URL's such as 'mysite.com/#contact' that will show a
> certain div.
> I have my function written and working to show the div, currently being
> used as "$("#a.contact").click(showContact);"
>
> How would I use something like "window.location.hash" to fire off the
> function "showContact" for example, if the URL was /#contact?
>
> This would need to provide for about 3 pages, Home, About, Portfolio and
> Contact.
> I know there's a plugin for enabling use of the back button etc, but I'd
> rather something simple without having to load plugins.
>
> Many thanks,
> Alex
>


[jQuery] Re: Help creating a special menu

2008-12-05 Thread ivanisevic82


Thank you for your support!

I don't know if I understand all...

I tried to change the css part I posted in the first post with this, but I
don't think is right becouse it doesn't work...

#main_nav { 
list-style: none;
margin: 0;
padding: 0; 
}

#main_nav li { 
float: left; 
list-style: none;
}

#main_nav li a { 
text-indent: -99px; 
overflow: hidden; 
display: block; 
height: 80px; 
background-position: 0 0;
} 

#home{ background: url(/media/1.jpg) 0 0; width: 103px; }
#webdesign { background: url(/media/2.jpg) 0 0; width: 103px; }
#about { background: url(/media/3.jpg) 0 0; width: 103px; }

#main_nav li a.Blur {
background-position: -206px 0;
} 

#main_nav li a:hover { background-position: -103px 0; } 


What I wrong?

And (second question) is possible to insert fade effect in the same .js I
use for blur.

Last thing: when I say "blur" I want to say the kind of effect hat make a
text or image with less focus.


thank you, bye!


brian-263 wrote:
> 
> 
> You're only passing one value for background-position; there should be
> a left and top.
> 
> Looking at the code you posted and the images themselves, it's not
> clear to me what you want the hovered link to look like. I'm assuming
> here that you want the hovered link to change to black text, and the
> others to be blurred.
> 
> #main_nav li a {
> text-indent: -99px;
> overflow: hidden;
> display: block;
> height: 80px;
> background-position: 0 0;  /* set it here globally */
> }
> 
> /* default white text
>  */
> #home{ background: url(/media/1.jpg) 0 0; width: 103px; }
> #why { background: url(/media/2.jpg) 0 0; width: 103px; }
> #try { background: url(/media/3.jpg) 0 0; width: 103px; }
> 
> /* class for the blurred state
>  */
> #main_nav li a.Blur {
> background-position: -206px 0;
> }
> 
> /* Changes the hovered link to black text
>  */
> #main_nav li a:hover { background-position: -103px 0; }
> 
> /* there's no need to assign hover callbacks for each link individually
>  */
> $(function(){
>   $("#main_nav li a").hover(
>   function(){$("#main_nav li a").addClass('Blur');},
>   function(){$("#main_nav li a").removeClass('Blur');}
>   );
> });
> 
> 
> The one thing this is missing is the fadeIn effect you had. But you
> could use this to potentially add that, maybe with setTimeout.
> 
> 
> On Fri, Dec 5, 2008 at 7:32 AM, ivanisevic82 <[EMAIL PROTECTED]>
> wrote:
>>
>> Hi!
>> Sorry for my english!
>> I need help to create a special menu with jquery.
>> In this menu, when I will be hover a "button", it remain the same, but
>> all the other changes!
>>
>> You can see a very basics and work in progress example in the orange
>> menu here: www.ivanisevic82.com
>>
>>
>> I used this tutorial:
>>
>> http://www.3point7designs.com/blog/2007/12/22/advanced-css-menu-trick/
>>
>> So, I created this menu with this code:
>>
>> PHP:
>>
>> 
>> http://xxx.com  title="Home">Home 
>> http://yyy.com Why> a>
>> http://ppp.com Web
>> Design 
>> 
>>
>> CSS:
>>
>> #main_nav {
>> list-style: none;
>> margin: 0;
>> padding: 0;
>> }
>>
>> #main_nav li {
>> float: left;
>> list-style: none;
>> }
>>
>> #main_nav li a {
>> text-indent: -99px;
>> overflow: hidden;
>> display: block;
>> height: 80px;
>> }
>>
>> #home{ background: url(/media/1.jpg); width: 103px; }
>> #why { background: url(/media/2.jpg); width: 103px; }
>> #try { background: url(/media/3.jpg); width: 103px; }
>>
>> #main_nav:hover li a#home { background-position: -206px; }
>> #main_nav:hover li a#why { background-position: -206px; }
>> #main_nav:hover li a#try { background-position: -206px; }
>>
>> #home:hover { background: url(/media/1.jpg) 0 0 !important; }
>> #why:hover { background: url(/media/2.jpg) 0 0 !important; }
>> #try:hover { background: url(/media/3.jpg) 0 0 !important; }
>>
>>
>>
>>
>>
>> Now what I'd like to do, is try to apply a fad-in / fade-out effect
>> (with jquery) everytime a part of the menu has to change aspect.
>>
>> I tried to build this js ofr jquery, but it doesn't works:
>>
>> $(function(){
>> $("#home").hover(
>>function(){$("#main_nav:hover li a#webdesign").fadeIn('slow');},
>>function(){$("#main_nav:hover li a#about").fadeIn('slow');});
>> });
>>
>>
>> Can you help me to build a js working for my project?
>>
>> Thank you, bye!
>>
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Help-creating-a-special-menu-tp20855490s27240p20864772.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Nokia 95 AJAX problem

2008-12-05 Thread nmiddleweek

Hello guys!

I'm doing mobile web work and am using jQuery for AJAX callbacks...

It all works nicely on my Vista Box using Safari, IE7, FF3 and Chrome
and I've been testing it on my N95 browser which I think is Safari
version 2.0 - www.cyscape.com  told me :)

I've hit a problem with the AJAX calls on the N95, I'm getting a
'success' on the textStatus when using $('#hidden').load
(url,"",callback(data, textStatus)) but the data part is null.

On the other browsers it's returning the contents of the server
response but the N95 is giving me a null.

The contents of the $('#hidden').html() is not getting getting
updated.

I've also tried using jQuery.get(url,"",callback(data))  but the data
value is null as well.

I'm thinking that my N95 doesn't support AJAX calls or the jQuery
implementation of it?

Is there any way I can test this further?

Does anyone know if AJAx works on the iPhone? I don't have one to
test :(


Thanks,
N


[jQuery] [ajax] [Pending - this message has not been accepted by the mailing list yet] Simple AJAX->PHP Request Returns "Access to restricted URI denied"

2008-12-05 Thread Mike

I'm trying to do a pop-up form that onsubmit will send the data to a
PHP file that will mail(the_data).  The page is located here :
http://www.kuhnsjewelers.com/products/blue-topaz-and-peridot-ring

Click on "Share this item" and when you click Send, firebug returns
the "access to restricted uri denied" error

Here's the function that is called when the user clicks send :

$('#share-send').click(function() {

$.ajax({
  type: "GET",
  url: "http://www.sunrisedesign.com/clients/kuhns/shopify/
share.php",
  data: $("#share-form").serializeArray(),
  dataType: "JSONP",
  success: function(msg){
alert(msg);
  }
});
$.unblockUI();
return false;

});


I sorta understand the whole cross-domain security thing, but I've
read if you change your dataType to "jsonp", that will fix it

The client-side file (http://www.kuhnsjewelers.com/products/blue-topaz-
and-peridot-ring) isn't PHP and the only dev I can use is Javascript.

Any help!?!?


[jQuery] [blockUI] Permit jQuery-wrapped DOM elements not currently in DOM as messages

2008-12-05 Thread harningt

Currently blockUI makes the assumption that any jQuery element that is
passed in is a 'real' DOM element.  To fix this, also check that the
element also has a parent when performing operations on the parent.

Since this list doesn't appear to have file-posting capability...
here's an inlined patch to jquery.blockUI.js ... if attributions
needed, attribute to "Thomas Harning <[EMAIL PROTECTED]>"

--- jquery.blockUI.js?v2.10 2008-10-22 19:42:20.0 -0400
+++ jquery.block.js 2008-12-05 11:02:09.0 -0500
@@ -133,7 +133,8 @@
 data.parent = node.parentNode;
 data.display = node.style.display;
 data.position = node.style.position;
-data.parent.removeChild(node);
+if(data.parent)
+data.parent.removeChild(node);
 }

 var z = opts.baseZ;
@@ -244,7 +245,8 @@
 if (data && data.el) {
 data.el.style.display = data.display;
 data.el.style.position = data.position;
-data.parent.appendChild(data.el);
+if(data.parent)
+data.parent.appendChild(data.el);
 $(data.el).removeData('blockUI.history');
 }
 if (typeof opts.onUnblock == 'function')


[jQuery] Re: Select "next" until specific element is reached

2008-12-05 Thread Karl Swedberg
one more thing ... those table rows are going to get mangled in FF.  
You're better off using toggle() without the speed or fadeIn() /  
fadeOut()


--Karl


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




On Dec 5, 2008, at 5:04 PM, Karl Swedberg wrote:


Hi Marc,

This is all untested, but you could try using John Resig's  
nextUntil() plugin [1] :


$.fn.nextUntil = function(expr) {
   var match = [];

   // We need to figure out which elements to push onto the array
   this.each(function(){
   // Traverse through the sibling nodes
   for( var i = this.nextSibling; i; i = i.nextSibling ) {
   // Make sure that we're only dealing with elements
   if ( i.nodeType != 1 ) continue;

   // If we find a match then we need to stop
   if ( jQuery.filter( expr, [i] ).r.length ) break;

   // Otherwise, add it on to the stack
   match.push( i );
   }
   });

   return this.pushStack( match, arguments );
};

// then do something like this (inside document ready) ...

$('td.group').parent('tr').hide();
$('tr:has(td.grouphead)').click(function() {
$(this).nextUntil('tr:has(td.grouphead)').toggle('fast');
});



[1] 
http://docs.jquery.com/JQuery_1.2_Roadmap#.nextUntil.28.29_.2F_.prevUntil.28.29

--Karl


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




On Dec 5, 2008, at 2:45 PM, Marc wrote:



I have a simple show/hide thing I'm working on, but I can't figure  
out

how to have the script show ALL the hidden rows up to the next
heading.

Here's how the simplified HTML looks:

Heading Text 1
Group Item 1
Group Item 2
Group Item 3
Heading Text 2
Group Item 1
Group Item 2
Group Item 3

The JS doing the show/hide:

$('td.group').parent('tr').hide();
$('td.grouphead').parent('tr').click(function() {
$(this).next().toggle('fast');
});

Unfortunately, for the real-world situation, I cannot use lists  
like I

normally do because of multiple columns. The example shows only one
column for sake of simplifying.

Basically, the script works, but it only shows the "next"  and
fails to reveal the remaining 's.

What I'd like to learn is how to make it so that clicking on HEADING
TEXT 1 would reveal not just GROUP ITEM 1, but items 2 and 3 as well,
without revealing all the other group items not associated with
HEADING TEXT 1.

Did that make sense?






[jQuery] Re: [validate] Rule Selectors

2008-12-05 Thread Jörn Zaefferer
You could use a selector to add classes and attributes that the
validation reads to your elements. You can even group rules using
addClassRule: 
http://docs.jquery.com/Plugins/Validation/Validator/addClassRules#namerules

Jörn

On Fri, Dec 5, 2008 at 8:33 PM, Mihai Danila <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
>
> Is it possible to use jQuery selectors to identify the elements to
> which certain rules should apply? If this feature exists, then I won't
> have to unnecessarily complicate the component that dynamically
> creates my form and that features various control types.
>
>
> Thanks,
> Mihai
>
>


[jQuery] Re: [validate] - Validation by regular expression

2008-12-05 Thread Jörn Zaefferer
You can safely remove the first modification, thats not necessary. Its
used for required only to move the method to the front (which is
actually a bad workaround). Anyway:

I've commented on regex-methods here:
http://docs.jquery.com/Plugins/Validation/Validator/addMethod#namemethodmessage

Please note: While the temptation is great to add a regex method that
checks it's parameter against the value, it is much cleaner to
encapsulate those regular expressions inside their own method. If you
need lots of slightly different expressions, try to extract a common
parameter. A library of regular expressions:
http://regexlib.com/DisplayPatterns.aspx

Jörn

On Fri, Dec 5, 2008 at 8:01 PM, skidmarek <[EMAIL PROTECTED]> wrote:
>
> I've created a useful addition to your class that you may want to
> include in a future version.
>
> Set the value of the regex attribute to a regular expression.  If any
> characters in the input don't match the regex, it returns false.  Very
> handy.
>
> Here's the source:
>
> --- In rules:
>
> if (data.regex) {
>var param = data.regex;
>delete data.regex;
>data = $.extend({regex: param}, data);
> }
>
> --- Then in methods:
>
> regex: function(value,element,param) {
>if (param) {
>var expression = new RegExp(param, "g");
>return (value.replace(expression,"").length==0);
>} else {
>return true;
>}
> },
>
> --- Usage:
>
> regex: "\\b[a-zA-Z0-9()[EMAIL PROTECTED]"'?&* ]+\\b"
>
> If the input contains any characters that aren't in that list, it
> validates as false.
>


[jQuery] Re: Select "next" until specific element is reached

2008-12-05 Thread Karl Swedberg

Hi Marc,

This is all untested, but you could try using John Resig's nextUntil()  
plugin [1] :


$.fn.nextUntil = function(expr) {
   var match = [];

   // We need to figure out which elements to push onto the array
   this.each(function(){
   // Traverse through the sibling nodes
   for( var i = this.nextSibling; i; i = i.nextSibling ) {
   // Make sure that we're only dealing with elements
   if ( i.nodeType != 1 ) continue;

   // If we find a match then we need to stop
   if ( jQuery.filter( expr, [i] ).r.length ) break;

   // Otherwise, add it on to the stack
   match.push( i );
   }
   });

   return this.pushStack( match, arguments );
};

// then do something like this (inside document ready) ...

$('td.group').parent('tr').hide();
$('tr:has(td.grouphead)').click(function() {
$(this).nextUntil('tr:has(td.grouphead)').toggle('fast');
});



[1] 
http://docs.jquery.com/JQuery_1.2_Roadmap#.nextUntil.28.29_.2F_.prevUntil.28.29

--Karl


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




On Dec 5, 2008, at 2:45 PM, Marc wrote:



I have a simple show/hide thing I'm working on, but I can't figure out
how to have the script show ALL the hidden rows up to the next
heading.

Here's how the simplified HTML looks:

Heading Text 1
Group Item 1
Group Item 2
Group Item 3
Heading Text 2
Group Item 1
Group Item 2
Group Item 3

The JS doing the show/hide:

$('td.group').parent('tr').hide();
$('td.grouphead').parent('tr').click(function() {
$(this).next().toggle('fast');
});

Unfortunately, for the real-world situation, I cannot use lists like I
normally do because of multiple columns. The example shows only one
column for sake of simplifying.

Basically, the script works, but it only shows the "next"  and
fails to reveal the remaining 's.

What I'd like to learn is how to make it so that clicking on HEADING
TEXT 1 would reveal not just GROUP ITEM 1, but items 2 and 3 as well,
without revealing all the other group items not associated with
HEADING TEXT 1.

Did that make sense?




[jQuery] Re: multiple width kwicks

2008-12-05 Thread Andy Matthews

I'm pretty sure that the whole point is that the kwicks are evenly
distributed. You can't have multiple widths.


andy

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of jesusbet
Sent: Friday, December 05, 2008 1:17 PM
To: jQuery (English)
Subject: [jQuery] multiple width kwicks


Hi.

I'm implementing this effect for a project:
http://www.jeremymartin.name/projects.php?project=kwicks

The problem is that I'm trying to apply the same effect but using different
width buttons, I mean, the first button is 88px width, the second 100px, the
third 75px and so on...

I tryed defining the widths in the CSS but didn't work, the effect cuts in
700px even if I defined a 960px container, got this CSS:
* defaults for all examples */
.kwicks {
list-style: none;
position: relative;
margin: 0;
padding: 0;
width: 690px;
}
.kwicks li{
display: block;
overflow: hidden;
padding: 0;
/*  cursor: pointer; */
float: left;
width: 130px; /*  */
height: 50px;
margin-right: 0px;
}

.kwicks li a {
display: block;
height: 50px;
}
#it1 {
background: url(../img/nav/home.jpg) no-repeat; } #it1.active {
background-color: #86e6bb;
}
#it2 {
background: url(../img/nav/about.jpg) no-repeat; } #it2.active {
background: url(../img/nav/about_selected.jpg) no-repeat; }
#it3 {
background: url(../img/nav/procedures.jpg) no-repeat; } #it3.active
{
background-color: #f5979b;
}
#it4 {
background: url(../img/nav/treatments.jpg) no-repeat; } #it4.active
{
background-color: #efaffa;
}
#it5 {
background: url(../img/nav/facilities.jpg) no-repeat; } #it5.active
{
background-color: #86e6bb;
}
#it6 {
background: url(../img/nav/packages.jpg) no-repeat; } #it6.active {
background-color: #8d9cdc;
}
#it7 {
background: url(../img/nav/photogallery.jpg) no-repeat; }
#it7.active {
background-color: #f5979b;
}
#it8 {
 background: url(../img/nav/testimonials.jpg) no-repeat; }
#it8.active {
background-color: #efaffa;
}

and the js I'm using is in the example 2:
http://www.jeremymartin.name/examples/kwicks.php?example=2

As I said, I tried adding the width: 100px; property to each #it (, ,  and so on) but didn't
work.

Is there a way to do that effect in different width buttons or I have to
change my design and make all buttons the same width?

Thank you very much!




[jQuery] Trouble with event.stopPropagation();

2008-12-05 Thread MOtoroller

This is small function for scroll images in div with scroll mouse:



var mouse=function(event, delta) {

_imgFrame.unbind("mousewheel",
mouse);



if (delta > 0) {

   _imgFrame.find(_child+":last").clone
().show().prependTo( _imgFrame );

   _imgFrame.css("marginLeft",-
_width);

   _imgFrame.animate( {marginLeft:0},
_speedWheel, '', function(){

   _imgFrame.find(_child
+":last").remove();

 
event.stopPropagation();

 
event.preventDefault();

   _imgFrame.bind
("mousewheel", mouse);

   });

} else if (delta < 0) {

   _imgFrame.animate
( {marginLeft:-_width}, _speedWheel, '', function(){

 
_imgFrame.find(_child+":first").appendTo( _imgFrame );

 
_imgFrame.css("marginLeft",0);

 
event.stopPropagation();

 
event.preventDefault();

 
_imgFrame.bind("mousewheel", mouse);

   });

}

};



When i scroll by obj  (imgFrame) with images scrolling with document,
but me need object don`t move, so I try to execute
event.stopPropagation(); and event.preventDefault(); but this function
dosen`t work in this construction.



If I move this function up, they work, but I have scroll too, help me





if (delta > 0) {

   event.stopPropagation();

   event.preventDefault();

_imgFrame.find(_child+":last").clone().show().prependTo( _imgFrame );

   _imgFrame.css("marginLeft",-
_width);

   _imgFrame.animate( {marginLeft:0},
_speedWheel, '', function(){

   _imgFrame.find(_child
+":last").remove();



   _imgFrame.bind
("mousewheel", mouse);

   });

}



Thanks



[jQuery] Select "next" until specific element is reached

2008-12-05 Thread Marc

I have a simple show/hide thing I'm working on, but I can't figure out
how to have the script show ALL the hidden rows up to the next
heading.

Here's how the simplified HTML looks:

Heading Text 1
Group Item 1
Group Item 2
Group Item 3
Heading Text 2
Group Item 1
Group Item 2
Group Item 3

The JS doing the show/hide:

$('td.group').parent('tr').hide();
$('td.grouphead').parent('tr').click(function() {
$(this).next().toggle('fast');
});

Unfortunately, for the real-world situation, I cannot use lists like I
normally do because of multiple columns. The example shows only one
column for sake of simplifying.

Basically, the script works, but it only shows the "next"  and
fails to reveal the remaining 's.

What I'd like to learn is how to make it so that clicking on HEADING
TEXT 1 would reveal not just GROUP ITEM 1, but items 2 and 3 as well,
without revealing all the other group items not associated with
HEADING TEXT 1.

Did that make sense?


[jQuery] cluetip mouse tracking

2008-12-05 Thread [EMAIL PROTECTED]

Hi, I'm interested in using the cluetip mouse tracking plugin, but I
noticed that the feature is "experimental." Does anyone have more info
on this? Are there plans to support it fully? In the meantime, am I
safe using it in the major browsers?


[jQuery] multiple width kwicks

2008-12-05 Thread jesusbet

Hi.

I'm implementing this effect for a project:
http://www.jeremymartin.name/projects.php?project=kwicks

The problem is that I'm trying to apply the same effect but using
different width buttons, I mean, the first button is 88px width, the
second 100px, the third 75px and so on...

I tryed defining the widths in the CSS but didn't work, the effect
cuts in 700px even if I defined a 960px container, got this CSS:
* defaults for all examples */
.kwicks {
list-style: none;
position: relative;
margin: 0;
padding: 0;
width: 690px;
}
.kwicks li{
display: block;
overflow: hidden;
padding: 0;
/*  cursor: pointer; */
float: left;
width: 130px; /*  */
height: 50px;
margin-right: 0px;
}

.kwicks li a {
display: block;
height: 50px;
}
#it1 {
background: url(../img/nav/home.jpg) no-repeat;
}
#it1.active {
background-color: #86e6bb;
}
#it2 {
background: url(../img/nav/about.jpg) no-repeat;
}
#it2.active {
background: url(../img/nav/about_selected.jpg) no-repeat;
}
#it3 {
background: url(../img/nav/procedures.jpg) no-repeat;
}
#it3.active {
background-color: #f5979b;
}
#it4 {
background: url(../img/nav/treatments.jpg) no-repeat;
}
#it4.active {
background-color: #efaffa;
}
#it5 {
background: url(../img/nav/facilities.jpg) no-repeat;
}
#it5.active {
background-color: #86e6bb;
}
#it6 {
background: url(../img/nav/packages.jpg) no-repeat;
}
#it6.active {
background-color: #8d9cdc;
}
#it7 {
background: url(../img/nav/photogallery.jpg) no-repeat;
}
#it7.active {
background-color: #f5979b;
}
#it8 {
 background: url(../img/nav/testimonials.jpg) no-repeat;
}
#it8.active {
background-color: #efaffa;
}

and the js I'm using is in the example 2: 
http://www.jeremymartin.name/examples/kwicks.php?example=2

As I said, I tried adding the width: 100px; property to each #it (, ,  and so on) but
didn't work.

Is there a way to do that effect in different width buttons or I have
to change my design and make all buttons the same width?

Thank you very much!


[jQuery] Re: Optimizing Easiest Tooltip

2008-12-05 Thread Karl Swedberg

Ok, I dropped your table into my page, and it seems to work fine.

http://test.learningjquery.com/very-simple-tooltip.html

--Karl


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




On Dec 5, 2008, at 11:45 AM, Frank wrote:



Also, I just realised that putting "title"s on TDs is a silly idea,
and completely invalid. But I tried it with a direct copy of your
script after putting actual links in, but still only get empty
tooltips. Here is an example row:


Abridged Title
-
-
-
-

-
-
-
-
-
-
-
Y














2
06:01, 05:55
Y

-
Lorem ipsum dolor sit...




On Dec 5, 4:29 pm, Frank <[EMAIL PROTECTED]> wrote:

Simply exchanging "A" for "TD" in your script didn't work (that would
have been too easy :), it only pops up empty tooltips. I'll continue
to play with it.




[jQuery] Re: Hide a div on blur

2008-12-05 Thread Hector Virgen
You can't "blur" a div. Only elements that can be "focused" can be blurred.
AFAIK, that's form input elements (input, select, etc.)

You'll have to use another event or listener to make the div disappear.

-Hector


On Fri, Dec 5, 2008 at 9:21 AM, Echilon <[EMAIL PROTECTED]> wrote:

>
> I have a div which is shown when a AJAX callback is executed, but I
> can't get it to hide again. I'm using some of the code from the
> autocompleter and the div contains a . The code I have is at
> http://pastebin.com/m4b7bf13c . I've left out everything but the
> relevant parts. I thought I understood how the autocompleter hides the
> menu when the user clicks elsewhere in the window but I can't get it
> working.
>
> Is there something I've missed out?
>


[jQuery] Re: links going to "top" of page

2008-12-05 Thread rpetras


OK that worked GREAT!  I'm using the livequery plugin and it worked on the
first shot.  

Now, I'm having the same issue with forms.  

I'm bringing in legacy forms to the page and putting them in the div tag. 
When I hit submit they pop to the top.  

I tried a few form plugins, but they tend to all work with the form being
different than the target div.  I want to replace the current div with the
updated data from the form.  Basically recreating the behavior of the old
framed pages.  

I also tried using livequery for this, but it did not work correctly.  



Rik Lomas wrote:
> 
> 
> Yeah, it'll be due to the new "a" tags that are loaded into the page,
> there's more on this here:
> 
> http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F
> http://www.learningjquery.com/2008/05/working-with-events-part-2
> 
> 
> 2008/11/12 rpetras <[EMAIL PROTECTED]>:
>>
>>
>> Yes, the preventDefault() works just great, but only for "a" tags that
>> are
>> loaded with the page initially.
>>
>> When I load a sub-page within the div tags, that's where I'm having the
>> problem.  That sub-page does not respect the new "a" handler.  I suspect
>> it
>> is because the new page is loaded after the original document.ready.
>>
>>
>>
>>
> 

-- 
View this message in context: 
http://www.nabble.com/links-going-to-%22top%22-of-page-tp20447058s27240p20861558.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: problem with $.JSON request

2008-12-05 Thread Michael Geary

The second option - calling another function from the callback - is really
the way to go. Otherwise you don't know when the data is ready. By calling
the other function from the callback, you can ensure that the data is
actually present.

-Mike 

> From: ricardobeat
> 
> just declare the variable outside the callback, in the scope 
> where you need it, for example:
> 
> $('something').click(function(){
> 
> var message;  //the var 'message' will be available 
> inside this function, and can be set by any inner function
> 
> $.getJSON('http://...', function(data){
> message = data;
> });
> 
> });
> 
> You can also call another function inside your callback, passing the
> data:
> 
> function getData(data) { doSomethingWithIt }
> 
> $.getJSON('http//...', getData) //the 'data' parameter will 
> be passed to it on execution
> 
> About scope and closures in JS:
> http://www.robertnyman.com/2008/10/09/explaining-javascript-sc
> ope-and-closures/
> http://odetocode.com/Blogs/scott/archive/2007/07/09/11077.aspx
> 
> - ricardo

> On Dec 5, 11:33 am, "[EMAIL PROTECTED]"
> <[EMAIL PROTECTED]> wrote:
> > I spek in Englisn bed. Sorry. Part of sample code:
> >
> > $.getJSON("http://some.url/?callback=?";
> >         function(json){
> >             var result   = json.error;
> >             var message  = json.message;
> >             var record   = json.data;
> >         });
> >
> > How I return value of the variable: result or message or record to 
> > others part of script? it is possible?
> 



[jQuery] Re: load() works for html, not php

2008-12-05 Thread rodeored

Thanks for the help.

That was the immediate problem, but not my original problem which I
was having on another site, but you did give me the idea of trying to
actually look at the php file(duh)

The problem was an internal error caused by incorrect permission. I
had set the correct permissions of the file, but not the folder.
On my server, all folders need to be chmoded to 755 and all
PHP scripts need to be chmoded to 644.

Some how when I create a folder sometimes it has the wrong
permissions, I'm not sure why.

On Dec 5, 10:06 am, Mike Alsup <[EMAIL PROTECTED]> wrote:
> >http://reenie.org/test/jquerytest.html
> > This uses
> > $('#container').load('content.html'); to load content from an html
> > file
>
> >http://reenie.org/test/jquerytest.html
> > This uses
> > $('#container').load('content.php'); to load from a php file.
>
> > Why doesn' t the second one work? They are the same except for the
>
> http://reenie.org/test/content.phpdoes not exist (404).


[jQuery] [validate] Rule Selectors

2008-12-05 Thread Mihai Danila


Hi,

Is it possible to use jQuery selectors to identify the elements to
which certain rules should apply? If this feature exists, then I won't
have to unnecessarily complicate the component that dynamically
creates my form and that features various control types.


Thanks,
Mihai



[jQuery] Re: How to access href-property

2008-12-05 Thread Karl Swedberg
Yeah, that's what I would say, too. The person who mentioned it said  
it affects feedburner and google reader. I can neither confirm nor  
deny that claim, though.


cf. 
http://www.learningjquery.com/2008/10/1-awesome-way-to-avoid-the-not-so-excellent-flash-of-amazing-unstyled-content#comment-63276

--Karl


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




On Dec 5, 2008, at 2:03 PM, brian wrote:



I'd say that's a broken feed-reader.

On Fri, Dec 5, 2008 at 12:46 PM, Karl Swedberg  
<[EMAIL PROTECTED]> wrote:
Not sure about that, but one advantage of full URLs is that they  
work in all
feed readers. I was using "root-relative" URLs on my blog until  
somebody

complained that these links wouldn't work for him in his feed reader.

--Karl

On Dec 5, 2008, at 11:29 AM, Andy Matthews wrote:

As an FYI, while I personally prefer relative URLs for simplicity and
code reuse, full URLs in the HREF attribute provide slightly better
SEO due to the replication of the domain name.

On Dec 5, 10:23 am, Andy Matthews <[EMAIL PROTECTED]> wrote:

Here's a reference URL by the way:

http://www.hscripts.com/tutorials/javascript/document-object.php

On Dec 5, 10:21 am, "Andy Matthews" <[EMAIL PROTECTED]> wrote:

Matthias...

Attr('href') will give you whatever is contained in the href  
property. If


you want the "http://otherpage.com"; then that needs to be contained  
in the


href property. Using the 'domain' property of the document object  
will give


you the first part:

   

   

   

andy

-Original Message-

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


Behalf Of Matthias Coy

Sent: Friday, December 05, 2008 10:10 AM

To: jquery-en@googlegroups.com

Subject: [jQuery] How to access href-property

Hi there,

how do I access the "href"-property of an anchor-element? I know  
there is a


$("#idOfAnAnchor").attr("href");

but this only gives me the attribute and not the property. I need the

property, because inside of this property is the full URL. See  
example:


Home // on  
otherpage.com 

id="idOfAnAnchor2" href="http://somepage.com/index.php";>Home

$("#idOfAnAnchor1").attr("href"); // gives '/index.php', needed is

'http://otherpage.com/index.php'

$("#idOfAnAnchor2").attr("href"); // gives 'http://somepage.com/index.php'

I could use:

var aLink = document.getElementById("#idOfAnAnchor1");

var aHrefProperty = aLink.href;

but where is the jQuery fun in this :) ?

Regards

   Matthias






[jQuery] Re: Checking to see if a SWF is fully loaded

2008-12-05 Thread Sam Sherlock
I think its better for flash to call an external function when its fully
loaded

2008/12/5 Mike Miller <[EMAIL PROTECTED]>

>
> Hi,
>
> Need to find a way to use jquery to check whether or not a swf has
> been fully loaded before executing a javaScript function.
>
> M


[jQuery] Expose an event?

2008-12-05 Thread paron

I made a searchbox object that I can add to a GoogleMap. It lets a
user draw a box on the map and keeps track of its max and min lat and
lon.

I'd like to have it raise an "updated" event whenever either of its
internal draggable markers fires a "dragend." That way other objects
can watch for an "updated" event and hit the server to search inside
the new boundaries, or repaint the map, or update a database with the
new boundaries.

I looked for a while at event delegation, but that didn't seem to be
the right topic.


[jQuery] [validate] - Validation by regular expression

2008-12-05 Thread skidmarek

I've created a useful addition to your class that you may want to
include in a future version.

Set the value of the regex attribute to a regular expression.  If any
characters in the input don't match the regex, it returns false.  Very
handy.

Here's the source:

--- In rules:

if (data.regex) {
var param = data.regex;
delete data.regex;
data = $.extend({regex: param}, data);
}

--- Then in methods:

regex: function(value,element,param) {
if (param) {
var expression = new RegExp(param, "g");
return (value.replace(expression,"").length==0);
} else {
return true;
}
},

--- Usage:

regex: "\\b[a-zA-Z0-9()[EMAIL PROTECTED]"'?&* ]+\\b"

If the input contains any characters that aren't in that list, it
validates as false.


[jQuery] Re: How to achieve this effect?

2008-12-05 Thread brian

Once you've got a function that can fade in a series of images, slide
them across the page, and fade out, just keep track of the last
direction and use the opposite for the next one.

On Fri, Dec 5, 2008 at 1:53 PM, sabrinax <[EMAIL PROTECTED]> wrote:
>
> If you go to the Gucci homepage: http://gucci.com/us/index2.html you
> will see a brief slideshow where the image fades in, moves
> horizontally across the screen (say from right to left), then fades
> out.  Easy.  But then the next image fades in, switches direction and
> moves across the screen in the opposite direction (say left to right),
> then fades out.  How can you use jquery to switch direction of the
> animation for each new slide?
>
> Thanks!


[jQuery] Re: How to access href-property

2008-12-05 Thread brian

I'd say that's a broken feed-reader.

On Fri, Dec 5, 2008 at 12:46 PM, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> Not sure about that, but one advantage of full URLs is that they work in all
> feed readers. I was using "root-relative" URLs on my blog until somebody
> complained that these links wouldn't work for him in his feed reader.
>
> --Karl
>
> On Dec 5, 2008, at 11:29 AM, Andy Matthews wrote:
>
> As an FYI, while I personally prefer relative URLs for simplicity and
> code reuse, full URLs in the HREF attribute provide slightly better
> SEO due to the replication of the domain name.
>
> On Dec 5, 10:23 am, Andy Matthews <[EMAIL PROTECTED]> wrote:
>
> Here's a reference URL by the way:
>
> http://www.hscripts.com/tutorials/javascript/document-object.php
>
> On Dec 5, 10:21 am, "Andy Matthews" <[EMAIL PROTECTED]> wrote:
>
> Matthias...
>
> Attr('href') will give you whatever is contained in the href property. If
>
> you want the "http://otherpage.com"; then that needs to be contained in the
>
> href property. Using the 'domain' property of the document object will give
>
> you the first part:
>
> 
>
> 
>
> 
>
> andy
>
> -Original Message-
>
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
>
> Behalf Of Matthias Coy
>
> Sent: Friday, December 05, 2008 10:10 AM
>
> To: jquery-en@googlegroups.com
>
> Subject: [jQuery] How to access href-property
>
> Hi there,
>
> how do I access the "href"-property of an anchor-element? I know there is a
>
> $("#idOfAnAnchor").attr("href");
>
> but this only gives me the attribute and not the property. I need the
>
> property, because inside of this property is the full URL. See example:
>
> Home // on otherpage.com 
> id="idOfAnAnchor2" href="http://somepage.com/index.php";>Home
>
> $("#idOfAnAnchor1").attr("href"); // gives '/index.php', needed is
>
> 'http://otherpage.com/index.php'
>
> $("#idOfAnAnchor2").attr("href"); // gives 'http://somepage.com/index.php'
>
> I could use:
>
> var aLink = document.getElementById("#idOfAnAnchor1");
>
> var aHrefProperty = aLink.href;
>
> but where is the jQuery fun in this :) ?
>
> Regards
>
> Matthias
>
>


[jQuery] mcDropDown - problem getting displayed value

2008-12-05 Thread Sean O


Hi,


I'm using the (excellent) mcDropDown plugin:
http://www.givainc.com/labs/mcdropdown_jquery_plugin.htm
...but can't seem to get the displayed input value, after hours of Googling
& hacking.

Code
-
$(function () {
   mc = $("#modelName").mcDropdown({
  'select': function(){
 modelName = $('.mcdropdown input').val();
 updateModelName();   // fn that sets text of .modelname spans
  }
   });
});

Text
-
Your model: REPLACE ME

What's strange is that the first time a model is selected after page load,
modelName (and .modelname) is set to an empty string. The second time you
select a model, .modelName is replaced... with the text of the previous
model selection. Each successive selection sets the value of the previous
selection(?).

.getValue() doesn't work, and would only return the rel attribute of
selection anyway. What I need is the displayed text.

Ideas? Thanks.



SEAN O
http://www.sean-o.com
-- 
View this message in context: 
http://www.nabble.com/mcDropDown---problem-getting-displayed-value-tp20860269s27240p20860269.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Help creating a special menu

2008-12-05 Thread brian

You're only passing one value for background-position; there should be
a left and top.

Looking at the code you posted and the images themselves, it's not
clear to me what you want the hovered link to look like. I'm assuming
here that you want the hovered link to change to black text, and the
others to be blurred.

#main_nav li a {
text-indent: -99px;
overflow: hidden;
display: block;
height: 80px;
background-position: 0 0;  /* set it here globally */
}

/* default white text
 */
#home{ background: url(/media/1.jpg) 0 0; width: 103px; }
#why { background: url(/media/2.jpg) 0 0; width: 103px; }
#try { background: url(/media/3.jpg) 0 0; width: 103px; }

/* class for the blurred state
 */
#main_nav li a.Blur {
background-position: -206px 0;
}

/* Changes the hovered link to black text
 */
#main_nav li a:hover { background-position: -103px 0; }

/* there's no need to assign hover callbacks for each link individually
 */
$(function(){
$("#main_nav li a").hover(
function(){$("#main_nav li a").addClass('Blur');},
function(){$("#main_nav li a").removeClass('Blur');}
);
});


The one thing this is missing is the fadeIn effect you had. But you
could use this to potentially add that, maybe with setTimeout.


On Fri, Dec 5, 2008 at 7:32 AM, ivanisevic82 <[EMAIL PROTECTED]> wrote:
>
> Hi!
> Sorry for my english!
> I need help to create a special menu with jquery.
> In this menu, when I will be hover a "button", it remain the same, but
> all the other changes!
>
> You can see a very basics and work in progress example in the orange
> menu here: www.ivanisevic82.com
>
>
> I used this tutorial:
>
> http://www.3point7designs.com/blog/2007/12/22/advanced-css-menu-trick/
>
> So, I created this menu with this code:
>
> PHP:
>
> 
>http://xxx.com"; accesskey="3" id="home"
> title="Home">Home
>http://yyy.com"; accesskey="4" id="why" title="why">Why a>
>http://ppp.com"; accesskey="5" id="try" " title="try">Web
> Design
> 
>
> CSS:
>
> #main_nav {
> list-style: none;
> margin: 0;
> padding: 0;
> }
>
> #main_nav li {
> float: left;
> list-style: none;
> }
>
> #main_nav li a {
> text-indent: -99px;
> overflow: hidden;
> display: block;
> height: 80px;
> }
>
> #home{ background: url(/media/1.jpg); width: 103px; }
> #why { background: url(/media/2.jpg); width: 103px; }
> #try { background: url(/media/3.jpg); width: 103px; }
>
> #main_nav:hover li a#home { background-position: -206px; }
> #main_nav:hover li a#why { background-position: -206px; }
> #main_nav:hover li a#try { background-position: -206px; }
>
> #home:hover { background: url(/media/1.jpg) 0 0 !important; }
> #why:hover { background: url(/media/2.jpg) 0 0 !important; }
> #try:hover { background: url(/media/3.jpg) 0 0 !important; }
>
>
>
>
>
> Now what I'd like to do, is try to apply a fad-in / fade-out effect
> (with jquery) everytime a part of the menu has to change aspect.
>
> I tried to build this js ofr jquery, but it doesn't works:
>
> $(function(){
> $("#home").hover(
>function(){$("#main_nav:hover li a#webdesign").fadeIn('slow');},
>function(){$("#main_nav:hover li a#about").fadeIn('slow');});
> });
>
>
> Can you help me to build a js working for my project?
>
> Thank you, bye!
>


[jQuery] How to achieve this effect?

2008-12-05 Thread sabrinax

If you go to the Gucci homepage: http://gucci.com/us/index2.html you
will see a brief slideshow where the image fades in, moves
horizontally across the screen (say from right to left), then fades
out.  Easy.  But then the next image fades in, switches direction and
moves across the screen in the opposite direction (say left to right),
then fades out.  How can you use jquery to switch direction of the
animation for each new slide?

Thanks!


[jQuery] Re: Hover Repeats Over and Over...

2008-12-05 Thread Brian Cherne
Hi Ricardo, you're correct. You can now stop any animation. At the time
hoverIntent was written a year and a half ago $(foo).stop() wasn't
available. I've been meaning to update the hoverIntent plugin/page. It's in
my personal animation queue. :)
Brian.
On Wed, Dec 3, 2008 at 1:03 PM, ricardobeat <[EMAIL PROTECTED]> wrote:

>
>
>
> On Dec 3, 4:23 pm, brian <[EMAIL PROTECTED]> wrote:
> >  Also, because jQuery
> > animations cannot be stopped once they've started it's best not to
> > start them prematurely.
> > -- snip --
>
> That's not the case; you can stop any animation, jumping to the end of
> it or not.
>
> cheers,
> - ricardo
>


[jQuery] Re: IE problem

2008-12-05 Thread Michael Geary

I see one problem right away: You're getting a "guid is null or not an
object" error in your initialization code. Walking up the call stack, it
turns out that this comes from the .hover() call at the end of your
JavaScript code. The .hover() method takes two function arguments, and it's
not being called with these arguments.

Once you get past that error, I notice that clicking the Next button seems
to work OK, but it only highlights the selected item number on every other
click. This is happening because your $('#promotion_holder >
#promotion_navigation > ul > li a') selector (with the :eq(n) part removed)
is selecting 18 elements, not the 9 elements that you expect.

Looking at the page with the IE Developer Toolbar, it does indeed show that
each of your LI elements contains not only the expected A element, but a
second A element as well.

I didn't investigate why that is happening.

Do you have any debugging tools for IE? Here's what you need to do the
investigation I just did. First, do this Google search:

ie developer toolbar

and install the developer toolbar. This includes a page inspector similar to
the one in Firebug.

Then, use this Google search:

visual web developer express debug javascript

The first result should be a page on berniecode.com that explains how to set
up Microsoft's free Visual Web Developer 2008 Express Edition to debug
JavaScript in IE. There's one item the page omits: I found that you need to
make IE the default browser before starting debugging.

This is actually an outstanding JavaScript debugger, much better than the
one in Firebug or any other.

-Mike

> From: luke adamis
> 
> test page:
> http://kitchenshop.ebeacon.net/catalog/
> thanks,
> luke

> On Dec 4, 2008, at 6:29 PM, Michael Geary wrote:
> 
> >
> > It doesn't seem to work for me in Firefox either.
> >
> > For some reason, $('.promotion_content').length evaluates to 0.
> >
> > Oh! I get it. I'm missing the HTML code!
> >
> > Sorry, just kidding around with you. :-)
> >
> > But seriously, it's pretty hard to guess what might be 
> wrong without a 
> > test page to look at.
> >
> > The one thing I can suggest from looking at the JS code 
> alone is that 
> > there's a big chunk of duplicate code that could be removed. That's 
> > unlikely to be related to the IE problem, though. So put up a test 
> > page and someone can probably give you some ideas.
> >
> > -Mike
> >
> >> From: luke adamis
> >>
> >> Why isn't tis working in IE?
> >>
> >> $(document).ready(function(){  
> >>
> >>//tabber
> >>
> >>var e = $('.promotion_content').length;
> >>
> >>var n = Math.floor(Math.random()*e);
> >>
> >>$('#promotion_holder > .promotion_content').hide();
> >>
> >>$('#promotion_holder > .promotion_content:eq('+n+')').show();
> >>$('#promotion_holder > #promotion_navigation > ul > li
> >>> a:eq('+n
> >> +')').addClass('selected');
> >>
> >>$('#promotion_holder > #promotion_navigation > #next > 
> a').click 
> >> (function () {
> >>if (n == e-1) { n = 0; } else { n = n+1; }
> >>$('#promotion_holder > .promotion_content').hide();
> >>$('#promotion_holder > #promotion_navigation > 
> ul > li > 
> >> a').removeClass('selected');
> >>$('#promotion_holder >
> >> .promotion_content:eq('+n+')').fadeIn('slow');
> >>$('#promotion_holder > #promotion_navigation > 
> ul > li > a:eq('+n
> >> +')').addClass('selected');
> >>return false;
> >>});
> >>
> >>$('#promotion_holder > #promotion_navigation > 
> #previous > a').click 
> >> (function () {
> >>if (n == 0) { n = e-1; } else { n = n-1; }
> >>$('#promotion_holder > .promotion_content').hide();
> >>$('#promotion_holder > #promotion_navigation > 
> ul > li > 
> >> a').removeClass('selected');
> >>$('#promotion_holder >
> >> .promotion_content:eq('+n+')').fadeIn('slow');
> >>$('#promotion_holder > #promotion_navigation > 
> ul > li > a:eq('+n
> >> +')').addClass('selected');
> >>return false;
> >>});
> >>
> >>var tab_content = $('#promotion_holder > .promotion_content');
> >>
> >>$('#promotion_holder > #promotion_navigation > ul > li
> >>> a').click (function () {
> >>tab_content.hide().filter(this.hash).fadeIn('slow');
> >>
> >>$('#promotion_holder > #promotion_navigation > 
> ul > li > 
> >> a').removeClass('selected');
> >>$(this).addClass('selected');
> >>n = $(this).attr('name') - 1;
> >>
> >>return false;
> >>
> >>}).filter(':first').hover();
> >>
> >> });
> >>
> >> 
> >>
> >> both the random selection and the clicking on the next previous 
> >> buttons are messed up in IE6, IE7. if I set var e = $ 
> >> ('.promotion_content').length; to a fixed number, the script works.
> >> but I need to count the elements someh

[jQuery] Checking to see if a SWF is fully loaded

2008-12-05 Thread Mike Miller

Hi,

Need to find a way to use jquery to check whether or not a swf has
been fully loaded before executing a javaScript function.

M


[jQuery] Re: Submit form using ajax

2008-12-05 Thread Mike Alsup

> Please let me know where i am wrong.

Move this line:

$('#add_prime_show_id').ajaxForm(options);

and put it right beneath this line:

$('#admin_ajax_new_content_id').html(html); //show the html
inside .content div

For background info on why:

http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F




[jQuery] Submit form using ajax

2008-12-05 Thread vicky

Hi,

I am loading a form on click of an hyperlink using ajax.after loading
i want to submit that form again with ajax.i tried many methods but no
one is working.i need to do validation also.

i am using this code.

 $(document).ready(function(){
 $('#admin_ajax_new_content_id').load('add_prime_shows.php');   //by
default initally load text from boo.php
 $('#admin_left_navigation a').click(function() { //start
function when any link is clicked
$('#admin_ajax_new_content_id').slideUp("slow");
//  var content_show = $(this).attr("title");
var href_name = $(this).attr("title");

$.ajax({
method: "get",url: href_name,data: "",
beforeSend: function(){$("#loading").show("slow");}, //show 
loading
just when link is clicked
complete: function(){ $("#loading").hide("slow");}, //stop 
showing
loading when the process is complete
error: function(){
$('#loading').hide();
alert( "Error: while fetching form.");},

success: function(html){ //so, if data is retrieved, store it in
html
$('#admin_ajax_new_content_id').slideDown("slow"); //animation
$('#admin_ajax_new_content_id').html(html); //show the html
inside .content div
 }
 }); //close $.ajax(
 }); //close click(

// After click of an a link form comes fine.


var options = {
target:'#admin_ajax_message_div',   // target element
(s) to be updated with server response
beforeSubmit:  validate_prime_show,  // pre-submit callback
success:   prime_showResponse,  // post-submit callback

// other available options:
//url:   url // override for form's 'action'
attribute
type:  'post',// 'get' or 'post', override for
form's 'method' attribute
//dataType:  null// 'xml', 'script', or
'json' (expected server response type)
clearForm: false// clear all form fields after
successful submit
//resetForm: true// reset the form after successful
submit

// $.ajax options can be used here too, for example:
//timeout:   3000
};

   $('#add_prime_show_id').ajaxForm(options);

function validate_prime_show(formData, jqForm, options) {

var queryString = $.param(formData);
var error_status=0;
var showValue = $('[EMAIL PROTECTED]').fieldValue();
if (!showValue[0]) {
alert('Please enter show name.');
error_status = 1;
return false;
}
if(error_status == 0)
{
$('#loading').show();
return true;
}
}

// post-submit callback
function showResponse(responseText, statusText)  {

 $('#loading').hide();
 $('#admin_ajax_message_div').fadeOut(5000);
}

But this thing is not working
 }); //close $(

Please let me know where i am wrong.





[jQuery] Hide a div on blur

2008-12-05 Thread Echilon

I have a div which is shown when a AJAX callback is executed, but I
can't get it to hide again. I'm using some of the code from the
autocompleter and the div contains a . The code I have is at
http://pastebin.com/m4b7bf13c . I've left out everything but the
relevant parts. I thought I understood how the autocompleter hides the
menu when the user clicks elsewhere in the window but I can't get it
working.

Is there something I've missed out?


[jQuery] jQuery slidable pananel with mouse over + gMaps + IE = SLOW!

2008-12-05 Thread sosamv

Hi guys, Im creating a informative dashboard using googlemaps,using
marker manager and some other stuff, I also have a panel on the
left... we can click on each one of the options and it will do
something like $(this).next().slideToggle("slow"); and this function
is also looking for all of the other elements and its collapsing them.
the problem is that i'm importing a bunch of files:

http://maps.google.com/maps?
file=api&v=2&key=ABQInfs7bKE82qgb3Zc2YyS-
oBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSySz_REpPq-4WZA27OwgbtyR3VcA" type="text/
javascript">

-5kb
-3kb

-55kb
 -3kb

Everything is working smoothly on FF, but as I mencioned, IE is very
slow if i remove the imports for the google map or the marker manager
everything works fine.

What should I do?


[jQuery] Hide a div onblur

2008-12-05 Thread Echilon

I have a div which is shown when a AJAX callback is executed, but I
can't get it to hide again. I'm using some of the code from the
autocompleter and the div contains a . The code I have is at
http://pastebin.com/m4b7bf13c . I've left out everything but the
relevant parts. I thought I understood how the autocompleter hides the
menu when the user clicks elsewhere in the window but I can't get it
working.

Is there something I've missed out?


[jQuery] Re: IE problem

2008-12-05 Thread luke adamis


OK I figured it out.

There is nothing wrong with my script.

This website is developed in ShopSite. http://shopsite.com/
ShopSite uses templates to build static pages. In order to cross link  
and to be able to search ShopSite places anchors all over the HTML.
For some reason for these anchors it duplicates the ids and classes I  
put into the template. since JQuery relies on classes and ids of DOM  
elements we get a conflict there.
Safari, Firefox are smart enough to deal with the conflict. IE6 and  
IE7 mess up.


L.




On Dec 5, 2008, at 10:12 AM, luke adamis wrote:



test page:
http://kitchenshop.ebeacon.net/catalog/
thanks,
luke

On Dec 4, 2008, at 6:29 PM, Michael Geary wrote:



It doesn't seem to work for me in Firefox either.

For some reason, $('.promotion_content').length evaluates to 0.

Oh! I get it. I'm missing the HTML code!

Sorry, just kidding around with you. :-)

But seriously, it's pretty hard to guess what might be wrong  
without a test

page to look at.

The one thing I can suggest from looking at the JS code alone is that
there's a big chunk of duplicate code that could be removed.  
That's unlikely
to be related to the IE problem, though. So put up a test page and  
someone

can probably give you some ideas.

-Mike


From: luke adamis

Why isn't tis working in IE?

$(document).ready(function(){   

//tabber

var e = $('.promotion_content').length;

var n = Math.floor(Math.random()*e);

$('#promotion_holder > .promotion_content').hide();

$('#promotion_holder > .promotion_content:eq('+n+')').show();
$('#promotion_holder > #promotion_navigation > ul > li

a:eq('+n

+')').addClass('selected');

$('#promotion_holder > #promotion_navigation > #next >
a').click (function () {
if (n == e-1) { n = 0; } else { n = n+1; }
$('#promotion_holder > .promotion_content').hide();
$('#promotion_holder > #promotion_navigation >
ul > li > a').removeClass('selected');
$('#promotion_holder >
.promotion_content:eq('+n+')').fadeIn('slow');
$('#promotion_holder > #promotion_navigation >
ul > li > a:eq('+n
+')').addClass('selected');
return false;
});

$('#promotion_holder > #promotion_navigation >
#previous > a').click (function () {
if (n == 0) { n = e-1; } else { n = n-1; }
$('#promotion_holder > .promotion_content').hide();
$('#promotion_holder > #promotion_navigation >
ul > li > a').removeClass('selected');
$('#promotion_holder >
.promotion_content:eq('+n+')').fadeIn('slow');
$('#promotion_holder > #promotion_navigation >
ul > li > a:eq('+n
+')').addClass('selected');
return false;
});

var tab_content = $('#promotion_holder > .promotion_content');

$('#promotion_holder > #promotion_navigation > ul > li

a').click (function () {

tab_content.hide().filter(this.hash).fadeIn('slow');

$('#promotion_holder > #promotion_navigation >
ul > li > a').removeClass('selected');
$(this).addClass('selected');
n = $(this).attr('name') - 1;

return false;

}).filter(':first').hover();

});



both the random selection and the clicking on the next
previous buttons are messed up in IE6, IE7. if I set var e =
$ ('.promotion_content').length; to a fixed number, the
script works.
but I need to count the elements somehow first.

thanks,
luke













[jQuery] Re: Using "window.location.hash" for URLs without plugin

2008-12-05 Thread Andy Matthews
location.hash is a property, so you'd just get it's value then compare that.
Something like this might work:
 
// get the hash
var page = location.hash;
// show the correct page
$('#' + page).show();
 
 
 
andy matthews
 

  _  

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Alex Hempton-Smith
Sent: Friday, December 05, 2008 11:48 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Using "window.location.hash" for URLs without plugin


Hi, 

I'm trying to use URL's such as 'mysite.com/#contact' that will show a
certain div.
I have my function written and working to show the div, currently being used
as "$("#a.contact").click(showContact);"


How would I use something like "window.location.hash" to fire off the
function "showContact" for example, if the URL was /#contact?


This would need to provide for about 3 pages, Home, About, Portfolio and
Contact.
I know there's a plugin for enabling use of the back button etc, but I'd
rather something simple without having to load plugins.



Many thanks,
Alex


[jQuery] Re: How to access href-property

2008-12-05 Thread Andy Matthews

The crawler fully 'understands' both methods, but bear in mind that in
addition to rendering the source code, the crawler also treats the rendered
code as text. References to domains can provide a modest increase in
performance. While I don't know the exact amount, I'm guessing it's not more
than a few percent.

This information comes from our in-house SEO department who are all Google,
and Yahoo certified in SEO/SEM.


andy 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Michael Geary
Sent: Friday, December 05, 2008 11:38 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: How to access href-property


Is that really true? A crawler has to convert all relative URLs to their
full form in order to get to those pages. So it has the exact same full URL
on hand whether the HTML has a full or relative URL.

I don't have any hard evidence one way or the other, it just seems
surprising that a search engine would treat full and relative URLs any
differently, given that it has the full URL in all cases anyway.

-Mike

> From: Andy Matthews
> 
> As an FYI, while I personally prefer relative URLs for simplicity and 
> code reuse, full URLs in the HREF attribute provide slightly better 
> SEO due to the replication of the domain name.




[jQuery] Re: Variable scope: Newbie Question

2008-12-05 Thread Michael Geary

Hi Mat,

1) You're defining towncity like this:

var towncity = window.towncity = new Array();

That creates both a local variable named towncity and a window property
(global variable) of the same name. Is that what you want? Do you need to
use towncity outside this code? If not, I would change it to:

var towncity = [];

2) In the .each() inside your ajax callback you have this code:

towncity = $(this).text();

That *replaces* the towncity variable with the text of the single XML
element for the current iteration of .each() - so it's no longer an array
but is now a simple text string. It doesn't sound like that's what you want,
is it?

To append the item text to the towncity array, you could change it to:

towncity.push( $(this).text() );

But you probably also want to clear this array before running the loop (is
that right?), so just before the $(xml).find(...) you should add:

towncity = [];  // note: no "var" here

which gives you this code:

success: function(xml) {
towncity = [];
$(xml).find(...).map(function(){
towncity.push( $(this).text() );
});
}

Given that, you could simplify the code to:

success: function(xml) {
towncity = $(xml).find(...).map(function(){
return $(this).text();
});
}

BTW, do you have control over the XML file that the server generates? If you
do, you could use JSON instead of XML to make the code simpler. If you're
stuck with XML, this code should do the trick.

-Mike

> From: Mat
> 
> Hi there,
> 
> I'm sorry this is a pretty newbie question
> 
> 
> I am using JQuery with an xml file and autocomplete. What I am trying
> to achieve is to use an xml file as my data source to autocomplete
> cities in a form once a user selects their province. When a user
> selects a particular province then only the cities in that province
> will be listed by the autocomplete script as the user starts to type
> in the 'city' form field.
> 
> My problem here is that I am trying to use the array 'towncity' as my
> data source for autocomplete and change the contents of the array when
> the province select box #province is changed. However, I can not get
> my $('#province').change(function() to affect the array 'towncity'
> that I have declared outside of the function
> 
>   
>   $(document).ready(function() {
>   var towncity = window.towncity = new Array();
>   $("#city").autocomplete(towncity);
>   $.preloadCssImages();
>   $('div.jshide').show();
>   $("#tenantForm").validate({
> rules: {
>   name: {
> required: true,
> minlength: 2
>   },
>   province:"required",
>   ccom:"required",
>   occupied: "required",
>   rented:"required",
>   condo:"required",
>   payment:"required"
> 
> }
>   });
> 
> 
>   $("#renewdate").datepicker({
>   dateFormat: "d M, yy",
>   showOn: "both",
>   buttonImage: "images/calendar.gif",
>   buttonImageOnly: true
>   });
> 
>   $('#province').change(function() {
>   var currprov = $('option:selected', 
> this).text();
> 
>   $(function() {
>   $.ajax({
>   type: "GET",
>   url: "xml/location.xml",
>   dataType: "xml",
>   success: function(xml) {
> 
>   
> $(xml).find("[EMAIL PROTECTED]'"+ currprov +"'] >
> TOWN_CITY_NAME").each(function(){
>   
> towncity = $(this).text();
>   });
>   }
>   });
>   });
>   });
>   });
> 
> 
> 
> Anyone have any ideas?
> 
> Thanks,
> Mat
> 



[jQuery] Re: How to access href-property

2008-12-05 Thread Karl Swedberg
Not sure about that, but one advantage of full URLs is that they work  
in all feed readers. I was using "root-relative" URLs on my blog until  
somebody complained that these links wouldn't work for him in his feed  
reader.


--Karl


On Dec 5, 2008, at 11:29 AM, Andy Matthews wrote:



As an FYI, while I personally prefer relative URLs for simplicity and
code reuse, full URLs in the HREF attribute provide slightly better
SEO due to the replication of the domain name.

On Dec 5, 10:23 am, Andy Matthews <[EMAIL PROTECTED]> wrote:

Here's a reference URL by the way:

http://www.hscripts.com/tutorials/javascript/document-object.php

On Dec 5, 10:21 am, "Andy Matthews" <[EMAIL PROTECTED]> wrote:


Matthias...


Attr('href') will give you whatever is contained in the href  
property. If
you want the "http://otherpage.com"; then that needs to be  
contained in the
href property. Using the 'domain' property of the document object  
will give

you the first part:









andy



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



Behalf Of Matthias Coy
Sent: Friday, December 05, 2008 10:10 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] How to access href-property



Hi there,


how do I access the "href"-property of an anchor-element? I know  
there is a



$("#idOfAnAnchor").attr("href");


but this only gives me the attribute and not the property. I need  
the
property, because inside of this property is the full URL. See  
example:


Home // on  
otherpage.com 
id="idOfAnAnchor2" href="http://somepage.com/index.php";>Home



$("#idOfAnAnchor1").attr("href"); // gives '/index.php', needed is
'http://otherpage.com/index.php'
$("#idOfAnAnchor2").attr("href"); // gives 'http://somepage.com/index.php'



I could use:



var aLink = document.getElementById("#idOfAnAnchor1");
var aHrefProperty = aLink.href;



but where is the jQuery fun in this :) ?



Regards
Matthias




[jQuery] Using "window.location.hash" for URLs without plugin

2008-12-05 Thread Alex Hempton-Smith
Hi,
I'm trying to use URL's such as 'mysite.com/#contact' that will show a
certain div.
I have my function written and working to show the div, currently being used
as "$("#a.contact").click(showContact);"

How would I use something like "window.location.hash" to fire off the
function "showContact" for example, if the URL was /#contact?

This would need to provide for about 3 pages, Home, About, Portfolio and
Contact.
I know there's a plugin for enabling use of the back button etc, but I'd
rather something simple without having to load plugins.

Many thanks,
Alex


[jQuery] Re: How to access href-property

2008-12-05 Thread Michael Geary

Is that really true? A crawler has to convert all relative URLs to their
full form in order to get to those pages. So it has the exact same full URL
on hand whether the HTML has a full or relative URL.

I don't have any hard evidence one way or the other, it just seems
surprising that a search engine would treat full and relative URLs any
differently, given that it has the full URL in all cases anyway.

-Mike

> From: Andy Matthews
> 
> As an FYI, while I personally prefer relative URLs for 
> simplicity and code reuse, full URLs in the HREF attribute 
> provide slightly better SEO due to the replication of the domain name.



[jQuery] Re: Trouble Understanding getJSON call

2008-12-05 Thread brian

You use it like jQuery.getJSON(url, data, callback)

function handleIt104(data, status)
{
// ...
}

var url = 'http://the.domain.com/getJSON.php';
var data = {what: ever};

$.getJSON(url, data, handleIt104)

I don't know what you mean about a 

[jQuery] Re: .load preventing links on page from working

2008-12-05 Thread ricardobeat

Nothing in the load() function prevents any clicks or interaction to
happen, unless the ajax object is configured to be synchronous. If you
provide a test page showing the issue someone might be able to help.

cheers,
- ricardo

On Dec 5, 7:26 am, ykoorb <[EMAIL PROTECTED]> wrote:
> Hey everyone,
>
> I've just downloaded and started using jQuery v1.2.6 in a web project
> i'm working on. When a search result page loads i want to also search
> another site and show the results in my page. It looked like the $
> ([node]).load() function would be the best way of doing this.
>
> I implemented it and it seems to work fine, however, the .load
> function can take 5-10 seconds to return any data and in that time,
> none of the links on my page will allow the user to navigate away -
> which is undesirable. I've read in the documentation that the .load
> function is asynchronous by default, so in theory i can't understand
> why it would be stopping other content from being usable.
>
> The project is primarily ASP.NET and i use Page.RegisterStartupScript
> to write the following javascript to the page so it executes after the
> page has completed loading :
>
> 

[jQuery] datepicker and highlight current day

2008-12-05 Thread fabrice.regnier

Hi,

I can't find the option of datepicker that could highlight the current
day when i open a calendar.
Any idea ?

thanks in advance,

regards,

f.



[jQuery] Re: Optimizing Easiest Tooltip

2008-12-05 Thread Frank

Also, I just realised that putting "title"s on TDs is a silly idea,
and completely invalid. But I tried it with a direct copy of your
script after putting actual links in, but still only get empty
tooltips. Here is an example row:


Abridged Title
-
-
-
-

-
-
-
-
-
-
-
Y














2
06:01, 05:55
Y

-
Lorem ipsum dolor sit...




On Dec 5, 4:29 pm, Frank <[EMAIL PROTECTED]> wrote:
> Simply exchanging "A" for "TD" in your script didn't work (that would
> have been too easy :), it only pops up empty tooltips. I'll continue
> to play with it.


[jQuery] Re: Select checkbox when click on row

2008-12-05 Thread Chizo

Thanks Karl, it works now, i don´t know what i was doing wrong, but
now works fine!
now lets keep learning! Thanks for your time!
Lucas



[jQuery] Re: problem with $.JSON request

2008-12-05 Thread ricardobeat

just declare the variable outside the callback, in the scope where you
need it, for example:

$('something').click(function(){

var message;  //the var 'message' will be available inside this
function, and can be set by any inner function

$.getJSON('http://...', function(data){
message = data;
});

});

You can also call another function inside your callback, passing the
data:

function getData(data) { doSomethingWithIt }

$.getJSON('http//...', getData) //the 'data' parameter will be passed
to it on execution

About scope and closures in JS:
http://www.robertnyman.com/2008/10/09/explaining-javascript-scope-and-closures/
http://odetocode.com/Blogs/scott/archive/2007/07/09/11077.aspx

- ricardo

On Dec 5, 11:33 am, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:
> I spek in Englisn bed. Sorry. Part of sample code:
>
> $.getJSON("http://some.url/?callback=?";
>         function(json){
>             var result   = json.error;
>             var message  = json.message;
>             var record   = json.data;
>         });
>
> How I return value of the variable: result or message or record to
> others part of script? it is possible?


[jQuery] Re: Optimizing Easiest Tooltip

2008-12-05 Thread Karl Swedberg


On Dec 5, 2008, at 11:17 AM, Frank wrote:


Here was my attempt at modifying the original script by the way, which
gave very, very strange results. :)



$(".adminTable").hover(function(e){



Hi Frank,

The first problem in your modification to the script is that you stuck  
with the .hover() method. It works great for most things, but not for  
event delegation when you need it to be triggered every time your  
mouse moves over another element within the one that is bound.


--Karl


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



[jQuery] Re: Optimizing Easiest Tooltip

2008-12-05 Thread Frank

Simply exchanging "A" for "TD" in your script didn't work (that would
have been too easy :), it only pops up empty tooltips. I'll continue
to play with it.


[jQuery] Re: How to access href-property

2008-12-05 Thread Andy Matthews

As an FYI, while I personally prefer relative URLs for simplicity and
code reuse, full URLs in the HREF attribute provide slightly better
SEO due to the replication of the domain name.

On Dec 5, 10:23 am, Andy Matthews <[EMAIL PROTECTED]> wrote:
> Here's a reference URL by the way:
>
> http://www.hscripts.com/tutorials/javascript/document-object.php
>
> On Dec 5, 10:21 am, "Andy Matthews" <[EMAIL PROTECTED]> wrote:
>
> > Matthias...
>
> > Attr('href') will give you whatever is contained in the href property. If
> > you want the "http://otherpage.com"; then that needs to be contained in the
> > href property. Using the 'domain' property of the document object will give
> > you the first part:
>
> >         
> >         
> >         
>
> > andy
>
> > -Original Message-
> > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
>
> > Behalf Of Matthias Coy
> > Sent: Friday, December 05, 2008 10:10 AM
> > To: jquery-en@googlegroups.com
> > Subject: [jQuery] How to access href-property
>
> > Hi there,
>
> > how do I access the "href"-property of an anchor-element? I know there is a
>
> > $("#idOfAnAnchor").attr("href");
>
> > but this only gives me the attribute and not the property. I need the
> > property, because inside of this property is the full URL. See example:
>
> > Home // on otherpage.com  > id="idOfAnAnchor2" href="http://somepage.com/index.php";>Home
>
> > $("#idOfAnAnchor1").attr("href"); // gives '/index.php', needed is
> > 'http://otherpage.com/index.php'
> > $("#idOfAnAnchor2").attr("href"); // gives 'http://somepage.com/index.php'
>
> > I could use:
>
> > var aLink = document.getElementById("#idOfAnAnchor1");
> > var aHrefProperty = aLink.href;
>
> > but where is the jQuery fun in this :) ?
>
> > Regards
> >         Matthias


[jQuery] Re: textarea problem

2008-12-05 Thread Eric Martin

So, you want each line of the textarea to become a column for a single
record in the database?

You should be able to just split the contents by the cr/lf and then
building a record accordingly. How will you verify the data though,
for example, making sure that each line gets added to the correct
column?

On Dec 5, 7:32 am, Jesse <[EMAIL PROTECTED]> wrote:
> I have an html textarea that is 41 columns wide.  I need to capture
> each line and input it into a database( each line in its own seperate
> field).  I have been searching the internet and haven't had any luck
> at finding anything.  Any help would be greatly appreciated.
>
> Thanks!


[jQuery] Re: [TUTORIAL] Create an amazing music player using mouse gestures & hotkeys in jQuery

2008-12-05 Thread Isaak Malik
you'll notice*

On Fri, Dec 5, 2008 at 5:24 PM, Isaak Malik <[EMAIL PROTECTED]> wrote:

> If you read the entire tutorial you'll noticed that he mentions it's just
> an interface and he has plans to integrate it with 
> plusmusica(request for an invitation)
>
>
> On Fri, Dec 5, 2008 at 5:11 PM, Jean <[EMAIL PROTECTED]> wrote:
>
>>
>> 4 me too
>>
>> On Fri, Dec 5, 2008 at 7:29 AM, Mika Tuupola <[EMAIL PROTECTED]>
>> wrote:
>> >
>> >
>> > On Dec 4, 2008, at 7:28 PM, AdrianMG wrote:
>> >
>> >> You can see the tutorial over here:
>> >>
>> >>
>> http://yensdesign.com/2008/12/create-an-amazing-music-player-using-mouse-gestures-hotkeys-in-jquery/
>> >
>> >
>> > Should there be music too? It is silent for me FF3 & Safari in OSX?
>> >
>> > --
>> > Mika Tuupola
>> > http://www.appelsiini.net/
>> >
>> >
>>
>>
>>
>> --
>>
>> []´s Jean
>> www.suissa.info
>>
>>   Ethereal Agency
>> www.etherealagency.com
>>
>
>
>
> --
> Isaak Malik
> Web Developer
>



-- 
Isaak Malik
Web Developer


[jQuery] Re: :last in IE6

2008-12-05 Thread ricardobeat

Have you tried li.alt.last? :D

On Dec 5, 12:59 pm, Liam Potter <[EMAIL PROTECTED]> wrote:
> yes I know this,
>
> defining li.last.alt allows me apply specific styles to the last li.
> The li's have zebra striping, and the last is rounded, so i need to swap
> out the image if the alt class is applied.
>
> all new browsers support li.last.alt
>
> tlob wrote:
> > the class="last alt" are two classes!
> > .alt {} and
> > .last{}
>
> > is that ok?
>
> > On Dec 5, 2:59 pm, Liam Potter <[EMAIL PROTECTED]> wrote:
>
> >> As it turns out, it's not a jQuery problem at all, the last function
> >> works fine, it came down to an ie6 bug
>
> >> if i have class="last alt" (alt for striping) and declare css like
>
> >> li.last.alt {
> >> blah
>
> >> }
>
> >> ie6 see's the ".alt" in ".last.alt" and applies it to any alt class in
> >> the html rather then just on class="last alt"
>
> >> Karl Swedberg wrote:
>
> >>> On Dec 5, 2008, at 6:46 AM, Liam Potter wrote:
>
>  I have a simple function to add a "last" class to the last li tag in
>  a specific ul
>
>  $(".createNewOrder ul li:last").addClass('last');
>
>  problem is in IE6 it selects all the li's and adds the class.
>
>  Anyone come across this before?
>
> >>> I've never seen this before. Does it work correctly in other browsers?
> >>> Can you post a demo page or usehttp://jsbin.comfora stripped down
> >>> version of a page so we can see the problem?
>
> >>> --Karl
> >>> 
> >>> Karl Swedberg
> >>>www.englishrules.com
> >>>www.learningjquery.com


[jQuery] Re: [TUTORIAL] Create an amazing music player using mouse gestures & hotkeys in jQuery

2008-12-05 Thread Isaak Malik
If you read the entire tutorial you'll noticed that he mentions it's just an
interface and he has plans to integrate it with
plusmusica(request for an invitation)

On Fri, Dec 5, 2008 at 5:11 PM, Jean <[EMAIL PROTECTED]> wrote:

>
> 4 me too
>
> On Fri, Dec 5, 2008 at 7:29 AM, Mika Tuupola <[EMAIL PROTECTED]>
> wrote:
> >
> >
> > On Dec 4, 2008, at 7:28 PM, AdrianMG wrote:
> >
> >> You can see the tutorial over here:
> >>
> >>
> http://yensdesign.com/2008/12/create-an-amazing-music-player-using-mouse-gestures-hotkeys-in-jquery/
> >
> >
> > Should there be music too? It is silent for me FF3 & Safari in OSX?
> >
> > --
> > Mika Tuupola
> > http://www.appelsiini.net/
> >
> >
>
>
>
> --
>
> []´s Jean
> www.suissa.info
>
>   Ethereal Agency
> www.etherealagency.com
>



-- 
Isaak Malik
Web Developer


[jQuery] Re: textarea problem

2008-12-05 Thread MorningZ

var Entries = $("#TextArea1").val().split(/\n/g);

Will give you an array of items broken up by the line breaks in the





On Dec 5, 10:32 am, Jesse <[EMAIL PROTECTED]> wrote:
> I have an html textarea that is 41 columns wide.  I need to capture
> each line and input it into a database( each line in its own seperate
> field).  I have been searching the internet and haven't had any luck
> at finding anything.  Any help would be greatly appreciated.
>
> Thanks!


[jQuery] Re: How to access href-property

2008-12-05 Thread Andy Matthews

Here's a reference URL by the way:

http://www.hscripts.com/tutorials/javascript/document-object.php

On Dec 5, 10:21 am, "Andy Matthews" <[EMAIL PROTECTED]> wrote:
> Matthias...
>
> Attr('href') will give you whatever is contained in the href property. If
> you want the "http://otherpage.com"; then that needs to be contained in the
> href property. Using the 'domain' property of the document object will give
> you the first part:
>
>         
>         
>         
>
> andy
>
> -Original Message-
> From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
>
> Behalf Of Matthias Coy
> Sent: Friday, December 05, 2008 10:10 AM
> To: jquery-en@googlegroups.com
> Subject: [jQuery] How to access href-property
>
> Hi there,
>
> how do I access the "href"-property of an anchor-element? I know there is a
>
> $("#idOfAnAnchor").attr("href");
>
> but this only gives me the attribute and not the property. I need the
> property, because inside of this property is the full URL. See example:
>
> Home // on otherpage.com  id="idOfAnAnchor2" href="http://somepage.com/index.php";>Home
>
> $("#idOfAnAnchor1").attr("href"); // gives '/index.php', needed is
> 'http://otherpage.com/index.php'
> $("#idOfAnAnchor2").attr("href"); // gives 'http://somepage.com/index.php'
>
> I could use:
>
> var aLink = document.getElementById("#idOfAnAnchor1");
> var aHrefProperty = aLink.href;
>
> but where is the jQuery fun in this :) ?
>
> Regards
>         Matthias


[jQuery] Re: How to access href-property

2008-12-05 Thread Andy Matthews

Matthias...

Attr('href') will give you whatever is contained in the href property. If
you want the "http://otherpage.com"; then that needs to be contained in the
href property. Using the 'domain' property of the document object will give
you the first part:






andy


-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Matthias Coy
Sent: Friday, December 05, 2008 10:10 AM
To: jquery-en@googlegroups.com
Subject: [jQuery] How to access href-property


Hi there,

how do I access the "href"-property of an anchor-element? I know there is a

$("#idOfAnAnchor").attr("href");

but this only gives me the attribute and not the property. I need the
property, because inside of this property is the full URL. See example:

Home // on otherpage.com http://somepage.com/index.php";>Home

$("#idOfAnAnchor1").attr("href"); // gives '/index.php', needed is
'http://otherpage.com/index.php'
$("#idOfAnAnchor2").attr("href"); // gives 'http://somepage.com/index.php'

I could use:

var aLink = document.getElementById("#idOfAnAnchor1");
var aHrefProperty = aLink.href;

but where is the jQuery fun in this :) ?

Regards
Matthias




[jQuery] code not functioning if ajax request is executed...

2008-12-05 Thread ToonMariner

Hi people I have the following code which works fine independandtly
but NOT when used together...

here's the code
[code]
$(document).ready
(
  function()
  {

$("ul li div.info").hide();

$("ul.profiles li h3").hover
(
  function()
  {
$(this).css({"cursor":"pointer"})
  }
  ,
  function()
  {
$(this).css({"cursor":"default"})
  }
);


$("ul.profiles li h3").click
(
  function()
  {
var id = $(this).attr("id").split('-');

if  (
$("#info-"+id[1]).is(":hidden")
)
{
  $("#info-"+id[1]).slideDown("slow");
}
else
{
  $("#info-"+id[1]).slideUp("slow");
  //alert($(this).attr("id"));
}

  }
);

$("span.jargonterm").hover
(
  function()
  {
$(this).css({"cursor":"help"});
  }
  ,
  function()
  {
$(this).css({"cursor":"default"});
$(".jargonDesc").fadeOut(250,function(){ $
(".jargonDesc").remove();});
  }
);

$("span.jargonterm").click
(
  function()
  {
$(this).css({"cursor":"default"});
var elID = $(this).attr("id").split('-');
$(this).append(''+$(this).text
()+''+desc[elID[1]]+'');
$("div.jargonDesc").fadeIn(500);
  }
);

$.ajax
(
  {
type: "GET",
url: "http://localhost/jargonterms.xml";,
dataType: "xml",


success: function(xml)
{
  j=0;
  desc = new Array();
  $(xml).find('description').each
  (
function()
{
  var tmpD = $(this).text();
  desc[j++] = tmpD;
}
  );

  var cont = $("#iContentHolder").html();

  j=0;
  $(xml).find('term').each
  (
function()
{
  term = $(this).text();
  cont = cont.replace(term,''+term+'');
  j++;
}
  );
  $("#iContentHolder").html(cont);

   },

error:  function (XMLHttpRequest, textStatus, errorThrown)
{
  alert(textStatus);
}

  }
);
  }
);[/code]

all the code prior to the ajax call works fine IF I don't perform the
ajax call.  The ajax call works fine (except in IE where is doesn't
work at all and constantly yields 'parsererror' in the alert if the
ajax error is called).

I get no errors in my code any where and cannot for teh life of me
fathom why this is happening.

any help/guidance/pointers would be VERY muh appreciated.


[jQuery] ajax request stops rest of code working

2008-12-05 Thread ToonMariner

Hi people I have the following code which works fine independandtly
but NOT when used together...

here's the code
[code]
$(document).ready
(
  function()
  {

$("ul li div.info").hide();

$("ul.profiles li h3").hover
(
  function()
  {
$(this).css({"cursor":"pointer"})
  }
  ,
  function()
  {
$(this).css({"cursor":"default"})
  }
);


$("ul.profiles li h3").click
(
  function()
  {
var id = $(this).attr("id").split('-');

if  (
$("#info-"+id[1]).is(":hidden")
)
{
  $("#info-"+id[1]).slideDown("slow");
}
else
{
  $("#info-"+id[1]).slideUp("slow");
  //alert($(this).attr("id"));
}

  }
);

$("span.jargonterm").hover
(
  function()
  {
$(this).css({"cursor":"help"});
  }
  ,
  function()
  {
$(this).css({"cursor":"default"});
$(".jargonDesc").fadeOut(250,function(){ $
(".jargonDesc").remove();});
  }
);

$("span.jargonterm").click
(
  function()
  {
$(this).css({"cursor":"default"});
var elID = $(this).attr("id").split('-');
$(this).append(''+$(this).text
()+''+desc[elID[1]]+'');
$("div.jargonDesc").fadeIn(500);
  }
);

$.ajax
(
  {
type: "GET",
url: "http://localhost/jargonterms.xml";,
dataType: "xml",


success: function(xml)
{
  j=0;
  desc = new Array();
  $(xml).find('description').each
  (
function()
{
  var tmpD = $(this).text();
  desc[j++] = tmpD;
}
  );

  var cont = $("#iContentHolder").html();

  j=0;
  $(xml).find('term').each
  (
function()
{
  term = $(this).text();
  cont = cont.replace(term,''+term+'');
  j++;
}
  );
  $("#iContentHolder").html(cont);

   },

error:  function (XMLHttpRequest, textStatus, errorThrown)
{
  alert(textStatus);
}

  }
);
  }
);[/code]

all the code prior to the ajax call works fine IF I don't perform the
ajax call.  The ajax call works fine (except in IE where is doesn't
work at all and constantly yields 'parsererror' in the alert if the
ajax error is called).

I get no errors in my code any where and cannot for teh life of me
fathom why this is happening.

any help/guidance/pointers would be VERY muh appreciated.


[jQuery] textarea problem

2008-12-05 Thread Jesse

I have an html textarea that is 41 columns wide.  I need to capture
each line and input it into a database( each line in its own seperate
field).  I have been searching the internet and haven't had any luck
at finding anything.  Any help would be greatly appreciated.

Thanks!


[jQuery] Re: Optimizing Easiest Tooltip

2008-12-05 Thread Frank

Hi Karl,

Thanks for your comprehensive reply! I'll give that a go as soon as I
can. I need the tooltip for TDs rather than links but that shouldn't
be hard to modify I hope.

Here was my attempt at modifying the original script by the way, which
gave very, very strange results. :)

$(document).ready(function(){
xOffset = 10;
yOffset = 20;
var t;

$(".adminTable").hover(function(e){
var $tgt = $(e.target);
if($tgt.hasClass("tooltip")) {
t = $tgt.attr("title");
$tgt.attr("title", "");
$("body").append(""+ t +"");
$("#tooltip")
.css("top",(e.pageY - xOffset) + "px")
.css("left",(e.pageX + yOffset) + "px")
.fadeIn("fast");
}
},
function(e){
var $tgt = $(e.target);
$tgt.attr("title", t);
$("#tooltip").remove();
});
});

Frank.

On Dec 5, 2:58 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote:
> Hi Frank,
>
> Just for kicks, I cranked out my own very simple tooltip script. It  
> isn't a plugin. Yet. But it gets the job done.
>
> Basically, it binds the event listeners to a table (since that's what  
> you said you had) and uses event delegation to look for any links  
> within the table. The tooltip content comes from the title attribute.  
> It assumes that you don't have elements nested more than one deep  
> within a link, so it would work for yes  
> but not for no.
>
> Hopefully it'll make sense to you, but if it doesn't, let me know and  
> I'll try to explain whatever you're having problems with.
>
> Here is a link to a demo page:
>
> http://test.learningjquery.com/very-simple-tooltip.html
>
> And here is the code:
>
> $(document).ready(function() {
>    var $vsTip = $('').css('opacity',  
> '0.6').hide().appendTo('body');
>
>    var tgt,
>    vsTip = {
>      link: function(e) {
>        var t = e.target.nodeName === 'A' ?
>          e.target :
>          e.target.parentNode.nodeName === 'A' && e.target.parentNode;
>        return t || false;
>      },
>      xOffset: 10,
>      yOffset: 20,
>      contents: ''
>    };
>    $('table').mouseover(function(event) {
>     if (vsTip.link(event)) {
>       tgt = vsTip.link(event);
>       vsTip.contents = tgt.title;
>       tgt.title = '';
>       $vsTip.css({
>         left: event.pageX + vsTip.xOffset,
>         top: event.pageY + vsTip.yOffset
>       }).html(vsTip.contents).show();
>     }
>    }).mouseout(function(event) {
>      if (vsTip.link(event)) {
>        tgt = vsTip.link(event);
>        tgt.title = vsTip.contents;
>        $vsTip.hide();
>      }
>    }).mousemove(function(event) {
>      if (vsTip.link(event)) {
>        $vsTip.css({
>          left: event.pageX + vsTip.xOffset,
>          top: event.pageY + vsTip.yOffset
>        });
>
>      }
>    });
>
> });
>
> --Karl
>
> 
> Karl Swedbergwww.englishrules.comwww.learningjquery.com
>
> On Dec 5, 2008, at 5:36 AM, Frank wrote:
>
>
>
> > Hi there,
>
> > I've got a page with a very big table (unfortunately breaking it up
> > isn't an option), and I wanted to use the handy tooltip script here:
>
> >http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using...
>
> > This results in just over 2,000 cells with tooltips, and such over
> > 2,000 listeners. When I refresh the page, I get an "Unresponsive
> > Script" error in Firefox, which isn't suprising.
>
> > Could someone suggest a way I could modify the above script to use
> > fewer listeners? Maybe through event delegation? I'm still quite new
> > to jQuery, so any advice is welcome!
>
> > Frank.


[jQuery] Re: How to access href-property

2008-12-05 Thread Eric Martin

What about:

$("#idOfAnAnchor1")[0].href;

On Dec 5, 8:10 am, Matthias Coy <[EMAIL PROTECTED]> wrote:
> Hi there,
>
> how do I access the "href"-property of an anchor-element? I know there is a
>
> $("#idOfAnAnchor").attr("href");
>
> but this only gives me the attribute and not the property. I need the
> property, because inside of this property is the full URL. See example:
>
> Home // on otherpage.com
> http://somepage.com/index.php";>Home
>
> $("#idOfAnAnchor1").attr("href"); // gives '/index.php', needed is
> 'http://otherpage.com/index.php'
> $("#idOfAnAnchor2").attr("href"); // gives 'http://somepage.com/index.php'
>
> I could use:
>
> var aLink = document.getElementById("#idOfAnAnchor1");
> var aHrefProperty = aLink.href;
>
> but where is the jQuery fun in this :) ?
>
> Regards
>         Matthias


[jQuery] Re: jquery + struts action

2008-12-05 Thread Eric Martin

Marta -

Remember, an Ajax request/response is a separate processes and does
not affect the current page state. It happens "behind the scenes".

If you took my example and looked to see what was in the response
(resp), you would see that contains the results of jsp-listreports.do.

If you want the result of your request to load a new page, there are a
bunch of different options. One option would be to have the result of
your action return a success/failure message or the URL of the action
to call/failure message. I see you have dataType as xml, so you could
have your action return something like:


  /jsp-listreports.do


$.ajax({
  url: '/listReports.do',
  type:'post',
  cache: false,
  dataType:'xml',
  success: function (resp) {
// sudo code:
// parse xml for the success node
if (success) {
  window.location = test of success node
}
else {
  // provide an indication that there was a failure
}
  }
});

On Dec 5, 6:16 am, Marta Figueiredo <[EMAIL PROTECTED]> wrote:
> I'm trying to call a struts action using ajax. The action is correctly
> called. The problem is that the action forward method is called but it
> is not executing.
> My action is defined as follow:
>
>   parameter="/WEB-INF/reportmanagement/listreports.jsp" scope="request"
> type="weboncampus.action.reportmanagement.ForwardActionReports" />
>          type="weboncampus.action.reportmanagement.ActionGetReportsList"
> scope="request">
>              redirect="false"/>
>         
>
> Shouldn't the page be automatically redirected to listreports.jsp after
> calling listReports.do?
>
> Marta
>
> Eric Martin wrote:
> > Marta - what exactly are you trying to do? By using an Ajax call, you
> > are going to get a response that should be the output of the forwarded
> > action.
>
> > $.ajax({
> >   url: '/listReports.do',
> >   type:'post',
> >   cache: false,
> >   dataType:'xml',
> >   success: function (resp) {
> >     // do something with resp
> >   }
> > });
>
> > -Eric
>
> > On Dec 4, 10:32 am, Marta Figueiredo <[EMAIL PROTECTED]> wrote:
>
> >> Hi
>
> >> I need to call an action using jquery..
>
> >> The following piece of code works correctly for it is calling and
> >> executing code the correct struts action. However.. the action itseft is
> >> not being correcty forwarded. I don't think that the problem is the
> >> action, for if I call it in other ways the forward works. Any ideas?
>
> >> $.ajax({
> >>                url: '/listReports.do',
> >>                type:'post',
> >>                cache: false,
> >>                dataType:'xml'
>
> >>            });
>
> >> thanks
> >> Marta


[jQuery] Re: IE problem

2008-12-05 Thread luke adamis


test page:
http://kitchenshop.ebeacon.net/catalog/
thanks,
luke

On Dec 4, 2008, at 6:29 PM, Michael Geary wrote:



It doesn't seem to work for me in Firefox either.

For some reason, $('.promotion_content').length evaluates to 0.

Oh! I get it. I'm missing the HTML code!

Sorry, just kidding around with you. :-)

But seriously, it's pretty hard to guess what might be wrong  
without a test

page to look at.

The one thing I can suggest from looking at the JS code alone is that
there's a big chunk of duplicate code that could be removed. That's  
unlikely
to be related to the IE problem, though. So put up a test page and  
someone

can probably give you some ideas.

-Mike


From: luke adamis

Why isn't tis working in IE?

$(document).ready(function(){   

//tabber

var e = $('.promotion_content').length;

var n = Math.floor(Math.random()*e);

$('#promotion_holder > .promotion_content').hide();

$('#promotion_holder > .promotion_content:eq('+n+')').show();
$('#promotion_holder > #promotion_navigation > ul > li

a:eq('+n

+')').addClass('selected');

$('#promotion_holder > #promotion_navigation > #next >
a').click (function () {
if (n == e-1) { n = 0; } else { n = n+1; }
$('#promotion_holder > .promotion_content').hide();
$('#promotion_holder > #promotion_navigation >
ul > li > a').removeClass('selected');
$('#promotion_holder >
.promotion_content:eq('+n+')').fadeIn('slow');
$('#promotion_holder > #promotion_navigation >
ul > li > a:eq('+n
+')').addClass('selected');
return false;
});

$('#promotion_holder > #promotion_navigation >
#previous > a').click (function () {
if (n == 0) { n = e-1; } else { n = n-1; }
$('#promotion_holder > .promotion_content').hide();
$('#promotion_holder > #promotion_navigation >
ul > li > a').removeClass('selected');
$('#promotion_holder >
.promotion_content:eq('+n+')').fadeIn('slow');
$('#promotion_holder > #promotion_navigation >
ul > li > a:eq('+n
+')').addClass('selected');
return false;
});

var tab_content = $('#promotion_holder > .promotion_content');

$('#promotion_holder > #promotion_navigation > ul > li

a').click (function () {

tab_content.hide().filter(this.hash).fadeIn('slow');

$('#promotion_holder > #promotion_navigation >
ul > li > a').removeClass('selected');
$(this).addClass('selected');
n = $(this).attr('name') - 1;

return false;

}).filter(':first').hover();

});



both the random selection and the clicking on the next
previous buttons are messed up in IE6, IE7. if I set var e =
$ ('.promotion_content').length; to a fixed number, the
script works.
but I need to count the elements somehow first.

thanks,
luke









[jQuery] Re: [TUTORIAL] Create an amazing music player using mouse gestures & hotkeys in jQuery

2008-12-05 Thread Jean

4 me too

On Fri, Dec 5, 2008 at 7:29 AM, Mika Tuupola <[EMAIL PROTECTED]> wrote:
>
>
> On Dec 4, 2008, at 7:28 PM, AdrianMG wrote:
>
>> You can see the tutorial over here:
>>
>> http://yensdesign.com/2008/12/create-an-amazing-music-player-using-mouse-gestures-hotkeys-in-jquery/
>
>
> Should there be music too? It is silent for me FF3 & Safari in OSX?
>
> --
> Mika Tuupola
> http://www.appelsiini.net/
>
>



-- 

[]´s Jean
www.suissa.info

   Ethereal Agency
www.etherealagency.com


[jQuery] How to access href-property

2008-12-05 Thread Matthias Coy


Hi there,

how do I access the "href"-property of an anchor-element? I know there is a

$("#idOfAnAnchor").attr("href");

but this only gives me the attribute and not the property. I need the 
property, because inside of this property is the full URL. See example:


Home // on otherpage.com
http://somepage.com/index.php";>Home

$("#idOfAnAnchor1").attr("href"); // gives '/index.php', needed is 
'http://otherpage.com/index.php'

$("#idOfAnAnchor2").attr("href"); // gives 'http://somepage.com/index.php'

I could use:

var aLink = document.getElementById("#idOfAnAnchor1");
var aHrefProperty = aLink.href;

but where is the jQuery fun in this :) ?

Regards
Matthias


[jQuery] Re: SOT: Blinking cursor in Firefox 2 bleeds through divs...

2008-12-05 Thread Karl Swedberg

On Dec 5, 2008, at 8:21 AM, Dan G. Switzer, II wrote:



Karl,

I wish I could give you some good news, but instead I can only  
commiserate.

FF 2 had all sorts of problems like that. Try having an absolutely
positioned div overlapping the scrollbar of a div with overflow:  
scroll.
Ugly. I even recall seeing a cursor in one tab's textarea blinking  
through
to the currently visible tab. Those problems appear to have been  
fixed in

FF3.


FF3 works as expected. I know FF2 has a few bizarre issues like  
this, but I
just thought placing a div overlay over an input field was common  
enough

that there might be a fix for the issue.

-Dan


Hey Dan,

I think I have a workaround for you. When you place the div overlay  
over the input field, set the input field's contentEditable attribute  
to false. $('yourInput').attr('contentEditable', false)


Then when you remove the overlay, set it back to 'inherit'.

Not fully tested. But maybe it'll at least get you closer.

--Karl

[jQuery] Re: cancel ".hide()"

2008-12-05 Thread Matthias Coy

Hi,

thank you. I wasn't aware that setTimeout has a return value. Thanks.

Regards
Matthias

MorningZ schrieb:
> "PS: maybe a dumb question but I'm pretty new to jquery"
> 
> Well, the solution doesn't really have anything to do with jQuery
> 
> instead of :
> 
> $(".classoflinks").hover(function() {
>$("#myDiv").show();
> }, function() {
>setTimeout(function() { $("#myDiv").hide(); }, 4000);
> });
> 
> 
> this will hold the setTimeout in a later-accessible object
> 
> var _PendingHide;
> $(".classoflinks").hover(function() {
>$("#myDiv").show();
> }, function() {
>_PendingHide = setTimeout(function() { $("#myDiv").hide(); },
> 4000);
> });
> 
> 
> which in turn gives you the ability to cancel that "hide()" command
> 
> if (_PendingHide) { clearTimeout(_PendingHide ); }
> 
> 
> 
> On Dec 5, 7:55 am, Matthias Coy <[EMAIL PROTECTED]> wrote:
>> Hi there,
>>
>> I have a relativly simple question, first some code:
>>
>> $(".classoflinks").hover(function() {
>>$("#myDiv").show();}, function() {
>>
>>setTimeout(function() { $("#myDiv").hide(); }, 4000);
>>
>> });
>>
>> so that's what I'm doing. Mouseover shows the div, mouseout hides the
>> div after 4 seconds. Now the tricky part:
>>
>> When I hover over the shown div, I want to stop the hiding. Something like:
>>
>> $("#myDiv").hover(function(){
>>$(this).stopHide();}, function() {
>>
>>setTimeout(function() { $("#myDiv").hide(); }, 4000);
>>
>> });
>>
>> what do I have to do instead of my not existing function "stopHide()"?
>>
>> Sincerely
>> Matthias
>>
>> PS: maybe a dumb question but I'm pretty new to jquery.
> 


[jQuery] Re: Expanding div over an image on mouse-over

2008-12-05 Thread tlob

http://www.serie3.info/s3slider/demonstration.html

On Dec 5, 4:15 pm, Robert K <[EMAIL PROTECTED]> wrote:
> Wow, you rock!! :)  Looks great.
>
> Only problem, it doesn't seem to work in IE 7, any ideas?
>
> Cheers,
> Rob
>
> On Dec 4, 10:44 pm, ricardobeat <[EMAIL PROTECTED]> wrote:
>
> > One way to do it:
>
> >http://jsbin.com/owamu/
>
> > (yeah I went crazy on the math :D)
>
> > - ricardo
>
> > On Dec 4, 5:24 pm, Robert K <[EMAIL PROTECTED]> wrote:
>
> > > *cough* bump! :)
>
> > > On Dec 3, 1:43 pm, Robert K <[EMAIL PROTECTED]> wrote:
>
> > > > I want to add a description/info to some images, I came across this
> > > > really cool effect that I think is created usingMooTools, just
> > > > wondering if it is possible to replicate in jQuery?
>
> > > > Half way down the page (http://www.irishtimes.com/), 5 images with a
> > > > black text box, put mouse over an image, text box expands to reveal
> > > > more info.
>
> > > > This is exactly what I want, can it be done in jQuery? I have tried
> > > > using a couple of effects, but nothing that doesn't mess up the image.
>
> > > > Is it possible with jQuery? Any suggestions?
>
> > > > Thanks in advance.
>
> > > > Ro


[jQuery] Re: How do I build a variable array/object to use $.post?

2008-12-05 Thread Kevin Thorpe
Kevin Thorpe wrote:
> Hi, I'm struggling a bit to get $.post to work. I can get it working 
> as documented, ie.
> $.post("url", { param1: 1, param2: 2 } );
> but I want variable fields on my form (identified by the class 
> 'edit_field') to be posted to the url
> I thought the approach below would work, postdata is built correctly, 
> but it sends nothing.
> What  am I doing wrong?
> thanks
>
>   var postdata = [];
>
>   // get all the edit fields
>   $.each($('.edit_field'),function() {
> postdata[this.name] = $(this).val();
>   });
>
>   // and sent it away
>   $.post("/spt/newcanonical",
>  postdata,
>  function(data) {
>alert(data);
>  });
>
>
Oh. I'm an idiot!

I was creating an array, not an object. I didn't realise the subtle 
difference between the two. Changing postdata = [] to postdata = {} 
fixes it.


--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery (English)" group.
To post to this group, send email to jquery-en@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-en?hl=en
-~--~~~~--~~--~--~---



[jQuery] How do I build a variable array/object to use $.post?

2008-12-05 Thread Kevin Thorpe
Hi, I'm struggling a bit to get $.post to work. I can get it working as 
documented, ie.

$.post("url", { param1: 1, param2: 2 } );
but I want variable fields on my form (identified by the class 
'edit_field') to be posted to the url
I thought the approach below would work, postdata is built correctly, 
but it sends nothing.

What  am I doing wrong?
thanks

 var postdata = [];

 // get all the edit fields
 $.each($('.edit_field'),function() {
   postdata[this.name] = $(this).val();
 });

 // and sent it away
 $.post("/spt/newcanonical",
postdata,
function(data) {
  alert(data);
});




[jQuery] Re: Expanding div over an image on mouse-over

2008-12-05 Thread Robert K

Wow, you rock!! :)  Looks great.

Only problem, it doesn't seem to work in IE 7, any ideas?

Cheers,
Rob


On Dec 4, 10:44 pm, ricardobeat <[EMAIL PROTECTED]> wrote:
> One way to do it:
>
> http://jsbin.com/owamu/
>
> (yeah I went crazy on the math :D)
>
> - ricardo
>
> On Dec 4, 5:24 pm, Robert K <[EMAIL PROTECTED]> wrote:
>
> > *cough* bump! :)
>
> > On Dec 3, 1:43 pm, Robert K <[EMAIL PROTECTED]> wrote:
>
> > > I want to add a description/info to some images, I came across this
> > > really cool effect that I think is created usingMooTools, just
> > > wondering if it is possible to replicate in jQuery?
>
> > > Half way down the page (http://www.irishtimes.com/), 5 images with a
> > > black text box, put mouse over an image, text box expands to reveal
> > > more info.
>
> > > This is exactly what I want, can it be done in jQuery? I have tried
> > > using a couple of effects, but nothing that doesn't mess up the image.
>
> > > Is it possible with jQuery? Any suggestions?
>
> > > Thanks in advance.
>
> > > Ro


[jQuery] Re: load() works for html, not php

2008-12-05 Thread Mike Alsup

> http://reenie.org/test/jquerytest.html
> This uses
> $('#container').load('content.html'); to load content from an html
> file
>
> http://reenie.org/test/jquerytest.html
> This uses
> $('#container').load('content.php'); to load from a php file.
>
> Why doesn' t the second one work? They are the same except for the

http://reenie.org/test/content.php does not exist (404).
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"jQuery (English)" group.
To post to this group, send email to jquery-en@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/jquery-en?hl=en
-~--~~~~--~~--~--~---



[jQuery] Re: Select checkbox when click on row

2008-12-05 Thread Karl Swedberg

Hmm. It /should/ work.

Here is the complete code:

$(document).ready(function() {
  $('tr').click(function(event) {
$(this).toggleClass('click');
if (event.target.type !== 'checkbox') {
  $(':checkbox', this).click();
}
  });
});

of course, you need to include the jquery.js file first, etc.

Here is a demo:

http://test.learningjquery.com/clickrow.html

--Karl


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




On Dec 5, 2008, at 6:38 AM, Chizo wrote:



first, thanks! now...this is the code for the 

$("tr").click(function() {
$(this).toggleClass("click");
});
so, i suppose that here i should put the function to check the
checkbox, i tried with karl example but i can´t make it work...






[jQuery] Re: Optimizing Easiest Tooltip

2008-12-05 Thread Karl Swedberg

Hi Frank,

Just for kicks, I cranked out my own very simple tooltip script. It  
isn't a plugin. Yet. But it gets the job done.


Basically, it binds the event listeners to a table (since that's what  
you said you had) and uses event delegation to look for any links  
within the table. The tooltip content comes from the title attribute.  
It assumes that you don't have elements nested more than one deep  
within a link, so it would work for yes  
but not for no.


Hopefully it'll make sense to you, but if it doesn't, let me know and  
I'll try to explain whatever you're having problems with.


Here is a link to a demo page:

http://test.learningjquery.com/very-simple-tooltip.html

And here is the code:

$(document).ready(function() {
  var $vsTip = $('').css('opacity',  
'0.6').hide().appendTo('body');


  var tgt,
  vsTip = {
link: function(e) {
  var t = e.target.nodeName === 'A' ?
e.target :
e.target.parentNode.nodeName === 'A' && e.target.parentNode;
  return t || false;
},
xOffset: 10,
yOffset: 20,
contents: ''
  };
  $('table').mouseover(function(event) {
   if (vsTip.link(event)) {
 tgt = vsTip.link(event);
 vsTip.contents = tgt.title;
 tgt.title = '';
 $vsTip.css({
   left: event.pageX + vsTip.xOffset,
   top: event.pageY + vsTip.yOffset
 }).html(vsTip.contents).show();
   }
  }).mouseout(function(event) {
if (vsTip.link(event)) {
  tgt = vsTip.link(event);
  tgt.title = vsTip.contents;
  $vsTip.hide();
}
  }).mousemove(function(event) {
if (vsTip.link(event)) {
  $vsTip.css({
left: event.pageX + vsTip.xOffset,
top: event.pageY + vsTip.yOffset
  });

}
  });
});



--Karl


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




On Dec 5, 2008, at 5:36 AM, Frank wrote:



Hi there,

I've got a page with a very big table (unfortunately breaking it up
isn't an option), and I wanted to use the handy tooltip script here:

http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery

This results in just over 2,000 cells with tooltips, and such over
2,000 listeners. When I refresh the page, I get an "Unresponsive
Script" error in Firefox, which isn't suprising.

Could someone suggest a way I could modify the above script to use
fewer listeners? Maybe through event delegation? I'm still quite new
to jQuery, so any advice is welcome!

Frank.




  1   2   >