[jQuery] Re: repeatly fadein/fadeout an object

2009-06-06 Thread Davis

Hello Gustavo,

thanks very much for your help, solved.
thanks also for those previous helper.

Thanks/Davis.


[jQuery] Re: Restrcit user copy the site page article

2009-06-06 Thread bharani kumar
Hi its ok ya ,
Am not bother abut the browser disable ,

Because its intra net project ,

So we disable in the systems,

Tell me the snippet for that ,


thanks





On Sun, Jun 7, 2009 at 9:46 AM, Ricardo  wrote:

>
> It's "doable", but save your efforts. After you deliver the HTML to
> the user's browser, nothing is gonna stop him from copying it if he
> wants to.
>
> Ex: if you block it via Javascript, just disabling javascript nulls
> it. In Firefox you can use -moz-user-select: none, but disabling CSS
> or simply pressing Ctrl+U makes it useless.
>
> On Jun 6, 8:48 pm, bharani kumar 
> wrote:
> > Hi All ,
> >
> > How to restrict the user copy the article content in the page ,
> >
> > 1.I want to disable the copy from the right click menu ,
> >
> > 2.also want to restrict the user Select all the article and take the copy
> ,
> >
> > Any idea for this
> >
> > Thanks
>



-- 
Regards
B.S.Bharanikumar
http://php-mysql-jquery.blogspot.com/


[jQuery] Re: Restrcit user copy the site page article

2009-06-06 Thread Ricardo

It's "doable", but save your efforts. After you deliver the HTML to
the user's browser, nothing is gonna stop him from copying it if he
wants to.

Ex: if you block it via Javascript, just disabling javascript nulls
it. In Firefox you can use -moz-user-select: none, but disabling CSS
or simply pressing Ctrl+U makes it useless.

On Jun 6, 8:48 pm, bharani kumar 
wrote:
> Hi All ,
>
> How to restrict the user copy the article content in the page ,
>
> 1.I want to disable the copy from the right click menu ,
>
> 2.also want to restrict the user Select all the article and take the copy ,
>
> Any idea for this
>
> Thanks


[jQuery] Re: Even Odd Rows

2009-06-06 Thread Ricardo

Still not the best solution, but a bit more efficient:

$("li").removeClass("even odd").each(function(i){
  $(this).addClass(i%2 ? 'odd' : 'even')
});

On Jun 5, 8:40 pm, MorningZ  wrote:
> // delete 
> then
>
> $("li").removeClass("even").removeClass("odd")
>       .filter(":odd").addClass("odd")
>       .end()
>       .filter(":even").addClass("even");
>
> On Jun 5, 7:57 pm, "Dave Maharaj :: WidePixels.com"
>
>  wrote:
> > I have a li layout which have the even odd class applied to them. Each item
> > in the li has a delete link,click deletes the li but i am left with
> > li class even
> > li class even
> > li class odd
> > if i delete an odd one or vice versa
>
> > how can i upon delete re-assign the even odd classes so they remain looking
> > correct?
>
> > thanks
>
> > Dave


[jQuery] Re: Even Odd Rows

2009-06-06 Thread Ricardo

assuming you're always deleting one element at at a time (or in odd
quantities, hehe), how about

$(deleted_element).nextAll().toggleClass('odd').toggleClass('even');

(would be shorter if toggleClass could take multiple classes)

On Jun 5, 4:57 pm, "Dave Maharaj :: WidePixels.com"
 wrote:
> I have a li layout which have the even odd class applied to them. Each item
> in the li has a delete link,click deletes the li but i am left with
> li class even
> li class even
> li class odd
> if i delete an odd one or vice versa
>
> how can i upon delete re-assign the even odd classes so they remain looking
> correct?
>
> thanks
>
> Dave


[jQuery] Restrcit user copy the site page article

2009-06-06 Thread bharani kumar
Hi All ,

How to restrict the user copy the article content in the page ,


1.I want to disable the copy from the right click menu ,

2.also want to restrict the user Select all the article and take the copy ,

Any idea for this

Thanks


[jQuery] Re: document.body is null or is not an object

2009-06-06 Thread Ricardo

That's a check for proper W3C box model support, as you can see it
runs on document.ready (jQuery(function...), so it's impossible that
the document body doesn't exist yet. Kranti is right, it's likely a
previous error that's causing it.

On Jun 5, 9:07 am, Lideln  wrote:
> Hi !
>
> I have an issue... What is weird, is that my colleagues don't have
> it ! (and I did not have it this morning)
> It happens only on IE6... Everything is fine under Firefox (3), Safari
> (4 beta) and Opera (9.64).
>
> When logging in into my application, IE tells me "document.body is
> null or is not an object".
> I have the IE6 debugger installed, and it points me toward : (I used
> the "normal" jquery version to show the plain text code)
>
> [code]
> // Figure out if the W3C box model works as expected
> // document.body must exist before we can do this
> jQuery(function(){
>         var div = document.createElement("div");
>         div.style.width = div.style.paddingLeft = "1px";
>
>         document.body.appendChild( div ); <--- error happens here
>         jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
>         document.body.removeChild( div ).style.display = 'none';});
>
> [/code]
>
> How can this be possible ?
>
> Thank you for any possible lead that could help me get rid of this
> error...
>
> Kind regards,


[jQuery] Re: jQuery in OfficeLive

2009-06-06 Thread kranthi

clearly you are not including the jquery.js file(u are including a
file but that is empty) web developer firefox addon comes handy in
these cases


[jQuery] Re: jQuery in OfficeLive

2009-06-06 Thread GCasalett

I appreciate your replies. The pages that are not working are at
www.casalett.net/newhome . I am a new jQuery user, so I may very well
be overlooking something, but I can get the pages working offline.

I do have Firefox and Firebug, and I have included the jquery.js file
like so:


  //this one is for the background scrolling effect



$(document).ready(function(){

$("#navigation a")
.css( {backgroundPosition: "0 0"} )
.mouseover(function(){
$(this).animate(
{backgroundPosition:"(0 -100px)"},
{duration:300})
})
.mouseout(function(){
$(this).stop().animate(
{backgroundPosition:"(0 0)"},
{duration:300})
});
});



Am I on the right track? Thanks again!

On Jun 3, 8:16 pm, MorningZ  wrote:
> Considering it is "Office Live", does that mean it is online where we
> could see a live non working page?
>
> It's probably something simple overlooked
>
> On Jun 3, 7:20 pm, Jonathan  wrote:
>
> > We would need more details or a demo page showing the problem.
>
> > Did you make sure you're including the base jQuery.1.3.2.js properly?
> > If you don't know how to do that download and install firebug for
> > Firefox and use it to inspect the Script tag to see if it was
> > included.
>
> > On Jun 3, 11:45 am, GCasalett  wrote:
>
> > > Hello - I have just started learning jQuery and tried to upload a test
> > > to my website, hosted free by Microsoft's Office Live, and the jQuery
> > > bits don't seem to work. I looked through their community, and only
> > > one person has posted about the subject, and they have the same
> > > problem. Anyone here have any suggestions? Thanks!


[jQuery] jquery .live with a dialog box-can't get dialog to work

2009-06-06 Thread ktpmm5


I'm currently loading data from a mysql db - if a certain condition is met, a
volunteer button is displayed.  When the button is clicked I want to display
a dialog box, and a php file is called to populate the box.  First I
initialize the dialog:
[code]
$(document).ready(function() {  
$("#chaincrewDialog").dialog({ autoOpen: false });  
});
[/code]

Here is how I'm calling the dialog box:

[code]
$('.volunteer').live("click", function(){   
// this gets the game number from the table to pass to the php 
file
var gameno
=$(this).parent('td').prev("td").prev("td").prev("td").prev("td").prev("td").html();
  
$('#chaincrewDialog').dialog('open').load("popup.php?gameno="+gameno);
});
[/code]

My click button works fine, and there are no js or firebug error messages. 
My dialog is called with the following parameters: 
[code]
 $(function() {
$('#chaincrewDialog').dialog({
resizable: true,
//bgiframe: true,
autoOpen:   false,
resizable:  false,
modal:  true,
dialogClass:'flora',
title: 'Volunteer',
overlay: {
opacity: 0.5,
background: "#A8A8A8"
},
height: 600,
width: 700,
buttons: {
'Close': function() {
$(this).dialog('remove')
}
}
});
[/code]

I'm sure I'm missing something easy, but I can't get my dialog to even
display
-- 
View this message in context: 
http://www.nabble.com/jquery-.live-with-a-dialog-box-can%27t-get-dialog-to-work-tp23906786s27240p23906786.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Moving a div container from within to before a p container

2009-06-06 Thread Charlie





i did realize after reading your post my bad for not paying closer
attention to the  OP, wrapping it all first then moving out of p makes
sense

mkmanning wrote:

  This still won't move the optional caption text (see my post above).

On Jun 6, 4:21 pm, Charlie  wrote:
  
  
One reason I follow this board is to learn how to do things I haven't encountered. I had no idea off top of my head how to do what you want but in quest to learn jQuery many of the problems on this board are great for training one's self. Thanks to team jQuery for such a good library and for excellent API docs and examples
solution is very straight forward and easy to test with the markup of  some text 
//test example
$("img").each(function() {
       if ($(this).parent().is("p")){   
                   alert("My Parent is a P");
               $(this).insertBefore($(this).parent());                   
        }
     });
in your case you should be able to put following right after your .each(function (i) {:
if ($(this).parent().is("p")){               
               $(this).insertBefore($(this).parent());                   
        }
///rest of your function
var a = $(this).attr('alt');
Bruce MacKay wrote:Hi folks,
The following function takes an image tag (or table) that appears within a p tag container in the form< p>  text < /p>and wraps the image (and caption if a title is present) into a div for floating left, right, or centering.
My problem is that I don't know how to shift the processed image from within the p container to immediately before it (so that the created div is not within a p container)
I'd appreciate help in this next step.
Thanks,
Brucefunction fnDoImages() {
 $('img.imgposl,img.imgposr,img.imgposc,img.tblposl,img.tblposr,img.tblposc').each(function(i) {
 var a = $(this).attr('alt');
 var q = $(this).attr('class').substr(0,3);
 var p = $(this).attr('class').substr(6);
 var t = $(this).attr('title');   
 var w = $(this).attr('width');
 if (a.length=0) {
   $(this).attr('alt',''+t+'');
 }
  $(this).wrap("");
 if (q=='tbl' && t.length>0) {
  $(this).before(""+t+"");
 } else if (t.length>0){
  //$(this).after(""+t+"");
 };
  $("#g"+i).addClass("img"+p).css({width:w+'px'});
}); 
}

  
  
  






[jQuery] Re: Moving a div container from within to before a p container

2009-06-06 Thread mkmanning

This still won't move the optional caption text (see my post above).

On Jun 6, 4:21 pm, Charlie  wrote:
> One reason I follow this board is to learn how to do things I haven't 
> encountered. I had no idea off top of my head how to do what you want but in 
> quest to learn jQuery many of the problems on this board are great for 
> training one's self. Thanks to team jQuery for such a good library and for 
> excellent API docs and examples
> solution is very straight forward and easy to test with the markup of  
> some text 
> //test example
> $("img").each(function() {
>        if ($(this).parent().is("p")){   
>                    alert("My Parent is a P");
>                $(this).insertBefore($(this).parent());                   
>         }
>      });
> in your case you should be able to put following right after your 
> .each(function (i) {:
> if ($(this).parent().is("p")){               
>                $(this).insertBefore($(this).parent());                   
>         }
> ///rest of your function
> var a = $(this).attr('alt');
> Bruce MacKay wrote:Hi folks,
> The following function takes an image tag (or table) that appears within a p 
> tag container in the form< p>  text < /p>and wraps the image (and 
> caption if a title is present) into a div for floating left, right, or 
> centering.
> My problem is that I don't know how to shift the processed image from within 
> the p container to immediately before it (so that the created div is not 
> within a p container)
> I'd appreciate help in this next step.
> Thanks,
> Brucefunction fnDoImages() {
>  
> $('img.imgposl,img.imgposr,img.imgposc,img.tblposl,img.tblposr,img.tblposc').each(function(i)
>  {
>  var a = $(this).attr('alt');
>  var q = $(this).attr('class').substr(0,3);
>  var p = $(this).attr('class').substr(6);
>  var t = $(this).attr('title');   
>  var w = $(this).attr('width');
>  if (a.length=0) {
>    $(this).attr('alt',''+t+'');
>  }
>   $(this).wrap(" id='g"+i+"'>");
>  if (q=='tbl' && t.length>0) {
>   $(this).before(" style='width:"+w+"px;'>"+t+"");
>  } else if (t.length>0){
>   //$(this).after(" style='width:"+w+"px;'>"+t+"");
>  };
>   $("#g"+i).addClass("img"+p).css({width:w+'px'});
> }); 
> }


[jQuery] Re: Moving a div container from within to before a p container

2009-06-06 Thread mkmanning

Waseem's answer doesn't look good for a couple reasons, most
importantly calling obj.remove(). That will delete the image from the
DOM, which renders every action before it pretty useless :P

It also doesn't take into account the OP's request to also include the
caption text if it exists.

Try this to get familiar with chaining and manipulation:
$('p').wrapInner('').children().insertBefore($('p'));

If you're working from having a reference to the image (where this ==
your image):
var p = $(this).parent();
p.wrapInner('').children().insertBefore(p);

HTH

On Jun 6, 3:48 pm, infoaddicted  wrote:
> wasseem's answer looks good, I'd just like to off a little friendly
> advice on coding style, advice meant to make revisiting
> your own code in the future easier as well as making it under-
> standable to others.
>
> in a block like:
>
>     {
>         var a= $(this).attr('alt');
>         ...
>     }
>
> consider using more user friendly variables names, like
>
>     var alt = ...
>     var substr_1 = ...
>
> and putting spaces around operators like the concatenation
>
>     "foo" + "bar"
>
> the few bytes added to your code size is a very small percentage
> of your total page size.
>
> You can find a lot of good advice in the same vein here:
>
> Code Conventions for the JavaScript Programming Language
>  -http://javascript.crockford.com/code.html
>
> On Jun 6, 5:11 pm, Bruce MacKay  wrote:
>
> > Hi folks,
>
> > The following function takes an image tag (or table) that appears
> > within a p tag container in the form
> > < p>  text < /p>
>
> > and wraps the image (and caption if a title is present) into a div
> > for floating left, right, or centering.
>
> > My problem is that I don't know how to shift the processed image from
> > within the p container to immediately before it (so that the created
> > div is not within a p container)
>
> > I'd appreciate help in this next step.
>
> > Thanks,
>
> > Bruce
>
> > function fnDoImages() {
> >          
> > $('img.imgposl,img.imgposr,img.imgposc,img.tblposl,img.tblposr,img.tblposc' 
> > ).each(function(i)
> > {
> >                  var a = $(this).attr('alt');
> >                  var q = $(this).attr('class').substr(0,3);
> >                  var p = $(this).attr('class').substr(6);
> >                  var t = $(this).attr('title');
> >                  var w = $(this).attr('width');
> >                  if (a.length=0) {
> >                          $(this).attr('alt',''+t+'');
> >                  }
> >                  $(this).wrap(" > id='g"+i+"'>");
> >                  if (q=='tbl' && t.length>0) {
> >                  $(this).before(" > style='width:"+w+"px;'>"+t+"");
> >                  } else if (t.length>0){
> >                  //$(this).after(" > style='width:"+w+"px;'>"+t+"");
> >                  };
> >                  $("#g"+i).addClass("img"+p).css({width:w+'px'});
> >          });
>
> > }


[jQuery] Re: Moving a div container from within to before a p container

2009-06-06 Thread Charlie





One reason I follow this board is to learn how to do things I haven't
encountered. I had no idea off top of my head how to do what you want
but in quest to learn jQuery many of the problems on this board are
great for training one's self. Thanks to team jQuery for such a good
library and for excellent API docs and examples

solution is very straight forward and easy to test with the markup of
 some text 
//test example
$("img").each(function() {
       if ($(this).parent().is("p")){    
                   alert("My Parent is a P");
               $(this).insertBefore($(this).parent());               
    
        }
     });

in your case you should be able to put following right after your
.each(function (i) {: 

if ($(this).parent().is("p")){                
               $(this).insertBefore($(this).parent());               
    
        }
///rest of your function
var a = $(this).attr('alt');


Bruce MacKay wrote:
Hi
folks,
  
The following function takes an image tag (or table) that appears
within
a p tag container in the form 
  < p>  text < /p>
  
  and wraps the image (and caption if a title is present) into a
div
for floating left, right, or centering.
  
My problem is that I don't know how to shift the processed image from
within the p container to immediately before it (so that the created
div
is not within a p container)
  
I'd appreciate help in this next step.
  
Thanks,
  
Bruce
  
  function fnDoImages() {
  
$('img.imgposl,img.imgposr,img.imgposc,img.tblposl,img.tblposr,img.tblposc').each(function(i)
{
  
var a =
$(this).attr('alt');
  
var q =
$(this).attr('class').substr(0,3);
  
var p =
$(this).attr('class').substr(6);
  
var t =
$(this).attr('title');  

  
var w =
$(this).attr('width');
  
if (a.length=0)
{
  


$(this).attr('alt',''+t+'');
  
}
  

$(this).wrap(""); 
  
if (q=='tbl'
&& t.length>0) {
  

$(this).before(""+t+"");
  
} else if
(t.length>0){
  

//$(this).after(""+t+"");
  
};
  

$("#g"+i).addClass("img"+p).css({width:w+'px'});
  }); 
  
  
}
  





[jQuery] Re: Moving a div container from within to before a p container

2009-06-06 Thread infoaddicted

wasseem's answer looks good, I'd just like to off a little friendly
advice on coding style, advice meant to make revisiting
your own code in the future easier as well as making it under-
standable to others.

in a block like:

{
var a= $(this).attr('alt');
...
}

consider using more user friendly variables names, like

var alt = ...
var substr_1 = ...

and putting spaces around operators like the concatenation

"foo" + "bar"

the few bytes added to your code size is a very small percentage
of your total page size.

You can find a lot of good advice in the same vein here:

Code Conventions for the JavaScript Programming Language
 - http://javascript.crockford.com/code.html


On Jun 6, 5:11 pm, Bruce MacKay  wrote:
> Hi folks,
>
> The following function takes an image tag (or table) that appears
> within a p tag container in the form
> < p>  text < /p>
>
> and wraps the image (and caption if a title is present) into a div
> for floating left, right, or centering.
>
> My problem is that I don't know how to shift the processed image from
> within the p container to immediately before it (so that the created
> div is not within a p container)
>
> I'd appreciate help in this next step.
>
> Thanks,
>
> Bruce
>
> function fnDoImages() {
>          
> $('img.imgposl,img.imgposr,img.imgposc,img.tblposl,img.tblposr,img.tblposc').each(function(i)
> {
>                  var a = $(this).attr('alt');
>                  var q = $(this).attr('class').substr(0,3);
>                  var p = $(this).attr('class').substr(6);
>                  var t = $(this).attr('title');
>                  var w = $(this).attr('width');
>                  if (a.length=0) {
>                          $(this).attr('alt',''+t+'');
>                  }
>                  $(this).wrap(" id='g"+i+"'>");
>                  if (q=='tbl' && t.length>0) {
>                  $(this).before(" style='width:"+w+"px;'>"+t+"");
>                  } else if (t.length>0){
>                  //$(this).after(" style='width:"+w+"px;'>"+t+"");
>                  };
>                  $("#g"+i).addClass("img"+p).css({width:w+'px'});
>          });
>
> }


[jQuery] Re: Thoughts on creating a hoverable alphabetical list

2009-06-06 Thread Scott Sauyet


Dave Joyce wrote:

http://stuff.exit42design.com/grabup/475e4d0e25eaf92eefcecdd23af0b0c6.png

It's an alphabetical list of letters down the left column. When you hover
over those letters, a list in a block on the right side (with overflow
hidden) moves up or down to the letter that's being hovered over. It's sort
of reminiscent of the iPhone alphabetical list on the right side of the
screen.


This question inspired me to a very rough draft of a plug-in that takes 
an alphabetized list, extracts the initial letters and creates a 
navigation list much like you described.  It is very rough, but might be 
workable for you:


http://scott.sauyet.com/Javascript/Demo/2009-06-06a/

This depends on Ariel Flesler's ScrollTo plug-in and Brian Cherne's 
hoverIntent plug-in.


The nice thing is that the markup and the JS are very simple:


  Acura
  Alfa Romeo
  


$("#make").alphaList();

As a generic plug-in this would take much more work, but I think the 
skeleton is there.  There is only one option right now, which lets you 
choose whether a scrollbar show up.  By default it's false.


$("#make").alphaList({scrollbar: true});


  -- Scott


[jQuery] Re: Moving a div container from within to before a p container

2009-06-06 Thread waseem sabjee
i would usually wrap anything effected by jquery within a div


var obj = $(".pcontainer img");
var nav = obj.parent();
nav = nav .parent();
nav.prepend(obj);
obj.remove();











On Sat, Jun 6, 2009 at 11:11 PM, Bruce MacKay  wrote:

>  Hi folks,
>
> The following function takes an image tag (or table) that appears within a
> p tag container in the form
> < p>  text < /p>
>
> and wraps the image (and caption if a title is present) into a div for
> floating left, right, or centering.
>
> My problem is that I don't know how to shift the processed image from
> within the p container to immediately before it (so that the created div is
> not within a p container)
>
> I'd appreciate help in this next step.
>
> Thanks,
>
> Bruce
>
> function fnDoImages() {
>
> $('img.imgposl,img.imgposr,img.imgposc,img.tblposl,img.tblposr,img.tblposc').each(function(i)
> {
>  var a = $(this).attr('alt');
>  var q = $(this).attr('class').substr(0,3);
>  var p = $(this).attr('class').substr(6);
>  var t = $(this).attr('title');
>  var w = $(this).attr('width');
>  if (a.length=0) {
>$(this).attr('alt',''+t+'');
>  }
>   $(this).wrap(" id='g"+i+"'>");
>  if (q=='tbl' && t.length>0) {
>   $(this).before(" style='width:"+w+"px;'>"+t+"");
>  } else if (t.length>0){
>   //$(this).after(" style='width:"+w+"px;'>"+t+"");
>  };
>   $("#g"+i).addClass("img"+p).css({width:w+'px'});
> });
>
> }
>


[jQuery] Re: A beginerhaving problems with jquery

2009-06-06 Thread Charlie





you already have what you need

whenever you see a reference to jquery.js ( in tutorials,plugin docs
etc) you can substitute jQuery.1.3.2.js. or any other version The
numbers after jQuery are version numbers, but this is the jquery.js you
are needing. You can do one of following: save the jquery.1.3.2.js as
jquery.js, or probably the better method ( easier to keep track of what
version you have) is use it as is.

you could name this file anything you want, the file name is totally
irrelevant to it's use as long as the path to the file is valid

BrownPrince wrote:

  Thanks for the tip. Please could you send me any jquery.js file and
any other helpful jquery libraries. My Email is t.una...@yahoo.co.uk.
Thanks in anticipation of your help.

On Jun 5, 6:33 pm, waseem sabjee  wrote:
  
  
that is the correct file name

say if the jquery.1.2.3.js sits on your desktop
and the index.html sits on your desktop

in your head code you will say





On Fri, Jun 5, 2009 at 7:30 PM, BrownPrince  wrote:



  I downloaded the libraries but i couldnt see the jquet.js file. All  i
see is jquery.1.2.3.js
  


  On Jun 4, 4:06 pm, MorningZ  wrote:
  
  
And to add to that, the actual name of the "js" file makes absolutely
no difference  (i think that was the question actually asked by the
original poster)

  


  
On Jun 4, 11:04 am, waseem sabjee  wrote:

  


  

  have you downloaded th Jquery _javascript_ library fromhttp://
  

  
  jquery.com/?
  


  

  have you added the script refference you your page ?
  

  


  

  


  

  


  

  not : src is the file path or url path of which folder the script is
  

  
  sitting
  
  

  in and its' file name
  

  


  

  On Thu, Jun 4, 2009 at 1:46 PM, BrownPrince 
  

  
  wrote:
  


  

  
I just started using jquery recently. I do understand the codes and
how they work but i cant understand how to reference external jquery
file in the head section. If you download jquery libraries you see
e.g: jquery.1.2.3.js, but in the tutorials they expect you to refeer
to a certain jquery.js file. Please could someone help me solve this
problem? You could also mail me with t.una...@yahoo.co.uk- Hide

  

  
  quoted text -
  


  
- Show quoted text -- Hide quoted text -

  

- Show quoted text -

  
  
  






[jQuery] Moving a div container from within to before a p container

2009-06-06 Thread Bruce MacKay

Hi folks,

The following function takes an image tag (or table) that appears 
within a p tag container in the form

< p>  text < /p>

and wraps the image (and caption if a title is present) into a div 
for floating left, right, or centering.


My problem is that I don't know how to shift the processed image from 
within the p container to immediately before it (so that the created 
div is not within a p container)


I'd appreciate help in this next step.

Thanks,

Bruce

function fnDoImages() {
$('img.imgposl,img.imgposr,img.imgposc,img.tblposl,img.tblposr,img.tblposc').each(function(i) 
{

var a = $(this).attr('alt');
var q = $(this).attr('class').substr(0,3);
var p = $(this).attr('class').substr(6);
var t = $(this).attr('title');
var w = $(this).attr('width');
if (a.length=0) {
$(this).attr('alt',''+t+'');
}
$(this).wrap("id='g"+i+"'>");

if (q=='tbl' && t.length>0) {
$(this).before("style='width:"+w+"px;'>"+t+"");

} else if (t.length>0){
//$(this).after("style='width:"+w+"px;'>"+t+"");

};
$("#g"+i).addClass("img"+p).css({width:w+'px'});
});

}


[jQuery] Re: urgent json parsing error!!!! very important

2009-06-06 Thread mkmanning

It's not a cross-domain security issue, it's a JSONP issue (maybe an
authentication issue). Twitter's API allows you to make GET requests
which are returned as JSON with an option to specify a callback
function. Afaik it doesn't support JSONP however. You can add
&callback=some_function and the response will be:

some_function(true)

In a cross-domain getJSON call jQuery appends the response to the
document in a SCRIPT tag (no ajax involved). The problem may be that
this is an API call that requires authentication. I say 'may' because
it looks like you can hit the URL in the browser (try Chrome) and get
the response back without setting the auth header. (try
http://twitter.com/friendships/exists.json?user_a=cnn&user_b=cnni&callback=foobar)

My first suggestion is create a global callback function, then append
that function name to the URL (as above).


On Jun 6, 1:39 pm, Aaron Gundel  wrote:
> My guess is that you're not building an extension for twitter that
> will run on their site, so you're violating the cross domain request
> rule.  You cannot directly request from twitter.com, you'd have to
> proxy through a page on your site (some page that forwarded this
> request to twitter and returned the same result) or you can use jsonp
> to achieve the same effect, which is probably what you're looking for.
>  Hopefully this will help you.
>
> $(document).ready(function(){
>                        $.ajax( {
>                                            url: 
> 'http://twitter.com/friendships/exists.json?user_a='+
> usera + '&user_b=' + userb,
>                                            dataType: "jsonp",
>                        success: function(data)
>                        {
>                                                         if(data == true)
>                                                         {
>                                                                 var newDiv = 
> 'true';
>                                                         }
>
>                                                         
> $('#content').append(newDiv);
>                        }
>                        })});
>
> On Sat, Jun 6, 2009 at 3:47 AM, grand_unifier wrote:
>
> > 
>
> >    
> >    
>
> >    
>
> >    $(document).ready(function()
> >     {
> >                $('form#search').bind("submit", function(e)
> >                {
> >                        e.preventDefault();
> >                        $('#content').html('');
>
> >                        var query1 = urlencode($('input[name="user_a"]').val
> > ()); //userA
> >                        var query2 = urlencode($('input
> > [name="user_b"]').val()); //userB
>
> >                        
> > $.getJSON('http://twitter.com/friendships/exists.json?
> > user_a='+query1+'&user_b='+query2,
> >                        function(data)
> >                        {
>
> >                                  if(data.text == 'true')
> >                                    {
> >                                      var newDiv = '

true

'; > >                                    } > > >                             $('#content').append(newDiv); > > >                                }); > >                        }); > >                }); > > >          function urlencode(str) { > >            return escape(str).replace(/\+/g,'%2B').replace(/%20/g, > > '+').replace(/\*/g, '%2A').replace(/\//g, '%2F').replace(/@/g, '%40'); > >          } > >    }); > > >     > > > > > > i dont understand wats wron wth this code...could anyone plz correct > > itplzits very frustratin... > > any help wil be appreciated...

[jQuery] Re: Slide show transition using backgrounds and pngs (jquery cycle lite)

2009-06-06 Thread Gustavo Salomé
IE cant handle css-images properly
Try to use your images as html.

2009/6/6 D A 

>
> > I'm attempting to create a mini slide show of rotating image. I'm
> > using jquery cycle lite:
> >
> > http://malsup.com/jquery/cycle/lite/
>
> Well, after a lot more trial and error and experimenting, I've come to
> the conclusion that the plugin (or, perhaps more likely, IE) can't
> handle background images as part of the fade (they 'pop out' upon each
> fade in of the container) nor transparent PNGs (during the fade
> in/out, it reverts to 1-bit transparency).
>
> So, for now, the fix will be careful image creation matching the
> background and using them as inline images.
>
> Not ideal, but meets our needs.
>
> If anyone has used an image rotator that can allow IE to:
>
>   - do a fade transition
>   - handle background images
>   - (and bonus: handle the fading of transparent PNGs)
>
> please let me know!
>
> -DA
>



-- 
Gustavo Salome Silva


[jQuery] Re: ajax.request equivalent in jquery

2009-06-06 Thread mkmanning

You already set the postBody in your first jQuery conversion: data

The docs should provide you with all the explanations you need.

On Jun 5, 12:31 pm, deex  wrote:
> Hey all...
>
> I am doing a conversion of prototype to jquery and am stuck on a
> script... I can't figure out how to define certain fields.
>
> Here's the prototype call:
>
> new Ajax.Request(url,
>           {
>             method:'post',
>                         postBody: 'media_id='+media_id,
>             onSuccess: trigger,
>                         onComplete: function()
>                                 {
>                                 leftPos = 
> Position.positionedOffset($('doc'))[0];
>
>                                 if (window.pageYOffset)
>                                 ScrollTop = window.pageYOffset;
>
>                                 else
>                                 ScrollTop = (document.body.parentElement) ?
> document.body.parentElement.scrollTop : 0;
>
>                                 $('fade').setStyle({height: 
> $('doc').getHeight()+'px'});
>                                 $('popup').setStyle({left: 
> (leftPos+138)+'px'});
>                                 $('popup').setStyle({top: 
> (ScrollTop+50)+'px'});
>                                 }
>           });
>
> I've attempted to convert and got this far...
>
> jQuery.ajax({type: "POST",
>                     url: url,
>                     data: 'media_id='+media_id,
>                     success: trigger,
>                     complete: function() {
>
>                      leftPos = Position.positionedOffset(jQuery('#doc'))
> [0];
>
>                      if (window.pageYOffset)
>                                 ScrollTop = window.pageYOffset;
>
>                      else
>                                 ScrollTop = (document.body.parentElement) ?
> document.body.parentElement.scrollTop : 0;
>
>                                 jQuery('#fade').setStyle({height: 
> jQuery('#doc').height
> ()+'px'});
>                                 jQuery('#popup').setStyle({left: 
> (leftPos+138)+'px'});
>                                 jQuery('#popup').setStyle({top: 
> (ScrollTop+50)+'px'});}
>                     });
>
> To make things worse, there's a check in there to see if you're logged
> in and if not calls the following:
>
> new Ajax.Request('/profile/signin?noredirect=1',
>           {
>             method:'post',
>             postBody: Form.serialize($('signin_form_popup')),
>             onSuccess: callback
>           });
>
> which I've attempted to convert to :
>
> jQuery.ajax({type:'POST',
>                     url: '/profile/signin?noredirect=1',
>                     postBody: Form.serialize(jQuery
> ('#signin_form_popup')),
>                     success: callback});
>
> I think it's all working but am not sure...I have no idea what to do
> with the "postBody" parameter...what is it's equivalent in jquery.
>
> Any help would be greatly appreciated.
>
> Thanks


[jQuery] Re: urgent json parsing error!!!! very important

2009-06-06 Thread Aaron Gundel

My guess is that you're not building an extension for twitter that
will run on their site, so you're violating the cross domain request
rule.  You cannot directly request from twitter.com, you'd have to
proxy through a page on your site (some page that forwarded this
request to twitter and returned the same result) or you can use jsonp
to achieve the same effect, which is probably what you're looking for.
 Hopefully this will help you.

$(document).ready(function(){
   $.ajax( {
   url: 
'http://twitter.com/friendships/exists.json?user_a='+
usera + '&user_b=' + userb,
   dataType: "jsonp",
   success: function(data)
   {
if(data == true)
{
var newDiv = 
'true';
}


$('#content').append(newDiv);
   }
   })});

On Sat, Jun 6, 2009 at 3:47 AM, grand_unifier wrote:
>
>
> 
>
>    
>    
>
>    
>
>    $(document).ready(function()
>     {
>                $('form#search').bind("submit", function(e)
>                {
>                        e.preventDefault();
>                        $('#content').html('');
>
>                        var query1 = urlencode($('input[name="user_a"]').val
> ()); //userA
>                        var query2 = urlencode($('input
> [name="user_b"]').val()); //userB
>
>
>                        $.getJSON('http://twitter.com/friendships/exists.json?
> user_a='+query1+'&user_b='+query2,
>                        function(data)
>                        {
>
>
>                                  if(data.text == 'true')
>                                    {
>                                      var newDiv = '

true

'; >                                    } > >                             $('#content').append(newDiv); > >                                }); >                        }); >                }); > >          function urlencode(str) { >            return escape(str).replace(/\+/g,'%2B').replace(/%20/g, > '+').replace(/\*/g, '%2A').replace(/\//g, '%2F').replace(/@/g, '%40'); >          } >    }); > >     > > > > i dont understand wats wron wth this code...could anyone plz correct > itplzits very frustratin... > any help wil be appreciated... >

[jQuery] Re: simple(fy) data count

2009-06-06 Thread Gustavo Salomé
Sorry, i think i was sleeping when i wrote the code hehe
Its $count.data('clone_count').
My mistake.
2009/6/6 Peter Marino 

> hi,
> ok... now I tried it.. but it
> seems that
>
> $count.('data')
>
> is not valid way of testing if data is there.. my javascript dies at that
> point.
>
> peter
>
> On Fri, Jun 5, 2009 at 11:30 PM, Gustavo Salomé wrote:
>
>> $count=$(".div_count");
>> var clone_count =!$count.('data') ?1:$cont.data('clone_count')+1;
>> $count.data('clone_count',clone_count);
>>
>> 2009/6/5 Peter Marino 
>>
>> Hi jQuery,
>>> I have the following:
>>>
>>> if ( $(".div_count").data("clone_count")==undefined )
>>> {
>>> $(".div_count").data( "clone_count", 1 );
>>> }
>>> else
>>> {
>>> $(".div_count").data(
>>> "clone_count", $(".div_count").data("clone_count")+1 );
>>> }
>>> var clone_count = $(".div_count").data( "clone_count" );
>>>
>>> is there any method that can do this a little simplier (compact)..
>>>
>>> any suggestions?
>>>
>>> Peter
>>> --
>>> Power Tumbling - http://www.powertumbling.dk
>>> OSG-Help - http://osghelp.com
>>>
>>
>>
>>
>> --
>> Gustavo Salome Silva
>>
>
>
>
> --
> Power Tumbling - http://www.powertumbling.dk
> OSG-Help - http://osghelp.com
>



-- 
Gustavo Salome Silva


[jQuery] Re: A beginerhaving problems with jquery

2009-06-06 Thread BrownPrince

Thanks for the tip. Please could you send me any jquery.js file and
any other helpful jquery libraries. My Email is t.una...@yahoo.co.uk.
Thanks in anticipation of your help.

On Jun 5, 6:33 pm, waseem sabjee  wrote:
> that is the correct file name
>
> say if the jquery.1.2.3.js sits on your desktop
> and the index.html sits on your desktop
>
> in your head code you will say
>
> 
>
>
>
> On Fri, Jun 5, 2009 at 7:30 PM, BrownPrince  wrote:
>
> > I downloaded the libraries but i couldnt see the jquet.js file. All  i
> > see is jquery.1.2.3.js
>
> > On Jun 4, 4:06 pm, MorningZ  wrote:
> > > And to add to that, the actual name of the "js" file makes absolutely
> > > no difference  (i think that was the question actually asked by the
> > > original poster)
>
> > > On Jun 4, 11:04 am, waseem sabjee  wrote:
>
> > > > have you downloaded th Jquery Javascript library fromhttp://
> > jquery.com/?
>
> > > > have you added the script refference you your page ?
>
> > > > 
> > > > 
> > > > 
>
> > > > not : src is the file path or url path of which folder the script is
> > sitting
> > > > in and its' file name
>
> > > > On Thu, Jun 4, 2009 at 1:46 PM, BrownPrince 
> > wrote:
>
> > > > > I just started using jquery recently. I do understand the codes and
> > > > > how they work but i cant understand how to reference external jquery
> > > > > file in the head section. If you download jquery libraries you see
> > > > > e.g: jquery.1.2.3.js, but in the tutorials they expect you to refeer
> > > > > to a certain jquery.js file. Please could someone help me solve this
> > > > > problem? You could also mail me with t.una...@yahoo.co.uk- Hide
> > quoted text -
>
> > > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -


[jQuery] Re: repeatly fadein/fadeout an object

2009-06-06 Thread Gustavo Salomé
Using that function that i wrote do something like this:
a global var like : var timer;
then modify the function making the setInterval function receive it:
timer= setInterval(...)

then bind the click of the stop blink button to clear the setInterval :
$('#stop_blink').click(function(){
clearInterval(timer);
});

Glad i could help :)

2009/6/6 kranthi 

>
> use setTimeout clearTimeout combo.
>
> var timer;
> function func() {
> $("a.tm_link").fadeOut("slow").fadeIn("slow");
> setTimeout("func()", 5*1000)
> }
>
> onclick
>
> clearTimeout(timer);
>



-- 
Gustavo Salome Silva


[jQuery] Re: I need a copy of jquery.js file.

2009-06-06 Thread Chris Owen
Can you not just download it from:

http://code.google.com/p/jqueryjs/downloads/list

Chris.

On Sat, Jun 6, 2009 at 7:24 PM, BrownPrince  wrote:

>
> Please could anyone send me a copy of jquery.js file with other jquery
> library scripts. Pls send to t.una...@yahoo.co.uk
>


[jQuery] I need a copy of jquery.js file.

2009-06-06 Thread BrownPrince

Please could anyone send me a copy of jquery.js file with other jquery
library scripts. Pls send to t.una...@yahoo.co.uk


[jQuery] Re: Text Scroller vertical

2009-06-06 Thread waseem sabjee
whats the link ? il have a look.

On Sat, Jun 6, 2009 at 5:42 PM, Robson  wrote:

>
> Hey guy, take a look at this page of mine and see if my solution is
> what you're looking for. If it solves your problem, just copy it from
> the code. No plugin requires.
>


[jQuery] Treeview

2009-06-06 Thread weirf...@google.com

I'm trying to use the treeview 1.4 with jquery.tabs.pack which comes
with jquery.1.1.3.1.pack

There appears to be some sort of compatability issue between the 2
versions of code and I can't find a download where the tabs and the
treeview are listed in the same place.

Below you can see all the file calls which I'm making on my page;












$(function() {
$("#tree").treeview({
collapsed: true,
animated: "medium",
control:"#sidetreecontrol",
persist: "location"
});
})


$('#container-9').tabs({ remote: true });

$('

Disable third tab<\/a><\/ p>').prependTo('#fragment-28').find('a').click(function() { $(this).parents('div').eq(1).disableTab(3); return false; }); $('

Activate third tab<\/a><\/ p>').prependTo('#fragment-28').find('a').click(function() { $(this).parents('div').eq(1).triggerTab(3); return false; }); $('

Enable third tab<\/a><\/ p>').prependTo('#fragment-28').find('a').click(function() { $(this).parents('div').eq(1).enableTab(3); return false; }); Anyone know how I can get these 2 scripts to function together?


[jQuery] Re: Text Scroller vertical

2009-06-06 Thread Robson

Hey guy, take a look at this page of mine and see if my solution is
what you're looking for. If it solves your problem, just copy it from
the code. No plugin requires.


[jQuery] Cycle Plugin Questions

2009-06-06 Thread Terry

Hi all. I am a newbie to jquery as well as the Cycle plug in. I
initally have 2 questions.
First, can I utilize the prev and next options along with the pager
option, so that someone can have both options of clicking prev/next
and or click on one of the pagers.
And second, can I have a Cycle slide show within another Cycle slide
show.
The reason for question 2 is that I am a graphic designer and I want
to use Cycle to show my portfolio. There are some instances where I
would like to give the viewer the option to see additional detailed
images of a particular portfolio item, and at the same time not force
someone to have to go through each and every image in the portfolio.


[jQuery] Re: Slide show transition using backgrounds and pngs (jquery cycle lite)

2009-06-06 Thread D A

> I'm attempting to create a mini slide show of rotating image. I'm
> using jquery cycle lite:
>
> http://malsup.com/jquery/cycle/lite/

Well, after a lot more trial and error and experimenting, I've come to
the conclusion that the plugin (or, perhaps more likely, IE) can't
handle background images as part of the fade (they 'pop out' upon each
fade in of the container) nor transparent PNGs (during the fade
in/out, it reverts to 1-bit transparency).

So, for now, the fix will be careful image creation matching the
background and using them as inline images.

Not ideal, but meets our needs.

If anyone has used an image rotator that can allow IE to:

   - do a fade transition
   - handle background images
   - (and bonus: handle the fading of transparent PNGs)

please let me know!

-DA


[jQuery] Re: Even Odd Rows

2009-06-06 Thread Dave Maharaj :: WidePixels.com

Thanks everyone for your assistance.

Greatly appreciated.

Dave 

-Original Message-
From: RobG [mailto:robg...@gmail.com] 
Sent: June-06-09 11:27 AM
To: jQuery (English)
Subject: [jQuery] Re: Even Odd Rows




On Jun 6, 11:25 pm, Karl Swedberg  wrote:
> You can make that first line a bit more compact:
>
> $("li").removeClass("even odd")

It's still very inefficient.  All that is required is for the LIs below the
deleted one to have their class swapped from odd to even and vice versa.


--
Rob



[jQuery] Re: Even Odd Rows

2009-06-06 Thread waseem sabjee
here's something i put together

var iseven = 0; // a normal 1, 0 switch
var limit = 34; // maximum limit

$("body").prepend('<\/ul>'); // i want to do this as a list
for(var i = 0; i < limit; i++) {

if(iseven = 0) {
// if odd
$(".test").append('Odd<\/li>')
iseven = 1;
} else {
// if even
$(".test").append('Odd<\/li>')
iseven = 0
}

}

/*
== OUTPUT ===

Odd
Even



*/

this way you create even and odd list items.
may be you can manipulate this logic to achieve what you need.

On Sat, Jun 6, 2009 at 3:57 PM, RobG  wrote:

>
>
>
> On Jun 6, 11:25 pm, Karl Swedberg  wrote:
> > You can make that first line a bit more compact:
> >
> > $("li").removeClass("even odd")
>
> It's still very inefficient.  All that is required is for the LIs
> below the deleted one to have their class swapped from odd to even and
> vice versa.
>
>
> --
> Rob
>


[jQuery] Re: document.body is null or is not an object

2009-06-06 Thread kranthi

i dont have a faintest idea why this is happening. and i am sure that
i am not providing a solution to your
problem.

but from my experience of debugging JS errors on IE 6 (while it
works fine on IE 7) i can tell you that probably you encountered a IE
6 specific JS error before that line of code. in these cases Firefox
web developer addon, firebug addon and inbuilt javascript console came
to my aid.


[jQuery] Re: Cycle Plugin and Wordpress not playing nice

2009-06-06 Thread Mike Alsup

> http://www.ltdmag.com/hometest/

You have an error:

$("#indexGallery").cycle is not a function

because this URL returns 404:

http://www.ltdmag.com/hometest/ltdmag.com/wp-content/themes/ltd_theme/js/jquery.cycle.all.js



[jQuery] Re: Even Odd Rows

2009-06-06 Thread RobG



On Jun 6, 11:25 pm, Karl Swedberg  wrote:
> You can make that first line a bit more compact:
>
> $("li").removeClass("even odd")

It's still very inefficient.  All that is required is for the LIs
below the deleted one to have their class swapped from odd to even and
vice versa.


--
Rob


[jQuery] urgent json parsing error!!!! very important

2009-06-06 Thread grand_unifier









$(document).ready(function()
 {
$('form#search').bind("submit", function(e)
{
e.preventDefault();
$('#content').html('');

var query1 = urlencode($('input[name="user_a"]').val
()); //userA
var query2 = urlencode($('input
[name="user_b"]').val()); //userB


$.getJSON('http://twitter.com/friendships/exists.json?
user_a='+query1+'&user_b='+query2,
function(data)
{


  if(data.text == 'true')
{
  var newDiv = '

true

'; } $('#content').append(newDiv); }); }); }); function urlencode(str) { return escape(str).replace(/\+/g,'%2B').replace(/%20/g, '+').replace(/\*/g, '%2A').replace(/\//g, '%2F').replace(/@/g, '%40'); } }); i dont understand wats wron wth this code...could anyone plz correct itplzits very frustratin... any help wil be appreciated...

[jQuery] question on jQuery.get(url)

2009-06-06 Thread JRough

I have a question about .get(url)  jQuery.get() calls a page on a
server somewhere but what I want to do is get the data pairs from a
local page url and parse it and post it to  google maps .  I have a
desktop application that posts a user choice from a form to this html
page on my desktop and I get an address string in the url.
So I want to use .get(url) to get the contents of this string and then
I want to parse it in a Javascript function so I can pass it to Google
maps.  The type should be text I think, and the get_to_post will be
my  function that will post the data pairs to my php server.  I may
have to post it to a cookie.   I just want to know if I use .get(url)
to do this?



pg_posturl = jQuery.get("file:///Users/jlrough/Desktop/
pgform.html", ,get_to_post, text

This is an example of the string from the database app that is in the
url:

file://HD/clientsidepost.html/?a:14:{i:0;s:54:"7069 Consolidated Way,
Suite 100, San Diego, CA, 92121";i:1;s:50:"15272 Bolsa Chica St ,
Huntington Beach, Ca, 92649";i:2;s:53:"5150 Ontario Mills Pkwy, suit
400, Ontario, CA, 91764";i:3;s:36:"1461 Concord Ave, Concord, CA,
94520";i:4;s:45:"12727 Sherman Way, North Hollywood, CA, 91605";i:5;s:
45:"6416 Variel Avenue, Woodland Hills, CA, 91367";i:6;s:49:"5720
Lankershim Blvd., North Hollywood, CA, 91601";i:7;s:44:"1200 S.
Western Ave., Los Angeles, CA, 90006";i:8;s:33:"608 S Central Av,
Lodi, CA, 95240";i:9;s:45:"435 Valencia Street, San Francisco, CA,
94103";i:10;s:42:"200 Anchor Court, Thousand Oaks, ca, 91320";i:11;s:
37:"633 Laurel St., San Carlos, Ca, 94070";i:12;s:33:"515 Appian Way,
Pinole, CA, 94803";i:13;s:39:"29011 The Old Road, Valencia, ca,
91355";}


[jQuery] Re: jQuery.post -> PHP script -> redirect

2009-06-06 Thread kranthi

$.post worked for me (the redirection is completely accidental and i
had to scratch my head for hours to understand why this happened)..

i was not able to understand what your problem is, but i noted a few }
mismatches in your code. that should have been

$(document).ready(function() {
$("#submit_butt").click( function() {
// configurations for the buzzing effect. Be careful not to make
it too annoying!
var conf = {
frequency: 5000,
spread: 5,
duration: 600
};
/* do your AJAX call and processing here...*/
var unameval = $("#username").val();
var pwdval = $("#pwd").val();
$.post("backend.php", { username: unameval, pwd: pwdval }, 
function(data){
if(data.length >0) {
window.location.href("account.php");
} else {
// this is the call we make when the AJAX callback 
function
indicates a login failure
$("#login").vibrate(conf);
// let's also display a notification
if($("#errormsg").text() == "") {
$("#loginform").append('Nesprávne meno alebo heslo!');
}
   // clear the fields to discourage brute forcing :)
   $("#username").val("");
   $("#pwd").val("");
}
});
});
});


[jQuery] Re: repeatly fadein/fadeout an object

2009-06-06 Thread kranthi

use setTimeout clearTimeout combo.

var timer;
function func() {
$("a.tm_link").fadeOut("slow").fadeIn("slow");
setTimeout("func()", 5*1000)
}

onclick

clearTimeout(timer);


[jQuery] Problem w/ Rapid getJSON Calls

2009-06-06 Thread Nestor Alvarez

I'm trying to make a little script to check the availability of
usernames. I'm doing it with the following javascript (currently
outputting information for debugging)...

$("input[name='username']").keyup(checkIfUsernameExists);

function checkIfUsernameExists() {
username = $("input[name='username']")[0].value;
$('#registrationUsernameAlert').append('Sending for ' + username +
"...");
ajaxUrl = "";
$.getJSON(ajaxUrl, {
username: username
}, usernameAvailabilityReceived);
}

function usernameAvailabilityReceived(json) {
$('#registrationUsernameAlert').append('Received ' + json.username +
"... Available? " + json.available + ".");
if (json.available == "false") {
if ($("input[name='username']").val() == json.username) {
/* $('#registrationUsernameAlert').text("<== That user 
name isn't
available."); */
}
}
}

If I type slowly, waiting for the response from the last call to be
received, then everything works fine. But if I type quickly, it seems
to get held up on the results from past requests. Below is an example
of the output I might receive if I type slowly for the first two or
three characters, then quickly for several, and then slowly again at
the end. What might I do to correct this problem? Is there any way I
can abort past requests when a new one comes along???

Sending for n...
Received n... Available? true.
Sending for ne...
Received ne... Available? true.
Sending for nes...
Received nes... Available? true.
Sending for nest...
Received nes... Available? true.
Sending for nestor...
Received nes... Available? true.
Sending for nestor...
Received nes... Available? true.
Sending for nestora...
Received nes... Available? true.
Sending for nestoral...
Received nes... Available? true.
Sending for nestoralva...
Received nes... Available? true.
Sending for nestoralva...
Received nes... Available? true.
Sending for nestoralvar...
Received nes... Available? true.
Sending for nestoralvare...
Received nes... Available? true.
Sending for nestoralvarez...
Received nestoralvarez... Available? false.


[jQuery] Re: document.body is null or is not an object

2009-06-06 Thread Naren

Use

var body= document.getElementsByTagName('body')[0]
body.appendChild( div );
body.removeChild( div );

On Jun 5, 9:07 pm, Lideln  wrote:
> Hi !
>
> I have an issue... What is weird, is that my colleagues don't have
> it ! (and I did not have it this morning)
> It happens only on IE6... Everything is fine under Firefox (3), Safari
> (4 beta) and Opera (9.64).
>
> When logging in into my application, IE tells me "document.body is
> null or is not an object".
> I have the IE6 debugger installed, and it points me toward : (I used
> the "normal" jquery version to show the plain text code)
>
> [code]
> // Figure out if the W3C box model works as expected
> // document.body must exist before we can do this
> jQuery(function(){
>         var div = document.createElement("div");
>         div.style.width = div.style.paddingLeft = "1px";
>
>         document.body.appendChild( div ); <--- error happens here
>         jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
>         document.body.removeChild( div ).style.display = 'none';});
>
> [/code]
>
> How can this be possible ?
>
> Thank you for any possible lead that could help me get rid of this
> error...
>
> Kind regards,


[jQuery] Re: jquery.ui.cascade null/not an object/undefined, etc etc.

2009-06-06 Thread kranthi

most possible reason is ui.cascade is not defined by the time u call
the above line of code. If ui.cascade is defined in an external js
file (sorry i never used this plugin) then the file must have been
included after calling this line of code.

other possibility being...
you are using frames/iframes. the above code is in the child while the
js file is included in the parent.


[jQuery] Re: drag and drop portlet system based on DotNetNuke

2009-06-06 Thread Rick Faircloth
Look good, Armand...however I couldn't get the editing feature to work.

Rick

On Sat, Jun 6, 2009 at 4:18 AM, Armand Datema  wrote:

> Hi
>
> Just wanna show of our portal system based on DotNetNuke jQuery and
> jQueryUI
>
> We took the sortable example and modified it with
>
> up down movement animation
> slide into place
> smooth animation
> drag to delete and click to delete
> restore functionality
>
> Inspiration was the bbc.co.uk
> site
>
> http://www.2dnn.com/DragnDrop/tabid/128/Default.aspx
>



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


[jQuery] Re: Even Odd Rows

2009-06-06 Thread Karl Swedberg

You can make that first line a bit more compact:

$("li").removeClass("even odd")

--Karl


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




On Jun 5, 2009, at 11:40 PM, MorningZ wrote:



// delete 
then

$("li").removeClass("even").removeClass("odd")
 .filter(":odd").addClass("odd")
 .end()
 .filter(":even").addClass("even");


On Jun 5, 7:57 pm, "Dave Maharaj :: WidePixels.com"
 wrote:
I have a li layout which have the even odd class applied to them.  
Each item

in the li has a delete link,click deletes the li but i am left with
li class even
li class even
li class odd
if i delete an odd one or vice versa

how can i upon delete re-assign the even odd classes so they remain  
looking

correct?

thanks

Dave




[jQuery] Re: jQuery.post -> PHP script -> redirect

2009-06-06 Thread WD.acgrs

$.ajax should be used instead of $.post.

WD

On May 27, 5:48 pm, mrozko  wrote:
> Hi All,
>
> I am looking for the solution of this problem:
>
> i have a login form. i would like to "shake" the login-form box, if
> the authentication (PHP+MySQL) failed.
> i use jQuery.post for posting the values from login form to the PHP-
> script (used for validation - named "backend.php").
>
> This is the code:
>
> 
>
> $(document).ready(function() {
>         $("#submit_butt").click( function() {
>                 // configurations for the buzzing effect. Be careful not to 
> make it
> too annoying!
>                 var conf = {
>                                 frequency: 5000,
>                                 spread: 5,
>                                 duration: 600
>                         };
>                 /* do your AJAX call and processing here...
>                          */
>                         var unameval = $("#username").val();
>                   var pwdval = $("#pwd").val();
>
>                   $.post("backend.php", { username: unameval, pwd: pwdval },
> function(data){
>             if(data.length >0) {
>
>                 window.location.href("account.php");
>
>             }
>         });
>                 // this is the call we make when the AJAX callback function
> indicates a login failure
>                 $("#login").vibrate(conf);
>                 // let's also display a notification
>                 if($("#errormsg").text() == "")
>                         $("#loginform").append('

Nesprávne > meno alebo heslo! >

'); >                 // clear the fields to discourage brute forcing :) >                 $("#username").val(""); >                 $("#pwd").val(""); >         }); > > }); > > > > Could you pls help me? Any suggestions? > > Thanks a lot. > > Best, > Marian

[jQuery] Re: document.body is null or is not an object

2009-06-06 Thread Lideln

Hi,

I am using strict doctype, but I think I tried loose too but no
success.
I don't "do" the append thing, what I quoted is the jquery 3.2 library
code where it fails (I was previously using the minified version, but
not handy to debug)

Any idea ?

On Jun 6, 5:27 am, Aaron Gundel  wrote:
> What is your doctype for the page?  strict doctypes will render under
> document.documentElement rather than document.body.
>
> Not sure if there's any particular reason you're doing it this way
> though.  It would probably be much simpler to do something like
>
> jQuery("body").append("")
>
> On Fri, Jun 5, 2009 at 9:07 AM, Lideln wrote:
>
> > Hi !
>
> > I have an issue... What is weird, is that my colleagues don't have
> > it ! (and I did not have it this morning)
> > It happens only on IE6... Everything is fine under Firefox (3), Safari
> > (4 beta) and Opera (9.64).
>
> > When logging in into my application, IE tells me "document.body is
> > null or is not an object".
> > I have the IE6 debugger installed, and it points me toward : (I used
> > the "normal" jquery version to show the plain text code)
>
> > [code]
> > // Figure out if the W3C box model works as expected
> > // document.body must exist before we can do this
> > jQuery(function(){
> >        var div = document.createElement("div");
> >        div.style.width = div.style.paddingLeft = "1px";
>
> >        document.body.appendChild( div ); <--- error happens here
> >        jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
> >        document.body.removeChild( div ).style.display = 'none';
> > });
> > [/code]
>
> > How can this be possible ?
>
> > Thank you for any possible lead that could help me get rid of this
> > error...
>
> > Kind regards,


[jQuery] Re: Echo html in with jquery? (code attached)

2009-06-06 Thread jez

thank to everyone who replied!
I figured out using $('head').append is the way to go!

many thanks for the pointer and help!
best,
jez

On Jun 4, 9:27 pm, Ricardo  wrote:
> Works fine in FF/IE/Webkit:
>
> $('head').append('')
>
> On Jun 4, 1:26 pm, jez  wrote:
>
> > Hello,
> > I am almost certain one of you guys will have a super quick solution
> > to this, but I just can't get it and it is doing my head in:
>
> > I have this piece of code which basically checks on client-side what
> > time of the day it is.
> > This information should be used to "use" different stylesheets based
> > on the time, e.g.
>
> > >=18 will be night.css
> > >=15 will be afternoon.css, etc.
>
> > however I cannot get to write this piece of html (e.g.  > rel="stylesheet" href="night.css" type="text/css" media="screen"
> > title="night" charset="utf-8" />) by means of jquery.
>
> > I was able to set the class of  to either night, afternoon,
> > noon, etc, but I would rather like a solution where the time is
> > translated into night.css, afternoon.css, etc.
>
> > --- see code below ---
>
> > //date
> >   datetoday = new Date();
> >   timenow = datetoday.getTime();
> >   datetoday.setTime(timenow);
> >   thehour = datetoday.getHours();
>
> >   if (thehour >= 18)
> >     $('body').addClass('evening');
> >   else if (thehour >= 15)
> >     $('body').addClass('afternoon');
> >   else if (thehour >= 12)
> >     $('body').addClass('noon');
> >   else if (thehour >= 7)
> >     $('body').addClass('morning');
> >   else if (thehour >= 0)
> >     $('body').addClass('night');
> >   else
> >     $('body').addClass('general');
> > //end
>
> > Many thanks in advance for any suggestions and replies!
> > Any pointers or brain teasers welcome!


[jQuery] Re: event

2009-06-06 Thread Chris Chen
current domElement

2009/6/6 runrunforest 

>
>if(o.btnGo)
>$.each(o.btnGo, function(i, val) {
>$(val).click(function() {
>return go(o.circular ? o.visible+i : i);
>});
>});
>
>
> Hi,
>
> I wonder whats the second parameter, val, in the function means ?
>



-- 
Chris


[jQuery] event

2009-06-06 Thread runrunforest

if(o.btnGo)
$.each(o.btnGo, function(i, val) {
$(val).click(function() {
return go(o.circular ? o.visible+i : i);
});
});


Hi,

I wonder whats the second parameter, val, in the function means ?


[jQuery] Re: IFrame caching in Firefox

2009-06-06 Thread waseem sabjee
here's is one way you can do this however my  way does not use IFrames, but
it does pull all the html from another page.

your html






your script

$.ajax({
url:"source.html",
caching:false,
success: function(html) {
$("#target").html(html);
}
});

so what i do is i loop it in a setTimout


function refreshData() {

setTimeout(function() {
$("#target").html(""); // clear html
// refill html
$.ajax({
url:"source.html",
caching:false,
success: function(html) {
$("#target").html(html);
}
});
refreshData(); // recall this functon every 5 seconds.
}, 5000);

}

On Sat, Jun 6, 2009 at 3:11 AM, Amit Saurav  wrote:

>
> Hello,
>
> I am using a jQuery script to insert iframe in the document after the
> page load completes as follows:
>
> jQuery(window).load(function() {
>var container = jQuery(‘#container_id”);
>jQuery(‘ src=”www.some-url.com”>’).prependTo(container);
> });
>
> Apparently there is a problem (or probably a speed-up trick) with
> Firefox where it tries to cache any iframe content so that next time
> when you come back to the page (using forward or back button), it
> fetches the content of the iframe from its cache rather than making a
> new request. This is a problem to my usecase as the number of request
> received by the server is of high importance.
>
> Hence to get around this caching issue I have a small piece of
> cache-busting code just after prependTo() call above, which forces a
> reload of the iframe is as follows:
>
> if ((navigator.userAgent.indexOf("Firefox") > -1) &&
> (navigator.userAgent.indexOf("Windows") > -1)) {
>var i = document.getElementById("my_iframe");
>if (i) {
>i.src="www.some-url.com";
>}
> }
>
> I read somewhere that when we add iframes to the DOM dynamically, it
> actually takes some amount of time before which it can be queried
> using the standard DOM manipulation function. So, I am suspecting that
> for most of the time my cache-busting code above does not do anything,
> but it’s hard to spot the error as it could be happening only 1 in 10
> times or less.
>
> My question is, would using jQuery’s selector to get the iframe node
> for cache-busting help me get around this iframe-ready-to-query delay?
> I just want to ensure that my cache-busting code runs every time its
> meant to run.
>
> I appreciate any help.
>
> Thanks,
>


[jQuery] Re: ajax.request equivalent in jquery

2009-06-06 Thread waseem sabjee
To be honest i have not used prototype  before.
i'm not sure what post body does.

On Sat, Jun 6, 2009 at 3:22 AM, Dan Cochran  wrote:

> Thanks for the responses. I did realize after I posted that I hadn't
> converted the css changes yet...
>
> What about postBody? What is it?
>
> On Fri, Jun 5, 2009 at 5:59 PM, waseem sabjee wrote:
>
>> $("#myelement").css({ position:"absolute" })
>>
>> thats how you set css in jquery
>>
>>
>> On Fri, Jun 5, 2009 at 11:55 PM, waseem sabjee wrote:
>>
>>> heres something cool
>>>
>>>
>>> in your index.php have an empty div
>>>
>>>
>>> 
>>>
>>> 
>>>
>>> now create a different file new.php
>>>
>>> in this file have the following
>>>
>>> Message One
>>>
>>> 
>>> just testing
>>> 
>>>
>>> in your index.php have the following jquery
>>>
>>> $(function() {
>>> $.ajax({
>>> url:"new.php",
>>> success: function(html) {
>>> var messageOne = $(#MessageOne", html);
>>> var test = $("#test", html);
>>>
>>> alert(messageOne);
>>> alert(test);
>>>
>>>
>>> }
>>> });
>>> });
>>>
>>>
>>> you can extract specific nodes from other files
>>>
>>> On Fri, Jun 5, 2009 at 11:47 PM, waseem sabjee 
>>> wrote:
>>>
 $.ajax({
 url : "data.php", // target URL
 type: "GET", // get  or post
 success: function(html) { // html or data on success
 alert(html):
 }

 });


 On Fri, Jun 5, 2009 at 9:31 PM, deex  wrote:

>
> Hey all...
>
> I am doing a conversion of prototype to jquery and am stuck on a
> script... I can't figure out how to define certain fields.
>
> Here's the prototype call:
>
> new Ajax.Request(url,
>  {
>method:'post',
>postBody: 'media_id='+media_id,
>onSuccess: trigger,
>onComplete: function()
>{
>leftPos =
> Position.positionedOffset($('doc'))[0];
>
>if (window.pageYOffset)
>ScrollTop = window.pageYOffset;
>
>else
>ScrollTop =
> (document.body.parentElement) ?
> document.body.parentElement.scrollTop : 0;
>
>$('fade').setStyle({height:
> $('doc').getHeight()+'px'});
>$('popup').setStyle({left:
> (leftPos+138)+'px'});
>$('popup').setStyle({top:
> (ScrollTop+50)+'px'});
>}
>  });
>
>
> I've attempted to convert and got this far...
>
> jQuery.ajax({type: "POST",
>url: url,
>data: 'media_id='+media_id,
>success: trigger,
>complete: function() {
>
> leftPos = Position.positionedOffset(jQuery('#doc'))
> [0];
>
> if (window.pageYOffset)
>ScrollTop = window.pageYOffset;
>
> else
>ScrollTop =
> (document.body.parentElement) ?
> document.body.parentElement.scrollTop : 0;
>
>jQuery('#fade').setStyle({height:
> jQuery('#doc').height
> ()+'px'});
>jQuery('#popup').setStyle({left:
> (leftPos+138)+'px'});
>jQuery('#popup').setStyle({top:
> (ScrollTop+50)+'px'});}
>});
>
>
> To make things worse, there's a check in there to see if you're logged
> in and if not calls the following:
>
> new Ajax.Request('/profile/signin?noredirect=1',
>  {
>method:'post',
>postBody: Form.serialize($('signin_form_popup')),
>onSuccess: callback
>  });
>
> which I've attempted to convert to :
>
> jQuery.ajax({type:'POST',
>url: '/profile/signin?noredirect=1',
>postBody: Form.serialize(jQuery
> ('#signin_form_popup')),
>success: callback});
>
> I think it's all working but am not sure...I have no idea what to do
> with the "postBody" parameter...what is it's equivalent in jquery.
>
> Any help would be greatly appreciated.
>
> Thanks
>
>
>
>

>>>
>>
>


[jQuery] drag and drop portlet system based on DotNetNuke

2009-06-06 Thread Armand Datema
Hi

Just wanna show of our portal system based on DotNetNuke jQuery and jQueryUI

We took the sortable example and modified it with

up down movement animation
slide into place
smooth animation
drag to delete and click to delete
restore functionality

Inspiration was the bbc.co.uk
site

http://www.2dnn.com/DragnDrop/tabid/128/Default.aspx


[jQuery] Re: simple(fy) data count

2009-06-06 Thread Peter Marino
hi,
ok... now I tried it.. but it
seems that

$count.('data')

is not valid way of testing if data is there.. my javascript dies at that
point.

peter

On Fri, Jun 5, 2009 at 11:30 PM, Gustavo Salomé wrote:

> $count=$(".div_count");
> var clone_count =!$count.('data') ?1:$cont.data('clone_count')+1;
> $count.data('clone_count',clone_count);
>
> 2009/6/5 Peter Marino 
>
> Hi jQuery,
>> I have the following:
>>
>> if ( $(".div_count").data("clone_count")==undefined )
>> {
>> $(".div_count").data( "clone_count", 1 );
>> }
>> else
>> {
>> $(".div_count").data( "clone_count", $(".div_count").data("clone_count")+1
>> );
>> }
>> var clone_count = $(".div_count").data( "clone_count" );
>>
>> is there any method that can do this a little simplier (compact)..
>>
>> any suggestions?
>>
>> Peter
>> --
>> Power Tumbling - http://www.powertumbling.dk
>> OSG-Help - http://osghelp.com
>>
>
>
>
> --
> Gustavo Salome Silva
>



-- 
Power Tumbling - http://www.powertumbling.dk
OSG-Help - http://osghelp.com