[jQuery] Re: getting the value of list box in jquery

2009-07-01 Thread naz

i m w8ing for your reply

On Jul 1, 10:30 am, naz s.na...@gmail.com wrote:
 i have HTMl code like this
 select name=itemsToAdd id=right size=8 multiple=multiple
            /select

 and i m getting its values from database
 but when i write
 $('#right').val();
 it give sme null :(
 On Jul 1, 9:32 am, MorningZ morni...@gmail.com wrote:



  Got some HTML to show of the select box?

  if you have

  select id=right mulitple=multiple
       option value=1One/option
       option value=2 selected=selectedTwo/option
       option value=3 selected=selectedThree/option
  /select

  then

  $(#right).val()  will be an array that is 2,3

  if it's not like that, then (1) your selector doesn't work, (2)
  there's nothing actually selected

  On Jul 1, 12:18 am, naz s.na...@gmail.com wrote:

   yes i have multiple value in that list box and i want to have all
   values in the form of comma seperated list.
   you are telling me to write some thing like this?var cources_matrix=$
   ('#right').options.val();
   right is id of my listbox.i dont know how to do it and bcz of this my
   work is stoppped. plz tel me what to do

   On Jun 30, 3:12 pm, Charlie charlie...@gmail.com wrote:

do the options in select each have a value assigned? are you working 
with a number value and need to parsInt()? Need more info to help
can you put an example of this not working in jsbin? or post link
naz wrote:i have a list box and i want to get its values in jquery 
please tel me how can i do that i m writing $('#right').val(); but this 
is giving me null plpease tell me how can i do that i need help as soon 
as possible thx to all persons which reply to my questions- Hide quoted 
text -

  - Show quoted text -- Hide quoted text -

 - Show quoted text -


[jQuery] Re: getting the value of list box in jquery

2009-07-01 Thread naz

i m w8ing for your reply

On Jul 1, 9:32 am, MorningZ morni...@gmail.com wrote:
 Got some HTML to show of the select box?

 if you have

 select id=right mulitple=multiple
      option value=1One/option
      option value=2 selected=selectedTwo/option
      option value=3 selected=selectedThree/option
 /select

 then

 $(#right).val()  will be an array that is 2,3

 if it's not like that, then (1) your selector doesn't work, (2)
 there's nothing actually selected

 On Jul 1, 12:18 am, naz s.na...@gmail.com wrote:



  yes i have multiple value in that list box and i want to have all
  values in the form of comma seperated list.
  you are telling me to write some thing like this?var cources_matrix=$
  ('#right').options.val();
  right is id of my listbox.i dont know how to do it and bcz of this my
  work is stoppped. plz tel me what to do

  On Jun 30, 3:12 pm, Charlie charlie...@gmail.com wrote:

   do the options in select each have a value assigned? are you working with 
   a number value and need to parsInt()? Need more info to help
   can you put an example of this not working in jsbin? or post link
   naz wrote:i have a list box and i want to get its values in jquery please 
   tel me how can i do that i m writing $('#right').val(); but this is 
   giving me null plpease tell me how can i do that i need help as soon as 
   possible thx to all persons which reply to my questions- Hide quoted text 
   -

 - Show quoted text -


[jQuery] Re: ul.nav a VS. .nav li a

2009-07-01 Thread Ricardo

Yes, but in this tree:

ul class=nav
  lia href=#/a/li
/ul

both selectors will yield the same results, the point here is
performance.

@north the article is right. Sizzle processes the selector from right
to left, so explicit child relationships and simpler selectors will
make it faster. See for yourself (switch between versions under
Source on the left): http://jquery.nodnod.net/cases/474

cheers
ricardo

On Jun 30, 6:04 pm, Cesar Sanz the.email.tr...@gmail.com wrote:
 .nav li a  is very different to .nav li  a

 in the second statement (.nav li  a) only the anchors that are direct
 descendant of li elements will be chosen
 in the first statement (.nav li a ) every anchor will be picked, direct or
 indirect descendant

 - Original Message -
 From: brian bally.z...@gmail.com
 To: jquery-en@googlegroups.com
 Sent: Tuesday, June 30, 2009 11:45 AM
 Subject: [jQuery] Re: ul.nav a VS. .nav li  a

  I can't speak for Sizzle but, if you'll only ever have one nav
  element on a page, you're better off using an ID than a class.

  On Tue, Jun 30, 2009 at 8:03 AM, northollo...@web.de wrote:

  Hi,

  yesterday I read an article about jQuery performance. In one part the
  author talks about selectors and uses

  .nav li a

  as an example. He states that before jQuery 1.3., the selector

  ul.nav a

  would have been the best way to get all links in the list. In jQuery
  1.3., due to the inclusion of Sizzle,

  .nav li  a

  should be the best way. He doesn't mention any speed tests though,
  and only briefly explains that the reason for this is Sizzle's way of
  walking through selectors from right to left.

  Can anyone confirm this theory?

  Thanks!


[jQuery] Re: Howto detect DOM element from selected text

2009-07-01 Thread Massimo Lombardo

On Tue, Jun 30, 2009 at 12:31, Alexanderalexanderf...@gmail.com wrote:
 I am trying to detect the DOM element on a unkown web page  from the
 current selected text on that page.

 Which means: I select text on a web page and then I would like to get
 the dom element to which this text belongs.

This is not a jQuery-specific topic, it's pure JavaScript / DOM management.
You need to use the W3C DOM selection API / IE DOM selection API to do that.

In particular, you need to differentiate between the standard W3C
implementation and the non-standard IE implementation:

if (typeof window.getSelection === 'function') {
// W3C DOM selection API available :)
} else {
if (typeof window.selection === 'object') {
// IE selection API available :|
} else {
// No selection API available :(
}
}

Be sure to read:
https://developer.mozilla.org/en/DOM/Selection
http://msdn.microsoft.com/en-us/library/ms535869.aspx
-- 
Massimo Lombardo
Linux user #437712


[jQuery] Cluetip - From a function

2009-07-01 Thread DotnetShadow

Hi Karl,

I recently posted here: http://plugins.jquery.com/node/8405 about an
issue of calling cluetip from a function (see post for extra comment
information)

In the response you created a demo showing how this could be achieved:
http://plugins.learningjquery.com/cluetip/demo/lazyload.html

When I tried the demo I noticed if you scroll down with the mousewheel
then u hover over an element it keeps automatically scrolling down on
it's own and doesn't have the desired effect.

Has the demo got a problem? Can this be fixed?

Thanks once again appreciate the hard effort
Regards Dotnetshadow


[jQuery] Re: ul.nav a VS. .nav li a

2009-07-01 Thread olsch01

Thanks for the answers, guys.

I should have done what Ricardo did, and post a small code example.

Using an ID is (probably) always faster than using a class, since it
maps to the native JS method getElementById (even though there are
browsers which also support getElementsByClassName -
http://ejohn.org/blog/getelementsbyclassname-speed-comparison/). But
the point here was indeed to compare the performance of the two
mentioned selector statements.

So special thanks to Ricardo. :)

On 1 Jul., 08:56, Ricardo ricardob...@gmail.com wrote:
 Yes, but in this tree:

 ul class=nav
   lia href=#/a/li
 /ul

 both selectors will yield the same results, the point here is
 performance.

 @north the article is right. Sizzle processes the selector from right
 to left, so explicit child relationships and simpler selectors will
 make it faster. See for yourself (switch between versions under
 Source on the left):http://jquery.nodnod.net/cases/474

 cheers
 ricardo

 On Jun 30, 6:04 pm, Cesar Sanz the.email.tr...@gmail.com wrote:

  .nav li a  is very different to .nav li  a

  in the second statement (.nav li  a) only the anchors that are direct
  descendant of li elements will be chosen
  in the first statement (.nav li a ) every anchor will be picked, direct or
  indirect descendant

  - Original Message -
  From: brian bally.z...@gmail.com
  To: jquery-en@googlegroups.com
  Sent: Tuesday, June 30, 2009 11:45 AM
  Subject: [jQuery] Re: ul.nav a VS. .nav li  a

   I can't speak for Sizzle but, if you'll only ever have one nav
   element on a page, you're better off using an ID than a class.

   On Tue, Jun 30, 2009 at 8:03 AM, northollo...@web.de wrote:

   Hi,

   yesterday I read an article about jQuery performance. In one part the
   author talks about selectors and uses

   .nav li a

   as an example. He states that before jQuery 1.3., the selector

   ul.nav a

   would have been the best way to get all links in the list. In jQuery
   1.3., due to the inclusion of Sizzle,

   .nav li  a

   should be the best way. He doesn't mention any speed tests though,
   and only briefly explains that the reason for this is Sizzle's way of
   walking through selectors from right to left.

   Can anyone confirm this theory?

   Thanks!


[jQuery] Re: Border around fisheye images

2009-07-01 Thread Wolfram Rösler

Hi,

 .fisheyeItem img {  width: 90%; }

Works great and does just what I've been looking for. Thanks a lot!

Best regards
Wolfram Rösler


[jQuery] Re: Border around fisheye images

2009-07-01 Thread Wolfram Rösler

Hi,

 this is your code stating a width is 32, then you have img margin as much 
 as 10, losing 1/3 of space inside a
 no need for margin on img
 $('#Flags').html(HTML).Fisheye(
 {
  maxWidth: 48,
 items: 'a',
  itemsText: 'span',
 container: '.fisheyeContainter',
  itemWidth: 32,
  proximity: 32,
  halign : 'center'
 });

Sorry, I'm afraid I don't quite understand. Could you elaborate?


[jQuery] Div and Button display as active and open only on certain pages

2009-07-01 Thread Takaya213


Hi

I have a DIV overlay that I want to show as open only on certain pages but
not on others (it is on all pages). The button that is related to the DIV
must also display as on when the DIV overlay is open and in the off state
when it is closed.

This must happen on page load.

e.g. DIV open, button on.
DIV closed, button off.

I have the click show and activation working so all i need is it to display
as open and on, on certain pages and then on others closed and off.

An help would be greatly appreaciated.

Thanks
-- 
View this message in context: 
http://www.nabble.com/Div-and-Button-display-as-active-and-open-only-on-certain-pages-tp24286826s27240p24286826.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: find out if an element is a drop down list

2009-07-01 Thread cms4j

I just found something that helps me a lot, it's not just a jQuery
property, but a direct property of HTML-elements:

.tagName

So my above workarounds would work as follows.

if (self.tagName == 'IMG') { // --- image ---
// do something
}

if (self.tagName == 'SELECT') { // --- drop down list ---
// do something

}

So i am sure that i will find matching tag names for all the other
elements that have to be considered...

Best regards,
CMS4j


[jQuery] Re: getting the value of list box in jquery

2009-07-01 Thread Charlie






post a link to page you are working on, or make a test case and put it
in jsbin com.
Morning Z gave you reasons you would get null, so seeing all the code
(html and the rest of script you use for the select) will help resolve
this. Are you sure the option tags created in server code have
value attribute?

naz wrote:

  i m w8ing for your reply

On Jul 1, 10:30am, naz s.na...@gmail.com wrote:
  
  
i have HTMl code like this
select name="itemsToAdd" id="right" size="8" multiple="multiple"
 /select

and i m getting its values from database
but when i write
$('#right').val();
it give sme null :(
On Jul 1, 9:32am, MorningZ morni...@gmail.com wrote:





  Got some HTML to show of the select box?
  


  if you have
  


  select id="right" mulitple="multiple"
  option value="1"One/option
  option value="2" selected="selected"Two/option
  option value="3" selected="selected"Three/option
/select
  


  then
  


  $("#right").val() will be an array that is "2,3"
  


  if it's not like that, then (1) your selector doesn't work, (2)
there's nothing actually selected
  


  On Jul 1, 12:18am, naz s.na...@gmail.com wrote:
  


  
yes i have multiple value in that list box and i want to have all
values in the form of comma seperated list.
you are telling me to write some thing like this?var cources_matrix=$
('#right').options.val();
right is id of my listbox.i dont know how to do it and bcz of this my
work is stoppped. plz tel me what to do

  


  
On Jun 30, 3:12pm, Charlie charlie...@gmail.com wrote:

  


  

  do the options in select each have a value assigned? are you working with a number value and need to parsInt()? Need more info to help
can you put an example of this not working in jsbin? or post link
naz wrote:i have a list box and i want to get its values in jquery please tel me how can i do that i m writing $('#right').val(); but this is giving me null plpease tell me how can i do that i need help as soon as possible thx to all persons which reply to my questions- Hide quoted text -
  

  


  - Show quoted text -- Hide quoted text -
  

- Show quoted text -

  
  
  






[jQuery] Re: Div and Button display as active and open only on certain pages

2009-07-01 Thread Charlie





what are parameters to determine your "certain pages"? does this
require an involved solution like parsing url or would a simple
solution like adding class to body like "myOverlay" and use that as
selector in code to run overlay functions?

Takaya213 wrote:

  
Hi

I have a DIV overlay that I want to show as open only on certain pages but
not on others (it is on all pages). The button that is related to the DIV
must also display as on when the DIV overlay is open and in the off state
when it is closed.

This must happen on page load.

e.g. DIV open, button on.
DIV closed, button off.

I have the click show and activation working so all i need is it to display
as open and on, on certain pages and then on others closed and off.

An help would be greatly appreaciated.

Thanks
  






[jQuery] Re: simple JSON parse problem!!!

2009-07-01 Thread Shawn


As mentioned in another reply, theObject is an object.

So, building a string with

( + theObject + );

will not give you what you'd expect.  If that were to work at all you'd 
likely end up with a string of ([Object]) - not what you want.


If you really must do the eval(), then it should be something like

var json = eval( '{ key : value }' );

But, eval() is evil and should be avoided wherever possible.  Mostly 
because it is mis-used, introduces various issues, and is known to be an 
expensive call in terms of processing speeds.  It *is* the right tool in 
some cases though...


In your code, I'd recommend doing as MorningZ mentioned:

var theObject = { key: value};
alert(theObject.key);

HTH

Shawn

theozmanbo wrote:


Why won't this work??? Nothing pops up for the alert.

script type=text/javascript

var theObject = {key: value};
var JSON = eval ((+theObject+));
alert(JSON.key);

/script


[jQuery] Re: Border around fisheye images

2009-07-01 Thread Charlie





this was css related but sounds like you got it working in last post

Wolfram Rsler wrote:

  Hi,

  
  
this is your code stating a width is 32, then you have img margin as much as 10, losing 1/3 of space inside a
no need for margin on img
$('#Flags').html(HTML).Fisheye(
{
maxWidth: 48,
items: 'a',
itemsText: 'span',
container: '.fisheyeContainter',
itemWidth: 32,
proximity: 32,
halign : 'center'
});

  
  
Sorry, I'm afraid I don't quite understand. Could you elaborate?

  






[jQuery] Re: getting the value of list box in jquery

2009-07-01 Thread Shawn


First, this is a mailing list.  Not an IRC channel or Instant Messenger. 
 This means replies can take hours or even days sometimes.  Patience is 
the keyword here.  If you need help with an issue that urgently, try the 
##Javascript channel on IRC.  The message I am replying to is 
timestamped 12:56am.  If I kept normal hours, I would not have even seen 
your message for another few hours yet.


As for your question.  the .val() will return the current value of the 
form element.  A multi-select list *may* return all the selected 
elements, but that is not my experience in the few times I've tried this.


In the case of a multi-select list, I find it better to fall back to 
some old school techniques and remember that the selected property 
will be set to true on each of the selected options.  So, I do something 
like this:


var selectedArray = [];
$(#right option).attr(selected, true).each( function () {
  selectedArray.push(this.val());
});

alert(selectedArray); - should result in the comma delimited string you 
are looking for.  IF and ONLY if there are selected items.


The gurus here will tell you my approach is probably overly long, but 
it's worked for me.  Your mileage may vary.  Tweak it as needed.


Shawn

naz wrote:

i m w8ing for your reply

On Jul 1, 9:32 am, MorningZ morni...@gmail.com wrote:

Got some HTML to show of the select box?

if you have

select id=right mulitple=multiple
 option value=1One/option
 option value=2 selected=selectedTwo/option
 option value=3 selected=selectedThree/option
/select

then

$(#right).val()  will be an array that is 2,3

if it's not like that, then (1) your selector doesn't work, (2)
there's nothing actually selected

On Jul 1, 12:18 am, naz s.na...@gmail.com wrote:




yes i have multiple value in that list box and i want to have all
values in the form of comma seperated list.
you are telling me to write some thing like this?var cources_matrix=$
('#right').options.val();
right is id of my listbox.i dont know how to do it and bcz of this my
work is stoppped. plz tel me what to do
On Jun 30, 3:12 pm, Charlie charlie...@gmail.com wrote:

do the options in select each have a value assigned? are you working with a 
number value and need to parsInt()? Need more info to help
can you put an example of this not working in jsbin? or post link
naz wrote:i have a list box and i want to get its values in jquery please tel 
me how can i do that i m writing $('#right').val(); but this is giving me null 
plpease tell me how can i do that i need help as soon as possible thx to all 
persons which reply to my questions- Hide quoted text -

- Show quoted text -


[jQuery] SuperFish for Joomla - SlideUp Animation

2009-07-01 Thread Chris

Dear developers, dear community,

in order to complete my design, I'd like to kindly ask you if there's
a possibility to use JQuery's SlideUp animation within a horizontal
menu created by SuperFish.

I tried to modify the mod_superfishmenu.xml to be able to set
parameters within the animation - dropdown list, but i can't find
the type-definitions :(.

Is there a possibility to create a custom animation below in the
specific field?

Many thanks in advance and your great work,
Chris


[jQuery] jCarousel - xHTML-Errors

2009-07-01 Thread msr

Hi over there,
i integrated the script jCarousel ( http://sorgalla.com/jcarousel/ ),
so i there are 2 errors at sitevalidation.
The site ( http://www.pulverlack-matzen.de/de/oberflaechenveredelung.php
) is using XHTML 1.0 Strict.

The first one, where the carousel is loaded, can be easy transform:

no Valid!
ul id=mycarousel class=jcarousel-skin-ie7
!-- The content will be dynamically loaded in here --
/ul

Valid!
 ul id=mycarousel class=jcarousel-skin-ie7 
 li !-- The content will be dynamically loaded in here -- /li 
 /ul 

and for the CSS insert:

.jcarousel-skin-ie7 li {
list-style-type: none;
}

-

The other one javascript-specialy:

{
return ' img src= ' + item.url + ' width=50 height=50 alt=' +
item.title + ' title=' + item.title + ' /';
};

i can't help...sorry I'm not a programmer.

My best regards


[jQuery] reload an SWF object from jquery

2009-07-01 Thread pacodelucia

I am using Open PHp chart. It uses a flash object to display charts. I
would like to update this swf object via ajax.
I have a problem accessing the object using jquery selectors:
Here is the HTML code
object id=reportChart ...

//access via pure javascript
document.getElementById('reportChart').reload(charts/
genrate_chart.php); // this works :-)

//access via jquery
$(reportChart).reload(charts/genrate_chart.php) // does not work

Apparently $(reportChart) is not returning really an SWF object.
Anyone has an idea if this possible with jquery?

thanks


[jQuery] Need jQuery/Ajax/jsonp HELP

2009-07-01 Thread skywalk3r

Hi, I'm getting sick trying to solve this problem:

I have a web page A that loads another page B using an iframe (or an
object tag), the B page is an external page (it's not on my server)
and contains a form.

I want to be able to auto fill the form with pre-defined values. In
jquery i think it's impossible due to security reasons, somebody can
help me?!?!

I hope I explained the problem correctly, if you need more info just
tell me.
Thanks,


[jQuery] SuperFish for Joomla - SlideUp Animation

2009-07-01 Thread Chris

Dear developers, dear community,

in order to complete my design I would like to kindly ask you what I
have do, if i want to a set up a SlideUp effect for Superfish Menu,
using it on a Joomla! installation?

I tried to modify mod_superfishmenu.xml in order to be able, to select
a new option from Animation dropdown-list, but didn't know where to
set the correct params.

Is there a chance, to achieve my goal by setting up a custom
animation?

Many thanks in advance, as well as for your great work,
Chris


[jQuery] Re: Event for when a select is changed?

2009-07-01 Thread developm...@sdinternet.co.uk

If you have a single dropdown list with the id of 'theSelectsID' the
below code should store the selected item into the variable 'str'.
Hope that helps


$(#theSelectsID).change(function () {
  var str = ;
  str = $(#theSelectsID).val();
});


[jQuery] ajax post not sending header

2009-07-01 Thread hadaraz

Posting data from a form using this function:

$(function() {
$('#emailform').submit(function() {
$.ajax({
url: '/post/url/',
dataType: 'json',
data: $('#emailform').serialize(),
success: function(rdata) {
$('#emailformmessage').text(rdata.message).show
('slow');
}
});
});
return false;
});

the server doesn't detect an ajax call ('X-Requested-With' header is
not sent). I tried forcing it with beforeSubmit and also with
ajaxSetup,  but no go.
Any solutions to this problem?

hadaraz


[jQuery] Problem accessing external iframe form values

2009-07-01 Thread skywalk3r

Hi, I'm getting sick trying to solve this problem:

I have a web page A that loads another page B using an iframe (or an
object tag), the B page is an external page (it's not on my server)
and contains a form.

I want to be able to auto fill the form with pre-defined values. In
jquery i think it's impossible due to security reasons, somebody can
help me?!?!

I hope I explained the problem correctly, if you need more info just
tell me.
Thanks,


[jQuery] Setting Rowspan Of Dynamic Table

2009-07-01 Thread chuckalicious

I have a table which is dynamically created in html. I have pasted an
example below:

table
thead
tr
thTeam/th
thDesignation/th
thName/th
/tr
/thead
tr id=ADM
td class=teamADM/td
/tr
tr class=ADM
td class=desigPartner/td
td class=nameGus/td
/tr
tr class=ADM
td class=desigSolicitor/td
td class=nameMark/td
/tr
tr id=VB
td class=teamVB/td
/tr
tr class=VB
td class=desigPartner/td
td class=nameVincent/td
/trtr class=VB
td class=desigSolicitor/td
td class=nameFiona/td
/tr
/table

The idea is that a row will be given an ID, for example ADM and then
each row below that has a class of the same name, until a new row is
given a new ID, in this case, VB.

What I want to do is set the rowspan of each tr with an ID to the
number of rows below it.

So, I guess to put it in jQuery speak, I'd like to traverse the table,
setting the rowspan of any tr with an ID, to the number of rows below
it which have a class matching the ID.

Hope that makes sense!

Thanks



[jQuery] Looks like a bug in IE7 with replaceWith

2009-07-01 Thread Max Fedorov

Hi,

I have a following Jquery code, as you can see all it does when user
clicks an html link it shows a hidden div (I am using SlideToggle).

The problem is in changing plus icon on minus icon after we clicked on
a link, for example when div is hidden we should show plus, after we
clicked a link and shown a hidden div we are showing minus icon.
It perfectly works in Chrome and Firefox. But in IE7 I got a problem,
it changes plus on a minus only once, and then shows minus only. I am
not sure what modifications should I make to my code to get it working
in IE.

Thanks in advance, really appreciate any help.

//Hiding first level of main menu
$('a#mainmenu_anchor001').click( function(event) {

var minusORplus = $(img#imp_plus001).attr(src);

if ( minusORplus == 'img/plus.gif' ) {
$('img#imp_plus001').replaceWith('img 
src=img/minus.gif
id=imp_plus001 alt= border=0 align=top \/');

}

if ( minusORplus == 'img/minus.gif' ) {
$('img#imp_plus001').replaceWith('img 
src=img/plus.gif
id=imp_plus001 alt= border=0 align=top \/');

}
//Removing filter attribute
$('div#sub_menu_level001').slideToggle(fast, function() {
if(jQuery.browser.msie) {
this.style.removeAttribute('filter');
}
});

$('div#sub_menu_level001').css({'filter' : 
'alpha(opacity=100)'});
event.preventDefault();
});


[jQuery] reload an SWF object from jquery

2009-07-01 Thread pacodelucia

I am using Open PHP chart. It uses a flash object to display charts. I
would like to update this swf object via ajax.

I have a problem accessing the object using jquery selectors:
Here is the HTML code
object id=reportChart ...

//access via pure javascript
document.getElementById('reportChart').reload(charts/
genrate_chart.php); // this works :-)

//access via jquery
$(reportChart).reload(charts/genrate_chart.php) // does not work

Apparently $(reportChart) is not returning really an SWF object.
Anyone has an idea if this possible with jquery?

thanks





[jQuery] adding rule to selector syntax

2009-07-01 Thread introvert

Hello

I have a simple jquery selector:

$('[id^=total_item]')

I would like to add a rule so that the upper code would match all
elements that don't have 'locked' class (so that it wouldnt match
those with class='locked').

How should I add this rule to the selector?

Many thanks in advance!


[jQuery] Re: need a hand with it, show/hide stuff

2009-07-01 Thread Liam Potter


on the function that initiates the ajax call, insert the spinning gif image.

$(div).append('img src=spin.gif width=20 height=20 
alt=Loading... class=loading /');


and on the success callback on the ajax function, remove the image

$(div img.loading).remove();

How you add and remove the image is up to you, but this is the basic idea.

heohni wrote:

Hi,

I have a small newsletter script on my page, where I check via Ajax if
the user already exists, if the entered email is valid etcpp...
Success and failure messages are printed on the page via JAlerts plug-
in.

So fine it works pretty cool.

But there is still space for improvements :-)
The newsletter form (email text field and submit button) is inside a
div.

While I proof in the backgound all the mentioned stuff, I wanted that
the div is hiding and one of these loading circel gifs would appear.
Can you help me unterstanding what I have to do to get there?
Where do I get one of these loading gifs?

I am looking forward to find help in this group :-)

Kind regards from a very sunny Germany!
Bye
Heohni
  


[jQuery] Re: simple JSON parse problem!!!

2009-07-01 Thread theozmanbo


Okay - well here's what I'm really doing. I'm using an ajax upload plugin and
in the callback function, which returns a variable data, I need to parse
it into a JSO so I can use it. Right now it's just a string.

onComplete: function(file, data) {
$('#uploadPics').show();
$('#loader').hide();

// evaluate response
var JSON = eval((+data+));
 

if (JSON.messages) {
// display messags
displayAlert(JSON.messages[0], message);
} else {
displayAlert(JSON.errors[0], error);
}

}

NONE of the code gets run after the eval line. I try putting in alerts
before it and after it and only the ones before it show up. I looked at the
javascript console in chrome and there are no errors. The data that gets
returned looks like this: 

uploadPicture{errors:[This file was already uploaded]}

so when I eval it, it should give me an object and I can refer to
JSON.messages[0] and whatnot
-- 
View this message in context: 
http://www.nabble.com/simple-JSON-parse-problem%21%21%21-tp24283450s27240p24289302.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Cluetip - From a function

2009-07-01 Thread Karl Swedberg
Hi! So sorry I've been delinquent in following up with that. It is a  
very strange bug. It doesn't appear to occur unless you've already  
scrolled down quite a bit, right? Honestly, I'm just as confused as  
you are about what might be the source of the problem. There isn't  
anything in the plugin itself that shifts the scroll position, so I  
wonder if it's some weird combination of the dimensions/positioning  
stuff going on in the plugin and how some of that is calculated in  
jQuery core.


I put it on my todo list for later today when I get a chance. I'll try  
a few things and report back as soon as I can.


--Karl


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




On Jul 1, 2009, at 3:39 AM, DotnetShadow wrote:



Hi Karl,

I recently posted here: http://plugins.jquery.com/node/8405 about an
issue of calling cluetip from a function (see post for extra comment
information)

In the response you created a demo showing how this could be achieved:
http://plugins.learningjquery.com/cluetip/demo/lazyload.html

When I tried the demo I noticed if you scroll down with the mousewheel
then u hover over an element it keeps automatically scrolling down on
it's own and doesn't have the desired effect.

Has the demo got a problem? Can this be fixed?

Thanks once again appreciate the hard effort
Regards Dotnetshadow




[jQuery] Re: Div and Button display as active and open only on certain pages

2009-07-01 Thread Takaya213


The class solution would work fine.

As there is only 1 page that the overlay really needs to be open on and the
button active so a class function would be sufficient.


Charlie Tomlinson wrote:
 
 what are parameters to determine your certain pages? does this
 require an involved solution like parsing url or would a simple
 solution like adding class to body like myOverlay and use that as
 selector in code to run overlay functions? 
 
 Takaya213 wrote:
 
   
 Hi
 
 I have a DIV overlay that I want to show as open only on certain pages but
 not on others (it is on all pages). The button that is related to the DIV
 must also display as on when the DIV overlay is open and in the off state
 when it is closed.
 
 This must happen on page load.
 
 e.g. DIV open, button on.
 DIV closed, button off.
 
 I have the click show and activation working so all i need is it to
 display
 as open and on, on certain pages and then on others closed and off.
 
 An help would be greatly appreaciated.
 
 Thanks
   
 
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Div-and-Button-display-as-active-and-open-only-on-certain-pages-tp24286826s27240p24289383.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: SuperFish for Joomla - SlideUp Animation

2009-07-01 Thread Charlie





using the animation option you can get effects on the opening of sub
menus

example:
jQuery('ul.sf-menu').superfish({animation:{height: "show"},speed :
1000});// produces 1 second slide down effect, use opacity for fades,
margins for positions etc

to reverse for the slideUp there is no option in code for this as it is
set to hide(); 

you can however go into superfish.js and modify the function
hideSuperfishUl()
if it's the hide() you want to work with I have a modified script file
that might help



example;
Chris wrote:

  Dear developers, dear community,

in order to complete my design, I'd like to kindly ask you if there's
a possibility to use JQuery's SlideUp animation within a horizontal
menu created by SuperFish.

I tried to modify the mod_superfishmenu.xml to be able to set
parameters within the "animation" - dropdown list, but i can't find
the type-definitions :(.

Is there a possibility to create a custom animation below in the
specific field?

Many thanks in advance and your great work,
Chris

  






[jQuery] Re: simple JSON parse problem!!!

2009-07-01 Thread MorningZ

uploadPicture{errors:[This file was already uploaded]}
isn't valid JSON

and even
 var JSON = eval((+data+));
resulting in
(uploadPicture{errors:[This file was already uploaded]} )

isn't valid JSON... hence eval() and expecting it to act like an
object is never going to work

On Jul 1, 8:55 am, theozmanbo b.k.osbo...@hotmail.com wrote:
 Okay - well here's what I'm really doing. I'm using an ajax upload plugin and
 in the callback function, which returns a variable data, I need to parse
 it into a JSO so I can use it. Right now it's just a string.

                     onComplete: function(file, data) {
                         $('#uploadPics').show();
                         $('#loader').hide();

                         // evaluate response
                         var JSON = eval((+data+));

                         if (JSON.messages) {
                             // display messags
                             displayAlert(JSON.messages[0], message);
                         } else {
                             displayAlert(JSON.errors[0], error);
                         }

                     }

 NONE of the code gets run after the eval line. I try putting in alerts
 before it and after it and only the ones before it show up. I looked at the
 javascript console in chrome and there are no errors. The data that gets
 returned looks like this:

 uploadPicture{errors:[This file was already uploaded]}

 so when I eval it, it should give me an object and I can refer to
 JSON.messages[0] and whatnot
 --
 View this message in 
 context:http://www.nabble.com/simple-JSON-parse-problem%21%21%21-tp24283450s2...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: adding rule to selector syntax

2009-07-01 Thread Charlie





$('[id^=total_item]').not('.locked')

introvert wrote:

  Hello

I have a simple jquery selector:

$('[id^=total_item]')

I would like to add a rule so that the upper code would match all
elements that don't have 'locked' class (so that it wouldnt match
those with class='locked').

How should I add this rule to the selector?

Many thanks in advance!

  






[jQuery] jquery menu plugin browser test

2009-07-01 Thread Dave

http://labs.makotokw.com/s/jquery/menu

Are planning to use the above menu plugin but need to know how it
works in different browsers, most important IE6/7.

The plugin author says it works in:
Google Chrome 3 (Windows)
Firefox 3 (Windows/Mac)
Safari 4 (Mac)

I have tested it in these, where it works fine:
IE8(Windows)
Opera9.6(Windows)
Opera9.64(Windows)
Netscape9.0b3(Windows)

It doesn't work as it should in:
IE7(Windows) - in example 2 the submenus aren't show properly.


So if anyone have the possibility to test the plugin out in other
browsers please do and tell.

Also if it doesn't work in a certain browser, and you are a jquery
pro, maybe you could come up with a solution to make it work.

Thanks / Dave

http://labs.makotokw.com/s/jquery/menu


[jQuery] Re: simple JSON parse problem!!!

2009-07-01 Thread theozmanbo


Is it because of the uploadPicture part? Why isn't it valid? Sorry for all
these stupid questions.
-- 
View this message in context: 
http://www.nabble.com/simple-JSON-parse-problem%21%21%21-tp24283450s27240p24289615.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: need a hand with it, show/hide stuff

2009-07-01 Thread Charlie





online loading gif generator for your image, multiple styles , set your
own colors

http://www.ajaxload.info/

Liam Potter wrote:

on the function that initiates the ajax call, insert the spinning gif
image.
  
  
$("div").append('img src="" width="20" height="20"
alt="Loading..." class="loading" /');
  
  
and on the success callback on the ajax function, remove the image
  
  
$("div img.loading").remove();
  
  
How you add and remove the image is up to you, but this is the basic
idea.
  
  
heohni wrote:
  
  Hi,


I have a small newsletter script on my page, where I check via Ajax if

the user already exists, if the entered email is valid etcpp...

Success and failure messages are printed on the page via JAlerts plug-

in.


So fine it works pretty cool.


But there is still space for improvements :-)

The newsletter form (email text field and submit button) is inside a

div.


While I proof in the backgound all the mentioned stuff, I wanted that

the div is hiding and one of these loading circel gifs would appear.

Can you help me unterstanding what I have to do to get there?

Where do I get one of these loading gifs?


I am looking forward to find help in this group :-)


Kind regards from a very sunny Germany!

Bye

Heohni

 
  






[jQuery] Re: simple JSON parse problem!!!

2009-07-01 Thread MorningZ

Yes, it is because of that part

I'd suggest, despite the silly title, reading this blog post

http://blog.archive.jpsykes.com/67/how-to-explain-json-to-your-mum/index.html

On Jul 1, 9:16 am, theozmanbo b.k.osbo...@hotmail.com wrote:
 Is it because of the uploadPicture part? Why isn't it valid? Sorry for all
 these stupid questions.
 --
 View this message in 
 context:http://www.nabble.com/simple-JSON-parse-problem%21%21%21-tp24283450s2...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: reload an SWF object from jquery

2009-07-01 Thread Olaf Bosch


pacodelucia schrieb:


Apparently $(reportChart) is not returning really an SWF object.
Anyone has an idea if this possible with jquery?


This is not a correct Selectot for ID, try so:

//access via jquery
$(#reportChart).reload(charts/genrate_chart.php); // does not work

# for ID, . for CLASS

--
Viele Grüße, Olaf

---
olaf.bo...@t-online.de
http://olaf-bosch.de/
http://ohorn.info/
http://www.akitafreund.de/
---


[jQuery] Re: jQuery cycle plugin pager not working in FF and Safari

2009-07-01 Thread Mike Alsup

 I am having an odd error where the pager generates links but they
 don't change the slide in FF and Safari. The biggest surprise of all
 is that it actually works in IE.

 Here is the page I am referring to:http://76.12.208.222/


Try this:

#slideshowPage { position: relative: z-index: 100; }



[jQuery] checkboxTree Plugin

2009-07-01 Thread Matt W.

Hello Everybody,

I have rewritten and posted my jquery checkboxTree plugin that I
originally put out a year ago.  Tried to add features and options
people were asking for. Information can be found here:

http://floatmargin.com/2009/jquery-checkbox-tree-plugin-new-and-improved/

The github repository can be found here:

http://github.com/magearwhig/jquery-checkboxtree

-Matt W.


[jQuery] Re: reload an SWF object from jquery

2009-07-01 Thread pacodelucia

sorry for the type error. I meant really  that
$(#reportChart).reload(charts/genrate_chart.php);

does not work with the # selector.


On Jul 1, 3:51 pm, Olaf Bosch olaf.bo...@t-online.de wrote:
 pacodelucia schrieb:

  Apparently $(reportChart) is not returning really an SWF object.
  Anyone has an idea if this possible with jquery?

 This is not a correct Selectot for ID, try so:

 //access via jquery
 $(#reportChart).reload(charts/genrate_chart.php); // does not work

 # for ID, . for CLASS

 --
 Viele Grüße, Olaf

 ---
 olaf.bo...@t-online.dehttp://olaf-bosch.de/http://ohorn.info/http://www.akitafreund.de/
 ---


[jQuery] Re: GM_xmlhttpRequest sort data

2009-07-01 Thread Dman

Is there really no way? Anyone, please reply.

On Jun 26, 2:20 am, Dman dman...@gmail.com wrote:
 bump help please

 On Jun 25, 1:16 am, Dman dman...@gmail.com wrote:

  Hello,
  I am trying to get a html page using GM_xmlhttpRequest, store the html
  page code, in a var, and sort some data from it.
  GM_xmlhttpRequest({
  method: 'GET',
  url: 'http://www.myurl.com/test.html',
  onload: function(html)
  {
          html = html.responseText;
          $(html).(div[style*='font-size']).each(function(i){
          alert(i);
                                                                             
  });}

                             });
  html contains the correct code, but I can't sort the data like I could
  in $(document).(div[style*='font-size']). Any ideas?

  Thanks


[jQuery] Re: Help with some jquery basics

2009-07-01 Thread Lee Hanson

Thanks for the pointer :)!

-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On
Behalf Of Ricardo
Sent: 28 June 2009 20:27
To: jQuery (English)
Subject: [jQuery] Re: Help with some jquery basics


You're trying to set the 'opid' property of opid[0] when it doesn't
exist. You should either create an object in that position first:
opid[i] = {};
opid[i]['opid'] = $(this).attr(id).substr(9);

Or just save it directly to the index (like a simple array):
opid[i] = $(this).attr(id).substr(9);

A few recommendations:

use the array literal instead of new Array():
var opid = [];

Try to rely less on slicing your ID to match other elements, use
classes and tagnames instead:

$('#'+userid').each(function(){
   $(this).find(':checkbox')...
   $(this).find('input.pa')...
});

That way your code will be less prone to errors.

On Jun 26, 4:11 pm, Lee leejohnhan...@googlemail.com wrote:
 Can someone help me to get opid to be populated. The selectors all
 work correctly, and the code cycles the correct elements (tested this
 with an alert). Problem is I need to get the values I cycle in the
 each statement out and into the wrapping click function.

 Anyhelp would be appreciated. At the moment I get an opid[i] undefined
 error Thanks for any help you can offer

         var opid = new Array();

         $(a.btn.submit).click(function(){
 //              alert($(this).attr(id).substr(7));
                 var userid = $(this).attr(id).substr(4);

                 $(#+userid+ input:disabled).each(function(i){
                 //      var opid = new Array();
                        
if($(#chk_+$(this).attr(id).substr(9)).is(:checked))
                         {

                                 if
($(#pa_+$(this).attr(id).substr(9)).val() == '')
                                 {
                                         //display error,
                                         alert(If you have selected to
submit a PO you must give it a
 weighting);
                                         var error = 1;
                                 }
                                 else
                                 {
                                        
alert($(this).attr(id).substr(9)+ +$(this).val()+ +$(#pa_+
 $(this).attr(id).substr(9)).val())
                                         opid[i]['opid'] =
$(this).attr(id).substr(9);
                                         alert(opid[i]['opid']);
                                 }
                         }
                         else
                         {
 //                              alert(not selected);
                         }

                         i++
                 });
         });



[jQuery] Re: reload an SWF object from jquery

2009-07-01 Thread Liam Byrne

Is there an error / typo in the URL being requested ?

Should it be charts/gen_*e*_rate_chart.php ?

L


pacodelucia wrote:

sorry for the type error. I meant really  that
$(#reportChart).reload(charts/genrate_chart.php);

does not work with the # selector.


On Jul 1, 3:51 pm, Olaf Bosch olaf.bo...@t-online.de wrote:
  

pacodelucia schrieb:



Apparently $(reportChart) is not returning really an SWF object.
Anyone has an idea if this possible with jquery?
  

This is not a correct Selectot for ID, try so:

//access via jquery
$(#reportChart).reload(charts/genrate_chart.php); // does not work

# for ID, . for CLASS

--
Viele Grüße, Olaf

---
olaf.bo...@t-online.dehttp://olaf-bosch.de/http://ohorn.info/http://www.akitafreund.de/
---



No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.375 / Virus Database: 270.13.1/2212 - Release Date: 07/01/09 05:53:00







[jQuery] Re: reload an SWF object from jquery

2009-07-01 Thread pacodelucia

Hi
The code I have written in my post was some how pseuodo code. That is
the reason why it contains so much typing errors. Sorry for that

Here is the code directly copied from my js file:

  document.getElementById('reportChart').reload(charts/
pie_chart.php);//works
  $(#reportChart).reload(charts/
pie_chart.php);   // does not
work

I am using firefox 3.5

On Jul 1, 5:03 pm, Liam Byrne l...@onsight.ie wrote:
 Is there an error / typo in the URL being requested ?

 Should it be charts/gen_*e*_rate_chart.php ?

 L

 pacodelucia wrote:
  sorry for the type error. I meant really  that
  $(#reportChart).reload(charts/genrate_chart.php);

  does not work with the # selector.

  On Jul 1, 3:51 pm, Olaf Bosch olaf.bo...@t-online.de wrote:

  pacodelucia schrieb:

  Apparently $(reportChart) is not returning really an SWF object.
  Anyone has an idea if this possible with jquery?

  This is not a correct Selectot for ID, try so:

  //access via jquery
  $(#reportChart).reload(charts/genrate_chart.php); // does not work

  # for ID, . for CLASS

  --
  Viele Grüße, Olaf

  ---
  olaf.bo...@t-online.dehttp://olaf-bosch.de/http://ohorn.info/http://www.akitafreund.de/
  ---
  

  No virus found in this incoming message.
  Checked by AVG -www.avg.com
  Version: 8.5.375 / Virus Database: 270.13.1/2212 - Release Date: 07/01/09 
  05:53:00


[jQuery] Re: Need jQuery/Ajax/jsonp HELP

2009-07-01 Thread Karl Swedberg


On Jul 1, 2009, at 6:15 AM, skywalk3r wrote:



Hi, I'm getting sick trying to solve this problem:

I have a web page A that loads another page B using an iframe (or an
object tag), the B page is an external page (it's not on my server)
and contains a form.

I want to be able to auto fill the form with pre-defined values. In
jquery i think it's impossible due to security reasons, somebody can
help me?!?!

I hope I explained the problem correctly, if you need more info just
tell me.
Thanks,


I'm pretty sure you're right, but it's a *JavaScript* security  
restriction, not specifically jQuery.



--Karl


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



[jQuery] Re: Looks like a bug in IE7 with replaceWith

2009-07-01 Thread Charlie





there are a number of ways of doing this and make it look a lot cleaner

your problem could be that replaceWith replaces the whole element. Once
you *replace* img#imp_plus001 that ID isn't there anymore so next time
function runs it isn't found and no image change. 
http://docs.jquery.com/Manipulation/replaceWith

If you don't have firebug it would be well worth installing it and
looking at the html it produces after this replacement. None of the
original element is left

Not sure why you going to trouble of rewriting the html each time. You
already utlized attr("src") and easily could have switched that each
time for cleaner look but even that looks ugly in your if conditions.
One way to clean this up would be to toggle a class on each click,
something like

$('a#mainmenu_anchor001').click( function() {

 ///change image source , nothing will happen to selector that isn't
there
  $('img#imp_plus001 .minusORplus').attr("src", 'img/plus.gif');
  $('img#imp_plus001').not('minusORplus').attr("src",
'img/minus.gif');
  
  ///toggle class, removes if already there, adds if not
  $('img#imp_plus001').toggleClass('minusORplus'); 
   
}); 

To really shorten this up you could make images into sprite, give
#imp_plus001 an absolute position then use the class"minusORplus" to
shift the position of sprite in css. Adding and removing of
class"minusORplus" would then shift your image each time and all you
would need for script is 

$('a#mainmenu_anchor001').click( function() {
  $('img#imp_plus001').toggleClass('minusORplus'); 
   
}); 

css .minusORplus {left: ///minus width of image}







Max Fedorov wrote:

  Hi,

I have a following Jquery code, as you can see all it does when user
clicks an html link it shows a hidden div (I am using SlideToggle).

The problem is in changing plus icon on minus icon after we clicked on
a link, for example when div is hidden we should show plus, after we
clicked a link and shown a hidden div we are showing minus icon.
It perfectly works in Chrome and Firefox. But in IE7 I got a problem,
it changes plus on a minus only once, and then shows minus only. I am
not sure what modifications should I make to my code to get it working
in IE.

Thanks in advance, really appreciate any help.

//Hiding first level of main menu
$('a#mainmenu_anchor001').click( function(event) {

		var minusORplus = $("img#imp_plus001").attr("src");

if ( minusORplus == 'img/plus.gif' ) {
			$('img#imp_plus001').replaceWith('img src=""
id="imp_plus001" alt="" border="0" align="top" \/');

		}

		if ( minusORplus == 'img/minus.gif' ) {
			$('img#imp_plus001').replaceWith('img src=""
id="imp_plus001" alt="" border="0" align="top" \/');

		}
		//Removing filter attribute
		$('div#sub_menu_level001').slideToggle("fast", function() {
			if(jQuery.browser.msie) {
this.style.removeAttribute('filter');
		}
		});

		$('div#sub_menu_level001').css({'filter' : 'alpha(opacity=100)'});
		event.preventDefault();
});

  






[jQuery] jQuery CrossSilde in IE7

2009-07-01 Thread Johnny
Please forgive my inexperience, I am a designer trying to take over the
development!

These 2 sites I created using cross-slide and it doesn't seem to work in
IE7:

http://nirmada.bigrigmedia.com/portfolio/

and

http://horizonrvresorts.bigrigmedia.com/

Please help, THANK YOU!


[jQuery] Re: Problem with double submit of and form

2009-07-01 Thread jogep

i try it know with this code, but the problem with double submit of
the form still exists.
I read that I can have so many $(document).ready(function () { }); I
need.

a href=# id=testlinkShow Test/a
div id=tpanlegen style=width: 100%; display: none;
form id=teilprojektcreate action=/test.action method=post
select name=test id=test class=textfeld style=width:
100%;
option value=1950Test 1/option
option value=2000Test 2/option
/select
input id=tpcsubmit value=Submit type=submit
$(document).ready(function () {
$('#tpcsubmit').click(function(e) {
$('#teilprojektcreate').ajaxSubmit({
beforeSubmit:  function() {
$('#indicator').show();
},
success:   function() {
$('#indicator').hide();
$(#col2_content).effect(slide,{  },2000);
},
timeout:   3000,
target:'#col2_content'

});
return false;
});
});
/script
/form
/div
script type=text/javascript
script type=text/javascript
$(document).ready(function () {
$('#testlink').bind(
'click',
function(e){
   $(#tpanlegen).effect(slide,{  },2000
  );
});
});
/script

/script
Best Regards
Johannes Geppert

-
web:http://www.jgeppert.com
twitter:http://twitter.com/jogep


[jQuery] Re: checkboxTree Plugin

2009-07-01 Thread Cesar Sanz


Good to know that there is a plugin for this..!!


- Original Message - 
From: Matt W. propel...@gmail.com

To: jQuery (English) jquery-en@googlegroups.com
Sent: Wednesday, July 01, 2009 8:30 AM
Subject: [jQuery] checkboxTree Plugin




Hello Everybody,

I have rewritten and posted my jquery checkboxTree plugin that I
originally put out a year ago.  Tried to add features and options
people were asking for. Information can be found here:

http://floatmargin.com/2009/jquery-checkbox-tree-plugin-new-and-improved/

The github repository can be found here:

http://github.com/magearwhig/jquery-checkboxtree

-Matt W.


[jQuery] Re: check/uncheck all checkboxes with specific id

2009-07-01 Thread Cesar Sanz
Hi,

Charlie solution is very elegant

$(input[id^='chkEvent']).attr(checked,checked);

But I agree that you must use a class in your markup, so it it's the easier way

regards
  - Original Message - 
  From: Charlie 
  To: jquery-en@googlegroups.com 
  Sent: Tuesday, June 30, 2009 1:34 PM
  Subject: [jQuery] Re: check/uncheck all checkboxes with specific id


  definitely defer to experience. Question, have seen you mention attr() is 
broken,don't use it. I try to learn and absorb as much as possible from here

  Is it the performance of attr() or reliablity problem?

  Matt Kruse wrote: 
On Jun 30, 12:24 pm, evanbu...@gmail.com evanbu...@gmail.com
wrote:
  $(':checkbox.chkEvent').each(function() {
var el = $(this);
el.attr('checked', el.is(':checked') ? '' :
'checked');
  })

Avoid attr(), and try to avoid fitting every problem into a jQuery
solution...

Try this simple code:

$(':checkbox.chkEvent').each(function() {
  this.checked = !this.checked;
}

I also keep my run plugin handy for simple things like this:

// A General run function to simplify coding
$.fn.run = function(fn) {
if (typeof fn=='string') { fn = new Function(fn); }
this.each(fn);
}

Then:

$(':checkbox.chkEvent').run(this.checked = !this.checked);

Whether that's actually more efficient to write depends on the
situation ;)

Matt Kruse

  


[jQuery] Re: reload an SWF object from jquery

2009-07-01 Thread Liam Byrne


Any chance that there are 2 items with id / name reportChart ?

L

pacodelucia wrote:

Hi
The code I have written in my post was some how pseuodo code. That is
the reason why it contains so much typing errors. Sorry for that

Here is the code directly copied from my js file:

  document.getElementById('reportChart').reload(charts/
pie_chart.php);   //works
  $(#reportChart).reload(charts/
pie_chart.php);   // does not
work

I am using firefox 3.5

On Jul 1, 5:03 pm, Liam Byrne l...@onsight.ie wrote:
  

Is there an error / typo in the URL being requested ?

Should it be charts/gen_*e*_rate_chart.php ?

L

pacodelucia wrote:


sorry for the type error. I meant really  that
$(#reportChart).reload(charts/genrate_chart.php);
  
does not work with the # selector.
  
On Jul 1, 3:51 pm, Olaf Bosch olaf.bo...@t-online.de wrote:
  

pacodelucia schrieb:


Apparently $(reportChart) is not returning really an SWF object.
Anyone has an idea if this possible with jquery?
  

This is not a correct Selectot for ID, try so:

//access via jquery

$(#reportChart).reload(charts/genrate_chart.php); // does not work

# for ID, . for CLASS

--

Viele Grüße, Olaf

---

olaf.bo...@t-online.dehttp://olaf-bosch.de/http://ohorn.info/http://www.akitafreund.de/
---


No virus found in this incoming message.

Checked by AVG -www.avg.com
Version: 8.5.375 / Virus Database: 270.13.1/2212 - Release Date: 07/01/09 
05:53:00



No virus found in this incoming message.
Checked by AVG - www.avg.com 
Version: 8.5.375 / Virus Database: 270.13.1/2212 - Release Date: 07/01/09 05:53:00







[jQuery] just trying to get more efficient with jQuery coding

2009-07-01 Thread Adam

This is a FAQ page I built with custom jquery function that toggles
the answers open/closed on click of a question, and Im just wondering
if anyone has a suggestion to make the code leaner and meaner:

http://dfrecruiting.com/faqs

The code:

$(.entry h4).click(function() {

if ( $(this).hasClass(active) ) {
$(this).removeClass(active).next().animate({ opacity: 0 },
200).slideToggle(500).removeClass(active);
} else {
$(this).addClass(active).next().addClass
(active).slideToggle(500).animate({ opacity: 1 }, 1000).dequeue
().siblings('h4.active').not(this).removeClass('active').next().animate
({ opacity: 0 }, 200).slideToggle(500).dequeue().removeClass
(active);
}

return false;
});

Thanks!!


[jQuery] Re: GM_xmlhttpRequest sort data

2009-07-01 Thread Charlie





would loading it into a hidden div, pulling what you need from it then
empty the div help?

Dman wrote:

  Is there really no way? Anyone, please reply.

On Jun 26, 2:20am, Dman dman...@gmail.com wrote:
  
  
bump help please

On Jun 25, 1:16am, Dman dman...@gmail.com wrote:



  Hello,
I am trying to get a html page using GM_xmlhttpRequest, store the html
page code, in a var, and sort some data from it.
GM_xmlhttpRequest({
method: 'GET',
url: 'http://www.myurl.com/test.html',
onload: function(html)
{
html = html.responseText;
$(html).("div[style*='font-size']").each(function(i){
alert(i);
 });}
  


   });
html contains the correct code, but I can't sort the data like I could
in $(document).("div[style*='font-size']"). Any ideas?
  


  Thanks
  

  
  
  






[jQuery] Re: simple JSON parse problem!!!

2009-07-01 Thread Ricardo

that is called jsonp. You need to define a function named
uploadPicture that will get called when the response arrives. jQuery
handles that for you if you use the proper method (assuming the
callback name can be set in the request):

$.getJSON('uploadpicture.php?callback=?, {some:'data'}, function(data)
{
 alert(data.errors[0]);
});

http://docs.jquery.com/Ajax/jQuery.getJSON#urldatacallback

On Jul 1, 10:16 am, theozmanbo b.k.osbo...@hotmail.com wrote:
 Is it because of the uploadPicture part? Why isn't it valid? Sorry for all
 these stupid questions.
 --
 View this message in 
 context:http://www.nabble.com/simple-JSON-parse-problem%21%21%21-tp24283450s2...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Join several JS scripts into one big file to lower http request

2009-07-01 Thread AndyPSV

I've got on site a huge amount of js, 'single' script. What I want to
do is to pack them into one file.
Could somebody assist me in doing this? Tried before but something
crashed...
Here is package: http://rcdrugs.com/_done/js.zip

I've posted this question on several boards:
- 
http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_24498924.html
- http://forum.webhelp.pl/viewtopic.php?p=906036#906036
- http://forum.php.pl/Polaczyc_wszystkie_pliki_js_w_JEDEN_wielki_t124138.html

nobody couldn't / didn't know how to help. Thanks for help.


[jQuery] ui.jquery.com down?

2009-07-01 Thread Vorge

Is the UI section of the site down? I have a few websites that link to
it and they're all taking forever to load, seemingly hanging when
waiting for ui.jquery.com...

This is the first time I've seen this and am wondering if anyone else
is aware of the problem.

Thanks,

Vorge


[jQuery] [Validate] Radio buttons

2009-07-01 Thread Purno

Is it possible that, say i have two radio buttons, if radio one is
chosen validate gives a message(error) and if radio two is chosen the
form passes validation?


[jQuery] Re: Problem accessing external iframe form values

2009-07-01 Thread James

I believe that it's not possible, in general, as you said due to
security reasons.

On Jul 1, 12:17 am, skywalk3r luca.martinc...@gmail.com wrote:
 Hi, I'm getting sick trying to solve this problem:

 I have a web page A that loads another page B using an iframe (or an
 object tag), the B page is an external page (it's not on my server)
 and contains a form.

 I want to be able to auto fill the form with pre-defined values. In
 jquery i think it's impossible due to security reasons, somebody can
 help me?!?!

 I hope I explained the problem correctly, if you need more info just
 tell me.
 Thanks,


[jQuery] Re: ajax post not sending header

2009-07-01 Thread James

Have you tried using Firebug for Firefox to examine the headers of the
AJAX request to be sure that it wasn't sent? Check that first.

You might be reading the headers incorrectly on the PHP side. Are you
using: $_SERVER['HTTP_X_REQUESTED_WITH']
The beginning HTTP_ part is the tricky part. Make sure you have that.

On Jun 30, 9:52 pm, hadaraz hada...@gmail.com wrote:
 Posting data from a form using this function:

 $(function() {
     $('#emailform').submit(function() {
         $.ajax({
             url: '/post/url/',
             dataType: 'json',
             data: $('#emailform').serialize(),
             success: function(rdata) {
                 $('#emailformmessage').text(rdata.message).show
 ('slow');
             }
         });
     });
     return false;

 });

 the server doesn't detect an ajax call ('X-Requested-With' header is
 not sent). I tried forcing it with beforeSubmit and also with
 ajaxSetup,  but no go.
 Any solutions to this problem?

 hadaraz


[jQuery] Re: Event for when a select is changed?

2009-07-01 Thread James

Just simplify it like:

$(#theSelectsID).change(function () {
var str = $(this).val();
//or -- var str = this.value;
});

On Jun 30, 11:51 pm, developm...@sdinternet.co.uk
p...@sdinternet.co.uk wrote:
 If you have a single dropdown list with the id of 'theSelectsID' the
 below code should store the selected item into the variable 'str'.
 Hope that helps

     $(#theSelectsID).change(function () {
           var str = ;
           str = $(#theSelectsID).val();
         });


[jQuery] Re: Problem accessing external iframe form values

2009-07-01 Thread Michael Lawson

It isn't possible.  iframes abide  by the same origin policy just as ajax
requests do.

cheers

Michael Lawson
Development Lead, Global Solutions, ibm.com
Phone:  1-276-206-8393
E-mail:  mjlaw...@us.ibm.com

'Examine my teachings critically, as a gold assayer would test gold. If you
find they make sense, conform to your experience, and don't harm yourself
or others, only then should you accept them.'


   
  From:   James james.gp@gmail.com   
   
  To: jQuery (English) jquery-en@googlegroups.com  
   
  Date:   07/01/2009 02:18 PM  
   
  Subject:[jQuery] Re: Problem accessing external iframe form values
   






I believe that it's not possible, in general, as you said due to
security reasons.

On Jul 1, 12:17 am, skywalk3r luca.martinc...@gmail.com wrote:
 Hi, I'm getting sick trying to solve this problem:

 I have a web page A that loads another page B using an iframe (or an
 object tag), the B page is an external page (it's not on my server)
 and contains a form.

 I want to be able to auto fill the form with pre-defined values. In
 jquery i think it's impossible due to security reasons, somebody can
 help me?!?!

 I hope I explained the problem correctly, if you need more info just
 tell me.
 Thanks,

inline: graycol.gifinline: ecblank.gif

[jQuery] jquery prompt replacement

2009-07-01 Thread pantagruel

Hi,

I've seen a number of jquery prompt replacements that allow you to
have a customizable prompt of some sort but none that allow you to
actually use it the way a prompt is normally used - that would say
var x = prompt(please enter your value);
alert(x);

Is there anything like that?

If not - I have a situation like this where I have functions that take
a function as a parameter - for example:

newProc(Command('info'));

Command returns a value based on, in some cases at least, the value a
user inputs in response to a prompt.

Does anyone have an example of how you would do that using any of the
prompt replacing libraries?



[jQuery] Re: simple JSON parse problem!!!

2009-07-01 Thread Rick Faircloth
So...am I to understand that jsonp provides a method by which an image can
be uploaded after submission of a form as part of a callback function?  I've
done
some research on jsonp, but still am not clear about it.

Rick

On Wed, Jul 1, 2009 at 1:03 PM, Ricardo ricardob...@gmail.com wrote:


 that is called jsonp. You need to define a function named
 uploadPicture that will get called when the response arrives. jQuery
 handles that for you if you use the proper method (assuming the
 callback name can be set in the request):

 $.getJSON('uploadpicture.php?callback=?, {some:'data'}, function(data)
 {
 alert(data.errors[0]);
 });

 http://docs.jquery.com/Ajax/jQuery.getJSON#urldatacallback

 On Jul 1, 10:16 am, theozmanbo b.k.osbo...@hotmail.com wrote:
  Is it because of the uploadPicture part? Why isn't it valid? Sorry for
 all
  these stupid questions.
  --
  View this message in context:
 http://www.nabble.com/simple-JSON-parse-problem%21%21%21-tp24283450s2...
  Sent from the jQuery General Discussion mailing list archive at
 Nabble.com.




-- 
--
Ninety percent of the politicians give the other ten percent a bad
reputation.  Henry Kissinger


[jQuery] Re: Eval issue ?

2009-07-01 Thread James

How about changing the technique a bit like:

for (var i=0; i  TAGS.length; i++) {
TAGS[i].data('count', i)
.click(function(event) {
alert( B[$(this).data('count')] );
});
}

Basically it stores the value of 'i' with the element using .data(),
and you can retrieve it again later when the click is executed.

This might not work if the index of the element in TAGS changed. If $
(.class) is index-0, make sure no other element will take it's
index, otherwise you'll have to update the stored value using .data().

On Jun 30, 3:30 pm, Olivier the.fuz...@gmail.com wrote:
 Hi,

 I'm trying to to something in javascript but I don't know how to do
 that.

 Basicly, I have something like this :
 TAGS = new Array(
         $(.class),
         $(#foo)
 );

 B = new Array(
         hey,
         oh
 );

 for (var i=0; i  TAGS.length; i++) {
         TAGS[i].click( function(event) {
                 alert(B[i]);
         });

 }

 I would like to alert hey when the user clicks on a tag of class
 class and to alert oh when he clicks on a tag of id foo.
 This doesn't work because B[i] takes the i when the callback
 function is called by jquery (when a click occurs). So it always takes
 B[2] in this case (which doesn't exist).
 How could I effectively alert B[0] for .class tags and B[1] for #foo
 tags ?

 Thanks,
 Olivier


[jQuery] Re: Problem accessing external iframe form values

2009-07-01 Thread skywalk3r

Ok, I supposed it!

Thanks anyway guys!

On Jul 1, 8:28 pm, Michael Lawson mjlaw...@us.ibm.com wrote:
 It isn't possible.  iframes abide  by the same origin policy just as ajax
 requests do.

 cheers

 Michael Lawson
 Development Lead, Global Solutions, ibm.com
 Phone:  1-276-206-8393
 E-mail:  mjlaw...@us.ibm.com

 'Examine my teachings critically, as a gold assayer would test gold. If you
 find they make sense, conform to your experience, and don't harm yourself
 or others, only then should you accept them.'

   From:       James james.gp@gmail.com                                  
                                                   

   To:         jQuery (English) jquery-en@googlegroups.com                 
                                                    

   Date:       07/01/2009 02:18 PM                                             
                                                    

   Subject:    [jQuery] Re: Problem accessing external iframe form values      
                                                   

 I believe that it's not possible, in general, as you said due to
 security reasons.

 On Jul 1, 12:17 am, skywalk3r luca.martinc...@gmail.com wrote:

  Hi, I'm getting sick trying to solve this problem:

  I have a web page A that loads another page B using an iframe (or an
  object tag), the B page is an external page (it's not on my server)
  and contains a form.

  I want to be able to auto fill the form with pre-defined values. In
  jquery i think it's impossible due to security reasons, somebody can
  help me?!?!

  I hope I explained the problem correctly, if you need more info just
  tell me.
  Thanks,



  graycol.gif
  1KViewDownload

  ecblank.gif
  1KViewDownload


[jQuery] Form Plugin Question

2009-07-01 Thread icfantv

As jQuery has both a serialize() and serializeArray() method for
serializing an HTML form to a String and JSON respectively, why does
the Form Plugin at malsup.com include yet another serialize() method
in the form of formSerialize()?  I understand the fieldSerialize()
method, but not the former.

My concern is that the file is 25K uncompressed and 8K compressed
which, to me, seems like a very heavy footprint even if the cost/
benefit is worth the size.  If removing a potentially unnecessary
method will decrease the compressed size, then to me, it's worth it.

Thoughts?  Flames?


[jQuery] Re: ajax post not sending header

2009-07-01 Thread hadaraz

I have used firebug, and there is no sign of AJAX request.

On the server side I use python, and yes, I'm checking for
'HTTP_X_REQUESTED_WITH'. Maybe there is a problem with the jquery
1.3.2 (which is what I use, linked from google ajax libs)?


On Jul 1, 9:21 pm, James james.gp@gmail.com wrote:
 Have you tried using Firebug for Firefox to examine the headers of the
 AJAX request to be sure that it wasn't sent? Check that first.

 You might be reading the headers incorrectly on the PHP side. Are you
 using: $_SERVER['HTTP_X_REQUESTED_WITH']
 The beginning HTTP_ part is the tricky part. Make sure you have that.

 On Jun 30, 9:52 pm, hadaraz hada...@gmail.com wrote:

  Posting data from a form using this function:

  $(function() {
      $('#emailform').submit(function() {
          $.ajax({
              url: '/post/url/',
              dataType: 'json',
              data: $('#emailform').serialize(),
              success: function(rdata) {
                  $('#emailformmessage').text(rdata.message).show
  ('slow');
              }
          });
      });
      return false;

  });

  the server doesn't detect an ajax call ('X-Requested-With' header is
  not sent). I tried forcing it with beforeSubmit and also with
  ajaxSetup,  but no go.
  Any solutions to this problem?

  hadaraz


[jQuery] Using live() within context of a node

2009-07-01 Thread Hector Virgen
Hello,
I am building a plugin and need to use live() to capture click events on
elements with a configurable class name, but only if they are children of
specific node (that may or may not have an ID).

For example, I want to create several containers (divs) on the page, and if
any element with a class name of close within the container is clicked, it
should remove the container.

I tried this using live():

var createContainer = function()
{
var container = $('div/div');
container.find('.close').live(function()
{
container.remove();
});
container.append('span class=close[close]/span');
$(document.body).append(container);
};

The code works if there's only one container on the page. But if I create 2
or more containers, clicking the [close] on any of them will close all of
them. It seems that live() is firing for any element on the page that
contains a close class, but I only need it to fire in the container that was
clicked.

I cannot use bind() or click() because the containers can be modified after
they are created and all elements that contain the class close should
close the container.

Any workarounds for this? Do I have to write my own event delegation code to
get this to work? Thanks for the help!

--
Hector


[jQuery] Re: simple JSON parse problem!!!

2009-07-01 Thread Shawn


theozmanbo wrote:

uploadPicture{errors:[This file was already uploaded]}



That is not valid JSON.

If you were returning

{errors:[This file was already uploaded]}

You would have more luck.  In fact I'm willing to bet you'd be able to 
do something like  alert(data.errors[0]) - because the data variable 
would likely already be translated to a JS object, rather than a string. 
 But, I don't know the details of the ajax upload plugin you are 
using either, so I could be wrong.


As mentioned in another reply.  You should probably go study up on JSON 
more.  It seems your core issues are within your current understanding 
of JSON.  You're not far off, but not quite there. :)


Shawn


[jQuery] Re: ajax post not sending header

2009-07-01 Thread James

Hmm...

What happens if you add:
type: POST

in your AJAX options?

On Jul 1, 10:36 am, hadaraz hada...@gmail.com wrote:
 I have used firebug, and there is no sign of AJAX request.

 On the server side I use python, and yes, I'm checking for
 'HTTP_X_REQUESTED_WITH'. Maybe there is a problem with the jquery
 1.3.2 (which is what I use, linked from google ajax libs)?

 On Jul 1, 9:21 pm, James james.gp@gmail.com wrote:

  Have you tried using Firebug for Firefox to examine the headers of the
  AJAX request to be sure that it wasn't sent? Check that first.

  You might be reading the headers incorrectly on the PHP side. Are you
  using: $_SERVER['HTTP_X_REQUESTED_WITH']
  The beginning HTTP_ part is the tricky part. Make sure you have that.

  On Jun 30, 9:52 pm, hadaraz hada...@gmail.com wrote:

   Posting data from a form using this function:

   $(function() {
       $('#emailform').submit(function() {
           $.ajax({
               url: '/post/url/',
               dataType: 'json',
               data: $('#emailform').serialize(),
               success: function(rdata) {
                   $('#emailformmessage').text(rdata.message).show
   ('slow');
               }
           });
       });
       return false;

   });

   the server doesn't detect an ajax call ('X-Requested-With' header is
   not sent). I tried forcing it with beforeSubmit and also with
   ajaxSetup,  but no go.
   Any solutions to this problem?

   hadaraz


[jQuery] Plugins and context

2009-07-01 Thread Hector Virgen
Is there a way for plugins to know the context of the jQuery object?
According to the jQuery Core docs, I can create a jQuery collection by
passing in a selector and a context, and I should be able to retrieve the
context from the object's context property, but it's not working within
plugins.

For example, here's a simple plugin and some code to run it:

$.fn.myPlugin = function()
{
console.log('selector:', this.selector); // this works
console.log('context:', this.context); // this doesn't work
};

var foo = $('#foo');
$('p', foo).myPlugin();

Is the context property only available outside the scope of plugins?

--
Hector


[jQuery] Re: Event for when a select is changed?

2009-07-01 Thread Hector Virgen
You might want to pull the variable declaration out of the anonymous
function so that it can be used later (outside the function):
var str = ;
$(#theSelectsID).change(function () {
str = $(this).val();
});

// later
alert(str);

--
Hector


On Wed, Jul 1, 2009 at 11:25 AM, James james.gp@gmail.com wrote:


 Just simplify it like:

 $(#theSelectsID).change(function () {
 var str = $(this).val();
 //or -- var str = this.value;
 });

 On Jun 30, 11:51 pm, developm...@sdinternet.co.uk
 p...@sdinternet.co.uk wrote:
  If you have a single dropdown list with the id of 'theSelectsID' the
  below code should store the selected item into the variable 'str'.
  Hope that helps
 
  $(#theSelectsID).change(function () {
var str = ;
str = $(#theSelectsID).val();
  });



[jQuery] Re: HELP: how to browser cache json request?

2009-07-01 Thread wgordonw1

bump. is it possible to cache something using the ajax call and only
download it using last-modified headers? or is that why nobody ever
responded?


[jQuery] Re: HELP: how to browser cache json request?

2009-07-01 Thread James

If your requests are returning 304 Not Modified, then it means it's
using the cached version because the one on the server is not
different from the one in the cache.

On Jul 1, 1:07 pm, wgordonw1 wgordo...@gmail.com wrote:
 bump. is it possible to cache something using the ajax call and only
 download it using last-modified headers? or is that why nobody ever
 responded?


[jQuery] Re: jquery prompt replacement

2009-07-01 Thread Michael Geary

There are no plugins like that because you can't do that in JavaScript. You
can't block execution of JavaScript code until some event (such as closing
your lightbox-style confirmation) occurs.

The best you can do is to call another function when the event happens. This
is why every asynchronous JavaScript API uses callback functions.

I haven't looked at any of the plugins you're talking about, but I'm sure
they all work that way. (Or perhaps they fire a custom event, but that's
really the same thing as calling a callback function.)

So instead of code like your example:

var value = prompt( 'enter value' );
alert( value );

You'd expect to use a pattern like this:

prompt( 'enter value', function( value ) {
alert( value );
});

-Mike

 From: pantagruel
 
 Hi,
 
 I've seen a number of jquery prompt replacements that allow 
 you to have a customizable prompt of some sort but none that 
 allow you to actually use it the way a prompt is normally 
 used - that would say var x = prompt(please enter your 
 value); alert(x);
 
 Is there anything like that?
 
 If not - I have a situation like this where I have functions 
 that take a function as a parameter - for example:
 
 newProc(Command('info'));
 
 Command returns a value based on, in some cases at least, the 
 value a user inputs in response to a prompt.
 
 Does anyone have an example of how you would do that using 
 any of the prompt replacing libraries?
 



[jQuery] jQuery Animation Loading

2009-07-01 Thread Valor

I think my problem would be better clarified if you guys were able to
view the live site. The link is http://nxiel.com/ and the password is
guest1234 (without quotations).

Now if you browse through the pages you will see how the animation
slides to the left and back to right with updated content.

My problem arises when I use this to access the portfolio section. The
portfolio section doesn't seem to work. If you head over to
http://nxiel.com/Portfolio/ , you can see how the section should
render and how a person can use the scroll feature, however, when the
content is loaded using jQuery, it doesn't function properly.

Additionally another problem i'm realizing is the delay of the
content. For example, if you are on the contact page and then click on
downloads, the content will slide left and then slide back right when
the content is loaded. However the problem i'm seeing is the delay in
the content loading meaning that the animation will finish and the
content will then load. A second or two delay. I've tested it in
multiple browsers and seeing the same problem. Surprisingly the only
browser i'm not seeing this in is IE6.

Anyways any help in this matter is appreciated, especially with the
scroll of portfolio.

Thanks!


[jQuery] Target specific ul list items for css

2009-07-01 Thread Wacko Jacko

How would I target (with jQuery or normal javascript) the 5th and 6th
li in an unsorted list for styling?  I need to change the css for only
2 items in a list.

Thanks in advance for your help.


[jQuery] Re: Target specific ul list items for css

2009-07-01 Thread James

http://docs.jquery.com/Selectors/eq

On Jul 1, 3:10 pm, Wacko Jacko jackson.be...@gmail.com wrote:
 How would I target (with jQuery or normal javascript) the 5th and 6th
 li in an unsorted list for styling?  I need to change the css for only
 2 items in a list.

 Thanks in advance for your help.


[jQuery] copy and paste event

2009-07-01 Thread jonathan

I have a text input box, is there  a way to detect a copy and paste
event into the box?  keyup, focus doesn't really do it.
thanks


[jQuery] Re: Target specific ul list items for css

2009-07-01 Thread Paul Witschger

http://docs.jquery.com/Selectors/nthChild

also works.

James wrote:

http://docs.jquery.com/Selectors/eq

On Jul 1, 3:10 pm, Wacko Jacko jackson.be...@gmail.com wrote:
  

How would I target (with jQuery or normal javascript) the 5th and 6th
li in an unsorted list for styling?  I need to change the css for only
2 items in a list.

Thanks in advance for your help.



  


[jQuery] Re: Cleaning up javascript before ajax load

2009-07-01 Thread Veeru

anybody??


[jQuery] Re: jQuery Animation Loading

2009-07-01 Thread Charlie





seems you are at mercy of load times and with a rapid animation there
isn't much room for time lag. Have you considered skipping the ajax
loading?

Shouldn't be a lot of work to create 4 divs within your sliding panel,
with ID's match your nav href

rather than code all this out giving sequence and a little description

all divs that match nav --- give them 0 width, overflow: hidden,
absolute position, left 0, so they are all in same position on left
apply class "active" to your welcome div

on nav click

class "active" animate left to hide, remove active class
add class "active" to div matches href
class "active" animate right to show




Valor wrote:

  I think my problem would be better clarified if you guys were able to
view the live site. The link is http://nxiel.com/ and the password is
"guest1234" (without quotations).

Now if you browse through the pages you will see how the animation
slides to the left and back to right with updated content.

My problem arises when I use this to access the portfolio section. The
portfolio section doesn't seem to work. If you head over to
http://nxiel.com/Portfolio/ , you can see how the section should
render and how a person can use the scroll feature, however, when the
content is loaded using jQuery, it doesn't function properly.

Additionally another problem i'm realizing is the delay of the
content. For example, if you are on the contact page and then click on
downloads, the content will slide left and then slide back right when
the content is loaded. However the problem i'm seeing is the delay in
the content loading meaning that the animation will finish and the
content will then load. A second or two delay. I've tested it in
multiple browsers and seeing the same problem. Surprisingly the only
browser i'm not seeing this in is IE6.

Anyways any help in this matter is appreciated, especially with the
scroll of portfolio.

Thanks!

  






[jQuery] Re: jQuery Animation Loading

2009-07-01 Thread Valor

I did consider leaving out the ajax loading. In my opinion, its just a
bit of eye candy and I still have the URL's a person can access
directly.

So if i'm not wrong, you are suggesting that I create a single page
will all the content and load the content using jquery. So a single
div container with class active would be displayed and I can switch it
to another continer by applying the class active and so on. Correct?

I actually wanna optimize this site for search engines. I don't know
if I should take this approach. Do you think for my portfolio, I
should apply your method since there is not alot of content?

On Jul 1, 9:59 pm, Charlie charlie...@gmail.com wrote:
 seems you are at mercy of load times and with a rapid animation there isn't 
 much room for time lag. Have you considered skipping the ajax loading?
 Shouldn't be a lot of work to create 4 divs within your sliding panel, with 
 ID's match your nav href
 rather than code all this out giving sequence and a little description
 all divs that match nav --- give them 0 width, overflow: hidden, absolute 
 position, left 0, so they are all in same position on left
 apply class active to your welcome div
 on nav click
 class active animate left to hide, remove active class
 add class active to div matches href
 class active animate right to show
  
 Valor wrote:I think my problem would be better clarified if you guys were 
 able to view the live site. The link ishttp://nxiel.com/and the password is 
 guest1234 (without quotations). Now if you browse through the pages you 
 will see how the animation slides to the left and back to right with updated 
 content. My problem arises when I use this to access the portfolio section. 
 The portfolio section doesn't seem to work. If you head over 
 tohttp://nxiel.com/Portfolio/, you can see how the section should render and 
 how a person can use the scroll feature, however, when the content is loaded 
 using jQuery, it doesn't function properly. Additionally another problem i'm 
 realizing is the delay of the content. For example, if you are on the contact 
 page and then click on downloads, the content will slide left and then slide 
 back right when the content is loaded. However the problem i'm seeing is the 
 delay in the content loading meaning that the animation will finish and the 
 content will then load. A second or two delay. I've tested it in multiple 
 browsers and seeing the same problem. Surprisingly the only browser i'm not 
 seeing this in is IE6. Anyways any help in this matter is appreciated, 
 especially with the scroll of portfolio. Thanks!


[jQuery] Re: Cleaning up javascript before ajax load

2009-07-01 Thread waseem sabjee
Been trying to replicate your situation.

the best solution i see is to not load the variables.

may be if you can explain your environment in more detail. like :

this is how I understand.

lets assume we have our container
div id=container
within this container we have out element
div id=target
we basically loading the full html. css and js from this page into our
target element
$.ajax ({
url:b.html,
success : function(html) {
$(#target.).html(); // ensure the target is empty
$(#target).html(html); // fill target with everything
// if you want only the html within the body tag remove the commenting from
the following line
// $(#target).html($(body, html()));
}
});

Now from what i gather b.html as some ajax functions that you want to
maintain but there are some functions in there which you do not want.

my solution is

create seperate .js files instead of having script in the b.html page.
so in b.html in the head area you would have something like
script type=text/javascript src=js/ajax.js/script
try to ensure that all your js files are external and there is no internal
js on the page.
instead of loading the whole page - just load items within the body tag and
in this ajax call load the appropriate scripts into  your page.
so your ajax function wil be like

$.ajax ({
url:b.html,
success : function(html) {
$(#target.).html(); // ensure the target is empty
// load script refferences
 $(#target).append('script type=text/javascript
src=js/ajax.js/script');
 $(#target).append($(body, html()));
}
});


On Thu, Jul 2, 2009 at 3:51 AM, Veeru swamyve...@gmail.com wrote:


 anybody??


[jQuery] Re: jQuery cycle plugin pager not working in FF and Safari

2009-07-01 Thread Jason

Thanks! Problem solved. It is always the simple things. I appreciate
the help.

On Jul 1, 8:54 am, Mike Alsup mal...@gmail.com wrote:
  I am having an odd error where the pager generates links but they
  don't change the slide in FF and Safari. The biggest surprise of all
  is that it actually works in IE.

  Here is the page I am referring to:http://76.12.208.222/

 Try this:

 #slideshowPage { position: relative: z-index: 100; }


[jQuery] mouseover on image in jCarousel

2009-07-01 Thread camila

Is there a way to create a mouseover effect on an image that is in a
jQuery carousel? I want a description to appear by my image when you
mouseover it. Does anyone know if this is possible and how to do it?


[jQuery] jQuery with HTML radio button forms

2009-07-01 Thread Shiro

Hi,
I have a problem running a simple jQuery script. This is what I'd like
to do:

- Select from a list of radio button
- Each radio button will show a hidden dropdown list

The jQuery snippet I use is as follows:

$(#wrapper_almond).hide();

$(#flavors input[name=cakes]).click(function(){

if ($(#almond_cake:checked).val() == 'on') {
$(#wrapper_almond).show();

} else {
$(#wrapper_almond).hide();

};

});

And the HTML I use is as follows:

fieldset id=flavors
   input type=radio id=almond_cake name=cakes //input
label Almond Cake - White cake baked with freshly toasted
almonds/label
/fieldset

div id=wrapper_almond
  div align=leftAlmond Cake Fillings:/div/td
  div align=leftinput type=hidden name=on2 value=Cake
Filling /
select name=os2 id=os2  onchange=updatetotal()
  option value=Almond cream selected=selectedAlmond cream/
option
/select
  /div
/div

Now the problem is anytime I insert a value=x into the input type,
the jQuery ceases to work. For example:

input type=radio id=almond_cake name=cakes values=x //
input

Is there a way around this? Thanks!



[jQuery] Re: Chained Autocomplete selects

2009-07-01 Thread brotherjames

Is there an easy way with the Cascade plugin to tie to events in
addition to change... The issue is that the Cascade works well when
the parent is changed but does not show the child value on an update
form as the parent in most cases do not need to change... but the
child is not displayed because the change event is not nor does it
need to be fired.

On Jun 11, 12:30 am, Mike Nichols nichols.mik...@gmail.com wrote:
 I'd look at the autocomplete plugin 
 herehttp://github.com/ReinH/jquery-autocomplete/tree/master
 and a decent write up here 
 :http://www.bigredswitch.com/blog/2008/11/jquery-autocomplete-plugin/

 I used this tiny plugin as a kind of prototype when I wrote cascade.
 Incidentally, I have a few fixes to cascade to push out (dynamic ajax,
 etc) if you need it.

 Personally, I wouldn't use a select tag for that many options, but
 would opt for autocomplete. You can use the same datasource (JSON) and
 bind similar behavior on the autocomplete box.

 mike

 On Jun 10, 9:45 pm, netcomp ra...@netcompulsion.com wrote:



  Hi there.  I have a page that loads two other pages in with load.  In
  one of the files there are two select lists,chainedtogether using
  the Cascade plugin.  I have embedded the Cascade plugin in the page
  that gets loaded.  This works fine.

  However, the first list contains upwards of 2200 items and people are
  having trouble finding the proper choice.  So now I need to add a
  filter or auto complete functionality.

  I'm having a problem getting the wheels rolling on this one...anyone
  have an example or suggestion of how I can accomplish both tasks?  The
  current lists are fed by a JSON file I generate dynamically.

  TIA


[jQuery] how to make jquery.cycle slow down after one full cycle

2009-07-01 Thread YES

I want to have the timeout on my jquery.cycle change from 500 to 2500
after one full cycle is complete. (or after a certain amount of
seconds which ever is easier)

Ive tried all manner of ideas on how to get it to work but cant seem
to figure it out.

Can anyone offer me some advice.

Thanks,

James


[jQuery] Validate first and the carry on

2009-07-01 Thread James W

I am using some jquery code to validate a form and then post the
results of the form via an ajax request to a script. I am struggling
with the code as when I click submit the form validates but then also
makes the ajax request. What I would like to be able to do is validate
the form and then if the form checks out ok then I would like the
other code to run.

I am using the plug in

http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js

I am new to jquery, I understand the validation how how to validate a
form using the plug in, and I am comfortable with the ajax request and
how to show and hide layers. I am in the tricky place where I cant get
the two to work together!

script language=javascript
$(document).ready(function()
{

  $(#login_form).validate({
  rules: {
namea: required,

town: required,

emaila: {
  required: true,
  email: true
}



  }

});


  $(#login_form).submit(function()
 {
  $.post(login.php,{ name:$('#namea').val(),password:$
('#password').val(),rand:Math.random() } ,function(data)
{
if(data=='OK')
{
   $('#loginbox').hide();
$('#ajax_failed').hide();
   $('#ajax_show').show();
   $('#RegisterForm').show();

}
else
{
 $('#name').val();
  $('#ajax_failed').show();
  }

});
   return false;
 });
 $(#password).blur(function()
 {
  $(#login_form).trigger('submit');
 });
});
/script

If anyone could point me in the right direction or show me how to
achieve this I would be most grateful.

JW


[jQuery] jQuery + Jeditable

2009-07-01 Thread Annabel

Hi,

I have a PHP page containing a table of what are basically database
rows, several of the fields are editable using Jeditable.

I really like the Jeditable user-friendliness but...
The standard Jeditable behaviour is that once a field has been edited
the result is returned from the server - the result is put into the
Jeditable field.

But what I want to happen is for the whole web page to reload. Is
there a simple way to do this?
At the moment I am working on sending the results of the edit to a
function and having the function submit the form (presumably created
by Jeditable)


Thanks in advance for any replies.

Annabel


[jQuery] Modal Boxes Position Off on Centered Layout

2009-07-01 Thread smartpill

I have a few sites with centered layouts and any modalbox script
positions the containing item in a relative position to the parent
item instead of left:0; bottom:0; or whatever it will be over to the
right in relation to how much space is outside the main site
container. So if I have a 900px wide site an the window size is larger
than 900px, the modal position will be off.

I applied position: relative; to very element I could think of, is
there somthing else I should look for?


[jQuery] Re: Target specific ul list items for css

2009-07-01 Thread Shiro

Perhaps give each of them an ID? for example:

ul
lione/li
litwo/li
...
li id=fifthfifth/li
li id=sixthsixth/li
/ul

Then you can target them by:

$(#fifth) in jquery OR

#fifth {

}

in CSS

On Jul 1, 6:10 pm, Wacko Jacko jackson.be...@gmail.com wrote:
 How would I target (with jQuery or normal javascript) the 5th and 6th
 li in an unsorted list for styling?  I need to change the css for only
 2 items in a list.

 Thanks in advance for your help.


[jQuery] Re: Target specific ul list items for css

2009-07-01 Thread Wacko Jacko

Thanks guys! Paul's http://docs.jquery.com/Selectors/nthChild
suggestion is perfect as the lists are generated dynamically I can not
add id's to each item.

On Jul 2, 11:14 am, Shiro nimro...@gmail.com wrote:
 Perhaps give each of them an ID? for example:

 ul
 lione/li
 litwo/li
 ...
 li id=fifthfifth/li
 li id=sixthsixth/li
 /ul

 Then you can target them by:

 $(#fifth) in jquery OR

 #fifth {

 }

 in CSS

 On Jul 1, 6:10 pm, Wacko Jacko jackson.be...@gmail.com wrote:

  How would I target (with jQuery or normal javascript) the 5th and 6th
  li in an unsorted list for styling?  I need to change the css for only
  2 items in a list.

  Thanks in advance for your help.


[jQuery] Re: Cleaning up javascript before ajax load

2009-07-01 Thread Charlie





there was an interesting thread on this a few months ago. Take a look
at the test run, was continuous loading of large file every 200 ms. The
OP ran test for a day 

Solution Thread:
http://groups.google.com/group/jquery-en/browse_thread/thread/ef024e92a41113a3/58f86e8deca2de4c?lnk=gstq=memory+leak+ie7#58f86e8deca2de4c

Original Memory Test thread
http://groups.google.com/group/jquery-en/browse_thread/thread/f28ae96a467f84e0/c2d064c1a9ab81bc?lnk=gstq=memory+leak+ie7#c2d064c1a9ab81bc

Veeru wrote:

  Hi there
I have an ajax based page, which loads content from external page (html
+js)

So if i have a div "update_div" being updated with external content
(html+js)
Let me be more specifig

Step1: Ajax content along with js loaded into update_div from a.html

Step2: Ajax content along with js loaded into update_div from b.html

What happens to the js loaded from a.html? Is it lurking in the memory
or automatically/magically removed from the browser memory?
I am afraid of memory leaks, if the js is still lurking in memory, the
more ajax calls made, the more js is going to be held up in memory.

Unless am totally wrong; i have no idea of the mechanism happening
here. Can somebody shed some ligth?

p.s: Hope my post doest go missing this time :)

Thanks
Vru

  






[jQuery] Re: Cleaning up javascript before ajax load

2009-07-01 Thread Veeru

thanks for the reply waseem
i was thinking something along the same lines as well, to keep all the
js in an external file and probably load it even before the ajax pages
are called so there would be no js in the ajax calls, just html.

My web application, is something that usually runs round the clock - i
am not very sure how all these will effect the browser's memory. Too
many ajax calls, with the browser open for long hours; i don't know
how i am supposed to proceed or do things the right way.

What if my js is very huge? will that effect the browsers memory (if
the browser is open for too long).

I just need some information or direction if you can provide me some.

Thanks
Vru


[jQuery] Re: Cleaning up javascript before ajax load

2009-07-01 Thread Veeru

Hi Charlie
I have checked the links you gave me, found some interesting stuff
like adding a .html() before updating the ajax content; but in the
problem situation mentioned, they were only load html, but what if
there is js as well  - like if any element has an onClick() event in
the html, and this content loads every now and then, does the event
keep binding and binding till it hogs memory?

I can try to remoev all js and include in an external file and load it
before the ajax calls, but i am just afraid the js file might become
too big and get more complicated to handle.

Thanks
Vru


[jQuery] Re: Cleaning up javascript before ajax load

2009-07-01 Thread Charlie





all the memory issues are over my head, I was hoping someone in the
know might provide an interesting answer myself. 

I remembered that test , thought it might interest you. 

Veeru wrote:

  Hi Charlie
I have checked the links you gave me, found some interesting stuff
like adding a .html("") before updating the ajax content; but in the
problem situation mentioned, they were only load html, but what if
there is js as well  - like if any element has an onClick() event in
the html, and this content loads every now and then, does the event
keep binding and binding till it hogs memory?

I can try to remoev all js and include in an external file and load it
before the ajax calls, but i am just afraid the js file might become
too big and get more complicated to handle.

Thanks
Vru

  






  1   2   >