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

2008-12-05 Thread Mika Tuupola



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/



[jQuery] Re: autocomplete help

2008-12-05 Thread monk.e.boy


On Dec 4, 6:46 pm, Jörn Zaefferer [EMAIL PROTECTED]
wrote:
 Take a look at the source of this 
 demo:http://dev.jquery.com/view/trunk/plugins/autocomplete/demo/json.html


Thanks, that did the job. For future googlers this is what I did:

var data = [ {name:'Jeff', id:'1234'}, {name:'Link', id: '999'} ];

$().ready(function() {
function format(person) {
return person.name;
}

$(#client_names_autocomplete)
.autocomplete(data, {
mustMatch: true,
autoFill: true,
matchContains: false,
dataType: json,
parse: function(data) {
return $.map(data, function(row) {
return {
data: row,
value: row.name,
result: row.name + 
  + row.to + 
}
});
},
formatItem: function(item) {
return format(item);
}
})
.result(function(event, item) {
//alert(item.id);
// this pushes the person ID into a
// hidden form input and posts it
$(#person_id).attr(value, item.id);
document.nav_admin.submit()
});
});

there are a few mysteries that I didn't figure out, but the code works
OK for me :-)

Cheers,

monk.e.boy


[jQuery] Variable scope: Newbie Question

2008-12-05 Thread 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

script type=text/javascript
$(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();
});
}
});
});
});
});
/script


Anyone have any ideas?

Thanks,
Mat


[jQuery] .load preventing links on page from working

2008-12-05 Thread ykoorb

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 :

script type=text/javascript$(#RelatedResults).load({url});/
script

Has anyone got any ideas why this might be happening?

thanks,
Ykoorb


[jQuery] passing 'this' into getjson callback

2008-12-05 Thread pramodx

Hi,

On click of a button I am placing a json call in the following manner

jQuery( '#myButton' ).bind( 'click', myProject.callJson );

The callJson function calls the json parameters:

jQuery.getJSON( url, null, function( json ) { myProject.handleResult
( json ) } );

The handleResult function further takes me to someOtherFunction() as
well.

The issue is that all the while I need to keep on passing a reference
to the clicked button through jQuery(this) so that I can manipulate it
in someOtherFunction(). How do I do that? Any pointers would be very
helpful.

Thanks
Pramod


[jQuery] UI Datepicker Regional

2008-12-05 Thread [EMAIL PROTECTED]

Hello all,

I can't get the regional settings (language etc) to work with my
datepicker - the changes I have made other than that are:

$(#dateInput).datepicker({
closeText: 'Luk',
prevText: 'laquo; M',
nextText: 'M raquo;',
currentText: 'M',
navigationAsDateFormat: true,
firstDay: 1,
duration: 'fast',
showAnim: 'fadeIn'
});

What do I put in there to set the region?

Thanx


[jQuery] Re: passing 'this' into getjson callback

2008-12-05 Thread Erik Beeson
I think anonymous functions are much easier to read and understand. They
also make scoping a bit cleaner. You can rewrite with named functions if it
makes sense for your application. This is untested, but should be close to
what you're asking:

jQuery( '#myButton' ).bind( 'click', function() {var theButton = this;
jQuery.getJSON( url, null, function( json ) {
// handle json stuff here. theButton is the DOM node of the clicked
element.
// or call handleResult(json, theButton); to pass the element to
handleResult
} );});

FYI, if this is your real code, this:

jQuery.getJSON( url, null, function( json ) { myProject.handleResult( json )
} );

Is the same as this:

jQuery.getJSON( url, null, myProject.handleResult );

Creating an anonymous function that just calls a function with the same
arguments is redundant. This probably isn't actually what you want in this
case though since you then can't pass the button reference.

--Erik


On Fri, Dec 5, 2008 at 2:16 AM, pramodx [EMAIL PROTECTED] wrote:


 Hi,

 On click of a button I am placing a json call in the following manner

 jQuery( '#myButton' ).bind( 'click', myProject.callJson );

 The callJson function calls the json parameters:

 jQuery.getJSON( url, null, function( json ) { myProject.handleResult
 ( json ) } );

 The handleResult function further takes me to someOtherFunction() as
 well.

 The issue is that all the while I need to keep on passing a reference
 to the clicked button through jQuery(this) so that I can manipulate it
 in someOtherFunction(). How do I do that? Any pointers would be very
 helpful.

 Thanks
 Pramod



