[jQuery] Re: jQuery Nesting Tables

2009-07-25 Thread nullstring

oh grace god, someone replied. thanks @FrenchiNLA

here's the generated .NET html code



  PrinterProcessPackageTypeLeadTime


Edit

View
AlcanGravureLabels35


Edit

View
AlcanGravureMultipack
Lidding (not foil)35


Edit

View
EmsurGravureLabels30





12






That nested table is actually the Page Links and it's not always
there .. I mean, it only exists if GridView has something to page ..

here's the idea behind these problem:
I am using someones JS to manipulate the Table and do some column
freezing stuff .. but everytime this page links exists, cells always
messed up.. so my idea is to check if that page link exists, move it
before the table(parent table) ..

this code works .. but I need to check if the page links table
exists ..
this.before('');
jQuery("#ctl00_ContentPlaceHolder1_GV").find('tbody tr:last').remove
().appendTo($("#pages"));

On Jul 26, 12:54 am, FrenchiINLA  wrote:
> Could you provide your html code generated by .net? it would help, but
> in general rule you don't have to check existence of an element to
> apply action to it. Jquery disregard the action if it doesn't exist.
> For your example:
> $('tbody[tr:last][td][table]', $(this)).remove(); will work if it can
> find your criteria within $(this) otherwise it does nothing.
>
> On Jul 25, 8:57 am, nullstring  wrote:
>
>
>
> > Please help?
>
> > On Jul 25, 10:12 pm, nullstring  wrote:
>
> > > Hi,
>
> > > In my last row (parent Table) with colspan(tr), I have another Table
> > > (without any.attributes) which was generated by GridView, Paging
> > > enabled and located in footer ..l
>
> > > How do I know if that Table exists in my last row(parent Table)..
>
> > > this code won't work ..
>
> > > if(jQuery(this).is('table')) {
> > >                 if(this.find('tbody tr:last td table')) {
> > >                           /* remove paging table element */
> > >                 }
>
> > > }


[jQuery] Re: Form values getting unsynchronized after ajaxsubmit [validate]

2009-07-25 Thread anoop

After several attempts, I have been able to consistently reproduce
this problem. It appears that this is an issue with the ajaxSubmit in
the form plugin and only in firefox (latest version), IE 7 does not
seem to have this issue.

The issue occurs in firefox only; when a page with multiple forms is
refreshed (by hitting F5 or ctrl-r) the body of the form and the form
header get unsynchronized. But after clicking on the reset button for
each form it gets rectified.
On IE 7 the refresh did not cause any issue anytime.

I tried after removing the ajaxSubmit and the problem did not occur in
firefox or IE.

I have these lines which I think is the cause of the problem:

submitHandler: function(form) {
$(form).ajaxSubmit({
  target: 'body',
  error: function (xhr) {
$('.derror').text("Errors: Please fix " +
xhr.statustext).show("fast");
}

It could be that I am doing something wrong, but that does not explain
the inconsistent behavior between the 2 browsers. It was this block of
text that I had to remove to make my forms work even after a refresh.

Thanks,
Anoop


On Jul 24, 11:01 am, Anoop kumar V  wrote:
> Attached an html - that shows my situation...
>
> In the page - clicking on any region opens the pop-up form, and once in a
> while after you submit the pop-ups are mixed up, you see Newyork details for
> the Washington tab etc. But as soon as I click on the reset button, it
> rectifies itself...
>
> Can somebody please help a bit? I am not able to understand / explain why
> this happens - I do not have a lot of javascript / jquery code, just the 2
> functions...
>
> Should I call reset for all forms after I submit? If so can someone please
> show / hint at how that can be achieved?
>
> Thanks,
> Anoop
>
> On Fri, Jul 24, 2009 at 2:09 AM, Anoop kumar V wrote:
>
> > Hi All,
>
> > I have a very weird issue that I have been trying to resolve for over a
> > week now with no success in sight.
>
> > I use jsp to generate a page of regional information. The regions are
> > displayed as clickable blocks. On clicking each block a pop-up form opens up
> > with the corresponding region details like id, name and acronym. These can
> > be edited and submitted as updates. There is also a last block that allows
> > to create a new region which on clicking opens the same kind of form as the
> > others, except all the fields are blank and required.
>
> > I am using jquery validator plugin (bassistance) to ensure that the user
> > does not leave any field blank and I also use the form plugin to do an
> > ajaxsubmit, so that the id enterred is not a duplicate id.
>
> > On submitting the new region form, a new region gets created and updates
> > the page fine, but intermittently when I click on the other existing blocks
> > the information shown in the pop-up is for a completely different region:
> > for example when I click on a block labelled Washington, the popup that
> > comes up shows New York, NY, 02. On clicking New York block, the same
> > (correct) information is show. This does not happen always and I have
> > noticed it happening only in firefox, I use firefox more often also. Also if
> > I take out the ajaxsubmit and do a simple form submit, it seems to not
> > occur, but I need the ajaxsubmit for the id validation..
> > Interestingly, when I click on the reset button on the individual form, the
> > values in the fields correct themselves automagically for that form..
>
> > I also used firebug, and when I mouseover the field in the firebug console,
> > the values in the fields are shown correct (in forebug), except the page
> > displays the incorrect info. I think this safely eliminates my java code as
> > the culprit... Again - when I reset the particular form, the values are
> > good, but only for that form, so if I want to clean all such incorrect data,
> > I will have to open each form pop-up on the page and click on the reset
> > button - this would not work even as a workaround.
>
> > Below is the code if it helps:
>
> > *** JS***
> > $(function() {
> > var bbap = function() {
> >       $('.cbnav').live('click',function(event) {
> >         var target = $(event.target);
> >         if(($(target).is(".main-title")) || ($(target).is(".cls")))
> >         {
> >           $('.details').hide();
> >           if($(target).is(".main-title"))
> >             $(target).next('.details').show(450);
> >         } else if ($(target).is('input[type=reset]')){
> >             $('.derrors').hide();
> >             $('.errors').hide();
> >         }
> >     });
> >   }
> >   bbap();
> > });
>
> > var v = $(function() {
> >     $('.main-title').click(function(event) {
> >       var target = $(event.target);
> >       var parent = $(target).parent();
> >       $(parent).validate({
> >         rules: {
> >             regionid: "required",
> >             regionname: "required",
> >             regionacronym: "required"

[jQuery] Re: Check if movie (.mp4) is finished

2009-07-25 Thread 刘永杰
how does touch it finished?

2009/7/26 Sam Sherlock 

> I think you'd have to load a swf and have that call back to the page (via
> ex interface) when its completed
> hth - S
>
>
> 2009/7/25 Eswip 
>
>
>> Hi everyone,
>>
>> I'm using the jQuery Media Plugin to play a movie (.mp4) on a page
>> when a button is clicked. But I want to remove the  from the
>> DOM when the movie is finished. Is this possible? And in what way? I
>> searched on the group here and googled, but I found nothing.
>>
>> Regards,
>> Eswip
>>
>
>


[jQuery] Re: Form values getting unsynchronized after ajaxsubmit [validate]

2009-07-25 Thread anoop

After several attempts, I have been able to consistently reproduce
this problem. It appears that this is an issue with the ajaxSubmit in
the form plugin and only in firefox (latest version), IE 7 does not
seem to have this issue.

The issue occurs in firefox only; when a page with multiple forms is
refreshed (by hitting F5 or ctrl-r) the body of the form and the form
header get unsynchronized. But after clicking on the reset button for
each form it gets rectified.
On IE 7 the refresh did not cause any issue anytime.

I tried after removing the ajaxSubmit and the problem did not occur in
firefox or IE.

I have these lines which I think is the cause of the problem:

submitHandler: function(form) {
$(form).ajaxSubmit({
  target: 'body',
  error: function (xhr) {
$('.derror').text("Errors: Please fix " +
xhr.statustext).show("fast");
}

It could be that I am doing something wrong, but that does not explain
the inconsistent behavior between the 2 browsers. It was this block of
text that I had to remove to make my forms work even after a refresh.

Thanks,
Anoop


On Jul 24, 11:01 am, Anoop kumar V  wrote:
> Attached an html - that shows my situation...
>
> In the page - clicking on any region opens the pop-up form, and once in a
> while after you submit the pop-ups are mixed up, you see Newyork details for
> the Washington tab etc. But as soon as I click on the reset button, it
> rectifies itself...
>
> Can somebody please help a bit? I am not able to understand / explain why
> this happens - I do not have a lot of javascript / jquery code, just the 2
> functions...
>
> Should I call reset for all forms after I submit? If so can someone please
> show / hint at how that can be achieved?
>
> Thanks,
> Anoop
>
> On Fri, Jul 24, 2009 at 2:09 AM, Anoop kumar V wrote:
>
> > Hi All,
>
> > I have a very weird issue that I have been trying to resolve for over a
> > week now with no success in sight.
>
> > I use jsp to generate a page of regional information. The regions are
> > displayed as clickable blocks. On clicking each block a pop-up form opens up
> > with the corresponding region details like id, name and acronym. These can
> > be edited and submitted as updates. There is also a last block that allows
> > to create a new region which on clicking opens the same kind of form as the
> > others, except all the fields are blank and required.
>
> > I am using jquery validator plugin (bassistance) to ensure that the user
> > does not leave any field blank and I also use the form plugin to do an
> > ajaxsubmit, so that the id enterred is not a duplicate id.
>
> > On submitting the new region form, a new region gets created and updates
> > the page fine, but intermittently when I click on the other existing blocks
> > the information shown in the pop-up is for a completely different region:
> > for example when I click on a block labelled Washington, the popup that
> > comes up shows New York, NY, 02. On clicking New York block, the same
> > (correct) information is show. This does not happen always and I have
> > noticed it happening only in firefox, I use firefox more often also. Also if
> > I take out the ajaxsubmit and do a simple form submit, it seems to not
> > occur, but I need the ajaxsubmit for the id validation..
> > Interestingly, when I click on the reset button on the individual form, the
> > values in the fields correct themselves automagically for that form..
>
> > I also used firebug, and when I mouseover the field in the firebug console,
> > the values in the fields are shown correct (in forebug), except the page
> > displays the incorrect info. I think this safely eliminates my java code as
> > the culprit... Again - when I reset the particular form, the values are
> > good, but only for that form, so if I want to clean all such incorrect data,
> > I will have to open each form pop-up on the page and click on the reset
> > button - this would not work even as a workaround.
>
> > Below is the code if it helps:
>
> > *** JS***
> > $(function() {
> > var bbap = function() {
> >       $('.cbnav').live('click',function(event) {
> >         var target = $(event.target);
> >         if(($(target).is(".main-title")) || ($(target).is(".cls")))
> >         {
> >           $('.details').hide();
> >           if($(target).is(".main-title"))
> >             $(target).next('.details').show(450);
> >         } else if ($(target).is('input[type=reset]')){
> >             $('.derrors').hide();
> >             $('.errors').hide();
> >         }
> >     });
> >   }
> >   bbap();
> > });
>
> > var v = $(function() {
> >     $('.main-title').click(function(event) {
> >       var target = $(event.target);
> >       var parent = $(target).parent();
> >       $(parent).validate({
> >         rules: {
> >             regionid: "required",
> >             regionname: "required",
> >             regionacronym: "required"

[jQuery] Re: Looking for expand/collapse tree directory navigation

2009-07-25 Thread 刘永杰
dhtmlxtree,it is very good.

2009/7/26 Magnificent 

>
> Hello,
>
> I'm looking for an expanding/collapsing tree directory type of
> navigation and was wondering if someone knows of a good one that's out
> there and available.
>
> What I'm specifically looking for is one that is triggered on the
> click of a *graphic* that toggles the show/hide.  Each text nav item
> should be hyperlinkable to it's own link/page.  So for example (the +
> and - are the collapse/expand graphics, the dot leader is for some
> formatting):
>
> - Nav Item 1 (text should be hyperlinkable)
> ...Sub Nav 1(text should be hyperlinkable)
> ...- Sub Nav 2 (text should be hyperlinkable)
> ..Sub Nav 2a (text should be hyperlinkable)
> ..Sub Nav 2b (text should be hyperlinkable)
> ..Sub Nav 2c (text should be hyperlinkable)
> ...Sub Nav 3 (text should be hyperlinkable)
> + Nav Item 2 (text should be hyperlinkable)
> + Nav Item 3 (text should be hyperlinkable)
> + Nav Item 4 (text should be hyperlinkable)
>
> Ideally, this would work for plain old  and  structure.  I
> suppose infinite nesting would be cool, but I don't think I need to go
> beyond 3 levels with the first 2 levels having the show/hide graphic
> triggers.


[jQuery] Re: Check if movie (.mp4) is finished

2009-07-25 Thread Sam Sherlock
I think you'd have to load a swf and have that call back to the page (via ex
interface) when its completed
hth - S


2009/7/25 Eswip 

>
> Hi everyone,
>
> I'm using the jQuery Media Plugin to play a movie (.mp4) on a page
> when a button is clicked. But I want to remove the  from the
> DOM when the movie is finished. Is this possible? And in what way? I
> searched on the group here and googled, but I found nothing.
>
> Regards,
> Eswip
>


[jQuery] Setting identical events to multiple elements using a for loop

2009-07-25 Thread Blake

On my site, I have some click-able spans (will be referred to as
toggle spans) that show or hide other spans (that contain the content
I want on my site; will be referred to as content spans). The layout
of these spans is like this:

--
Span 1 - Span 2
- Span 3


Span 1 content.



Span 2 content.



Span 3 content.

--

Then, in my jQuery I have something like this:

--
slideSpeed=1000;

$("span#sp_span1").click(function () {
$("span#span1").slideToggle(slideSpeed);
$("span.contentSpan:not(#span1)").slideUp(slideSpeed);
});

$("span#sp_span2").click(function () {
$("span#span2").slideToggle(slideSpeed);
$("span.contentSpan:not(#span2)").slideUp(slideSpeed);
});
--

and so on for each separate content span. What the above code does is:
for example, when toggle span 1 is clicked on, content span 1 opens if
it is not open, and if content span 2 or 3 is open, that content span
is closed and content span 1 is opened. (If that doesn't make sense, I
apologize, and a download-able example can be found here:
http://willhostforfood.com/access.php?fileid=76513 )

This method works perfectly fine, but to make it easier for me to add
more content spans, I would like to use a for loop that will
automatically enter all that for me.

What I would like to do in my jQuery is use an array that will contain
the IDs of all the different content spans I want to have displayed on
the page. Then, a for loop will enter the appropriate information
(identical to the code above). I've tried many things, but I cannot
get this to work. Here's kind of what I have:

--
sections=new Array("span1","span2","span3");

for (i=0;i

[jQuery] accessing iframe content

2009-07-25 Thread kknaru

hi there, i just started working with iframes and i'm stucked :D

so...i have this code inside a html file:


 text


what i'm trying to do is to grab that paragraph text(using jquery).

by now i tried something like this:

$("#myframe").contents().find("p").html();

butwith no result :(

does anyone know the answer?


[jQuery] Check if movie (.mp4) is finished

2009-07-25 Thread Eswip

Hi everyone,

I'm using the jQuery Media Plugin to play a movie (.mp4) on a page
when a button is clicked. But I want to remove the  from the
DOM when the movie is finished. Is this possible? And in what way? I
searched on the group here and googled, but I found nothing.

Regards,
Eswip


[jQuery] Re: Fade in a div, push the div below down

2009-07-25 Thread Blake

Are you talking about the slideToggle effect? 
http://docs.jquery.com/Effects/slideToggle

A quick download-able example I made that demonstrates what I think
you're looking for (sliding up and hiding a div while the div below it
also moves up) can be found here: 
http://willhostforfood.com/?Action=download&fileid=76515

Blake


[jQuery] Ajax + XML

2009-07-25 Thread Phil

Scenario: I have the following code to load XML into my DOM but I
would like to load one specific node of the xml (by the id attrib)
(using a url parameter) the xml parameter (variable 'epParameter').


$(function() {
 $.ajax({
 type: "GET",
 url: "episodes.xml",
 dataType: "xml",
 success: function(xml) {
 $(xml).find('Episode').each(function(){
 var id_text = $(this).attr('id')
 var name_text = $(this).find('Name').text()
 $('')
 .html(name_text + ' (' + id_text + ')')
 .appendTo('#Details ol');
 });
 }
 });
 });


Thanks, Phil.


[jQuery] Re: Fade in a div, push the div below down

2009-07-25 Thread adrianemile

Found another example.

The mootools plugin Fx.Slide

http://demos.mootools.net/Fx.Slide

The vertical one with the toggle option is exactly what I want.


[jQuery] Re: appendCache issue in tablesorter with IE7/IE8

2009-07-25 Thread postme

bump

anyone?

On Jul 21, 6:18 pm, postme  wrote:
> Hi everybody,
>
> I'm using the tablesorter plugin with the zebra widget and I've run
> into an
> issue with IE8. I'm setting a number of tablerow (tr) elements to
> invisible
> and then run a tablesorter update + appendCache action to make sure
> the
> zebra widget picks up on the changed structure of the table. This
> works fine
> in all browsers except IE8. With a bit of debugging I've pinpointed it
> with
> reasonable certainty to the appendCache function in tablesorter
> (actually
> appendToTable) but I can't find anything to explain why IE8 will not
> cooperate.
>
> My own code is copied in below. What it does is that dependent on a
> value in
> a dropdown box and a match with a server-side generated javascript
> array it
> will hide certain tablerows.
>
> Any help in explaining why tablesorter+zebra doesn't process this
> correctly
> in IE8 would be much appreciated!
>
> $('.dropdown_hide').change(function() {
>         // Reset the checked flag for all checkboxes
>         $('input:checkbox').each(
>             function() {
>                 this.checked = '';
>             }
>         );
>         // Add class=hidden to every tr that is the grandparent of a
> checkbox
>           $('input:checkbox').each(
>             function() {
>                 $(this).parent().parent('tr').addClass('hidden');
>             }
>         );
>         // Remove the hidden class from the table header
>         $('#select_deselect').parent().parent('tr').removeClass
> ('hidden');
>         // Loop through the javascript array and see if there's a
> match with
>         // the value that's provided by the dropdown. If there's a
> match
>         // remove the class=hidden so the tr is shown
>         if ($('select').val() == 0) {
>             $('input:checkbox').each(
>                 function() {
>                     $(this).parent().parent('tr').removeClass
> ('hidden');
>                 }
>             );
>         } else {
>             for (i = 0; i < rbacArray.length; i++ ) {
>                 if (rbacArray[i][0] == $('select').val()) {
>                     $('input:checkbox').each(
>                         function() {
>                             if ($(this).val() == rbacArray[i][1]) {
>                                $(this).parent().parent
> ('tr').removeClass('hidden');
>                             }
>                         }
>                     );
>                 }
>             }
>         }
>         $(".stripeMe").trigger("update");
>         $(".stripeMe").trigger("appendCache");
>     });
>
> Thanks, Meint


[jQuery] Re: Fade in a div, push the div below down

2009-07-25 Thread adrianemile

An example would be this site:

http://www.teehanlax.com/work/

Click the button: Watch it
You will then see a new div with their reel being fade'd and slided
over the works div.
The works div gets pushed down about 200px.

Can anyone point me in the right direction?


[jQuery] Looking for expand/collapse tree directory navigation

2009-07-25 Thread Magnificent

Hello,

I'm looking for an expanding/collapsing tree directory type of
navigation and was wondering if someone knows of a good one that's out
there and available.

What I'm specifically looking for is one that is triggered on the
click of a *graphic* that toggles the show/hide.  Each text nav item
should be hyperlinkable to it's own link/page.  So for example (the +
and - are the collapse/expand graphics, the dot leader is for some
formatting):

- Nav Item 1 (text should be hyperlinkable)
...Sub Nav 1(text should be hyperlinkable)
...- Sub Nav 2 (text should be hyperlinkable)
..Sub Nav 2a (text should be hyperlinkable)
..Sub Nav 2b (text should be hyperlinkable)
..Sub Nav 2c (text should be hyperlinkable)
...Sub Nav 3 (text should be hyperlinkable)
+ Nav Item 2 (text should be hyperlinkable)
+ Nav Item 3 (text should be hyperlinkable)
+ Nav Item 4 (text should be hyperlinkable)

Ideally, this would work for plain old  and  structure.  I
suppose infinite nesting would be cool, but I don't think I need to go
beyond 3 levels with the first 2 levels having the show/hide graphic
triggers.


[jQuery] Re: UI TABS - Best Practices

2009-07-25 Thread brian

I've done something similar and, while it works, it took a bit of
head-scratching to get things working properly. The biggest thing was
ensuring that newly-loaded content was "initialised" on load.

The admin page contains:










I have a separate admin.js with admin-only routines.

$(function()
{
/* Not all admin pages are in tabs
 */
if ($('#nav_admin ul').length)
{
$('#nav_admin ul').tabs({
cache: true,
fx: { opacity: 'toggle' },
spinner: '',
load: function (event, ui)
{
/* Check which tab is in front and take care of 
any
 * initialisation necessary
 */
switch(ui.tab.id)
{
case 'admin_members':

$('#autocomplete_tmp').contents().appendTo('#autocomplete_placeholder');

$('#ac_members').autocomplete('/members/autocomplete', ac_options);
break;

/* Some tabs don't require anything 
special but I've left
 * a placeholder anyway
 */
case 'admin_contact':
break;

case 'admin_posts':

$('.Editor').wymeditor(wym_options);
toggleFormNotes();
initAsyncPaging();
break;

case 'admin_newsletter':

$('.Editor').wymeditor(wym_options);
initNewsletter();
toggleFormNotes();
break;

case 'admin_events':
initAsyncPaging();
break;

case 'admin_jobs':
break;

case 'admin_profile':
break;  

}
}
});
}
// ...
}

For edits, you can load the form inside a Thickbox-type pop-up. Use
the jquery.form plugin to then have it submit asynchronously. Use the
above switch() to initialise all of that in special-purpose functions.

As for tracking which tab is open, I don't bother with that at all.
Sometimes, the admin is taken away from the tabbed interface for
something, but I know which functions should redirect back to which
tab. This can be done by appending the proper hash to the redirect
URL. For instance, to get back to the eventrs tab, just redirect to:
/path/to/tabs#admin_events

On Sat, Jul 25, 2009 at 8:00 AM, SteveM wrote:
>
> I've implemented an admin console that has about 5 ajax-enabled tabs
> on a JSP. Each tab displays info from different areas of the system.
> Authorized users see an edit button. Some edits can be multiple pages.
>
> Fully integrating multi-page UI tabs requires a lot of considerations.
> I'm interested in best practices that I should consider.
>
> My question is where can I find a robust UI TAB example that includes
> multiple page swaps? I just finished writing the editing features, and
> for now I leave the tabs and use separate edit pages. I see that my
> first task will be to "hijax" the tab links to load my edit pages in
> place. Next, I need to switch my submit buttons to do a submit in the
> background. I'll also need to switch to client side validation. I
> suppose I should also disable the other tabs while any one tab is in
> edit mode. I also wonder if I should track the currently selected tab
> server side so that if I do anything that does require the user to
> navigate away from the tab page they can return with the previously
> selected tab open.
>
> Suggestions?
>
> Steve Mitchell
> http://www.ByteworksInc.com
>
>


[jQuery] Re: PNGFixes are breaking SuperFish in IE6...SUPRISE!

2009-07-25 Thread Matt

This problem now seems to be even more widespread. I installed just a
basic, pure, CSS dropdown menu and even it does not work with
Supersleight, UnitPNGfix or even jQuery's pngfix. GRR

On Jul 24, 3:44 pm, Matt  wrote:
> I've tried a few different PNGFixes thinking that maybe the problem
> was unique to one particular fix, but unfortunately all PNGFixes are
> breaking my menu. Basically, without the PNGFix, the menu works fine.
> But, as soon as the PNGFix loads, I lose my hover ability and
> naturally the dropdown feature. This is all CSS (plus jQuery) at the
> moment. It works in all other browsers.
>
> Has anyone ever run across this problem?
>
> Thanks!
> Matt


[jQuery] Re: Multiple Phone Fields

2009-07-25 Thread FrenchiINLA

I don't know about validte plugin, but you can easily check your
condition with jquery. for example you can add the same starting id to
your text fields something like
txt_Phone_bus, txt_Phone_Cell, txt_Phone_Home
then you can check for the value of those fields with
$('imput[type=text][id^=txt_Phone_]]'.each(function(){
// apply your validation for example one of them must be $(this).val
().length>0
});

On Jul 25, 8:04 am, kmac  wrote:
> Hi,
>
> I have a form with three text fields:
>
> Business Phone
> Cell Phone
> Home Phone
>
> One of the fields must be filled. Using jquery.validate.js how do I
> check for this?
>
> Thanks in advance for any help.


[jQuery] Re: jQuery Nesting Tables

2009-07-25 Thread FrenchiINLA

Could you provide your html code generated by .net? it would help, but
in general rule you don't have to check existence of an element to
apply action to it. Jquery disregard the action if it doesn't exist.
For your example:
$('tbody[tr:last][td][table]', $(this)).remove(); will work if it can
find your criteria within $(this) otherwise it does nothing.

On Jul 25, 8:57 am, nullstring  wrote:
> Please help?
>
> On Jul 25, 10:12 pm, nullstring  wrote:
>
> > Hi,
>
> > In my last row (parent Table) with colspan(tr), I have another Table
> > (without any.attributes) which was generated by GridView, Paging
> > enabled and located in footer ..l
>
> > How do I know if that Table exists in my last row(parent Table)..
>
> > this code won't work ..
>
> > if(jQuery(this).is('table')) {
> >                 if(this.find('tbody tr:last td table')) {
> >                           /* remove paging table element */
> >                 }
>
> > }


[jQuery] Re: newbie question.

2009-07-25 Thread Aleksey

Well, it's a common pattern that is used when creating a jQuery
plugin.
A common problem doing that is the use of a '$' sign, because other
frameworks use it too as well. I didn't try to use some frameworks
simultaneously yet, so I didn't encountered that problem by myself.
One of the way is to use 'jQuery' instead of '$' ('$' is a shorthand
of 'jQuery'), and to write, for example:

jQuery('a').click(function() { });
instead of
$('a').click(function() { });

But there is another way - this pattern allows you to use '$' in your
jQuery code without the worry of malfunctioning.

You can read more about the creating jQuery plugin in the following
articles:
http://blog.themeforest.net/tutorials/ask-jw-decoding-self-invoking-anonymous-functions/
http://blog.jeremymartin.name/2008/02/building-your-first-jquery-plugin-that.html
http://docs.jquery.com/Tutorials

Good luck)


On Jul 25, 4:04 pm, Kris  wrote:
> What does this do?
> (function($) { do some stuff } )(jQuery);


[jQuery] Re: simplemodal plugin - close modal dialog by button/link whatever

2009-07-25 Thread method8

just found out - you have to apply "simplemodal-close" class to your
button

On Jul 25, 6:32 pm, method8  wrote:
> I can't seem to close my modal dialog except when using the close
> button.
>
> I want to do a search dialog box, that closes as soon as the user
> presses search (rather than press search and then the close button)
>
> I created my search box like this:
>
> $("#search").click(function(){
>           $("#searchBox").modal({overlayClose:true});
>
> });
>
> But I am clueless about how to connect my search button to actually
> close it.
>
> Thanks in advance for your help


[jQuery] simplemodal plugin - close modal dialog by button/link whatever

2009-07-25 Thread method8

I can't seem to close my modal dialog except when using the close
button.

I want to do a search dialog box, that closes as soon as the user
presses search (rather than press search and then the close button)

I created my search box like this:

$("#search").click(function(){
  $("#searchBox").modal({overlayClose:true});
});

But I am clueless about how to connect my search button to actually
close it.

Thanks in advance for your help


[jQuery] Re: Parsing a complicated JSON file with JQUERY !

2009-07-25 Thread Walther

I think your problem is that you don't have a firm grasp of javascript
objects or object notation in general.

JSON is just a method of transfering javascript objects in a text
format. jQuery automatically converts the JSON string into a
javascript object if you tell it to (Look at the documentation to see
how). Once it is in a javascript object you can do whatever standard
javascript object manipulation methods you need or want to use.

If you want to see the parsed JSON I would advise using console.log,
you'll need FF and FireBug for it though.

On Jul 24, 11:57 am, Abraham Boray  wrote:
> well wot I'm doing is an ajax call to retrieve my json data .
> then i want to parse it & show all the records in the  "#postContent".
> but wot is harder here is the fact that in my jason file there are
> three objects at the same time returned by the query.
>
> Posts/Category/Comment
>
> The Categorystructure is :
>
> *Category
>      -Post
>      - comment
>            -comment_content
>            -mail
>
> U can also take a look to the picture 4 more explained structure of
> the JSON data
> and i want go through each "table"(object) & show it's records ...
>
> I did this code,& it's browser cross(it works perfectly with FF& IE6..
>
> $('#blogPage #blogPostsHolder .Post a').live('click',function(){
>          var currentPost=$(this).attr('post_id');//get the current(Clicked)
> post id
>
> //Load The Blog Post When A Post Link Is Clicked/**/
> $.post('posts/postslistbycat/', {params: ''},
>       function(data){
>            $.each(data, function(i){
>
> //here i want to show my json records after parsing the different
> "tables"
> $("#postContent").html('some records here');
>
>     });
>
> }, 'json');
>
> return false;           });
>
> I hope I did explain it well this time
> regards
> Abraham
>
> On Jul 22, 3:17 pm, Abraham Boray  wrote:
>
> > As U can see guys , I got that json structure , & I want to parse it
> > with jquery , I searched in the web but it's seems my json file is a
> > bite complicated :S
>
> > here is the picture more clear thatn the file down 
> > !http://www.zshare.net/image/63013802b34a7372/
>
> > Here is my plane JSON file
> > [{"Post":{"id":"1","category_id":"1","title":"CSS
> > Mastering","date":"2009-07-21 22:40:00","content":"How 2 CSS Master in
> > 5 Days :D ,This association creation and destruction is done using the
> > CakePHP model bindModel() and unbindModel() methods. (There is also a
> > very helpful behavior called \"Containable\", please refer to manual
> > section about Built-in behaviors for more information). Let's set up a
> > few models so we can see how bindModel() and unbindModel() work. We'll
> > start with two models: This association creation and destruction is
> > done using the CakePHP model bindModel() and unbindModel() methods.
> > (There is also a very helpful behavior called \"Containable\", please
> > refer to manual section about Built-in behaviors for more
> > information). Let's set up a few models so we can see how bindModel()
> > and unbindModel() work. We'll start with two models: This association
> > creation and destruction is done using the CakePHP model bindModel()
> > and unbindModel() methods. (There is also a very helpful behavior
> > called \"Containable\", please refer to manual section about Built-in
> > behaviors for more information). Let's set up a few models so we can
> > see how bindModel() and unbindModel() work. We'll start with two
> > models: ","visible":"1"},"Category":{"id":"1","name":"CSS","Post":
> > [{"id":"1","category_id":"1","title":"CSS
> > Mastering","date":"2009-07-21 22:40:00","content":"How 2 CSS Master in
> > 5 Days :D ,This association creation and destruction is done using the
> > CakePHP model bindModel() and unbindModel() methods. (There is also a
> > very helpful behavior called \"Containable\", please refer to manual
> > section about Built-in behaviors for more information). Let's set up a
> > few models so we can see how bindModel() and unbindModel() work. We'll
> > start with two models: This association creation and destruction is
> > done using the CakePHP model bindModel() and unbindModel() methods.
> > (There is also a very helpful behavior called \"Containable\", please
> > refer to manual section about Built-in behaviors for more
> > information). Let's set up a few models so we can see how bindModel()
> > and unbindModel() work. We'll start with two models: This association
> > creation and destruction is done using the CakePHP model bindModel()
> > and unbindModel() methods. (There is also a very helpful behavior
> > called \"Containable\", please refer to manual section about Built-in
> > behaviors for more information). Let's set up a few models so we can
> > see how bindModel() and unbindModel() work. We'll start with two
> > models: ","visible":"1","Category":{"id":"1","name":"CSS"},"Comment":
> > [{"id":"2","post_id":"1","date":"2009-07-22 14:10:00","content":"Nice
> > TUTO ,Keep it up Dude

[jQuery] Re: jQuery Nesting Tables

2009-07-25 Thread nullstring

Please help?

On Jul 25, 10:12 pm, nullstring  wrote:
> Hi,
>
> In my last row (parent Table) with colspan(tr), I have another Table
> (without any.attributes) which was generated by GridView, Paging
> enabled and located in footer ..
>
> How do I know if that Table exists in my last row(parent Table)..
>
> this code won't work ..
>
> if(jQuery(this).is('table')) {
>                 if(this.find('tbody tr:last td table')) {
>                           /* remove paging table element */
>                 }
>
>
>
> }


[jQuery] newbie question.

2009-07-25 Thread Kris

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


[jQuery] superfish menu centering - no fixed width

2009-07-25 Thread theGrimm

Hi
I'm trying to center a horizontal superfish menu with a flexible width
in a div container  with 980px width but i can't get it to work with
margin:0 auto;

any tips or tricks ?

thnx 4 help


[jQuery] jQuery Nesting Tables

2009-07-25 Thread nullstring

Hi,

In my last row (parent Table) with colspan(tr), I have another Table
(without any.attributes) which was generated by GridView, Paging
enabled and located in footer ..

How do I know if that Table exists in my last row(parent Table)..

this code won't work ..

if(jQuery(this).is('table')) {
if(this.find('tbody tr:last td table')) {
  /* remove paging table element */
}
}


[jQuery] Multiple Phone Fields

2009-07-25 Thread kmac

Hi,

I have a form with three text fields:

Business Phone
Cell Phone
Home Phone

One of the fields must be filled. Using jquery.validate.js how do I
check for this?

Thanks in advance for any help.


[jQuery] Re: help with an animation effect

2009-07-25 Thread leofromrio

Sorry, my last post was incomplete.
I've changed the code to keep it cleaner and more relevant to your
question.
Please, keep in mind I'm not a developer and the code is probably not
up to snuff.  :P

HTML



CONTENT HERE


show
hide



CSS

#container {
width: 180px;
min-height: 21px;
top: 0;
right: 40px;
font-size: 10px;
line-height: 20px;
position: absolute;
z-index: 5;

}

#slider {
width: 100%;
height: auto;
display: none;
background: #5e574a;

}

#sliderSwitch {
height: 21px;
width: 100px;
cursor: pointer;
line-height: 24px;

}

jQuery

// sliding box

$("#sliderSwitch").click( function() {
$("#sliderSwitch .switch").toggle
();  // toggle text
$("#slider").slideToggle
("slow");   // show / hide box
});
});

I hope it helps
- Leo

On Jul 24, 12:40 pm, Sir Rawlins 
wrote:
> Morning all,
>
> I'm looking for some help with ananimationeffectand your thoughts
> on how best to achieve it. At this stage we simply have a graphical
> representation, we can splice the images up any way we like, I'm
> really looking for your suggestions.
>
> The first stage is just the basic static object:
>
> http://s949.photobucket.com/albums/ad332/thinkblue_album/?action=view...
>
> Then, we have a slight mouse-overeffecton the small tab at the
> bottom which slightly reveals the content (width a nice slideyeffect). On a 
> mouse-out the tab would go back to it's static state.
>
> http://s949.photobucket.com/albums/ad332/thinkblue_album/?action=view...
>
> Thirdly, once the tab has been clicked it should pull out (nice 
> slideyeffectagain), notice this isn't like the slideDown()effect, the
> bottom of the thing comes out first, as if it were a card being pulled
> out from behind another by hand. Also note that the text/icon on the
> tab has changed.
>
> http://s949.photobucket.com/albums/ad332/thinkblue_album/?action=view...
>
> Finally we have it's resting state once it's pulled out completely, a
> click would simply send it back up again the way it came.
>
> http://s949.photobucket.com/albums/ad332/thinkblue_album/?action=view...
>
> Now this with any luck would degrade so that if JS was disabled then
> the tab would default to being fully pulled out so the content was
> exposed for anyone viewing the site without JS enabled.
>
> I'd imagine we'll be using the animate() method but this isn't
> something I've worked with before, I'd appreciate any help you can
> offer on how I should be structuring my HTML and JS for this.
>
> Thanks guys I appreciate it.
>
> Robert


[jQuery] Re: changing style attributes.

2009-07-25 Thread Charlie





understanding how the basic animations functions in jQuery helps.

$("#something").show()
jQuery uses amendments to the element syle attribute to make this
happen. So in your example 
$("#this=thing&that=more&bing=bang").show() will override the
display:none

If as you say you are doing this dynamically it's important to
understand that if an element is not in existence when document.ready
functions fire it has no events tied to it

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

Old Orange Juice wrote:

  OK, been banging my head with this for a while. I have a dynamic site
where we get a list of elements from the database, we identify these
items with id numbers and encoded get strings. So I'm trying to get
style changes to take affect with jquery and it really just doesn't
work.

I'm not sure what I'm doing wrong. Here is the source code: