[jQuery] possible to have tilted DIVs?

2007-03-28 Thread dalvarado
Hi,

Daring to dream, I was wondering if jQuery can be used to "tilt" DIVs.  That 
is, a traditional square can be rotated several degrees to give the appearance 
of being tilted, or in an extreme case, be tilted 90 degrees to give the 
appearance of a diamond.

Any advice is appreciated, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] input textfield within a DIV that is sortable

2007-03-23 Thread dalvarado
Hi,

I'm having trouble getting the cursor to focus on a text field within a DIV 
that has been made sortable.  Here is the HTML








Roman Numeral Converter
Type in a 
number in either form.

 







and here's the JS ...

$('div.listGroup1').Sortable(
{
accept :'sortList',
helperclass :   'sortHelper',
activeclass :   'sortableactive',
hoverclass :'sortablehover',
opacity:0.8,
tolerance:  'intersect',
onStart : function()
{
$.iAutoscroller.start(this, 
document.getElementsByTagName('body'));
},
onStop : function()
{
$.iAutoscroller.stop();
saveDivPositions();
}
}
)

when I try and click on cursor on the textfield, it won't focus (no cursor 
appears within the textfield).  Any advice on what I can do to enter data in 
the textfield?

Thanks,  - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] animating off screen

2007-03-20 Thread dalvarado
Thanks, Bryan.  So if I want to get the viewable width of the screen, would I 
call Geometry.getHorizontalScroll?

 - Dave

>  ---Original Message---
>  From: Bryan McLemore <[EMAIL PROTECTED]>
>  Subject: Re: [jQuery] animating off screen
>  Sent: Mar 20 '07 16:54
>  
>  Here is some code from the Geometry lib I've written based on some code
>  out of one of my books and whatnot.
>  
>  
>  if (window.innerWidth) { //All but IE
>  Geometry.getViewportWidth= function() { return
>  window.innerWidth; };
>  Geometry.getViewportHeight   = function() { return
>  window.innerHeight; };
>  Geometry.getHorizontalScroll = function() { return
>  window.pageXOffset; };
>  Geometry.getVerticalScroll= function() { return
>  window.pageYOffset; };
>  } else if (document.documentElement &&
>  document.documentElement.clientWidth) { // IE6 w/ doctype
>  Geometry.getViewportWidth= function() { return
>  document.documentElement.clientWidth; };
>  Geometry.getViewportHeight   = function() { return
>  document.documentElement.clientHeight; };
>  Geometry.getHorizontalScroll = function() { return
>  document.documentElement.scrollLeft ; };
>  Geometry.getVerticalScroll   = function() { return
>  document.documentElement.scrollTop; };
>  } else if (document.body.clientWidth) { // IE4,5,6(w/o doctype)
>  Geometry.getViewportWidth= function() { return
>  document.body.clientWidth; };
>  Geometry.getViewportHeight   = function() { return
>  document.body.clientHeight; };
>  Geometry.getHorizontalScroll = function() { return
>  document.body.scrollLeft; };
>  Geometry.getVerticalScroll   = function() { return
>  document.body.scrollTop; };
>  }
>  
>  
>  The Viewport functions will tell you how big the browser window is (
>  displayable area only)
>  
>  
>  On 3/20/07, [LINK: MAILTO:[EMAIL PROTECTED]
>  [EMAIL PROTECTED] <[LINK: mailto:[EMAIL PROTECTED]
>  [EMAIL PROTECTED]> wrote: Hi,
>  
>  Yesterday I got some great help on how to animate a DIV and move it from
>  offscreen left to the middle of the screen.  My question now is I want to
>  slide that div to off-screen right.  The complication is that I don't
>  know how big the user's browser is going to be.  How can I slide the
>  div completely off screen to the right?
>  
>  Thanks, - Dave
>  
>  ___
>  jQuery mailing list
>  [LINK: mailto:[EMAIL PROTECTED] discuss@jquery.com
>  [LINK: http://jquery.com/discuss/] http://jquery.com/discuss/
>  
>  
>  --
>  --
>  Bryan McLemore
>  Kaelten

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] animating off screen

2007-03-20 Thread dalvarado
Hi,

Yesterday I got some great help on how to animate a DIV and move it from 
offscreen left to the middle of the screen.  My question now is I want to slide 
that div to off-screen right.  The complication is that I don't know how big 
the user's browser is going to be.  How can I slide the div completely off 
screen to the right?

Thanks, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Plugin to move DIVs?

2007-03-19 Thread dalvarado

Thanks for this info.  From reading the page, there is still one thing I'm 
unsure of.  If you want your DIV to come in from left to right, (from 
off-screen to center on screen), what are the parameters that should be passed?

Thanks, - Dave

>  ---Original Message---
>  From: John Beppu <[EMAIL PROTECTED]>
>  Subject: Re: [jQuery] Plugin to move DIVs?
>  Sent: Mar 19 '07 18:23
>  
>  You're looking for the Interface plugin:
>  
>  [LINK: http://interface.eyecon.ro/docs/animate]
>  http://interface.eyecon.ro/docs/animate
>  
>  
>  On 3/19/07,  [LINK: MAILTO:[EMAIL PROTECTED]
>  [EMAIL PROTECTED] <[LINK: mailto:[EMAIL PROTECTED]
>  [EMAIL PROTECTED]> wrote: Hi,
>  
>  What is the most appropriate plug-in that will allow me to slide a DIV
>  horizontally from off-screen to on-screen center?
>  
>  Thanks, - Dave
>  
>  ___
>  jQuery mailing list
>  [LINK: mailto:[EMAIL PROTECTED] discuss@jquery.com
>  [LINK: http://jquery.com/discuss/] http://jquery.com/discuss/

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Plugin to move DIVs?

2007-03-19 Thread dalvarado
Hi,

What is the most appropriate plug-in that will allow me to slide a DIV 
horizontally from off-screen to on-screen center?

Thanks, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] How to convert "class" to "style='attrs ...'" [Offtopic]

2007-03-15 Thread dalvarado
Hi Javier,

Thanks for your thoughtful insight into my question.  I will try out this code. 
 It definitely gets me closer to where I want to be.

Best regards, - Dave


>  ---Original Message---
>  From: Javier Infante <[EMAIL PROTECTED]>
>  Subject: Re: [jQuery] How to convert "class" to "style='attrs...'"   
> [Offtopic]
>  Sent: Mar 15 '07 20:05
>  
>  El jue, 15-03-2007 a las 18:50 +, [EMAIL PROTECTED]
>  escribió:
>  > Thanks but what I am really trying to do is find out all the attributes 
> that define  "myClass".  Below it appears you have hard-coded certain values, 
> but I won't know those ahead of time and there could be different classes per 
> element, each defined differently.
>  >
>  > Thanks, - Dave
>  
>  Hi Dave,
>  
>  I have found your question interesting and i think i have got you a
>  point from where you can start.
>  
>  Alltought the code is not jquery at all maybe some jquery hacker finds
>  it interesenting to develop a small plugin (if i get some time i might
>  give it a try)
>  
>  here goes the code:
>  
>  function getClassContent(classname) {
>  for (var i=0; ivar styleSheet=document.styleSheets[i];
>  var ii=0;
>  var cssRule=false;
>do {
>  if (styleSheet.cssRules) cssRule = styleSheet.cssRules[ii];
>  else cssRule = styleSheet.rules[ii];
>  if (cssRule) {
>eval ("regExp = /\."+classname+"/");  // I 
> will look for
>  div".classname" in the css
>  if (regExp.test(cssRule.selectorText))
>return cssRule.style.cssText;
>  }
>  ii++;
>  } while (cssRule);
>  }
>  }
>  
>  alert(getStyleAttribute("infoExtra"));
>  
>  This thing will only work with css rules defined as class (div.myClass),
>  but not with css rules defined for id (div#myId)... allthought i think
>  you could make that work not to hardly.
>  
>  anyway, is this what you were looking for?
>  
>  
>  --
>  Javier Infante
>  Dpto. Internet y Desarrollo
>  Irontec, Internet y sistemas sobre GNU/Linux - http://www.irontec.com
>  +34 94 404 81 82  -  Ext. 202
>  
>  
>  ___
>  jQuery mailing list
>  discuss@jquery.com
>  http://jquery.com/discuss/
>  

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] How to convert "class" to "style='attrs ...'"

2007-03-15 Thread dalvarado
Thanks but what I am really trying to do is find out all the attributes that 
define  "myClass".  Below it appears you have hard-coded certain values, but I 
won't know those ahead of time and there could be different classes per 
element, each defined differently.

Thanks, - Dave

>  ---Original Message---
>  From: Brandon Aaron <[EMAIL PROTECTED]>
>  Subject: Re: [jQuery] How to convert "class" to "style='attrs ...'"
>  Sent: Mar 15 '07 17:44
>  
>  I didn't think MySpace allowed JavaScript either?
>  
>  Here is how you could do it.
>  $(function() {
>  $('.myClass').css({ fontFamily:'verdana', fontSize:'12px' });
>  });
>  
>  --
>  Brandon Aaron
>  
>  On 3/15/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>  > Hi,
>  >
>  > I'm trying to write a function to generate MySpace friendly HTML.  MySpace 
> does not accept "link" tags, so the HTML from my page that contains 
> "class='whatever'", will mean nothing on the mySpace page.
>  >
>  > My question is, given an element with a class, e.g. " class='myClass'>Hello", how would I use jQuery to rewrite that element 
> as "

Re: [jQuery] How to convert "class" to "style='attrs ...'"

2007-03-15 Thread dalvarado
>  ---Original Message---
>  From: Sam Collett <[EMAIL PROTECTED]>
>  Subject: Re: [jQuery] How to convert "class" to "style='attrs ...'"
>  Sent: Mar 15 '07 17:06
>  
>  On 15/03/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>  > Hi,
>  >
>  > I'm trying to write a function to generate MySpace friendly HTML.  MySpace 
> does not accept "link" tags, so the HTML from my page that contains 
> "class='whatever'", will mean nothing on the mySpace page.
>  >
>  > My question is, given an element with a class, e.g. " class='myClass'>Hello", how would I use jQuery to rewrite that element 
> as "?
>  
>  
>@import "http://example.com/style.css";;
>  
>  

Sadly, no.  They filter out the "@import" tag. - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] How to convert "class" to "style='attrs ...'"

2007-03-15 Thread dalvarado
Hi,

I'm trying to write a function to generate MySpace friendly HTML.  MySpace does 
not accept "link" tags, so the HTML from my page that contains 
"class='whatever'", will mean nothing on the mySpace page.

My question is, given an element with a class, e.g. "Hello", how would I use jQuery to rewrite that element as 
"

[jQuery] Sortables question: one for the experts

2007-03-12 Thread dalvarado
Hi,

I have two DIVs, one on the left, one on the right, each full of mini-DIVs.  My 
question is, I want to drag mini-DIVs from the left DIV to the right DIV, with 
everything in the right DIV being Sortable.  However, I do not want any fo the 
DIVs in the left to be sortable, but I would like the mini-DIVs from the left 
to be able to be Sortable if they are dragged to the right DIV.

Could someone tell me what are the first steps to begin to do this?

Thanks for your help, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] How to test if droppable has accepted a draggable?

2007-03-12 Thread dalvarado
Hi,

Thanks for Erik's previous response.  I have a new question on this subject.  
If I have defined draggables with class "drag" a droppable zone with id = 
"dropzone1", once I have finished dragging my item, how do I test if it has 
been accepted by "dropzone1"?  

Further, if it has not been accepted, how do I send the draggable item back to 
its original position?

Thanks, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] More sensible draggables question

2007-03-12 Thread dalvarado
Hi,

After reading through the documentation, I have a more sensible question about 
draggables, overriding the more vague question I asked before.  I am trying to 
create an area where the draggable can be moved and if it is not moved to this 
area, I would prefer it returns to where it is.  I found an attribute 
"containment" for the draggable.  Sadly, my page does not seem to be respecting 
the containment.  Instead allowing the draggable to be moved anywhere on the 
screen, regardless of whether it is in the containment area.  Can someone help? 
 Here is the snippet of HTML / JS code.



Available Worksheets




Worksheet 1






$(document).ready(
function () {
$('#w1').Draggable(
{
zIndex: 1000,
containment:'userWIArea',
ghosting:   false,
opacity:0.7
}
);
}
)




My Custom Worksheet



 

 

Thanks, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] draggables question

2007-03-12 Thread dalvarado
Hi,

I have two DIVs on my page.  Div A contains smaller DIVs that I'd like to be 
able to drag to DIV B.  But if the user doesn't drag DIV A's smaller DIV within 
part of the boundary of DIV B, I'd like the smaller DIV to return back to where 
it was.  

Does JQuery support this?  I've looked at the demo

http://interface.eyecon.ro/demos/drag.html

and I can't find anything that does quite this.

Thanks for any help, - Dave 

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] How to get the response text of an .ajax call?

2007-03-05 Thread dalvarado
Hi,

Simple question.  How do I get the response text of an ajax call?  Right now, 
my call is returning an XMLHttpRequest object, but I don't know how to extract 
the plain text that I'm expecting.  here's the code

var responseData = $.ajax({
type: "POST",
url: url,
data: paramStr,
dataType: "text",
async: false,
error: function(request, msg){
alert( "Error upon saving request: " + msg );
},
success: function(request) {
// alert( "Saved" );
}
});
alert(responseData);
var responseText = responseData.html();

As you may have guessed, there is a JS error on the last line of code.

Thanks, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] How to find a div with a class ending with a string?

2007-03-05 Thread dalvarado
Hi,

This mailing list has been great and helped me figure out how to find elements 
starting with a pattern ...

$(this).find("[EMAIL PROTECTED]");

My question now is how to find elements ending with a pattern.  Specifically, 
I'm trying to find all DIVs that are within "$(this)" whose class ends with 
"-1".

Thanks, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] finding closest ancestor matching a pattern

2007-03-05 Thread dalvarado
Hi,

I am trying to find the closest ancestor whose id begins with "childrenTOC".   
I am invoking the function within the onclick handler of the element with class 
"toggleStrike".  Previously, I was given this code

$(this).parents("[EMAIL PROTECTED]"); 

but that seems to return an arrray of elements, and I just want the closest 
one.  Here is the HTML in question ...







Unit 1: Our Land and First People
Read
Remove




Thanks, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] get class name

2007-03-05 Thread dalvarado
Hi,

What is the jQuery syntax to ge the class name of an item with a known id?

Thanks, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] iterating over child elements

2007-03-05 Thread dalvarado
Hi,

If I find a DIV, through a call

var parentDiv = $(this).parents("div:first");

How do I iterate over the child elements of what I found?  Better yet, is there 
a way to print out the child elements and their ID's in one fell swoop?

Thanks, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] how to find an item when you only know part of the class name

2007-03-02 Thread dalvarado



>  ---Original Message---
>  From: Jake McGraw <[EMAIL PROTECTED]>
>  Subject: Re: [jQuery] how to find an item when you only know part of the 
> class name
>  Sent: Mar 02 '07 23:19
>  
>  Not sure if the source is like this too, but you haven't closed this
>  element (insert a ):
>  
>  Remove 
>  
>  Maybe, that'll help?
>  
>  - jake
>  
>  
>  On 3/2/07,  [LINK: MAILTO:[EMAIL PROTECTED]
>  [EMAIL PROTECTED] <[LINK: mailto:[EMAIL PROTECTED]
>  [EMAIL PROTECTED]> wrote:
>  
>  
>  >  ---Original Message---
>  >  From: Jake McGraw <[LINK: mailto:[EMAIL PROTECTED]
>  [EMAIL PROTECTED]>
>  >  Subject: Re: [jQuery] how to find an item when you only know part of
>  the class name
>  >  Sent: Mar 02 '07 22:46
>  >
>  >  You can reference any attribute using the following notation:
>  >
>  >  [EMAIL PROTECTED] Starts with
>  >  [EMAIL PROTECTED] Ends with
>  >  [EMAIL PROTECTED] equals
>  >  [EMAIL PROTECTED] contains
>  >
>  >  So for your problem...
>  >
>  >  $("[EMAIL PROTECTED]")
>  >
>  >  Hope this helps,
>  >
>  >  - jake
>  >
>  >
>  >  On 3/2/07, [LINK: MAILTO: [LINK: mailto:[EMAIL PROTECTED]
>  [EMAIL PROTECTED]
>  >  [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
>  <[LINK: mailto:[LINK: mailto:[EMAIL PROTECTED]
>  [EMAIL PROTECTED]
>  >  [LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]>
>  wrote: Hi,
>  >
>  >  I have a DIV whose ID I know.  Within that DIV is a table with a table
>  >  cell which either has a class beginning with the word "title" and
>  followed
>  >  by an integer.  I would like to reference the text within that table
>  cell.
>  >  What is the easiest way to get a reference to this cell?
>  >
>  >  Thanks, - Dave
>  >
>  >  ___
>  >  jQuery mailing list
>  >  [LINK: mailto:[LINK: mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]
>  [LINK: mailto:[EMAIL PROTECTED]  discuss@jquery.com
>  >  [LINK: [LINK: http://jquery.com/discuss/] http://jquery.com/discuss/]
>  [LINK: http://jquery.com/discuss/] http://jquery.com/discuss/
>  
>  I appreciate your reply.  I'm still not finding the element, and I
>  wanted to ask what I was doing wrong.  The JS is
>  
>  $(document).ready(
>  function () {
>  $('a.toggleStrike').click( function() {
>  var parentDiv =
>  $(this).parents("[EMAIL PROTECTED]");
>  alert(parentDiv[0].id);
>  var tdElt =
>  parentDiv.find("[EMAIL PROTECTED]");
>  alert(tdElt[0].id);
>  var textDecor =
>  tdElt.css('text-decoration');
>  var newDecor = textDecor == "line-through"
>"none" : "line-through";
>  tdElt.css('text-decoration',
>  newDecor);
>  });
>  }
>  )
>  
>  and a sample HTML div would be
>  
>style="display:block; margin-left:30px">
>  
>  
>  
>style="text-decoration:none" class="title3">Lesson 1 Core Ancient
>  Americans
>href='#'>Read
>  
>class="toggleStrike">Remove
>  
>  
>  
>  
>  The first alert displays the correct value, but the second alert displays
>  a blank box and subsequently everything in the highest level table gets a
>  strike through it when I just want this one cell.
>  
>  Thanks, - Dave
>  
>  ___
>  jQuery mailing list
>  [LINK: mailto:[EMAIL PROTECTED] discuss@jquery.com
>  [LINK: http://jquery.com/discuss/] http://jquery.com/discuss/


That was indeed a problem.  Sadly, even after I remedied that, I still get the 
same result -- the second alert shows a blank value and the entire table gets a 
line through it.

 - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] how to find an item when you only know part of the class name

2007-03-02 Thread dalvarado



>  ---Original Message---
>  From: Jake McGraw <[EMAIL PROTECTED]>
>  Subject: Re: [jQuery] how to find an item when you only know part of the 
> class name
>  Sent: Mar 02 '07 22:46
>  
>  You can reference any attribute using the following notation:
>  
>  [EMAIL PROTECTED] Starts with
>  [EMAIL PROTECTED] Ends with
>  [EMAIL PROTECTED] equals
>  [EMAIL PROTECTED] contains
>  
>  So for your problem...
>  
>  $("[EMAIL PROTECTED]")
>  
>  Hope this helps,
>  
>  - jake
>  
>  
>  On 3/2/07, [LINK: MAILTO:[EMAIL PROTECTED]
>  [EMAIL PROTECTED]  <[LINK: mailto:[EMAIL PROTECTED]
>  [EMAIL PROTECTED]> wrote: Hi,
>  
>  I have a DIV whose ID I know.  Within that DIV is a table with a table
>  cell which either has a class beginning with the word "title" and followed
>  by an integer.  I would like to reference the text within that table cell.
>  What is the easiest way to get a reference to this cell?
>  
>  Thanks, - Dave
>  
>  ___
>  jQuery mailing list
>  [LINK: mailto:[EMAIL PROTECTED] discuss@jquery.com
>  [LINK: http://jquery.com/discuss/] http://jquery.com/discuss/

I appreciate your reply.  I'm still not finding the element, and I wanted to 
ask what I was doing wrong.  The JS is

$(document).ready(
function () {
$('a.toggleStrike').click( function() {
var parentDiv = $(this).parents("[EMAIL 
PROTECTED]");
alert(parentDiv[0].id);
var tdElt = parentDiv.find("[EMAIL PROTECTED]");
alert(tdElt[0].id);
var textDecor = tdElt.css('text-decoration');
var newDecor = textDecor == "line-through" ? 
"none" : "line-through";
tdElt.css('text-decoration', newDecor);
});
}
)

and a sample HTML div would be





Lesson 1 Core Ancient Americans
Read

Remove




The first alert displays the correct value, but the second alert displays a 
blank box and subsequently everything in the highest level table gets a strike 
through it when I just want this one cell.

Thanks, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] how to find an item when you only know part of the class name

2007-03-02 Thread dalvarado
Hi,

I have a DIV whose ID I know.  Within that DIV is a table with a table cell 
which either has a class beginning with the word "title" and followed by an 
integer.  I would like to reference the text within that table cell.  What is 
the easiest way to get a reference to this cell?

Thanks, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Reference to newly inserted item?

2007-02-22 Thread dalvarado
Hi,

If I have

$(this).parents("div.sidebarToDo").find("td.sidebarText").empty().append('');

What is the best way to get a reference to the newly created text field?  Note 
that it does not have an ID and I would prefer a more generic way of finding it 
other than "input.editableItem" because on PC IE 6, if I insert multiple text 
fields, like the above, this call  ...

$(this).parents("div.sidebarToDo").find("input.editableTDItem");  

only returns a correct reference for the first time a textfield is added.  I 
cant get the most recent addition with the above call if there had been text 
fields added in the past.

Thanks, please let me know what info I can provide to make this question more 
clear, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Reference to the last DIV in a group?

2007-02-22 Thread dalvarado
Hello,

I have a main div, with id= "todoList", and within it, a number of DIVs, all 
with classes "sidebarToDo".  Let's say I have just added a DIV to the DOM ...

$('#todoList').append('Hello');

How do I now get a reference to this last DIV with class "sidebarToDo"?  Notice 
it doesn't have an ID, but it is the last one in the master todoList DIV.

Thanks so much.  This discussion group is excellent. - Dave


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] appending text nodes

2007-02-22 Thread dalvarado
Thanks.  I incorporated your suggestion ... this is where item was coming from

var item = $(this).parents("div.sidebarToDo").find("td.sidebarText").text();

Things work great. - Dave


>  ---Original Message---
>  From: Karl Swedberg <[EMAIL PROTECTED]>
>  Subject: Re: [jQuery] appending text nodes
>  Sent: Feb 22 '07 16:17
>  
>  Hi Dave,
>  
>  
>  Not sure where the "item" variable is coming from, but you can try setting
>  the variable first with .text() and then just including that variable name
>  in the append string.
>  
>  
>  Something like this:
>  
>  
>  var item = $('your-selector-goes-here').text();
>  
>  
>  And then, instead of $.text(item) in the append string, just use item.
>  So:
>  
>  
>  
> $(this).parents("div.sidebarToDo").find("td.sidebarText").empty().append("  type=\"text\" size=\"10\" class=\"editableTDItem\" value=\"" + item +
>  "\">");
>  
>  
>  --Karl
>  
>  _
>  
>  Karl Swedberg
>  
>  www.englishrules.com
>  
>  www.learningjquery.com
>  
>  
>  On Feb 22, 2007, at 11:06 AM, <[LINK: mailto:[EMAIL PROTECTED]
>  [EMAIL PROTECTED]> <[LINK: mailto:[EMAIL PROTECTED]
>  [EMAIL PROTECTED]> wrote:
>  
>  
>   ---Original Message---
>  
>   From: Kristinn Sigmundsson <[LINK: mailto:[EMAIL PROTECTED]
>  [EMAIL PROTECTED]>
>  
>   Subject: Re: [jQuery] appending text nodes
>  
>   Sent: Feb 22 '07 15:42
>  
>  
>   Hm, you empty it and then append to it? wouldn't that be the same as
>  
>   using .html(val)? If that is what you'd want to do, try the .text()
>  
>   command:
>  
>   $(this).parents("div.sidebarToDo").find("td.sidebarText").text(val)
>  
>  
>   contents of "td.sidebarText" will be replaced with val
>  
>  
>   On 2/22/07, [LINK: mailto:[EMAIL PROTECTED]
>  [EMAIL PROTECTED] <[LINK: mailto:[EMAIL PROTECTED]
>  [EMAIL PROTECTED]> wrote:
>  
>  Hi, I want to append text to a node.  I'm using this code
>  
>  
>  
> $(this).parents("div.sidebarToDo").find("td.sidebarText").empty().append(val);
>  
>  
>  but if the variable "val" contains special characters, like "", that
>  will mess up the rest of my tree.  What is the best way to handle this?
>  
>  
>  Thanks, - Dave
>  
>  
>  ___
>  
>  jQuery mailing list
>  
>  [LINK: mailto:[EMAIL PROTECTED] discuss@jquery.com
>  
>  [LINK: http://jquery.com/discuss/] http://jquery.com/discuss/
>  
>  
>  Thanks.  This is what I wanted to do.  One further question about the
>  "text" command.  I'm getting a JS error when I try to implement the
>  following:
>  
>  
>
>  
> $(this).parents("div.sidebarToDo").find("td.sidebarText").empty().append("  type=\"text\" size=\"10\" class=\"editableTDItem\" value=\"" + $.text(item)
>  + "\">");
>  
>  
>  Your thoughts?  Thanks, - Dave
>  
>  
>  ___
>  
>  jQuery mailing list
>  
>  [LINK: mailto:[EMAIL PROTECTED] discuss@jquery.com
>  
>  [LINK: http://jquery.com/discuss/] http://jquery.com/discuss/

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] appending text nodes

2007-02-22 Thread dalvarado
>  ---Original Message---
>  From: Kristinn Sigmundsson <[EMAIL PROTECTED]>
>  Subject: Re: [jQuery] appending text nodes
>  Sent: Feb 22 '07 15:42
>  
>  Hm, you empty it and then append to it? wouldn't that be the same as
>  using .html(val)? If that is what you'd want to do, try the .text()
>  command:
>  $(this).parents("div.sidebarToDo").find("td.sidebarText").text(val)
>  
>  contents of "td.sidebarText" will be replaced with val
>  
>  On 2/22/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>  > Hi, I want to append text to a node.  I'm using this code
>  >
>  > 
> $(this).parents("div.sidebarToDo").find("td.sidebarText").empty().append(val);
>  >
>  > but if the variable "val" contains special characters, like "", that 
> will mess up the rest of my tree.  What is the best way to handle this?
>  >
>  > Thanks, - Dave
>  >
>  > ___
>  > jQuery mailing list
>  > discuss@jquery.com
>  > http://jquery.com/discuss/
>  >
>  

Thanks.  This is what I wanted to do.  One further question about the "text" 
command.  I'm getting a JS error when I try to implement the following:


$(this).parents("div.sidebarToDo").find("td.sidebarText").empty().append("");

Your thoughts?  Thanks, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] appending text nodes

2007-02-22 Thread dalvarado
Hi, I want to append text to a node.  I'm using this code

$(this).parents("div.sidebarToDo").find("td.sidebarText").empty().append(val);

but if the variable "val" contains special characters, like "", that will 
mess up the rest of my tree.  What is the best way to handle this?

Thanks, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Sortables: trouble editing a textfield that is a sortable

2007-02-21 Thread dalvarado
Hi, Let's say my web page consists solely of









Item 1

Item 3
Item 4
Item 5
Item 6
Item 7


$(document).ready(
function () {
$('#todoList').Sortable(
{
accept :'sidebarToDo',
helperclass :   'sorthelper',
activeclass :   'sortableactive',
hoverclass :'sortablehover',
opacity:0.8,
fx: 100,
axis:   'vertically',
opacity:0.4,
revert: true
}
)
}
);




On PC Firefox (haven't tested in IE), I'm having a problem trying to edit the 
value of the text field.  Whenever I focus my cursor on it, it treats it like 
I'm trying to move it and won't let me edit the field.  How can I adjust the 
above so I'm still able to edit that field?

Thanks, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Easiest way to add elements on the fly?

2007-02-21 Thread dalvarado
Hi,

If, after the document has fully loaded, I want to append a DIV to the end of 
another DIV with id = "todoList", what is the easiest way to do that?  The HTML 
code that I want to append is below ...




   
   
   
   




Thanks, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] How to get the ID of the parent node?

2007-02-21 Thread dalvarado
>  ---Original Message---
>  From: Sam Collett <[EMAIL PROTECTED]>
>  Subject: Re: [jQuery] How to get the ID of the parent node?
>  Sent: Feb 21 '07 17:19
>  
>  On 21/02/07, Sam Collett <[EMAIL PROTECTED]> wrote:
>  > On 21/02/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>  > >
>  > > >  ---Original Message---
>  > > >  From: Chris Ovenden <[EMAIL PROTECTED]>
>  > > >  Subject: Re: [jQuery] How to get the ID of the parent node?
>  > > >  Sent: Feb 21 '07 16:04
>  > > >
>  > > >  On 2/21/07, SAM COLLETT <[LINK: mailto:[EMAIL PROTECTED]
>  > > >  [EMAIL PROTECTED]> wrote: On 21/02/07, [LINK:
>  > > >  mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] <[LINK:
>  > > >  mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]> wrote:
>  > > >  > Hi,
>  > > >  >
>  > > >  > Following up from a question I asked yesterday, I wanted to get the
>  > > >  closest parent DIV given an arbitrary nested element.  But when I 
> request
>  > > >  the ".id" of that element, i repeatedly get an "undefined" message, 
> even
>  > > >  though this call, "$(this).parent(" div.sidebarToDo")" yields an 
> object.
>  > > >  >
>  > > >  > $('#todoList
>  > > >  a.deleteTDItem').each(function(index) {
>  > > >  > var divId =
>  > > >  $(this).parent("div.sidebarToDo").id;
>  > > >  > alert(divId);   // alwasy gives
>  > > >  'undefined'
>  > > >  > $(this).click = function() { $('#' +
>  > > >  divId).remove(); };
>  > > >  > });
>  > > >  >
>  > > >  > This is the HTML in question:
>  > > >  >
>  > > >  > 
>  > > >  > 
>  > > >  > 
>  > > >  >   > > >  type="checkbox" id="tdcb3" >
>  > > >  >
>  > > >  > Start Work
>  > > >  >   > > >  src="images/edit.gif" alt="Edit" border="0">
>  > > >  >   > > >  href="javascript:toggleDiv('dToDo3');">  > > >  src="images/deleteLink.gif" alt="Delete" border="0">
>  > > >  > 
>  > > >  > 
>  > > >  > 
>  > > >  >
>  > > >  > Thanks, - Dave
>  > > >
>  > > >  You can get the id via attr:
>  > > >
>  > > >  $(this).parent("div.sidebarToDo").attr("id")
>  > > >
>  > > >
>  > > >  To spell it out a little more clearly, the API for attributes has 
> changed
>  > > >  in jQuery 1.0.3+ and shortcuts like .id() no longer work
>  > > >
>  > > >  --
>  > > >  Chris Ovenden
>  > > >
>  > > >  [LINK: http://thepeer.blogspot.com]  http://thepeer.blogspot.com
>  > > >  "Imagine all the people / Sharing all the world"
>  > >
>  > > Thanks, but I'm still getting "undefined" even though I can an object 
> for my reference to the DIV.  Any ideas on how to troubleshoot?  here's the 
> JS:
>  > >
>  > > $('#todoList a.deleteTDItem').each(function(index) {
>  > > var divId = 
> $(this).parent("div.sidebarToDo").attr("id");
>  > > alert($(this).parent("div.sidebarToDo") + " id:" 
> + divId);
>  > > $(this).click = function() { $('#' + 
> divId).remove(); };
>  > > });
>  > >
>  >
>  > I would have thought that would have worked.. you could always try:
>  > $(this).parent("div.sidebarToDo")[0].id
>  >
>  > I think I have an idea of what you are trying to do - hide the todo
>  > item when delete is clicked, and put a line through the task if the
>  > checkbox is checked (i.e. task completed). In that case, the HTML can
>  > be tidied up a bit (I've removed the id's to improve readability, and
>  > also noticed that you had two defined on the checkbox):
>  >
>  >
>  > 
>  > 
>  > 
>  >
>  >Start Work
>  >  > src="images/edit.gif" alt="Edit" border="0">
>  >  > src="images/deleteLink.gif" alt="Delete" border="0">
>  > 
>  > 
>  > 
>  >
>  > And the following JavaScript used:
>  >
>  > $('#todoList a.deleteTDItem').click( function() {
>  > alert("clicked");
>  > $(this).parent("div.sidebarToDo").remove();
>  > return false;
>  > });
>  
>  That should be:
>  
>  $('#todoList a.deleteTDItem').click( function() {
>  $(this).parents("div.sidebarToDo").remove();
>  return false;
>  });
>  
>  > $('#todoList :checkbox').click( function() {
>  > var textDecor = (this.checked ? 'line-through' : 'none');
>  > $(this).parent().find("td.sidebarText").css('text-decoration', 
> textDecor);
>  > });
>  >
>  

You guessed correctly on the bigger picture of what I'm trying to do.  Thanks 
to all for their responses.  The "s" thing solved the biggest hurdle I was 
trying to get over. - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] How to get the ID of the parent node?

2007-02-21 Thread dalvarado

>  ---Original Message---
>  From: Chris Ovenden <[EMAIL PROTECTED]>
>  Subject: Re: [jQuery] How to get the ID of the parent node?
>  Sent: Feb 21 '07 16:04
>  
>  On 2/21/07, SAM COLLETT <[LINK: mailto:[EMAIL PROTECTED]
>  [EMAIL PROTECTED]> wrote: On 21/02/07, [LINK:
>  mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] <[LINK:
>  mailto:[EMAIL PROTECTED] [EMAIL PROTECTED]> wrote:
>  > Hi,
>  >
>  > Following up from a question I asked yesterday, I wanted to get the
>  closest parent DIV given an arbitrary nested element.  But when I request
>  the ".id" of that element, i repeatedly get an "undefined" message, even
>  though this call, "$(this).parent(" div.sidebarToDo")" yields an object.
>  >
>  > $('#todoList
>  a.deleteTDItem').each(function(index) {
>  > var divId =
>  $(this).parent("div.sidebarToDo").id;
>  > alert(divId);   // alwasy gives
>  'undefined'
>  > $(this).click = function() { $('#' +
>  divId).remove(); };
>  > });
>  >
>  > This is the HTML in question:
>  >
>  > 
>  > 
>  > 
>  >   type="checkbox" id="tdcb3" >
>  >
>  > Start Work
>  >   src="images/edit.gif" alt="Edit" border="0">
>  >   href="javascript:toggleDiv('dToDo3');">  src="images/deleteLink.gif" alt="Delete" border="0">
>  > 
>  > 
>  > 
>  >
>  > Thanks, - Dave
>  
>  You can get the id via attr:
>  
>  $(this).parent("div.sidebarToDo").attr("id")
>  
>  
>  To spell it out a little more clearly, the API for attributes has changed
>  in jQuery 1.0.3+ and shortcuts like .id() no longer work
>  
>  --
>  Chris Ovenden
>  
>  [LINK: http://thepeer.blogspot.com]  http://thepeer.blogspot.com
>  "Imagine all the people / Sharing all the world"

Thanks, but I'm still getting "undefined" even though I can an object for my 
reference to the DIV.  Any ideas on how to troubleshoot?  here's the JS:

$('#todoList a.deleteTDItem').each(function(index) {
var divId = 
$(this).parent("div.sidebarToDo").attr("id");
alert($(this).parent("div.sidebarToDo") + " id:" + 
divId);
$(this).click = function() { $('#' + divId).remove(); };
});



___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] How to get the ID of the parent node?

2007-02-21 Thread dalvarado
Hi,

Following up from a question I asked yesterday, I wanted to get the closest 
parent DIV given an arbitrary nested element.  But when I request the ".id" of 
that element, i repeatedly get an "undefined" message, even though this call, 
"$(this).parent("div.sidebarToDo")" yields an object.

$('#todoList a.deleteTDItem').each(function(index) {
var divId = $(this).parent("div.sidebarToDo").id;
alert(divId);   // alwasy gives 'undefined'
$(this).click = function() { $('#' + divId).remove(); };
});

This is the HTML in question:






Start Work






Thanks, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Getting parent nodes

2007-02-20 Thread dalvarado
Hi,

If I have a "this.id" reference to an element in my DOM, how would i get its 
parent node?  

More challenging, how would I get the first DIV node that the element is in?  
That is, it may be nested within an arbitrary number of table cells, but there 
is a DIV lurking at the top ...




   
  
 

In the example here, I would like to get a reference to the DIV with ID = 
"inner".

Thanks, you guys are the best, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] easy way to get checkbox state from within a DIV

2007-02-20 Thread dalvarado
>  ---Original Message---
>  From: Chris Domigan <[EMAIL PROTECTED]>
>  Subject: Re: [jQuery] easy way to get checkbox state from within a DIV
>  Sent: Feb 20 '07 20:48
>  
>  Oops, replace input.checked with input:checked.
>  
>  :)
>  
>  
>  ___
>  jQuery mailing list
>  [LINK: [EMAIL PROTECTED] discuss@jquery.com
>  [LINK: http://jquery.com/discuss/] http://jquery.com/discuss/

Thanks.  This indeed worked.  One follow up question, if I want to iterate over 
all the anchor tags in this same block with the class, "deleteAnchor", how 
would I invoke them?

 - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] easy way to get checkbox state from within a DIV

2007-02-20 Thread dalvarado
Hi,

I'm sure there's a shorthand way to do this.  I'm trying to get the checked 
state of a checkbox, the only one, within a particular DIV.  I would prefer not 
to use the ID of the checkbox but some more generic way of referring to the 
only checkbox within the DIV, id=dToDo1.  I am fine to use the ID of the DIV in 
the shorthand expression.  Here's how the HTML looks:





Wake 
Up






Thanks for your help, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Sortables question

2007-02-20 Thread dalvarado
>  ---Original Message---
>  From: Blair Mitchelmore <[EMAIL PROTECTED]>
>  Subject: Re: [jQuery] Sortables question
>  Sent: Feb 20 '07 18:29
>  
>  $('ol.steps li').each(function(index) {
>  $(this).append('List item ' + (index + 1) +
>  '');
>  });
>  
>  Would convert:
>  
>  
>  Cut a hole in a box
>  Put your junk in that box
>  Make her open the box
>  
>  
>  into:
>  
>  
>  Cut a hole in a boxList item 1
>  Put your junk in that boxList item 2
>  Make her open the boxList item 3
>  
>  
>  ...I think...
>  
>  If each li element has an id attribute you can access them by using
>  this.id inside the each iterator function.
>  
>  -blair
>  
>  [EMAIL PROTECTED] wrote:
>  > Regarding the sortables plug-in and the specific example
>  >
>  > http://interface.eyecon.ro/demos/sort_lists.html
>  >
>  > does anyone know how I would iterate over the items in the list in the 
> order in which they appear on screen?  My goal is to list the ids in the 
> order they appear.
>  >
>  > Your help is greatly appreciated as always, - Dave
>  >
>  > ___
>  > jQuery mailing list
>  > discuss@jquery.com
>  > http://jquery.com/discuss/
>  
>  

Beautiful!  Thanks, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Sortables question

2007-02-20 Thread dalvarado
Regarding the sortables plug-in and the specific example

http://interface.eyecon.ro/demos/sort_lists.html

does anyone know how I would iterate over the items in the list in the order in 
which they appear on screen?  My goal is to list the ids in the order they 
appear.

Your help is greatly appreciated as always, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Right way to set line-through?

2007-02-20 Thread dalvarado
Hi,

How do I use JQuery to set the text-decoration of an element with ID "id1" to 
"line-through"?  

Thanks, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Rounded corners question

2007-02-19 Thread dalvarado
Hi,

Please disregard my previous post about a bug in jquery and text elements.  I 
wish to revise that by saying, when I include jquery, the jq-corner.js library 
and then include this code


$(function(){
$('.inner').wrap('
'); $('.inner').each(function() { $(this).corner("round 5px").parent().css('padding', '1px').corner("round 6px"); }); }); the text elements within the DIV "inner" get disassociated from the parent form -- that is, when I submit the form, the elements are no longer a part of them. Here is the HTML for one of my DIVs. The text element "PM16033-1497" is getting dropped from the form. Any advice on how to overcome this problem is greatly appreciated. - Dave printer name:  customPrinter department:  Main printer model: MyManufacturer MyPrinter abcd / MyCartridge $15.00 $7.50   Qty: ___ jQuery mailing list discuss@jquery.com http://jquery.com/discuss/

[jQuery] Bug in jquery related to text elements?

2007-02-19 Thread dalvarado
Hi,

Is anyone familiar with a bug in JQuery where including the "jquery.js" library 
on your page seems to disassociate text elements from their parent forms?  This 
is the text element I have that no longer recognizes its parent form when I 
call "alert(document.getElementById('PM16033-1497').form.name);".  I get a JS 
error, "document.getElementById ... .form has no properties".



Thanks, - 

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Why isn't my Ajax call working?

2007-02-16 Thread dalvarado

>  ---Original Message---
>  From: Jake McGraw <[EMAIL PROTECTED]>
>  Subject: Re: [jQuery] Why isn't my Ajax call working?
>  Sent: Feb 16 '07 22:58
>  
>  Sorry, that function needs to be attached to jQuery object... if
>  you're just going to put up an alert box, you can use:
>  
>  $(document).ajaxError(function(request, settings){
>   alert('An error has occurred!');
>  });
>  
>  That should work, I think.
>  
>  - jake
>  
>  On 2/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>  >
>  > >  ---Original Message---
>  > >  From: Jake McGraw <[EMAIL PROTECTED]>
>  > >  Subject: Re: [jQuery] Why isn't my Ajax call working?
>  > >  Sent: Feb 16 '07 22:33
>  > >
>  > >  Which PHP array are you using to access user variables? If you're
>  > >  using $_GET, then your AJAX Post variables won't show up in the
>  > >  application, I usually use $_REQUEST. Also, have you thought of using
>  > >  the jQuery ajax abstraction methods? Something like this should do the
>  > >  trick (not tested):
>  > >
>  > >  $.ajaxError(function(request, settings){
>  > >  alert('An error has occurred!');
>  > >  });
>  > >
>  > >  function loadModuleHTML(p_id, p_moduleIndex) {
>  > >  $.post('get_file_contents.php',{mod_index:p_moduleIndex},function(data){
>  > >  $("#"+p_id).empty().append(''+data+'');
>  > >  });
>  > >
>  > >  $(function(){
>  > >  loadModuleHTML('li0',0);
>  > >  });
>  > >
>  > >  I noticed that you're using some plain Jane JavaScript, like
>  > >  'getElementById', etc. In case you haven't already, you should check
>  > >  out all the amazing things jQuery can do besides ajax.
>  > >
>  > >  - jake
>  > >
>  > >  On 2/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>  > >  > Hi,
>  > >  >
>  > >  > I'm sure this is really simple, but here is my dilemma.  I'm trying 
> to make an Ajax call to get some response text.  However, when I make the 
> call, my "html" variable is coming up empty.  Additionally, my error function 
> is never invoked.
>  > >  >
>  > >  > function loadModuleHTML(p_id, p_moduleIndex) {
>  > >  > var html = $.ajax({
>  > >  > type: "POST",
>  > >  > url: "get_file_contents.php",
>  > >  > data: "mod_index=" + p_moduleIndex,
>  > >  > dataType: "html",
>  > >  > error: function(req, errorMsg) {
>  > >  > alert("An error occurred: " + 
> errorMsg);
>  > >  > }
>  > >  > }).responseText;
>  > >  > alert(html);// This always returns a 
> blank alert box.
>  > >  > document.getElementById(p_id).innerHTML = " class=\"sortListInner\">" + html + "";
>  > >  > }// loadModuleHTML
>  > >  >
>  > >  > $().ready(function() {
>  > >  > loadModuleHTML('li0', 0);
>  > >  > });
>  > >  >
>  > >  > If I hard code the URL 
> "mydomain.com/get_file_contents.php?mod_index=0" into my browser, I get valid 
> HTML returned.  Any ideas what's going on?
>  > >  >
>  > >  > Thanks, - Dave
>  > >  >
>  > >  > ___
>  > >  > jQuery mailing list
>  > >  > discuss@jquery.com
>  > >  > http://jquery.com/discuss/
>  > >  >
>  > >
>  >
>  > Thanks for this info.  Unfortunately, I'm getting a JS error "$.ajaxError 
> is not a function".  My code is below.  Is that the right syntax or do I need 
> to be using a more current version of jQuery?
>  >
>  > $.ajaxError(function(request, settings){
>  > alert('An error has occurred!');
>  > });
>  >
>  > function loadModuleHTML(p_id, p_moduleIndex) {
>  > $.post('get_file_contents.php',
>  > {mod_index:p_moduleIndex},
>  > function(data){
>  > $("#"+p_id).empty().append(' class="sortListInner">'+data+'');
>  > });
>  > }
>  >
>  > $(function(){
>  > loadModuleHTML('li0',0);
>  > });
>  >
>  > Thanks, - Dave
>  >
>  > ___
>  > jQuery mailing list
>  > discuss@jquery.com
>  > http://jquery.com/discuss/
>  >
>  

It does.  Thanks, Jake.  I have seen the light! - 

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Why isn't my Ajax call working?

2007-02-16 Thread dalvarado

>  ---Original Message---
>  From: Jake McGraw <[EMAIL PROTECTED]>
>  Subject: Re: [jQuery] Why isn't my Ajax call working?
>  Sent: Feb 16 '07 22:33
>  
>  Which PHP array are you using to access user variables? If you're
>  using $_GET, then your AJAX Post variables won't show up in the
>  application, I usually use $_REQUEST. Also, have you thought of using
>  the jQuery ajax abstraction methods? Something like this should do the
>  trick (not tested):
>  
>  $.ajaxError(function(request, settings){
>  alert('An error has occurred!');
>  });
>  
>  function loadModuleHTML(p_id, p_moduleIndex) {
>  $.post('get_file_contents.php',{mod_index:p_moduleIndex},function(data){
>  $("#"+p_id).empty().append(''+data+'');
>  });
>  
>  $(function(){
>  loadModuleHTML('li0',0);
>  });
>  
>  I noticed that you're using some plain Jane JavaScript, like
>  'getElementById', etc. In case you haven't already, you should check
>  out all the amazing things jQuery can do besides ajax.
>  
>  - jake
>  
>  On 2/16/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>  > Hi,
>  >
>  > I'm sure this is really simple, but here is my dilemma.  I'm trying to 
> make an Ajax call to get some response text.  However, when I make the call, 
> my "html" variable is coming up empty.  Additionally, my error function is 
> never invoked.
>  >
>  > function loadModuleHTML(p_id, p_moduleIndex) {
>  > var html = $.ajax({
>  > type: "POST",
>  > url: "get_file_contents.php",
>  > data: "mod_index=" + p_moduleIndex,
>  > dataType: "html",
>  > error: function(req, errorMsg) {
>  > alert("An error occurred: " + errorMsg);
>  > }
>  > }).responseText;
>  > alert(html);// This always returns a blank 
> alert box.
>  > document.getElementById(p_id).innerHTML = " class=\"sortListInner\">" + html + "";
>  > }// loadModuleHTML
>  >
>  > $().ready(function() {
>  > loadModuleHTML('li0', 0);
>  > });
>  >
>  > If I hard code the URL "mydomain.com/get_file_contents.php?mod_index=0" 
> into my browser, I get valid HTML returned.  Any ideas what's going on?
>  >
>  > Thanks, - Dave
>  >
>  > ___
>  > jQuery mailing list
>  > discuss@jquery.com
>  > http://jquery.com/discuss/
>  >
>  

Thanks for this info.  Unfortunately, I'm getting a JS error "$.ajaxError is 
not a function".  My code is below.  Is that the right syntax or do I need to 
be using a more current version of jQuery?  

$.ajaxError(function(request, settings){
alert('An error has occurred!');
});

function loadModuleHTML(p_id, p_moduleIndex) {
$.post('get_file_contents.php',
{mod_index:p_moduleIndex},
function(data){
$("#"+p_id).empty().append(''+data+'');
});
}

$(function(){
loadModuleHTML('li0',0);
});

Thanks, - Dave  

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Why isn't my Ajax call working?

2007-02-16 Thread dalvarado
Hi,

I'm sure this is really simple, but here is my dilemma.  I'm trying to make an 
Ajax call to get some response text.  However, when I make the call, my "html" 
variable is coming up empty.  Additionally, my error function is never invoked.

function loadModuleHTML(p_id, p_moduleIndex) { 
var html = $.ajax({
type: "POST",
url: "get_file_contents.php",
data: "mod_index=" + p_moduleIndex,
dataType: "html",
error: function(req, errorMsg) { 
alert("An error occurred: " + errorMsg); 
}
}).responseText;
alert(html);// This always returns a blank alert 
box. 
document.getElementById(p_id).innerHTML = "" + html + "";
}// loadModuleHTML

$().ready(function() {
loadModuleHTML('li0', 0);
}); 

If I hard code the URL "mydomain.com/get_file_contents.php?mod_index=0" into my 
browser, I get valid HTML returned.  Any ideas what's going on?

Thanks, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] jqModal: How to invoke functions after ajax has loaded?

2007-02-16 Thread dalvarado
Hi,

Using jqModal, if I define that my dialog load its contents through ajax

$('#editPanelTitle').jqm({trigger: '#editTitle1',
  focus: true,
  overlayColor: '#fff',
  overlay: 30,
  ajax: "panel_title.html"},
 function(h) {
/* do stuff */
 });


how do I invoke a JS function once the ajax contents have been loaded?  The 
"onOpen" argument of the jqModal doesn't seem to work because I'm not 
guaranteed the ajax call will be loaded.

Thanks, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] rounding the corners but making the background transparent

2007-02-15 Thread dalvarado
Hi,

I used this JS to make my borders rounded ...

$().ready(function() {
$('#editPanelTitle').corner();
});

Here is the class-id definition:

#editPanelTitle {
background: #ff;
position:absolute;
font-family:verdana,tahoma,helvetica;
width:  400px;
display:none;
}

Problem is, the corners get rounded, but if I float my DIV above other 
elements, the space between the rounded corner and the normal rectangular 
corner is filled with white background, and I would prefer that this space be 
transparent, allowing you to see the elements behind.  Is that possible?  Is my 
question clear enough?

Thanks, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Centering jqmodal dialog windows

2007-02-15 Thread dalvarado
>  ---Original Message---
>  From: Benjamin Sterling <[EMAIL PROTECTED]>
>  Subject: Re: [jQuery] Centering jqmodal dialog windows
>  Sent: Feb 15 '07 18:28
>  
>  Dave,
>  you need to do something like:
>  
>  .jqWindow{
>  position:absolute;
>  width:300px;
>  height: 300px;
>  margin:-150px 0 0 -150px;
>  left:50%;
>  top:50%;
>  }
>  
>  
>  --
>  Benjamin Sterling
>  [LINK: http://www.KenzoMedia.com] http://www.KenzoMedia.com
>  [LINK: http://www.KenzoHosting.com] http://www.KenzoHosting.com

Thanks for this reply, unfortunately, when I defined the id for my class as

#editPanelTitle {
position:absolute;
font-family:verdana,tahoma,helvetica;
width:  400px;
display:none;
top:50%;
left:50%;
}

the jqmodal window appeared at the right of the screen, about 100 pixels down 
from the top, but definitely not vertically aligned.  When I added the "margin" 
property you suggested, the window did not appear at all.  No JS errors were 
reported.

 - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Centering jqmodal dialog windows

2007-02-15 Thread dalvarado
Hi,

What is the easiest way to center a jqModal dialog window?  The examples from 
http://dev.iceburg.net/jquery/jqModal/ seem to have the windows at fixed points 
on the screen.

Thanks, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Can't get a 1 pixel rounded corner

2007-02-15 Thread dalvarado
>  ---Original Message---
>  From: Mike Alsup <[EMAIL PROTECTED]>
>  Subject: Re: [jQuery] Can't get a 1 pixel rounded corner
>  Sent: Feb 15 '07 17:47
>  
>  > Following advice on this mailing list, I visited 
> http://www.malsup.com/jquery/corner/ to learn how to create a rounded border 
> that was a different color than the inner DIV.  I want to create a 1 pixel 
> border, and so I changed the code in the first "Adornment" example to read ...
>  >
>  > $(this).corner("round 8px").parent().css('padding', '1px').corner("round 
> 10px")
>  >
>  > but in both PC IE and Firefox, at the upper left and right box corners, 
> you can see pointy box corners, whereas at the bottom, the corners round 
> smoothly.  How can I adjust the above to make the top corners as smooth as 
> the bottom ones?
>  
>  
>  Dave,
>  
>  There are some practical limitations with this adornment approach.
>  But usually after a little experimenting you'll find something that
>  works.  For example, in your case, using a smaller border radius works
>  well:
>  
>  $(this).corner("round 5px").parent().css('padding', '1px').corner("round 
> 6px")
>  
>  With our implementation the acceptable "border width" (padding) is
>  constrained by the corner radius.  The larger the radius, the larger
>  the padding required to "hide" the inner corner.
>  
>  Mike
>  


I read this after posting my last reply.  This works perfectly.  Thanks for 
taking the time to explain.

 - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Can't get a 1 pixel rounded corner

2007-02-15 Thread dalvarado
>  ---Original Message---
>  From: Dave Methvin <[EMAIL PROTECTED]>
>  Subject: RE: [jQuery] Can't get a 1 pixel rounded corner
>  Sent: Feb 15 '07 17:36
>  
>  
>  > $(this).corner("round 8px").parent().css('padding', '1px').corner("round
>  10px")
>  
>  Unless Mike Alsup's recent changes removed this limitation, you need to have
>  at least as much padding as the corner height. That might cause what you are
>  seeing. See the "Tips and Tricks" section here:
>  http://methvin.com/jquery/jq-corner.html
>  

Thanks for your reply.  By "corner height", what would that be in the above 
example?  

 - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Can't get a 1 pixel rounded corner

2007-02-15 Thread dalvarado
Hello,

Following advice on this mailing list, I visited 
http://www.malsup.com/jquery/corner/ to learn how to create a rounded border 
that was a different color than the inner DIV.  I want to create a 1 pixel 
border, and so I changed the code in the first "Adornment" example to read ...

$(this).corner("round 8px").parent().css('padding', '1px').corner("round 10px")

but in both PC IE and Firefox, at the upper left and right box corners, you can 
see pointy box corners, whereas at the bottom, the corners round smoothly.  How 
can I adjust the above to make the top corners as smooth as the bottom ones?

Thanks, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] Rounded corners question

2007-02-14 Thread dalvarado
I was checking out the rounded corners jquery page:

http://methvin.com/jquery/jq-corner-demo.html

.  I wanted to create a rounded corners DIV in which the rounded border color 
is black and the rest of the cell is white.On the page above, the border is 
the same color as the background.  How would one work the above so that you 
have a different color border?  If the above can't do it, do you know a jquery 
plug-in that can?

Thanks, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jqModal: Defining a custom event before closing the window?

2007-02-14 Thread dalvarado
Rock on!  Works perfectly.  Thanks so much, - 


>  ---Original Message---
>  From: Chris Domigan <[EMAIL PROTECTED]>
>  Subject: Re: [jQuery] jqModal: Defining a custom event before closing the 
> window?
>  Sent: Feb 14 '07 23:18
>  
>  Ah whoops! You use it like this:
>  
>  $("#cancelButton").trigger("click");
>  
>  I must be half asleep... :)
>  
>  Chris

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] jqModal: Defining a custom event before closing the window?

2007-02-14 Thread dalvarado
Thanks Chris, This sounds like a winning idea.  I'm still new to JQuery and its 
plug-ins and syntax, but if the ID of my save button is "saveButton", how would 
I invoke '.trigger("#cancelButton")'?  Would it be ...



?   - Dave


>  ---Original Message---
>  From: Chris Domigan <[EMAIL PROTECTED]>
>  Subject: Re: [jQuery] jqModal: Defining a custom event before closing the 
> window?
>  Sent: Feb 14 '07 22:57
>  
>  You could just set Cancel as the only button that closes the window. Then
>  at the end of your Save action, just do .trigger("#cancelButton");
>  
>  Chris

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] jqModal: Defining a custom event before closing the window?

2007-02-14 Thread dalvarado
Hi,

I'm trying to create a modal dialog using

http://dev.iceburg.net/jquery/jqModal/

where I want to have two buttons, "Save" and 'Cancel".  Clicking "Save" should 
perform some action, and then close the window.  However, if I define the 
"onclick" handler for the "Save" button, the window no longer closes. How can I 
execute the functions of my "Save" and then close the modal dialog window?

Thanks, - Dave

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/