[jQuery] Re: Select checkbox when click on row

2008-12-05 Thread Chizo

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

$(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] :last in IE6

2008-12-05 Thread Liam Potter


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?
 


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

2008-12-05 Thread rodeored

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
files being loaded.
If I change the second one to load the html file, it works fine.





[jQuery] 2 sets of tabs with different container sizes?

2008-12-05 Thread toopix



Hi Im trying to set up 2 sets of tabs on the same page- I have the 1st
set working fine using an altered jquery.tabs.css file. The problem is
Ive set the tabs-container to 646px; in this file. I want the 2nd tab-
contaner to be 100px;. Ive tried specifying alternate jquery.tabs2.css
file and adding it but it seems the 1st css file overides it. when I
remove the link to the initial css file the 2nd set of tabs look fine,
so I presume it picks up the 2nd css file ok. But this messes up the
other tabs. Im sure there is an easier way to do this? Im new to all
this. Basically what I want is 2 sets of tabs on the same page that
use different css file to specify tabs-container values and span
widths or maybe i dont even need 2 separate css files? any help
appreciated Thanks


[jQuery] Optimizing Easiest Tooltip

2008-12-05 Thread Frank

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.


[jQuery] Re: [tooltip] Problem in IE 6 with multiple tooltips of different 'extra' classes

2008-12-05 Thread Jörn Zaefferer
The code looks fine. Could you file a ticket for this?
http://dev.jquery.com/newticket (requires registration)

Thanks
Jörn

On Fri, Dec 5, 2008 at 2:46 AM, Eric P [EMAIL PROTECTED] wrote:

 Hi,

 Just started messing around with Jörn's tooltip plugin, and I think I found a 
 bug while using IE 6 (not a problem in IE
 7 and FF 3).

 Here's some reference code.
 http://epierce.freeshell.org/jquery-tooltip-bug/index.html

 In the example I'm assigning three different tooltips each with their own 
 unique extraClass to three different p blocks.

 In IE 6 only the first p tooltip works (tooltip has a blue background).  
 The other two don't use their respective
 extraClasses (different background colors, etc.).

 As I'm new to this plugin, I wouldn't be surprised if I've borked the syntax, 
 but since it works in IE 7 and FF I'm not
 so sure.

 Thanks for any ideas.
 Eric



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

2008-12-05 Thread Dan G. Switzer, II

Mike,

 No matter what I set the z-index to, it always blinks through the
 layer. Here's a very straightforward example that shows the issue in
 every version of FF2 I have:


Dan, do you have the cursor keys option enabled?

No--that's a different issue altogether. :) That was one of the first things
I checked.

Are you not seeing the issue in FF2?

-Dan



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

2008-12-05 Thread Dan G. Switzer, II

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



[jQuery] Re: Has jQuery development halted?

2008-12-05 Thread GasGiant

I think we should expect to see a longer development cycle now that
jQuery has reached a new level of acceptance. You have to be much more
serious and methodical when your work starts affecting more people and
more projects. It is great to see MS, Zend, etc. taking jQuery
seriously, but it will change things a little.

BTW, PHP| Architect for October has a great example of jQuery use in
the article on reducing bandwidth. Validation of the write less, do
more motto. Bang on.


[jQuery] Re: :last in IE6

2008-12-05 Thread Karl Swedberg


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 use http://jsbin.com for a stripped down  
version of a page so we can see the problem?



--Karl

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



[jQuery] Need help adding rows to JCarousel

2008-12-05 Thread nat

I am desperate to get rows added to JCarousel, I am a js novice so I
have made many attempts to hack with css with no success. I am trying
to create a carousel that shows 6 dates in 3 x 2 grid at a time.

Any guidance as to how to add rows to JCarousel would be greatly
appreciated.

-n


[jQuery] Re: Trouble Understanding getJSON call

2008-12-05 Thread Guy

I spent quite a bit of time farting around with this problem and thing
I figured out what I was doing wrong. If someone can confirm I'm on
the write track I'd appreciate it.

I read somewhere that the format of the passed url which indicates
that .getJSON should handle the call as a x-browser call is url?
queryparamscallback=?. Is that right? If that is the format of the
call then I'm assuming the .getJSON method will create a script in
the DOM. If that's right where is the script tag created? In the
head tag?

Also, if the url doesn't have that callback=? in it then is a straight
XMLHTTPRequest called to the server?

Thanks, any clarification on the above would be greatly appreciated.

Guy

On Dec 4, 8:31 pm, Guy [EMAIL PROTECTED] wrote:
 Hi,

 I'm trying to use the $.getJSON() but with no luck. Here's the code
 I'm using to make the call.

 $.getJSON(http://the.domain.com/getJSON.php?
 experiment=104callback=handleIt104.callbackformat=jsonpaskingfor=recipet­ransaction');

 This calls a php script which as an example would return the
 following:

 handleIt104.callback({status: success, recipe: Ne,
 transaction: 11451988, recipemask: , askingfor:
 recipetransaction, experiment: 104});



[jQuery] Re: Creating a Plugin

2008-12-05 Thread Brian Ronk

I don't think that will work for a few reasons.  I have to be able to
see the decoded text in a certain size, thus what I have is something
where you click on the editable area, and it switches to editing.
Plus, I have a few custom bbcodes that are being used, and I didn't
see a way to add them.  Granted, I could have missed.

Thanks for that link though, it might come in handy somewhere else.

On Dec 5, 2:41 am, Kevin Kietel [EMAIL PROTECTED] wrote:
 How about this jQuery editor:

 http://markitup.jaysalvat.com/

 it's called markItUp! and uses Html, Textile, Wiki Syntax, Markdown,
 BBcode

 On 5 dec, 08:27, Brian  Ronk [EMAIL PROTECTED] wrote:

  I'm making an edit in place plugin, and am running into an issue,
  mainly because I'm not sure how to do it.  The data I am working with
  is bbcode, so what is seen on screen (non editing) is not bbcode, but
  it decoded.  I would like to be able to return the bbcode to work with
  it in another area.  I'm just not sure how to do that.

  What I'd like to be able to do is to initialize it: $('#test').bbcode
  ();  and then be able to call it again (or something) to get the
  actual bbcode out.  So, something like $('#test').bbcode('code');  or $
  ('#test').showcode();

  It basically works right now, except for the returning data.  I'm just
  not sure on how to procede to do that.


[jQuery] Re: :last in IE6

2008-12-05 Thread Liam Potter


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 use http://jsbin.com for a stripped down 
version of a page so we can see the problem?



--Karl

Karl Swedberg
www.englishrules.com http://www.englishrules.com
www.learningjquery.com http://www.learningjquery.com





[jQuery] Re: jquery + struts action

2008-12-05 Thread Marta Figueiredo


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:

action path=/jsp-listreports 
parameter=/WEB-INF/reportmanagement/listreports.jsp scope=request 
type=weboncampus.action.reportmanagement.ForwardActionReports /
   action path=/listReports 
type=weboncampus.action.reportmanagement.ActionGetReportsList 
scope=request
   forward name=list path=/jsp-listreports.do 
redirect=false/

   /action

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: Need help adding rows to JCarousel

2008-12-05 Thread Liam Potter


So, the carousel is scrolling separate divs right?
what's stopping you from nesting a table inside the div that will be 
scrolled?


nat wrote:

I am desperate to get rows added to JCarousel, I am a js novice so I
have made many attempts to hack with css with no success. I am trying
to create a carousel that shows 6 dates in 3 x 2 grid at a time.

Any guidance as to how to add rows to JCarousel would be greatly
appreciated.

-n
  




[jQuery] sortable not firing always in FF,IE. Safari works fine!

2008-12-05 Thread tlob

Hello
on this page, when you drag around LI's
http://www.vum.ch/thomas/post/11.html
the update: liCounting(), function does not firing alway in FF,IE.
Only in Safari or when you click the LI's.

I have no clue why
Any tips?

Thx
tom


[jQuery] Re: :last in IE6

2008-12-05 Thread tlob

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.comfor a stripped down
  version of a page so we can see the problem?

  --Karl
  
  Karl Swedberg
 www.englishrules.comhttp://www.englishrules.com
 www.learningjquery.comhttp://www.learningjquery.com


[jQuery] Re: [tooltip] Problem in IE 6 with multiple tooltips of different 'extra' classes

2008-12-05 Thread Eric P

Done.

http://dev.jquery.com/ticket/3689

Thanks,
Eric

Jörn Zaefferer wrote:
 The code looks fine. Could you file a ticket for this?
 http://dev.jquery.com/newticket (requires registration)
 
 Thanks
 Jörn
 
 On Fri, Dec 5, 2008 at 2:46 AM, Eric P [EMAIL PROTECTED] wrote:
 Hi,

 Just started messing around with Jörn's tooltip plugin, and I think I found 
 a bug while using IE 6 (not a problem in IE
 7 and FF 3).

 Here's some reference code.
 http://epierce.freeshell.org/jquery-tooltip-bug/index.html

 In the example I'm assigning three different tooltips each with their own 
 unique extraClass to three different p blocks.

 In IE 6 only the first p tooltip works (tooltip has a blue background).  
 The other two don't use their respective
 extraClasses (different background colors, etc.).

 As I'm new to this plugin, I wouldn't be surprised if I've borked the 
 syntax, but since it works in IE 7 and FF I'm not
 so sure.

 Thanks for any ideas.
 Eric






[jQuery] XML data consumption issue with Internet Explorer

2008-12-05 Thread Oki


Hello, I'm new to jQuery and I've been playing around with an example I found
regarding xml consumption. The thing is it works perfectly in every browser,
except IE, where it only displays the tables headers. I'm sure many of you
here have already seen something like this. Here is the code:

/**/
// Start function when DOM has completely loaded 
$(document).ready(function(){  

// Open the xml file
$.get(data.xml,{},function(xml){

// Build an HTML string
dataTable = '';
dataTable += 'table width=100% border=0 cellspacing=0
cellpadding=0 class=Data';
dataTable += 'th width=28% scope=colData1/thth 
width=33%
scope=colData2/thth width=23% scope=colData3/thth width=16%
scope=colData4/th';

// Run the function for each data tag in the XML file
$('data',xml).each(function(i) {
data1 = $(this).find(data1).html();
data2 = $(this).find(data2).html();
data3 = $(this).find(data3).html(); 
data4 = $(this).find(data4).html();

// Build row HTML data and store in string
mydata = BuildDataHTML(data1,data2,data3,data4);
dataTable = dataTable + mydata;
});
dataTable += '/table';

// Update the DIV called Content Area with the HTML string
$(#div_Id).append(dataTable);
});
});
 
 
 function BuildDataHTML(data1,data2,data3,data4){

// Build HTML string and return
output = '';
output += 'tr';
output += 'td valign=top'+ data1 +'/td';
output += 'td valign=top'+ data2 +'/td';
output += 'td valign=top'+ data3 +'/td';
output += 'td valign=top'+ data4 +'/td';
output += '/tr';
return output;
}
/**/


Seems to me like IE skips this part:

/**/
]// Run the function for each data tag in the XML file
$('data',xml).each(function(i) {
data1 = $(this).find(data1).html();
data2 = $(this).find(data2).html();
data3 = $(this).find(data3).html(); 
data4 = $(this).find(data4).html();

// Build row HTML data and store in string
mydata = BuildDataHTML(data1,data2,data3,data4);
dataTable = impactDataTable + mydata;
});
/**/

Any help would be greatly appreciated.
-- 
View this message in context: 
http://www.nabble.com/XML-data-consumption-issue-with-Internet-Explorer-tp20853767s27240p20853767.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] problem with $.JSON request

2008-12-05 Thread suhinin.dmit...@gmail.com

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] [validate] Required on Fields Matching Criteria

2008-12-05 Thread Mihai Danila

Hi guys,

Is it possible for the validator component to make exactly one field
within a chosen set required?

input type=text id=input1 class=my-group/
input type=text id=input2 class=my-group/

If either input has a value, then validation succeeds. If neither
input has a value, then both fields should be marked as failed with
preferably a message next to them.


Thanks,
Mihai



[jQuery] cancel .hide()

2008-12-05 Thread Matthias Coy

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] Help creating a special menu

2008-12-05 Thread ivanisevic82

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:

ul
lia href=http://xxx.com; accesskey=3 id=home
title=HomeHome/a/li
lia href=http://yyy.com; accesskey=4 id=why title=whyWhy/
a/li
lia href=http://ppp.com; accesskey=5 id=try  title=tryWeb
Design/a/li
/ul

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] Re: cancel .hide()

2008-12-05 Thread MorningZ

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.
--~--~-~--~~~---~--~~
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: :last in IE6

2008-12-05 Thread Liam Potter


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.comfor a stripped down
version of a page so we can see the problem?
  
--Karl


Karl Swedberg
www.englishrules.comhttp://www.englishrules.com
www.learningjquery.comhttp://www.learningjquery.com
  




[jQuery] Re: How do you get the name of a tag/node/element?

2008-12-05 Thread Mike Alsup

 I'm trying to convert an xml node into an object...all I want to do is
 find the name of the tag...function

 function initObjArray(xml, arr, tagName){
         (xml).find(tagName).each(function(){

                 var o = new Object();
                 var t = $(this);
                 var c = t.children();
                 c.each( function(){

 var key = $(this).TAGNAME;
 var val = $(this).text();

You don't need to extract the tagname from the element.  It was passed
into your function and is the bases of your find operation.  Just
use tagName,  or

var key = tagName;




[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 a href=#spanyes/span/a  
but not for a href=#spanstrongno/strong/span/a.


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 = $('div id=vs-tip/div').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.




[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

$(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: 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: 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] 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: 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] 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: 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: 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] 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:


a id=idOfAnAnchor1 href=/index.phpHome/a // on otherpage.com
a id=idOfAnAnchor2 href=http://somepage.com/index.php;Home/a

$(#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: [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] 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: 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:

response
  success/jsp-listreports.do/success
/response

$.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:

  action path=/jsp-listreports
 parameter=/WEB-INF/reportmanagement/listreports.jsp scope=request
 type=weboncampus.action.reportmanagement.ForwardActionReports /
         action path=/listReports
 type=weboncampus.action.reportmanagement.ActionGetReportsList
 scope=request
             forward name=list path=/jsp-listreports.do
 redirect=false/
         /action

 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: 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:

 a id=idOfAnAnchor1 href=/index.phpHome/a // on otherpage.com
 a id=idOfAnAnchor2 href=http://somepage.com/index.php;Home/a

 $(#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: 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(p id='tooltip'+ t +/p);
$(#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 a href=#spanyes/span/a  
 but not for a href=#spanstrongno/strong/span/a.

 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 = $('div id=vs-tip/div').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] 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] 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('div class=jargonDescdivh3'+$(this).text
()+'h3'+desc[elID[1]]+'/div/div');
$(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,'span class=jargonterm
id=term-'+j+''+term+'/span');
  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] 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('div class=jargonDescdivh3'+$(this).text
()+'h3'+desc[elID[1]]+'/div/div');
$(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,'span class=jargonterm
id=term-'+j+''+term+'/span');
  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] 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:

script type=text/javascript
!--
alert(document.domain);
//--
/script


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:

a id=idOfAnAnchor1 href=/index.phpHome/a // on otherpage.com a
id=idOfAnAnchor2 href=http://somepage.com/index.php;Home/a

$(#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

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:

         script type=text/javascript
         !--
                 alert(document.domain);
         //--
         /script

 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:

 a id=idOfAnAnchor1 href=/index.phpHome/a // on otherpage.com a
 id=idOfAnAnchor2 href=http://somepage.com/index.php;Home/a

 $(#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: [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
plusmusicahttp://www.plusmusica.com/(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
textarea




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: [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 
 plusmusicahttp://www.plusmusica.com/(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.comhttp://www.englishrules.com
 www.learningjquery.comhttp://www.learningjquery.com


[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: 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:

          script type=text/javascript
          !--
                  alert(document.domain);
          //--
          /script

  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:

  a id=idOfAnAnchor1 href=/index.phpHome/a // on otherpage.com a
  id=idOfAnAnchor2 href=http://somepage.com/index.php;Home/a

  $(#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: 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: 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: 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: 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: Optimizing Easiest Tooltip

2008-12-05 Thread Frank

Also, I just realised that putting titles 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:

tr class='adminRow3'
td colspan='3'a href='#' title=Full Title Here
class='tooltip'bAbridged Title/b/a/td
td align='center' style='background-color: #c00'-/td
td align='center' style='background-color: #c00'-/td
td align='center' style='background-color: #c00'-/td
td align='center' style='background-color: #c00'-/td

td align='center' style='background-color: #c00'-/td
td align='center' style='background-color: #c00'-/td
td align='center' style='background-color: #c00'-/td
td align='center' style='background-color: #c00'-/td
td align='center' style='background-color: #c00'-/td
td align='center' style='background-color: #c00'-/td
td align='center' style='background-color: #c00'-/td
td rowspan='2' align='center' style='padding: 1px; background-color:
#921ba9'Y/td
td rowspan='2' align='center' style='padding: 1px'/td

td rowspan='2' align='center' style='padding: 1px'/td
td rowspan='2' align='center' style='padding: 1px'/td
td rowspan='2' align='center' style='padding: 1px'/td
td rowspan='2' align='center' style='padding: 1px'/td
td rowspan='2' align='center' style='padding: 1px'/td
td rowspan='2' align='center' style='padding: 1px'/td
td rowspan='2' align='center' style='padding: 1px'/td
td rowspan='2' align='center' style='padding: 1px'/td
td rowspan='2' align='center' style='padding: 1px'/td
td rowspan='2' align='center' style='padding: 1px'/td
td rowspan='2' align='center' style='padding: 1px'/td
td rowspan='2' align='center' style='padding: 1px'/td
td rowspan='2' align='center'2/td
td rowspan='2' style='font-size: 8px'06:01, 05:55/td
td align='center'Y/td

td rowspan='2' align='center' style='background-color: #c00'-/td
td rowspan='2'a href='' title=Lorem ipsum dolor sit amet,
consectetur adipiscing elit. Integer purus. Duis posuere diam quis
ante. Aliquam erat volutpat. Suspendisse rutrum imperdiet ipsum.
class='tooltip'Lorem ipsum dolor sit.../a/td
td rowspan='2'/td
/tr


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] 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: .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 :

 script type=text/javascript$(#RelatedResults).load({url});/
 script

 Has anyone got any ideas why this might be happening?

 thanks,
 Ykoorb


[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 script tag. Maybe i've completely
misunderstood what you want to do.


On Thu, Dec 4, 2008 at 8:31 PM, Guy [EMAIL PROTECTED] wrote:

 Hi,

 I'm trying to use the $.getJSON() but with no luck. Here's the code
 I'm using to make the call.

 $.getJSON(http://the.domain.com/getJSON.php?
 experiment=104callback=handleIt104.callbackformat=jsonpaskingfor=recipetransaction');

 This calls a php script which as an example would return the
 following:

 handleIt104.callback({status: success, recipe: Ne,
 transaction: 11451988, recipemask: , askingfor:
 recipetransaction, experiment: 104});

 The handleIt104.callback method/function exists and this works fine
 when I make a call like this:

 script src=http://the.domain.com/getJSON.php?
 experiment=104callback=handleIt104.callbackformat=jsonpaskingfor=recipetransaction/
 script

 But I'm new to jQuery and I'm guessing that the way I'm currently
 doing things with the script tag is not correct.

 Can someone please let me know what I'm doing wrong and what I can
 expect back from the $.getJSON call? Is it only supposed to return a
 JSON block without the callback in front of it such as the following?

 {status: success, recipe: Ne, transaction: 11451988,
 recipemask: , askingfor: recipetransaction, experiment:
 104}

 Any help would be greatly appreciated.

 Thanks so much. Looking forward to learning all I can about jQuery and
 making use of it with my JavaScript programming.



[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] 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 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:



script type=text/javascript
!--
alert(document.domain);
//--
/script



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:


a id=idOfAnAnchor1 href=/index.phpHome/a // on  
otherpage.com a

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



$(#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: 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
 
   script type=text/javascript
   $(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();
   });
   }
   });
   });
   });
   });
 /script
 
 
 Anyone have any ideas?
 
 Thanks,
 Mat
 



[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: 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: 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] 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 ul. 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] 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 ul. 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:

script src=http://maps.google.com/maps?
file=apiamp;v=2amp;key=ABQInfs7bKE82qgb3Zc2YyS-
oBT2yXp_ZAY8_ufC3CFXhHIE1NvwkxSySz_REpPq-4WZA27OwgbtyR3VcA type=text/
javascript/script
script src=../js/markermanager.js type=text/javascript/script
-5kb
script src=../js/principalMap.js type=text/javascript/
script-3kb
script src=../js/jquery.js type=text/javascript/script
-55kb
script src=../js/principalMenuAjax.js type=text/javascript/
script -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] 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] 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: 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 somehow first.
 
  thanks,
  luke
 
 
 
 
 



[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] 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: 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:

 ul
lia href=http://xxx.com; accesskey=3 id=home
 title=HomeHome/a/li
lia href=http://yyy.com; accesskey=4 id=why title=whyWhy/
 a/li
lia href=http://ppp.com; accesskey=5 id=try  title=tryWeb
 Design/a/li
 /ul

 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] 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: lt;span class='.modelname'gt;REPLACE MElt;/spangt;

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: 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:

 script type=text/javascript

 !--

 alert(document.domain);

 //--

 /script

 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:

 a id=idOfAnAnchor1 href=/index.phpHome/a // on otherpage.com a

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

 $(#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 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] [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] 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] 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] 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:

   script type=text/javascript

   !--

   alert(document.domain);

   //--

   /script

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:


a id=idOfAnAnchor1 href=/index.phpHome/a // on  
otherpage.com a


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

$(#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] [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: 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] 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: 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: 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 ul. 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: 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 titles 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:

tr class='adminRow3'
td colspan='3'a href='#' title=Full Title Here
class='tooltip'bAbridged Title/b/a/td
td align='center' style='background-color: #c00'-/td
td align='center' style='background-color: #c00'-/td
td align='center' style='background-color: #c00'-/td
td align='center' style='background-color: #c00'-/td

td align='center' style='background-color: #c00'-/td
td align='center' style='background-color: #c00'-/td
td align='center' style='background-color: #c00'-/td
td align='center' style='background-color: #c00'-/td
td align='center' style='background-color: #c00'-/td
td align='center' style='background-color: #c00'-/td
td align='center' style='background-color: #c00'-/td
td rowspan='2' align='center' style='padding: 1px; background-color:
#921ba9'Y/td
td rowspan='2' align='center' style='padding: 1px'/td

td rowspan='2' align='center' style='padding: 1px'/td
td rowspan='2' align='center' style='padding: 1px'/td
td rowspan='2' align='center' style='padding: 1px'/td
td rowspan='2' align='center' style='padding: 1px'/td
td rowspan='2' align='center' style='padding: 1px'/td
td rowspan='2' align='center' style='padding: 1px'/td
td rowspan='2' align='center' style='padding: 1px'/td
td rowspan='2' align='center' style='padding: 1px'/td
td rowspan='2' align='center' style='padding: 1px'/td
td rowspan='2' align='center' style='padding: 1px'/td
td rowspan='2' align='center' style='padding: 1px'/td
td rowspan='2' align='center' style='padding: 1px'/td
td rowspan='2' align='center'2/td
td rowspan='2' style='font-size: 8px'06:01, 05:55/td
td align='center'Y/td

td rowspan='2' align='center' style='background-color: #c00'-/td
td rowspan='2'a href='' title=Lorem ipsum dolor sit amet,
consectetur adipiscing elit. Integer purus. Duis posuere diam quis
ante. Aliquam erat volutpat. Suspendisse rutrum imperdiet ipsum.
class='tooltip'Lorem ipsum dolor sit.../a/td
td rowspan='2'/td
/tr


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] 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 (li
id=it1/li, li id=it2/li, li id=it3/li 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!


  1   2   >