[jQuery] Newbie Question: Finding and manipulating an element

2010-03-01 Thread Aaron Johnson
Hello...

I have an unordered list containing nested lists...

ul class=foo
lia title=Announcements1 href=foo.htmlspan
class=portal-navigation-labelHome/span/a
ul
lia title=Announcements
href=foo.htmlspanAnnouncements/span/a/li
lia title=Announcements
href=foo.htmlspanAnnouncements/span/a/li
lia title=Announcements
href=foo.htmlspanAnnouncements/span/a/li
/ul
/li
lia title=Announcements2 href=foo.htmlspan
class=portal-navigation-labelHome/span/a
ul
lia title=Announcements
href=foo.htmlspanAnnouncements/span/a/li
lia title=Announcements
href=foo.htmlspanAnnouncements/span/a/li
lia title=Announcements
href=foo.htmlspanAnnouncements/span/a/li
/ul
/li
lia title=Announcements3 href=foo.htmlspan
class=portal-navigation-labelHome/span/a
ul
lia title=Announcements
href=foo.htmlspanAnnouncements/span/a/li
lia title=Announcements
href=foo.htmlspanAnnouncements/span/a/li
lia title=Announcements
href=foo.htmlspanAnnouncements/span/a/li
/ul
/li
/ul

The top level list has an ID and associated css, I'd like to add a class to
each of the nested ul elements in order to style them differently. I
cannot manually add a class so wondered if I could do it with jQuery.

I'm looking for a result like this:

ul class=foo
lia title=Announcements1 href=foo.htmlspan
class=portal-navigation-labelHome/span/a
ul class=bar
lia title=Announcements
href=foo.htmlspanAnnouncements/span/a/li
lia title=Announcements
href=foo.htmlspanAnnouncements/span/a/li
lia title=Announcements
href=foo.htmlspanAnnouncements/span/a/li
/ul
/li
lia title=Announcements2 href=foo.htmlspan
class=portal-navigation-labelHome/span/a
ul class=bar
lia title=Announcements
href=foo.htmlspanAnnouncements/span/a/li
lia title=Announcements
href=foo.htmlspanAnnouncements/span/a/li
lia title=Announcements
href=foo.htmlspanAnnouncements/span/a/li
/ul
/li
lia title=Announcements3 href=foo.htmlspan
class=portal-navigation-labelHome/span/a
ul class=bar
lia title=Announcements
href=foo.htmlspanAnnouncements/span/a/li
lia title=Announcements
href=foo.htmlspanAnnouncements/span/a/li
lia title=Announcements
href=foo.htmlspanAnnouncements/span/a/li
/ul
/li
/ul

Thanks for your help!

Aaron


Re: [jQuery] Newbie Question: Finding and manipulating an element

2010-03-01 Thread Nathan Klatt
On Mon, Mar 1, 2010 at 5:06 AM, Aaron Johnson
aaron.mw.john...@gmail.com wrote:
 The top level list has an ID and associated css, I'd like to add a class to
 each of the nested ul elements in order to style them differently. I
 cannot manually add a class so wondered if I could do it with jQuery.

 I'm looking for a result like this:

 ul class=foo
     lia title=Announcements1 href=foo.htmlspan
 class=portal-navigation-labelHome/span/a
         ul class=bar

If all of the inner uls are styled the same you don't need a class,
just add a rule to your css:

ul.foo  li  ul {
  /* style stuff */
}

Nathan


Re: [jQuery] Newbie Question: Finding and manipulating an element

2010-03-01 Thread Aaron Johnson
Greg, Nathan, Thanks very much for your help!

On 1 March 2010 14:58, Nathan Klatt n8kl...@gmail.com wrote:

 On Mon, Mar 1, 2010 at 5:06 AM, Aaron Johnson
 aaron.mw.john...@gmail.com wrote:
  The top level list has an ID and associated css, I'd like to add a class
 to
  each of the nested ul elements in order to style them differently. I
  cannot manually add a class so wondered if I could do it with jQuery.
 
  I'm looking for a result like this:
 
  ul class=foo
  lia title=Announcements1 href=foo.htmlspan
  class=portal-navigation-labelHome/span/a
  ul class=bar

 If all of the inner uls are styled the same you don't need a class,
 just add a rule to your css:

 ul.foo  li  ul {
  /* style stuff */
 }

 Nathan



[jQuery] Newbie question about updating iframe on tab select

2009-11-17 Thread zoog22

I have some tabs that I want to not update until they are selected.  

Currently, they all load their respective iframes src=xs when the page
loads.  I was thinking I could leave the link blank on loading and change
them as they are clicked.

$(function() {
$(#tabs).tabs();
});

ul
li #tab1 First TAB /li
li #tab2 Second TAB /li
li #tab3 Third TAB /li
/ul

div id=tabs class=ui-tabs ui-widget ui-widget-content ui-corner-all
div id=tab1
iframe height=100% width=100% frameBorder=0 src=page1.htmlyour
browser does not support IFRAMEs/iframe
/div

div id=tab2
iframe height=100% width=100% frameBorder=0 src=page2.htmlyour
browser does not support IFRAMEs/iframe
/div

div id=tab3
iframe height=100% width=100% frameBorder=0 src=page3.htmlyour
browser does not support IFRAMEs/iframe
/div
/div
-- 
View this message in context: 
http://old.nabble.com/Newbie-question-about-updating-iframe-on-tab-select-tp26402551s27240p26402551.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



Re: [jQuery] Newbie question about updating iframe on tab select

2009-11-17 Thread 刘永杰
you should use ajax.

2009/11/18 zoog22 marcusb...@hotmail.com


 I have some tabs that I want to not update until they are selected.

 Currently, they all load their respective iframes src=xs when the page
 loads.  I was thinking I could leave the link blank on loading and change
 them as they are clicked.

 $(function() {
$(#tabs).tabs();
 });

 ul
li #tab1 First TAB /li
li #tab2 Second TAB /li
li #tab3 Third TAB /li
 /ul

 div id=tabs class=ui-tabs ui-widget ui-widget-content ui-corner-all
 div id=tab1
 iframe height=100% width=100% frameBorder=0 src=page1.htmlyour
 browser does not support IFRAMEs/iframe
 /div

 div id=tab2
 iframe height=100% width=100% frameBorder=0 src=page2.htmlyour
 browser does not support IFRAMEs/iframe
 /div

 div id=tab3
 iframe height=100% width=100% frameBorder=0 src=page3.htmlyour
 browser does not support IFRAMEs/iframe
 /div
 /div
 --
 View this message in context:
 http://old.nabble.com/Newbie-question-about-updating-iframe-on-tab-select-tp26402551s27240p26402551.html
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.




[jQuery] [Newbie question]: What knowledge is required for Jquery

2009-10-15 Thread nitesh

Hi,

Im a completely new to Jquery. Can I start it instantly or I need to
first attain certain level of expertise in Html/CSS/JS
Below is my current expirience with above 3:

. HTML/CSS: Basic knowledge
. Javascript/DOM: No knowledge at all

Hence, let me know the roadmap to learn Jquery efficiently ASAP.

10x
Nitesh


[jQuery] Newbie Question

2009-10-14 Thread Tiger

I am running a function that takes a long time to run in coldfusion.
I would like to display a Loading Data message when the data needs to
be loaded then hide that message once the data load is complete.  What
jQuery functions do you recommend and what basic approach do I need to
take.

This is what I have (non qQuery approach), but the cfflush seems to
have issues on the production server.


!--- Load all offices to create a TopOffice org tree. ---
cfset application.EmployeeDB_Functions.Loading_Data_Message_On
('Load_Office','Loading Office Data .')
cfset application.TopOffice = createobject('component','EIMC/
EmployeeDB/cfc/Office').init(#p_OfficeID#)
cfset application.EmployeeDB_Functions.Loading_Data_Message_Off
('Load_Office')


!--- Turn ON Loading Data Message ---
cffunction name=Loading_Data_Message_On access=public
output=yes
  cfargument name=FormName required=yes
  cfargument name=Message required=yes
  form name=#FormName# style=margin:10px;width:600px
input name=inMessage value=#Message# style=font-size:
18px;width:600px
  /form
 cfflush
/cffunction


!--- Turn OFF Loading Data Message ---
cffunction name=Loading_Data_Message_Off access=public
output=yes
  cfargument name=FormName required=yes
  script
document.#FormName#.style.height=0px;
document.#FormName#.style.margin = 0px;
document.#FormName#.style.visibility=hidden;
document.#FormName#.style.margin=0px;

document.#FormName#.inMessage.value = Load Complete;
document.#FormName#.inMessage.style.height=0px;
document.#FormName#.inMessage.style.margin=0px;
document.#FormName#.inMessage.style.padding=0px;
document.#FormName#.inMessage.style.visibility=hidden;
  /script
  cfflush
/cffunction



[jQuery] Newbie question (Bassistance Validate) - error msg does not go away

2009-09-29 Thread mango

i am new to jquery and started using the validate plugin with jquery.
I tried the demo but have problems using my own jsp form.

i have added the usual
$(document).ready(function() {
$('#customForm').validate({
rules: {
field1: required,
...}
messages: { ...}
 });


the error messages showing up fine, but once i start typing into the
field, the error msg does not go away. where should i start to look?
can someone provide any pointers?

thanks


[jQuery] Newbie Question

2009-08-04 Thread Dave Maharaj :: WidePixels.com
I have a standard php page with some jquery going on its working fine.
 
Now I want to take that page and load it into a div on a different page
(tabbed layout pretty much) but when I do the script no longer works when
the page loads into the div.
 
SCRIPT CURRENTLY ON THE PHP PAGE THAT WORKS WHEN VIEWED DIRECTLY IN BROWSER
 
script type=text/javascript
$(document).ready(function() {
   $(a.group).fancybox(
{ 
 'overlayShow': true 
});
   });
window.onload = function () {
 $('.sliderGallery').each(function(){
  var id_parts = $(this).attr('id').split('_');
var id = id_parts[id_parts.length - 1];
var container = $('#sliderGallery_' + id) ;
var ul = $('ul', container);
 var itemsWidth = ul.innerWidth() - container.outerWidth();

$('.slider', container).slider({
min: 0,
max: itemsWidth,
handle: '.handle',
stop: function (event, ui) {
ul.animate({'left' : ui.value * -1}, 500);
},
slide: function (event, ui) {
ul.css('left', ui.value * -1);
}
});
});
};
/script
 
How can I get it to still work when loaded into the DIV?
 
Thanks
 
Dave 


[jQuery] newbie question.

2009-07-25 Thread Kris

What does this do?
(function($) { do some stuff } )(jQuery);


[jQuery] Newbie Question....

2009-07-17 Thread raisputin

Hello,

I have just discovered jQuery and it looks cool. I used the jQuery UI
builder at ui.jquery.com to build the UI and it looks and works
great :) Unfortunately I do not know enough about javascript to answer
my own question, so I am deferring to you :)

I would like to have a tab with a dialog button on it, and when that
dialog comes up there will be a form. This part I can do easily enough
and have already implemented, however, what I need to do after that is
where I am stuck :(

I want the user to fill out the form, say there are fields like
Customer Name Telephone Number and D.O.B. and once that form is
filled out, and the user clicks OK, I want it to do the proper
inserts, etc into my mysql database. This is probably a very easy
question, but I have not found out anything useful so far through
various google searches. I would like to do the bulk of my mysql stuff
via perl/mason. Is there a tutorial anywhere for this or perhaps I
should be using a different technique? I am trying to avoid PHP simply
because I would prefer to not have to learn PHP while I am in the
process of learning the things I need for jQuery, but I can if I need
to.

Any advice/help/examples would be greatly appreciated.,

Greg Evans


[jQuery] Newbie question

2009-07-16 Thread Greg Evans

Hello,

I have just discovered jQuery and it looks cool. I used the jQuery UI  
builder at ui.jquery.com to build the UI and it looks and works  
great :) Unfortunately I do not know enough about javascript to answer  
my own question, so I am deferring to you :)

I would like to have a tab with a dialog button on it, and when that  
dialog comes up there will be a form. This part I can do easily enough  
and have already implemented, however, what I need to do after that is  
where I am stuck :(

I want the user to fill out the form, say there are fields like  
Customer Name Telephone Number and D.O.B. and once that form is  
filled out, and the user clicks OK, I want it to do the proper  
inserts, etc into my mysql database. This is probably a very easy  
question, but I have not found out anything useful so far through  
various google searches. I would like to do the bulk of my mysql stuff  
via perl/mason. Is there a tutorial anywhere for this or perhaps I  
should be using a different technique? I am trying to avoid PHP simply  
because I would prefer to not have to learn PHP while I am in the  
process of learning the things I need for jQuery, but I can if I need  
to.

Any advice/help/examples would be greatly appreciated.,

Greg Evans


[jQuery] Newbie question

2009-07-02 Thread Alexandru Adrian Dinulescu
Hello.

I am trying to do something like this
$(element1 || element2).click(function(){})

unfortunately this does not work, both element1 and element2 work
independently but not together and i have no clue how to get them to work
together.

Basically what i need that either when element1 is clicked, OR element2 is
clicked, do identical thing.

I know this is a very simple issue, but i havent learned Javascript at all,
i've started with jQuery.

Thank you


[jQuery] Newbie question on selectors

2009-06-03 Thread Dave Maharaj :: WidePixels.com
I have a page with 6 links that each have a unique class ;
edit_profile
edit_preferences
edit_journal
edit_entry and so on
 
now I built 1 function based off edit_profile 
$(a.edit_profile).click(function(){
var url_id = $(this).attr('href');
do stuff..
});
 
but rather than writing the same function and changing the selector
everytime how can i get this all into 1 function? 
 
Thanks,
 
Dave 


[jQuery] Newbie question- declarative selectors inside procedural code

2009-05-25 Thread colin_e

Hi. I'm very new to jquery, and a lightweight coder, so apologies for
the newbie question.

I think I understand the implied loop declarative nature of jquery
selectors, that say (sort-of) for everything matching the selector
do{ some stuff }

What i'm struggling to get my head around is how this works inside a
function once you HAVE a this object?

Example:
I have a list of the form-

ul id=map
  lia class='EM' href='#' title='East Midlands'spanEast
Midlands/span/a/li
  lia class='NE' href=# title='North East'spanNorth East/
span/a/li
/ul

This inside my document.ready I have a function like this-

$('#map li').hover(
function(){
region= $('this a:first').attr('class');  // Tries to 
find the
class of the first a in li
  //
but always returns undefined??
do_something_with_the_region();
},
function(){
undo_something_with_the_region();
}
);


The piece that says region= $('this a:first').attr('class'); is my
(clearly incorrect) attempt at the incantation to say  Give the
current object (an il), return the class attribute of the first
anchor that is a child of the current item.

I suspect I haven't got the right idea at all, can anyone point me in
the right direction?

Regards: colin_e


[jQuery] jquery newbie question - .load() does not work after form submission

2009-05-22 Thread rumpa_g

Unable to figure out why my load function stops working after a form
submit.

On the page I have two different forms. After submitting the first
form - I come back to the page now when I click the add button - I see
an alert message but no JSP loaded. I don't see any interaction with
the server at all.

[code]
 $ (function() {
$('#add_value').click( function() {
   alert(inside click);
$('#descriptor_value').load(
 'descriptorValue.jsp', function(){return false;});
})
 });

[/code]

I have an add button with id=add_value. On the page I have an empty
div id=descriptor_value.
When add button is clicked I display the descriptorvalue.jsp. This
works fine on the every click until I submit my form.

What am I missing? I read through the re-binding issue but not sure if
its applicable to my case since I have only one unique add_button and
after the AJAX call the there is no other add_button.

Any help is much appreciated.

Thanks,
Rumpa Giri


[jQuery] Newbie question about toggle.

2009-05-21 Thread Lacrima

Hello!

I think very simple question, but I am very new to jquery...
For example, I have the next code:

$('#info').hide();
$('a#show_hide_info').click(function(){
$('#info').toggle();
});

So when a user click on #show_hide_info, #info element become visible
or invisible.
But the #show_hide_info element is placed on the top of the page and
the #info element is on the bottom of the page. The bottom of the page
isn't visible to the user because the page is too long.
So when user clicks #show_hide_info he doesn't see any effect because
#info element is several screens down.
How should I scroll down the page to the #info element when user
clicks #show_hide_info???

Sorry if my English is not very good.
Thank you in advance.

With regards,
Max.


[jQuery] Newbie Question... Appending multiple items, with the same span name

2009-05-13 Thread Troy

Hello,

I'm relatively new to jquery, so I have what I hope will be a simple
question.
I need to append multiple spans to the line items in an unordered
list.
Essentially, each line item contains a span and I need to grab the
content of that span and append it to the bottom of the line item it's
contained in.  Here's what I have so far:

My jquery code:
-
  $(ul).ready(function(){
var Name = $(.name) .text();
var Content = $(.content) .text();
$(li) .append(span class=\additional\a href=\/addinfo.php
\+ Name +'s additional info/a/span);
 });


The original HTML it needs to modify:
-
ul
  li
  span class=nameJohn Doe/spanbr /
  span class=contentJohn is an excellent Swimmer/spanbr /
  /li
  li
  span class=nameJane Doe/spanbr /
  span class=contentJane loves to play basketball/spanbr /
  /li
/ul


Here's the output I'm getting:
-
John Doe
John is an excellent Swimmer
John DoeJane Doe's additional info

Jane Doe
Jane loves to play basketball
John DoeJane Doe's additional info



Here's the desired outcome:
-
John Doe
John is an excellent Swimmer
John Doe's additional info

Jane Doe
Jane loves to play basketball
Jane Doe's additional info



As you can see, instead of taking the all the Name var's and putting
them together, instead of just using the Name var of that line item.
I'm sure it needs some type of this, $(this), or .each call on it, but
I can't seem to find this in the documentation anywhere.

Can someone help?
Thanks!
Troy


[jQuery] Newbie Question - Show/Hide on a:link

2009-04-17 Thread KetanMV

Hi guys -- very basic question here I think. I've got some
documentation and a book in front of me, but I can't get this to work!
I want to click the Welcome nav item to show the div named welcome
on the page. If I use just the hide line of code, the page loads up
with the DIV hidden properly. But, once I add the click/show code --
nothing happens, including the hide onLoad. Thoughts? Thanks so much!

$(document).ready(function() {
$(#welcome).hide();
${a.welcomenav).click(function() {
$(#welcome).show();
return false;
});
});

ul id=sliding-navigation
li class=sliding-elementa href=#
class=welcomenavWelcome/a/li
/ul


[jQuery] newbie question

2009-04-06 Thread Ronz

I've tried loading jquery.js into a site several times several
different ways and can't even get an alert to pop up. I can get a test
page to work only if I use an src address to google's jquery.

Can't I just upload the jquery-1.3.2.min.js file or is there some
configuring I have to do?

What problem should I look for on my web account?

...Ron


[jQuery] Newbie Question: get id from A tag

2009-03-24 Thread Jesse

Hello,

I am not good at js. I want to get the id from A tag.
E.g. a href=/comment.php class=clickme id=1234link/a

I need the value 1234 from the code above, but dont know how to do
it.

Please help.

Thanks.



[jQuery] newbie question: how can i prevent this infinite loop scenario?

2009-03-20 Thread bobby burgess

Hi all,

jQuery newbie here and this is my first post. I'm stuck on this
conundrum:

I have some images on a page and .hover() is bound to each. The is
hovering function displays an absolute-positioned DIV on top of
everything  else (it contains a bigger version of the clicked-on
image). The is not hovering function removes that DIV.

$('TD IMG').hover(
   function () {
   $('DIV/DIV').addClass('test_lightbox').append( $(this).clone
() ).fadeIn('fast').prependTo('BODY');
   },
   function () {
   $('DIV.test_lightbox').fadeOut('fast').remove();
   }
);

This works well, except in the rare case when the pop-up DIV overlaps
the thumbnail IMG that was clicked on (say, the user had their browser
shrunk super small). When that happens, the cursor is no longer
hovering over the thumbnail; it's hovering over the DIV. That causes
the IMG's is not hovering function to fire which removes the DIV--
but then the cursor falls upon the IMG again, starting the loop all
over again.

What approach or best practice should I follow to resolve this? I
could probably find a way to ensure that the DIV element never appears
over the IMG element, but there must be a way to handle this with the
JS code directly. Ideas?

Thanks,

Bobby


[jQuery] Newbie question - downloading jQuery

2009-02-06 Thread rontivo

I just stumbled across jQuery - I'm very impressed with what I've seen
on the site.  In my case my interest was sparked by a desire to put a
floating dialog on our site.  I've downloaded jQuery, and I was able
to copy the code from the sample and get a dialog to show up, but I
notice that the sample code includes the following lines:

script type=text/javascript src=http://ui.jquery.com/testing/ui/
ui.core.js/script
script type=text/javascript src=http://ui.jquery.com/testing/ui/
ui.dialog.js/script
script type=text/javascript src=http://ui.jquery.com/testing/ui/
ui.resizable.js/script
script type=text/javascript src=http://ui.jquery.com/testing/ui/
ui.draggable.js/script

I was expecting the download to either contain all of the necessary
code, or to expand to a set of files, and I would include the
appropriate files from that directory.  I'd like to have the code
hosted on my server, rather than referring to version on the jquery
servers.

I'm obviously missing something in my efforts to download jQuery to my
server.  A little help getting me pointed in the right direction would
be appreciated.

Thanks,
-Ron


[jQuery] newbie question- how to configure get request - ui sortable list using connectWith

2009-01-24 Thread Scott Wagner

Hello

I have been trying make a sortable list that sorts elements among different 
unordered lists and sends the data to a script to update the order in a a 
database.  The problem I'm having right now is that the get request is only 
sending the data from the ul that the element is dropped into.  So it would 
start reordering the list from that point even if it's not the first one.  
Here is my code so far:

!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.01 Transitional//EN 
http://www.w3.org/TR/html4/loose.dtd;
html

head
  title/title
  meta name=GENERATOR content=Quanta Plus
  meta http-equiv=Content-Type content=text/html; charset=utf-8
script type=text/javascript src=jquery-1.2.6.min.js/script
script type=text/javascript src=jquery-ui-
personalized-1.6rc4.min.js/script

script type='text/javascript'

$(function() {
$(#group-1, #group-2).sortable({
connectWith: ['.connectedSortable'],
  update: function() { 

var order = $(this).sortable(serialize); 
$.get(up_test.php+order); 
$(#info).load(up_test.php?+order);

   }
});
});

/script
/head
body
div
table width=50%
  tbody
tr
  tdh2Gym 1/h2
  ul id=group-1 class=connectedSortable
li id=act_1 Student 1/li 
li id=act_2Student 2/li 
li id=act_3Student 3/li 
li id=act_4Student 4/li /td
/ul
  td
h2Computers/h2
ul id=group-2 class=connectedSortable
li id=act_5Student 5/li 
li id=act_6Student 6/li 
li id=act_7Student 7/li 
li id=act_8Student 8/li 
/ul
/td
/tr
  /tbody
/table



 br
/div
div id=infoUpdate statements from script will load here./DIV


/body
/html

Thank you,
Scott



[jQuery] Newbie question

2009-01-05 Thread saiful.ha...@gmail.com

hi all,

is jquery have function like findXY(element) or scroll position?
sorry not finish read all document about jquery

~ saiful haqqi ~


[jQuery] Newbie Question with Hot Keys

2008-12-17 Thread sshefer

Hi,

I've been having a bit of trouble with this bit of code and I was
wondering what I am doing wrong in the chaining...

I am using the js-hotkeys plugin to allow keypress events only while
hovering over a specific class.  However,  I would like the effects
only to be applied to it's id.

How can I pass down the id or other self referencing attribute so that
the toggle() only applies to that specific element?

Below is a code snippet.

$('.position_info').hover(function(e) {
  $(document).bind('keypress', 'space', function(e){
$(e).children(strong).toggle();
  });
}, function(){
  $(document).unbind('keypress', 'space');
});

Thanks in advance for any help or just reading this.


[jQuery] Newbie Question: DropUP menus

2008-11-12 Thread Mike

I'm working on a website at http://beta.ponderosatreeservice.com
(excuse the dust). As you can see I have a series of tabs at the
bottom of the large image. Instead of a traditional menu that drops
down below the tab I'd like it to extend up with the original tab
header still at that top. I've uploaded an example of what I want it
to look like at http://beta.ponderosatreeservice.com/images/dropdownexample.jpg

Is there any jQuery script I can use to accomplish this?


[jQuery] Newbie question: how to reference an element via XML attribute.

2008-10-15 Thread JFQueralt

Hi, everyone.

Sorry for such simple question but not being familiar with jQuery I
just can´t find how to do this:

The objective is to change the content several elements of a page
loading an XML file via the get function.


The XML file:

?xml version=1.0 encoding=UTF-8?
Texts
item id=Txt1Some text in english/item
item id=Txt2Some more text in ENG/item
/Texts


The HTML code:

span id=Txt1/span
br
span id=Txt2/span
br


-- Note each item in the XML file corresponds to a specific span
using the id attribute.



The jQuery code:

$.get(Thefile.xml,{}, function (xml){

$('item', xml).each(function(i){

NOW FOR EACH NODE I FIND I NEED TO UPDATE EACH SPAN ELEMENT WITH THE
VALUE I FIND BASED ON THE id ATTRIBUTE.


});


I´ve been playing with this for a long while and simply can´t figure
it out.

Any help is appreciated.

Jean



[jQuery] Newbie question: how to reference an element via XML attribute.

2008-10-15 Thread JFQueralt

Hi, everyone.

Sorry for such simple question but not being familiar with jQuery I
just can´t find how to do this:

The objective is to change the content several elements of a page
loading an XML file via the get function.


The XML file:

?xml version=1.0 encoding=UTF-8?
Texts
item id=Txt1Some text in english/item
item id=Txt2Some more text in ENG/item
/Texts


The HTML code:

span id=Txt1/span
br
span id=Txt2/span
br


-- Note each item in the XML file corresponds to a specific span
using the id attribute.



The jQuery code:

$.get(Thefile.xml,{}, function (xml){

$('item', xml).each(function(i){

NOW FOR EACH NODE I FIND I NEED TO UPDATE EACH SPAN ELEMENT WITH THE
VALUE I FIND BASED ON THE id ATTRIBUTE.


});


I´ve been playing with this for a long while and simply can´t figure
it out.

Any help is appreciated.

Jean



[jQuery] NEWBIE Question re span and form elements

2008-08-28 Thread Peter Bailey

Hi there. I recently discovered jQuery and it appears to be an
excellent library. I started looking at libs because I have a specific
problem I want to solve easily. I want to an able to show and hide a
span on my page. The span may contain some form elements like
checkboxes for example. It is possible that a CB could have been
selected, and then the event the causes the span to hide comes into
play (they answered another question or whatever). If this is the
case, I want to hide the span but also uncheck (or whatever) the
elements in the span.

Is there an easy way to do this with jQuery. I am just starting to
read through the docs, and have purchased a couple of books, but of
course, I have a timeline to beat. Any suggestions or pointers to docs
would be much appreciated.

Thanks,

Peter



[jQuery] newbie question about assigning a varialbe for use in a selector statement

2008-07-12 Thread jt

I have a form with the following (there are about 20 of these; you can
assume that the id value goes up to 706):

input id=686 class=add_image type=button value=add image/
add image 2

and beneath it would like to have a form element that is normally
hidden:
div class=add_image_content 686 hello in add_image_content/div

Basically, I'd like to be able to access the e.targed.id and then use
it in a selector to select div's that have 'add_image_content' and the
associated id value.

My javascript is:
 $(document).ready(function(){
  $('.add_image_content').hide();

  $('.add_image').bind('click',function(e){

  //alert(e.target.id);
  var $val=e.target.id;
  $(div:contains($val)).show();
  //didn't work
  //$('.add_image_content' + e.target.id).show();
  //$(e.target.id).show();
 });
});

thanks for any help,

jt


[jQuery] Newbie question about Radio Buttons

2008-02-11 Thread PKJ

Hi,

I am thinking about using JQuery in a site I develop, but I am
struggling to work out how to achieve what I want, so any advice would
be appreciated.

I have a matrix of radio buttons.  I can ensure that only one radio
per row is selected by giving the radio buttons on each row the same
name.

In addition to the one selection per row rule, I want to use JQuery
to ensure that only one radio in each column is selected as well i.e
if a radio button is selected, I want to unselect all the radios in
the same column (as well as all those in the same row).

The complexity is that there will be several of these matrices on each
page.

Any ideas?

Thanks in advance

PKJ






[jQuery] newbie question

2007-12-06 Thread FrenchiINLA

I have a javascript function like MyFunc(btn), and I would like to
associate a click event to all my button with button1 class in the
page to this function. I tried the following code and is not working
for me:

$([EMAIL PROTECTED]'button'].button1).each(function()
{
this.click(function(){MyFunc(this);});
});

what's wrong with my code? any help would be greatly appreciated.




[jQuery] Newbie question regarding requesting confirmation when a link is selected.

2007-12-02 Thread lattedaddy

Hi-

I'm pretty new to both JS and JQuery.  Thanks for the help in advance.

I have a link in my code as follows (it talks to an app to do a delete
of a task)

   a class=taskDelete href=/deletetask.do?id=55aid=77 /
Delete/a

When the link is selected I would like to popup a confirmation dialog
and either do the delete or not depending on the answer in the
confirmation dialog.  My intuition tells me this should be easy.  I've
been working with jquery both with and without the impromptu plugin
with no success.

I must be missing something obvious.

Thanks again,
Bruce


[jQuery] Newbie Question: Callback for Load Only Works the First Time Load is Called?

2007-10-30 Thread Vik_R


I've got some code that uses load to add some help info to a page when the
user clicks on a help button. 

I pass the current contents of the div to the php function that provides the
help info.  The php function checks the current contents, and if it sees
that the help info is already on the screen, it toggles it off, and puts the
help button back in its place.

I added a callback so that after the load, the page will scroll to the help
info just added.

All this works great, but the scroll only works the first time:

- The user clicks the help button, and the help text is loaded and appears,
and page scrolls to the help text - correctly.
- The user clicks a close box button,  and the help text disappears and is
replaced by the help button - correctly.
- The user clicks the help button for the second time, and the help text is
loaded and appears - but the page doesn't scroll to the help text. 

How can I correct this?

Thanks in advance to all for any info. 


///JAVASCRIPT/JQUERY
 function ScrollToDiv(theDivID)
 {
 $(html,body).animate({ scrollTop: $(#+theDivID).offset().top });
 }
 
   $(document).ready(function(){

   $(#HelpInfo).click(function(){
 var htmlStr = $(this).html();


$(#HelpInfo).load(http://localhost:/index.php/your_plan/ShowHelpInfo;,
{contents: htmlStr}, ScrollToDiv(HelpInfo));
});


///PHP CODE - CodeIgniter framework - this function is callable as
///http://localhost:/index.php/your_plan/ShowHelpInfo

function ShowHelpInfo()
{
$lengthOfCurrentContents = strlen($_POST['contents']);
if ($lengthOfCurrentContents  500)
{
$output = Help info and Close Box;

echo $output;
}
else 
{
$output = Help Button;

echo $output;
}

}
-- 
View this message in context: 
http://www.nabble.com/Newbie-Question%3A-Callback-for-Load-Only-Works-the-First-Time-Load-is-Called--tf4720377s27240.html#a13494683
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Newbie Question: Specifying the links that are in a particular Div?

2007-10-29 Thread Vik_R


I'd like to attach an onclick function to the links that are in a specific
div. The id of the div is menu. I tried variations on this:

$(document).ready(function(){
 $(#menu).(a).click(function(){
   alert(Thanks for visiting!);
 });
 });

...but I was just guessing, and I didn't find the correct way yet. 

What is the correct way to do this? Thanks very much in advance to all for
any info.
-- 
View this message in context: 
http://www.nabble.com/Newbie-Question%3A-Specifying-the-links-that-are-in-a-particular-Div--tf4713851s27240.html#a13474559
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Newbie question on hide objects

2007-10-25 Thread Merlin

Hello everybody,

I am trying to add a comment functionality to my webapp that includes
a reply possibility on each comment. Like on digg for example. I am
new to AJAX, but would like to take this oportunity and to jump into
cold water with that task now.

My goal is to use JQuery to show and hide a dialog box which contains
the form to reply on the comments.
Basicaly I managed to do this, but now I have a general understanding
problem. Let's say there are 100 comments there and I want to have
reply possiblity for each of them. Do I have to integrate the same
code underneath each one? I would rather like to have a box in that is
used for everyone of them. I believe this is somehow done with divs,
but I do not know how.

Here is my code:
html
  head
script src=/app_global/jquery-1.2.1.pack.js type=text/
javascript/script
script type=text/javascript
$(document).ready(function() {
  $('#slickbox').hide();
  $('a#reply').click(function() {
$('#slickbox').toggle('slow');
return false;
  });

});
/script
  /head
  body
a href=# id=replyReply/a
div id=slickboxpSpace for reply box/div
p
next comment
  /body
  /html

I would like to place a complex reply form into the id=slickbox, but
here is where the problems starts. If I do this for all 100 comments
the code will be way to much to load. There must be a smarter way to
achieve this.

Thank you for any help on this. I am pretty much stuck here.

Best regards,

Merlin
-- 
  Merlin
  [EMAIL PROTECTED]

-- 
http://www.fastmail.fm - Does exactly what it says on the tin



[jQuery] Newbie question: Create a horizontal slide effect to switch between two divs

2007-10-15 Thread squawk

I have two divs, both with their own id. If necessary, I can wrap them
in a container element. I would like to achieve an effect as on
http://www.hugeinc.com/casestudies/ but am not quite sure how to
start. Should I hide the later div first? or position it absolutely
outside the container div with overflow:none?
Can anyone give me a quick push in the direction that I should start
looking Thanks



[jQuery] newbie: question

2007-10-13 Thread Manu

hi,

To use AJAX in my website, I select the a field. I'll would like to
know if it is possible to select only the link who have not an onclick
method.

Thanks,



[jQuery] newbie question

2007-10-05 Thread marciovozes

Hi for all.
First, excuse my english ;)
I'm starting to use JQuery, and I feel that will help me a lot.
I build a class that can help anyone to make tabs without troubles,
but I think it most be improved, and that is the ideal place to do
that.
So by the way, is there anyway to send that code for you?
Thanks,
Marcio



[jQuery] Newbie question

2007-10-02 Thread Johny

Hi,
I have style defined like this

div#Explanation{position:absolute; top:720px; width:10px;  right:
0px;margin:40px 0 0 0;}

and my HTML code


 div id=Explanation
table border=1 cellpadding=0 cellspacing=0 width=100%
  tr
td width=6%font color=#FF*/font/td
td width=44%Login input type=text id=id_Loginname=Login
size=30 value= maxlength=50 //td
td width=50% rowspan=2Popis/td
  /tr
  tr
td width=6%font color=#FF*/font/td
td width=44%Passwordinput type=text
id=id_Passwordname=Password size=30 value= maxlength=50 //
td
  /tr
/table
/div

and I would like to add Explanation style to my div id=Explanation
using jQuery.
Is that possible?
Thanks
BL.



[jQuery] Newbie Question: Workiing with form fields and jQuery / Select in Particular

2007-09-20 Thread Brook Davies
How do you get a reference to a select field and then do things like set the
selectedIndex, get the options array etc.

 

I know I can get a reference to the object via a basic selector
$(#mySelect) but then how do I access the options array and related stuff?

 

How do you access the 'object' that you would get returned from
getElementById('mySelect')

 

Brook



[jQuery] NEWBIE QUESTION: Catch Select event

2007-09-20 Thread hobbit

Hi,

I would like to catch the select event when a user changes the select
item in any SELECT in a form.  Something like:

$(select).select(function() {
//do some stuff here...
)};

Is this feasible?



[jQuery] NEWBIE Question: children() skips first element?

2007-09-12 Thread Brook Davies


Hello,

I am trying to simply grab the children of a div. The markup is:

div id=content
div id=panelPreview class=fieldset_theme  
div id=panelPreview_inner class=hPanel
fieldset  
legend[Section/Panel
Heading]/legend   
/fieldset
/div
/div  
/div

But, what I don't understand is why when I call 

alert($('#content').children().html());

The resulting html starts with  'div id=panelPreview_inner
class=hPanel'

It seems like it is missing the first div after #content? What am I
missing??

Brook 





[jQuery] Newbie Question: Javascript Never Gets Called?

2007-09-11 Thread Vik

I'm a Javascript newbie, but I do have some Javascript working, and I
have the jQuery demo working.

Here's the code I have on one of my html pages to load javascript:

-
script src=http://localhost:/js/jquery.js; type=text/
javascript/script
script type=text/javascript src=http://localhost:/js/
jquery.selectCombo1.2.1.js/script
script type=text/javascript src=http://localhost:/js/
your_foundry.js/script/head
-

Here's the _entire_ contents of the your_foundry.js file:

-
$(function(){
$('#foundry_popup').selectCombo('get_units.lasso?setval=true',
'#units_for_alloy_id_no_');
});
-

And here's the popup, from the html:

-
select id=foundry_popup name=foundry_popup
option value=0 selectedNo Item Selected/option
option value=14007Iron/option
option value=18521Brass/option
option value=9040Steel/option
/select
-

The anomaly is that, I can set breakpoints on the javascript in the
your_foundry.js file, and, according to Firebug, the code in that file
is never called, even when I select an item from the popup.

What am I missing?

Thanks very much in advance to all for any info..



[jQuery] Newbie question about click()

2007-06-15 Thread Giovanni Battista Lenoci

Hi, I'm a newbie in jquery please be patient :-)

I'm playin with jquery mixing some tutorials.

I'm trying to open a p with some text within with the animation 
control, and a link. Then when I opened the p I want to change the 
behaviour of the link.

When I click on the link I do the animation, and then call the 
changebutton function that would be change the link in something that 
can close the opened p
I've noticed that the function passed in the click event seems to be 
appended instead of replaced.
I can't find in the docs where this beahviour is explained.

Please apologize me for my bad english.

Here some code:

html
  head
script type=text/javascript src=js/jquery.js/script
script type=text/javascript
  function changebutton() {
   $(#switch).click(function() {
 alert('what I\'m doing?');
 /* $(p).animate({ height: 'toggle', opacity: 'toggle' }, slow, 
changebutton);*/
   }); 
}
$(document).ready(function() {
  $(#switch).click(function() {
 $(p).animate({ height: 'show', opacity: 'show' }, slow, 
changebutton);
  });
});
/script
style
p {
  border:1px solid red;
  width:300px;
  display:none; 
}
/style
  /head
  body
a href=# id=switchOpen/a
p
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh 
euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim 
ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl 
ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in 
hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu 
feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui 
blandit praesent luptatum zzril delenit augue duis dolore te feugait nulla 
facilisi. Nam liber tempor cum soluta nobis eleifend option congue nihil 
imperdiet doming id quod mazim placerat facer possim assum. Typi non habent 
claritatem insitam; est usus legentis in iis qui facit eorum claritatem. 
Investigationes demonstraverunt lectores legere me lius quod ii legunt saepius. 
Claritas est etiam processus dynamicus, qui sequitur mutationem consuetudium 
lectorum. Mirum est notare quam littera gothica, quam nunc putamus parum 
claram, anteposuerit litterarum formas humanitatis per seacula quarta decima et 
quinta decima. Eodem modo typi, qui nunc nobis videntur parum clari, fiant 
sollemnes in futurum.
/p
  /body
/html





[jQuery] newbie question: keypress vs keydown

2007-05-21 Thread james_027

Hi,

Is there a difference between to two? Any guidelines on which one to
use on a certion situation?

Thanks
james



[jQuery] newbie question: how to set location to a target in a way that is supported by i.e. and safari?

2007-05-03 Thread [EMAIL PROTECTED]

Hi

can jquery help with the followng problem?

If, in conventional javascript, I have a function
goToAnchor(){
 href.location=#blah
}
and call it by body onLoad=goToAnchor()

then it works fine in i.e. and firefox but causes safari to endlessly
load the page - see (http://www.s-seven.net/safari_bug.html#h_value6)

I'd been hoping that jquery had a function which could handle this,
but haven't found it - sorry if its obvious (I hope it is :))

Many thanks

Ron