[jQuery] Re: [ANNOUNCE] markItUp! 1.0 (former jTagEditor) is finally released!

2008-04-02 Thread Olaf Gleba


Hi Jay.

Am 23.03.2008 um 19:48 schrieb Jay Salvat:

I'm proud to announce you the official release of markItUp! (former
jTagEditor) and markItUp! website.
I hope everything will be ok and i forgot nothing important.


Its great. I like the approach.

After playing around a little, it sure is a candidate for integration  
in the next release of our CMS. Since there is a lot of customized DOM  
Javascript action focused on the main content textarea, the switch of  
the ID* makes me hesitate a bit because it would causes a lot of  
refactoring in all custom libs. Many functions rely on the textarea ID  
selection.


Am i missing something? Or is there a way to prevent the ID switch?

*) markItUp rips off the id from the textarea and uses it on the  
surrounding container.


greets
Olaf

--
Olaf Gleba : creatics media.systems
tel. +49 (0)212 38 32 94 30 : fax. +49 (0)212 38 32 94 31
[EMAIL PROTECTED] : http://www.creatics.de
http://www.creatics.de/keys/






[jQuery] Re: Click Radio Buttons to Disable/Enable a Text Box

2008-04-02 Thread Karl Rudd

Use .attr('disabled', true) and .attr('disabled', false) to set the
'disabled' state of form elements.

It's one of those things that works in a way you don't quite expect,
if you're thinking of it from an HTML perspective.

After a form element is parsed in from HTML the attributes like
'disabled', 'checked' and 'readonly' become "real" booleans, at least
as far as JavaScript is concerned, so you change them by assigning
true or false.

Hmm I think we're going to need to put this in the FAQ, it gets asked
at least every second week.

Karl Rudd

On Thu, Apr 3, 2008 at 4:21 PM, Gorkfu <[EMAIL PROTECTED]> wrote:
>
>  The setup:
>  2 Radio Buttons and a text field.
>
>  What I wish to accomplish:
>  When Radio #1 is clicked, disable the text box.
>  When Radio #2 is clicked, remove the disabled attribute so the text
>  box is now enabled.
>
>  I also want this done in more than one instance, the "2 Radio Buttons
>  and a text field" will be used on the page more than once, but I want
>  the ids to be unique. So I see using a method where Radio #1 and #2
>  have an id="x1" and the text box has a target="x1". Therefore I can do
>  x2, x3 etc. I'm having problems figuring this one out. Something
>  similar to this was done in HoverTip.
>
>  Below is what I started with, however it doesn't work.
>
>  --- code ---
>
>  $("#Radio2").click(function () {
> if $(this).is(":checked"))
> .next('input').removeAttr('disabled');
> else
> .next('input').attr('disabled', 'disabled');
>  });
>
>  --- code ---
>


[jQuery] Click Radio Buttons to Disable/Enable a Text Box

2008-04-02 Thread Gorkfu

The setup:
2 Radio Buttons and a text field.

What I wish to accomplish:
When Radio #1 is clicked, disable the text box.
When Radio #2 is clicked, remove the disabled attribute so the text
box is now enabled.

I also want this done in more than one instance, the "2 Radio Buttons
and a text field" will be used on the page more than once, but I want
the ids to be unique. So I see using a method where Radio #1 and #2
have an id="x1" and the text box has a target="x1". Therefore I can do
x2, x3 etc. I'm having problems figuring this one out. Something
similar to this was done in HoverTip.

Below is what I started with, however it doesn't work.

--- code ---

$("#Radio2").click(function () {
if $(this).is(":checked"))
.next('input').removeAttr('disabled');
else
.next('input').attr('disabled', 'disabled');
});

--- code ---


[jQuery] Re: call another function with jquery

2008-04-02 Thread balmeter

Did you find a solution to this?  I have the same problem.

On Apr 1, 9:41 am, cmt <[EMAIL PROTECTED]> wrote:
> I have a page that loads dynamically via innerHTML...I would like to
> replace the loading script with something from the jQuery library.
> But I cannot find any jQuery function in the documentation that will
> do what I need it to do.
>
> I suppose I should explain what I want it to do.
>
> I want another .html page to be loaded into a DIV tag.  I need a
> javascript function to automatically run on that page that truncates
> the text to a specified amount of characters.  The user can then click
> a "more" link to see the full text.
> I have tried to do this with standard javascript, but it is very
> complicated.
>
> Thanks!


[jQuery] Re: Problem of show and hide when I have several DIV and one only has to be affected

2008-04-02 Thread Joe

Or apply an ID instead of a class to the div(s)...maybe too simple of
an answer, but if you can't/won't change the divs to IDs then
FrenchiNLA's suggestions should be fine.

On Apr 2, 11:21 am, FrenchiINLA <[EMAIL PROTECTED]> wrote:
> you need to get the sibling of your see-more class somethig like :
> $(this).siblings(".news_complete")slideDown(1000);
> should work for you
>
> On Apr 1, 9:04 pm, Brandnew <[EMAIL PROTECTED]> wrote:
>
> > Hello,
>
> > I hope I'm more or less clear in my title.
>
> > I have this problem :
>
> > I have several DIVs which contains different infos (the content of
> > them is coming from a DB).
>
> > Exemple :
>
> > 
> > See more
> > CONTENT CONTENT
> >  
> >  HIDDEN CONTENT HIDDEN CONTENT
> >   
> > 
>
> > When i click on See more, I have a small Jquery command :
>
> > $(document).ready(function(){
> > $('.see_more').click(function(){
>
> > $('.news_complete').slideDown(1000);
>
> > return false;
> > });
>
> > });
>
> > So basically, the user is able to choose if he wants to see the
> > complete content of one DIV. My problem is that with the way I coded
> > it, when I click on the link "See more", it opens all my DIV where
> > there is a 'class="news_complete"', not just the one where I clicked
> > "See more".
>
> > I tried several different options, using ID and class, trying to have
> > an attribute in the DIV with the ID of the news. But nothing works so
> > far.
>
> > Could you help me to finish that ?
>
> > Thank you a lot !
>
> > Ced


[jQuery] Superfish and flash?

2008-04-02 Thread ritch

I've been using Joel Birch's superfish drop down menu, and have used
transparent pngs as background iamges on the drop downs. Woks
brilliantly, but in Firefox MAC, the links between the first and last
link disappers, but you can still hover over them. I've used
swfobject, and inserted the wmode opaque mode, but still to no avail.

Here's the work in progress:
http://www.studiomoso.com.au/designs/property-planning/www/_index.html

Any help would be much appreciated!

cheers,
Ritch


[jQuery] Re: check/uncheck via toggle

2008-04-02 Thread Karl Rudd

*head smack* I missed that version of the function. It's definitely
not something I've used.

Karl Rudd

On Thu, Apr 3, 2008 at 1:47 PM, Karl Swedberg <[EMAIL PROTECTED]> wrote:
>
>  Actually, .toggle() is a little like .load() in that it can be used for two
> different things. There is the .toggle() effect and the .toggle(fn, fn)
> event, with the .toggle(fn, fn) doing an "every other" event thing.
>
>
>  http://docs.jquery.com/Effects/toggle
>  http://docs.jquery.com/Events/toggle#fnfn
>
>  Still, Bruce's $(this).attr('checked', true) part doesn't make much sense
> because clicking a checkbox will check/uncheck it by default. Setting the
> checked attribute only seems to make sense when it's being triggered by some
> other element. Or maybe I'm missing something.
>
>
>  --Karl
>  _
>  Karl Swedberg
>  www.englishrules.com
>  www.learningjquery.com
>
>
>
>
>
>  On Apr 2, 2008, at 10:23 PM, Karl Rudd wrote:
>
>
> >
> > The "toggle()" function is used to hide and show items, nothing to do
> > with clicking or changing of state.
> >
> > http://docs.jquery.com/Effects/toggle
> >
> > What you want is something like:
> >
> > $('[EMAIL PROTECTED]').click(
> >   function() {
> > if ( this.checked )
> >
> $(this).parents('tr').animate({backgroundColor:'#9C3'},2000).animate({backgroundColor:'#FFF'},1000);
> > else
> >
> $(this).parents('tr').animate({backgroundColor:'#9C3'},2000).animate({backgroundColor:'#E0F88F'},1000);
> >   }
> > );
> >
> > Karl Rudd
> >
> > On Thu, Apr 3, 2008 at 12:41 PM, Bruce MacKay <[EMAIL PROTECTED]>
> wrote:
> >
> > >
> > > Hello folks,
> > >
> > > I have a table of data, with each row containing a checkbox.  What I
> want
> > > users to be able to do is tick the box of each row of data they want to
> > > delete (and after ticking, they will submit the form etc etc.
> > >
> > > As a visual aid, I want to alter the background colour of the row - and
> if
> > > they untick a selection, to reverse that background colour change.
> > >
> > > My code as follows achieves the background colour toggle, but the
> > > checkboxes are neither checked or unchecked.
> > >
> > > I'd appreciate someone pointing out my error?
> > >
> > >
> > > $('[EMAIL PROTECTED]').toggle(
> > >function() {
> > >  $(this).attr('checked',true);
> > >
> > >
> $(this).parents('tr').animate({backgroundColor:'#9C3'},2000).animate({backgroundColor:'#FFF'},1000);
> > >},
> > >function() {
> > >  $(this).attr('checked',false);
> > >
> > >
> $(this).parents('tr').animate({backgroundColor:'#9C3'},2000).animate({backgroundColor:'#E0F88F'},1000);
> > >}
> > > );
> > >
> > > Thanks
> > > Bruce
> > >
> >
>
>


[jQuery] Re: check/uncheck via toggle

2008-04-02 Thread Karl Swedberg


Actually, .toggle() is a little like .load() in that it can be used  
for two different things. There is the .toggle() effect and  
the .toggle(fn, fn) event, with the .toggle(fn, fn) doing an "every  
other" event thing.


http://docs.jquery.com/Effects/toggle
http://docs.jquery.com/Events/toggle#fnfn

Still, Bruce's $(this).attr('checked', true) part doesn't make much  
sense because clicking a checkbox will check/uncheck it by default.  
Setting the checked attribute only seems to make sense when it's being  
triggered by some other element. Or maybe I'm missing something.



--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Apr 2, 2008, at 10:23 PM, Karl Rudd wrote:



The "toggle()" function is used to hide and show items, nothing to do
with clicking or changing of state.

http://docs.jquery.com/Effects/toggle

What you want is something like:

$('[EMAIL PROTECTED]').click(
   function() {
 if ( this.checked )
   $(this).parents('tr').animate({backgroundColor:'#9C3'}, 
2000).animate({backgroundColor:'#FFF'},1000);

 else
   $(this).parents('tr').animate({backgroundColor:'#9C3'}, 
2000).animate({backgroundColor:'#E0F88F'},1000);

   }
);

Karl Rudd

On Thu, Apr 3, 2008 at 12:41 PM, Bruce MacKay  
<[EMAIL PROTECTED]> wrote:


Hello folks,

I have a table of data, with each row containing a checkbox.  What  
I want
users to be able to do is tick the box of each row of data they  
want to

delete (and after ticking, they will submit the form etc etc.

As a visual aid, I want to alter the background colour of the row -  
and if

they untick a selection, to reverse that background colour change.

My code as follows achieves the background colour toggle, but the
checkboxes are neither checked or unchecked.

I'd appreciate someone pointing out my error?


$('[EMAIL PROTECTED]').toggle(
function() {
  $(this).attr('checked',true);

$(this).parents('tr').animate({backgroundColor:'#9C3'}, 
2000).animate({backgroundColor:'#FFF'},1000);

},
function() {
  $(this).attr('checked',false);

$(this).parents('tr').animate({backgroundColor:'#9C3'}, 
2000).animate({backgroundColor:'#E0F88F'},1000);

}
);

Thanks
Bruce




[jQuery] Re: Creating a list of X quotes randomly

2008-04-02 Thread RobG

On Apr 3, 9:49 am, ab5tract <[EMAIL PROTECTED]> wrote:
> Thank you so much man. I really appreciate it, even if I don't
> understand the single-line glory of
>
>set.push(dat.splice(Math.random()*dat.length|0, 1));

  set.push(...)

Calls the push method of set, which is an array, with the
result of the expression inside the brackets.  The expression returns
a single element of the dat array.

  dat.splice( ..., 1)

Calls the splice method of dat, an array, with two argments: the first
is an expression that returns an integer that is used as the index to
start splicing from, the second is how many to splice (which is set to
1).

Splice removes the elements from the array (so you don't get a
repeated element) and returns it.


  Math.random()

Returns a random (decimal) number between 0 and 1.


  *dat.length

Multiplies the random number to get a (decimal) value between 0 and
dat.length (which gets shorter on each iteration due to splicing).  A
decrementing counter could be used instead if speed is an issue.


 | 0

A comparison using the bit-wise OR operator causes a value to be
returned that is an integer created by truncating the decimal part of
the random number (or zero).  It is equivalent to calling
Math.floor(...) with the random number as an argument, but faster and
needs less typing.  I'm up for that.  :-)


> It is pure JavaScript.

Yes, although "pure ECMAScript" might be more concise, "javascript"
usually infers DOM interaction and a certain amount of host
environment capability.


> I assume there is no "better" way to use jQuery?

While it is a reasonably common requirement, it is not something that
I would expect to find in a library but might be in a widget (or
plugin or package or whatever).  The lack of other reponses indicates
that jQuery has nothing to change my mind about that.  :-)


--
Rob


[jQuery] Re: check/uncheck via toggle

2008-04-02 Thread Erik Beeson
Also, '[EMAIL PROTECTED]' can be replaced with ':checkbox'.

--Erik


On 4/2/08, Karl Rudd <[EMAIL PROTECTED]> wrote:
>
>
> The "toggle()" function is used to hide and show items, nothing to do
> with clicking or changing of state.
>
> http://docs.jquery.com/Effects/toggle
>
> What you want is something like:
>
> $('[EMAIL PROTECTED]').click(
> function() {
>   if ( this.checked )
>
>
> 
> $(this).parents('tr').animate({backgroundColor:'#9C3'},2000).animate({backgroundColor:'#FFF'},1000);
>
>   else
>
>
> 
> $(this).parents('tr').animate({backgroundColor:'#9C3'},2000).animate({backgroundColor:'#E0F88F'},1000);
> }
> );
>
>
> Karl Rudd
>
>
> On Thu, Apr 3, 2008 at 12:41 PM, Bruce MacKay <[EMAIL PROTECTED]>
> wrote:
> >
> >  Hello folks,
> >
> >  I have a table of data, with each row containing a checkbox.  What I
> want
> > users to be able to do is tick the box of each row of data they want to
> > delete (and after ticking, they will submit the form etc etc.
> >
> >  As a visual aid, I want to alter the background colour of the row - and
> if
> > they untick a selection, to reverse that background colour change.
> >
> >  My code as follows achieves the background colour toggle, but the
> > checkboxes are neither checked or unchecked.
> >
> >  I'd appreciate someone pointing out my error?
> >
> >
> >  $('[EMAIL PROTECTED]').toggle(
> >  function() {
> >$(this).attr('checked',true);
> >
> >
> $(this).parents('tr').animate({backgroundColor:'#9C3'},2000).animate({backgroundColor:'#FFF'},1000);
> >  },
> >  function() {
> >$(this).attr('checked',false);
> >
> >
> $(this).parents('tr').animate({backgroundColor:'#9C3'},2000).animate({backgroundColor:'#E0F88F'},1000);
> >  }
> >  );
> >
> >  Thanks
> >  Bruce
>


[jQuery] Re: check/uncheck via toggle

2008-04-02 Thread Karl Rudd

The "toggle()" function is used to hide and show items, nothing to do
with clicking or changing of state.

http://docs.jquery.com/Effects/toggle

What you want is something like:

$('[EMAIL PROTECTED]').click(
function() {
  if ( this.checked )

$(this).parents('tr').animate({backgroundColor:'#9C3'},2000).animate({backgroundColor:'#FFF'},1000);
  else

$(this).parents('tr').animate({backgroundColor:'#9C3'},2000).animate({backgroundColor:'#E0F88F'},1000);
}
);

Karl Rudd

On Thu, Apr 3, 2008 at 12:41 PM, Bruce MacKay <[EMAIL PROTECTED]> wrote:
>
>  Hello folks,
>
>  I have a table of data, with each row containing a checkbox.  What I want
> users to be able to do is tick the box of each row of data they want to
> delete (and after ticking, they will submit the form etc etc.
>
>  As a visual aid, I want to alter the background colour of the row - and if
> they untick a selection, to reverse that background colour change.
>
>  My code as follows achieves the background colour toggle, but the
> checkboxes are neither checked or unchecked.
>
>  I'd appreciate someone pointing out my error?
>
>
>  $('[EMAIL PROTECTED]').toggle(
>  function() {
>$(this).attr('checked',true);
>
> $(this).parents('tr').animate({backgroundColor:'#9C3'},2000).animate({backgroundColor:'#FFF'},1000);
>  },
>  function() {
>$(this).attr('checked',false);
>
> $(this).parents('tr').animate({backgroundColor:'#9C3'},2000).animate({backgroundColor:'#E0F88F'},1000);
>  }
>  );
>
>  Thanks
>  Bruce


[jQuery] check/uncheck via toggle

2008-04-02 Thread Bruce MacKay

Hello folks,

I have a table of data, with each row containing a checkbox.  What I 
want users to be able to do is tick the box of each row of data they 
want to delete (and after ticking, they will submit the form etc etc.


As a visual aid, I want to alter the background colour of the row - 
and if they untick a selection, to reverse that background colour change.


My code as follows achieves the background colour toggle, but the 
checkboxes are neither checked or unchecked.


I'd appreciate someone pointing out my error?


$('[EMAIL PROTECTED]').toggle(
function() {
  $(this).attr('checked',true);
  
$(this).parents('tr').animate({backgroundColor:'#9C3'},2000).animate({backgroundColor:'#FFF'},1000);
},
function() {
  $(this).attr('checked',false);
  
$(this).parents('tr').animate({backgroundColor:'#9C3'},2000).animate({backgroundColor:'#E0F88F'},1000);
}
);

Thanks
Bruce 

[jQuery] Re: interface elements odd behavio in IE

2008-04-02 Thread OhNoMrBill

I have reduced the issue to a class named itemHeader. This class is
assigned to the sortable's handle param.

It is only this class that remains on top of the containing accordion.
panels. That class looks like:

.groupItem .itemHeader
{
line-height: 28px;
background-color: #DAFF9F;
border-top: 2px solid #B5EF59;
color: #000;
padding: 0 10px;
cursor: move;
font-weight: bold;
font-size: 16px;
height: 28px;
position: relative;
}

Anyone have any ideas on root cause here?


On Apr 2, 4:08 pm, OhNoMrBill <[EMAIL PROTECTED]> wrote:
> Does anytone know of the Eyecon interface components hardwire CSS z-
> index in their code?
>
> On Apr 2, 12:34 pm, OhNoMrBill <[EMAIL PROTECTED]> wrote:
>
> > I am trying to implement the sortables demo (http://
> > interface.eyecon.ro/demos/sort.html) in an accordion. Problem is it
> > works fine in FF and Safari, but IE is all wigged out. IE draws the
> > sortables on top of everything else, instead of inside like the other
> > browsers do.
>
> > Anyone have any insight on this kind of thing?
>
> > Both the accordion and the sortables are from Eyecon. They are, so
> > far, the only elements on the page.


[jQuery] Re: New to jqModal... couple questions

2008-04-02 Thread deronsizemore


Hi,

Sorry, I should have clarified. When I've tried other modal window options,
they have trouble with forms. What I'll be trying to do is place a login
form, register form, and forgot password form inside of the jqModal window.
Once submit is clicked, the modal window should close, and the main site
should refresh and log the user in, register them, or take them to the
forgot password screen. 

I've ready comments before where this type of behavior using forms is
possible using thickbox, but not without some work and JS knowhow. So,
that's why I asked this about jqModal. 

Doesn't matter anyway I guess. I can't even get basic functionality to work,
so forms is the least of my worries.




MorningZ wrote:
> 
> 
> "see no mention of using forms inside of the jqModal window?"
> 
> What's to mention?   There is nothing special about a form inside the
>  that would make up the modal window's content, it'd be just like
> anything else on the page
> 
> 

-- 
View this message in context: 
http://www.nabble.com/New-to-jqModal...-couple-questions-tp16447063s27240p16456004.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Creating a list of X quotes randomly

2008-04-02 Thread ab5tract

Thank you so much man. I really appreciate it, even if I don't
understand the single-line glory of

   set.push(dat.splice(Math.random()*dat.length|0, 1));

It is pure JavaScript. I assume there is no "better" way to use jQuery?


[jQuery] Re: ui.tabs - appending multiple new tabs

2008-04-02 Thread rolfsf

In partial answer to my own question, I wrote this, which seems to
work:

$('#newTab').click(function() {
var $tabs = $('#container > 
ul.tabs-nav').tabs('length');
var tabNum = ($tabs + 1);
var newTabID = ("#" + "newTab_" + tabNum);

$('#container > ul.tabs-nav').tabs('add',
newTabID, 'Tab ' + tabNum);
$(newTabID).append('new tab ' + tabNum + '');

return false;
});

However... if combined with closable tabs, it would not be able to
confirm uniqueness of the ID


On Apr 2, 11:25 am, rolfsf <[EMAIL PROTECTED]> wrote:
> Adding (appending) new tabs in ui.tabs is pretty straightforward, but
> I notice in the example:http://stilbuero.de/jquery/tabs_3/#container-9
>
> that if I append multiple new tabs, they are all given the same ID
> (which won't work well in real life)
>
> Is there an easy way to generate sequential IDs? e.g. #appendedTab_1,
> #appendedTab_2
>
> Also, is it possible to 'append' the *first* tab - in other words, add/
> create a tab to an 'empty' container?
>
> Thanks - this is the first time I've delved into the more advanced
> variations with this plugin
>
> rolfsf


[jQuery] Content not moving down when div height expands

2008-04-02 Thread phipps_73

I am having a real problem with some container divs whose content is
loaded via the .load() function. Each div holds a table containing a
form. When the form is submitted it adds (or removes) a row to the
table. When a row is added to the table the div elements that follow
do not move down to accommodate the new height. Here is some pseudo
code:

div id="container" (contents loaded via .load())

#container contents:

div id="tablecontainer"
  table (loaded with an initial number of rows.)

The table contains a form for adding new rows of data. When the form
is submitted (using the ajaxForm plugin) the #container div is re-
load()ed, at this point FF2 and IE7 correctly moves the following div
blocks down to allow the #container div to fit in. IE6 however doesn't
move anything and the now larger #container element overlaps the
content below.

I have trawled through google trying to do the hasLayout thing but
nothing seems to work. The only thing that corrects the layout is to
refresh the whole page which defeats the object of using ajax to load
individual bits.

Anyone got any ideas suggestions. The code is on a secure site so I
can provide a url. If I have time (It is now 00:11 here) I will try to
put together a demo of the problem. Hopefully it will be a simply fix.

Cheers,

Dave



[jQuery] Flicker issue with jCarousel in FF 2.0 with circular carousels

2008-04-02 Thread sauronette

Hello Jan,

I would like to ask if you have a hint on how to solve the white
flickering issue with jCarousel when in use on FF 2.0?   I have tried
the fix below that you gave to another user, but I don't know if this
was a circular carousel.  This fix does not work in FF 2.0
Any hints would be appreciated.  Incredible script by the way.  I
would donate to you if you were to put out a jar.  Think about it.

function mycarousel_itemVisibleOutCallback(carousel, item, i, state,
evt)
{
setTimeout(function() { carousel.remove(i); }, 20);
};


[jQuery] ready and jquery 1.2.3

2008-04-02 Thread Shelane

I'm seeing more and more evidence that the ready function isn't really
working properly with jquery 1.2.3 and FF 2.

$(function(){
$('#mydiv').hide();
});

things like above, when the page loads sometimes i see the div, then
it disappears.

Is there just a problem with the shortcut?  Is it a combination with
1.2.3 and FF?

I didn't notice this happening before with 1.2.2.


[jQuery] Re: unresponsive script error on long page with many clueTips

2008-04-02 Thread Karl Rudd

JavaScript in browsers is "single-threaded" (and thank goodness for
that). So when JavaScript is running (in most browsers) everything
else is queuing up. When you break the code into chunks, via
setTimeout, you are (essentially) "yielding" control back to the main
event loop periodically, so it has time to "breath" and clear it
various queues.

Karl Rudd

On Wed, Apr 2, 2008 at 8:04 PM, az <[EMAIL PROTECTED]> wrote:
>
>  Thanks to both Karls for your help!
>
>  I'll definitely try out the chunking method.  Since I'd like to
>  understand what I'm implementing, can you briefly explain why this way
>  is better?
>
>  thanks,
>  az
>
>
>
>  On Apr 1, 4:59 pm, "Karl Rudd" <[EMAIL PROTECTED]> wrote:
>  > You can initialise the tips in "chunks".
>  >
>  > Instead of doing something like this:
>  >
>  >   $('a.tip').cluetip();
>  >
>  > Do something like this:
>  >
>  > $('a.tip').each(function() {
>  >   var t = $(this);
>  >   setTimeout( function() { t.cluetip(); }, 10 );
>  >
>  > })
>  >
>  > You'll still have a bit of a CPU usage spike but it shouldn't totally
>  > freeze the browser or bring up the "Running too long" type warnings.
>  >
>  > Karl Rudd
>  >
>
>
> > On Tue, Apr 1, 2008 at 12:38 PM, az <[EMAIL PROTECTED]> wrote:
>  >
>  > >  Hello,
>  >
>  > >  I have a dynamically generated page that can be long or short.
>  > >  Everything is fine when it's short, but when it gets to be *very*
>  > >  long, it gives unresponsive script errors.
>  >
>  > >  I believe this is because each entry on the page contains 3 clueTip
>  > >  links.  If I have a thousand entries, that's 3,000 clueTips to bind
>  > >  and possibly keep in memory and then unbind when the user leaves the
>  > >  page.  That's a lot!
>  >
>  > >  Any suggestions on how to prevent these errors?
>  >
>  > >  My only thought is that instead of using jquery to bind the clueTips
>  > >  at page load, I can do things the old-fashioned way and trigger the
>  > >  clueTip by linking to a javascript function.
>  > >  Something like:
>  > >  link
>  >
>  > >  Will that work?
>  >
>  > >  thanks,
>  > >  az
>


[jQuery] Re: UI Tabs - closable tabs

2008-04-02 Thread Klaus Hartl



On Apr 2, 7:08 pm, rolfsf <[EMAIL PROTECTED]> wrote:
> Thanks Klaus!
>
> Any chance you could give me a quick explanation of what the different
> parts of that script are doing? I'm trying to understand how the
> script determines which tab to remove. Doing my best to learn these
> concepts!

The key is the following line:

$tabs.tabs('remove', $('li', $tabs).index(li));

- in particular $('li', $tabs).index(li)

It uses jQuery's index method to retrieve the index of an element in a
list/jQuery collection. The li that is passed to this method is a DOM
element and the parent of a clicked tab's  element:

var li = $(ui.tab).parents('li:eq(0)')[0];


--Klaus


[jQuery] Re: ui.tabs - appending multiple new tabs

2008-04-02 Thread Klaus Hartl

On Apr 2, 8:25 pm, rolfsf <[EMAIL PROTECTED]> wrote:
> Adding (appending) new tabs in ui.tabs is pretty straightforward, but
> I notice in the example:http://stilbuero.de/jquery/tabs_3/#container-9
>
> that if I append multiple new tabs, they are all given the same ID
> (which won't work well in real life)
>
> Is there an easy way to generate sequential IDs? e.g. #appendedTab_1,
> #appendedTab_2

That's just a lack of the (simple) demo - you can add as much tabs as
you want by clicking the link. In real life it's up to you to create
proper, unique ids that are passed to the add method.


> Also, is it possible to 'append' the *first* tab - in other words, add/
> create a tab to an 'empty' container?

No, that's not possible. You need at least one element to initialize
tabs. Besides an empty ul/ol element isn't valid HTML anyway.


--Klaus





[jQuery] Re: Interface TransferTo function in jQuery UI?

2008-04-02 Thread Jack Killpatrick
rolfsf, do you have a stable example? I need to do this asap with jquery 
1.2.x (simulate interface TransferTo) and am not able to start using the 
UI or Enchant stuff yet (for this project).


Thanks,
Jack

rolfsf wrote:

FWIW, I've gotten a similar effect using the animate() function, though
rather than the 'ghost' div animating back to the origin as seems to happen
with transferTo,  I'm animating the actual div. I may find this problematic
when I add more content to the div, but for now it's behaving correctly.
When I've got an example in some stable form I'll post it



chrismarx wrote:
  

we seriously need this!!

On Mar 10, 3:51 pm, rolfsf <[EMAIL PROTECTED]> wrote:


I want to use the old Interface transferTo function/effect, but I'm
wondering
if this is being refactored in the new jQuery UI, or if there is another
jquery 1.2 'optimized' version of this effect somewhere?

Thanks,
rolfsf
--
View this message in
context:http://www.nabble.com/Interface-TransferTo-function-in-jQuery-UI--tp1...
Sent from the jQuery General Discussion mailing list archive at
Nabble.com.
  



  




[jQuery] Re: disable select in FF?

2008-04-02 Thread Karl Swedberg


On Apr 2, 2008, at 4:28 PM, alivemedia wrote:


Still not working, weird, here it is as it stands:

$('input[type=checkbox]').bind("click",function(){
   var el=$(this).parent().next('td select')
   if (this.checked) {
   el.attr('disabled', false);
   } else {
  el.attr('disabled', true);
   }
   }).each(function(){ var el=$(this).parent().next('td select');
   if (this.checked) {
  el.attr('disabled', false);
   } else {
el.attr('disabled', true);
   }
});


Ah, yes, but you still didn't change the selector.

Try this (inside document.ready):

$('input:checkbox').bind("click",function(){
 var el=$(this).parent().next('td').find('select');
 if (this.checked) {
 el.attr('disabled', false);
 } else {
el.attr('disabled', true);
 }
}).each(function(){
   var el=$(this).parent().next('td').find('select');
   if (this.checked) {
el.attr('disabled', false);
   } else {
el.attr('disabled', true);
   }
});

You can also make this a bit more concise if you want:

$('input:checkbox').bind("click",function(){
   var el=$(this).parent().next('td').find('select');
   el.attr('disabled', this.checked ? false : true);
}).each(function(){
   var el=$(this).parent().next('td').find('select');
   el.attr('disabled', this.checked ? false : true);
});

Or, better yet:

$('input:checkbox').click(disenable).each(disenable);
function disenable() {
  var el=$(this).parent().next('td').find('select');
  el.attr('disabled', this.checked ? false : true);
}

If those revisions don't work for you, let me know and I'll post a  
test page showing it working.


Hope that helps.


--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com





[jQuery] Re: interface elements odd behavio in IE

2008-04-02 Thread OhNoMrBill

Does anytone know of the Eyecon interface components hardwire CSS z-
index in their code?

On Apr 2, 12:34 pm, OhNoMrBill <[EMAIL PROTECTED]> wrote:
> I am trying to implement the sortables demo (http://
> interface.eyecon.ro/demos/sort.html) in an accordion. Problem is it
> works fine in FF and Safari, but IE is all wigged out. IE draws the
> sortables on top of everything else, instead of inside like the other
> browsers do.
>
> Anyone have any insight on this kind of thing?
>
> Both the accordion and the sortables are from Eyecon. They are, so
> far, the only elements on the page.


[jQuery] Re: Shadowbox no worky with jQuery 1.2.3

2008-04-02 Thread Josh Nathanson


Yeah, it's weird.  It gets to the part in the script where it binds the 
event handler, so that's working ok, but it doesn't seem to be able to 
prevent the default click event.  Even when I put "return false" explicitly 
in the event handler, it opens the image in a new page.


Odd that it would work perfectly in 1.2.1 but not in 1.2.3.

-- Josh

- Original Message - 
From: "Karl Swedberg" <[EMAIL PROTECTED]>

To: 
Sent: Wednesday, April 02, 2008 1:49 PM
Subject: [jQuery] Re: Shadowbox no worky with jQuery 1.2.3




oh, that's a bummer. I was hoping it could help you out this time.  Well, 
tuck it away for future reference, I guess.


Hope you manage to solve the problem.

cheers,

--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Apr 2, 2008, at 3:04 PM, Josh Nathanson wrote:



Thanks Karl, I didn't know about that option in Firebug.  Haha, many 
times I've tried to quickly read the error in the console before the 
page gets refreshed.


However it's not helping in this case, as apparently no error is  being 
thrown.  Which leads me to believe that shadowbox's handler is  not being 
bound to the link for some reason.  I'll keep digging  around and see if 
I can figure it out.


-- Josh


- Original Message - From: "Karl Swedberg" <[EMAIL PROTECTED]
>
To: 
Sent: Wednesday, April 02, 2008 11:42 AM
Subject: [jQuery] Re: Shadowbox no worky with jQuery 1.2.3




Hey Josh,

I haven't used the Shadowbox plugin (though I've admired its  beauty). 
But sometimes it's hard to catch what could be a  JavaScript error when 
the page gets refreshed. Have you tried  using Firebug and checking the 
"Break on all errors" option? That  might help you troubleshoot. it 
could be an event binding thing,  or it could be some other error that 
isn't being reported quickly  enough before the page refreshes. Hope 
that makes sense.


To turn on "Break on all errors," open the Firebug console and  click 
on the "Script" tab. Then click the "Options" drop-down and  choose 
"Break on all errors."



--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Apr 2, 2008, at 2:04 PM, Josh Nathanson wrote:



Hey all,

I'm using the Shadowbox script successfully with jQuery 1.2.1, 
however when changing to jQuery 1.2.3, it no longer functions 
properly.  It looks like something in the preventDefault  mechanism  in 
the Shadowbox jQuery adapter is broken, because when  clicking on  the 
image, it does not prevent the default link event  -- it just  reloads 
the image in a new page.  But, I don't see  anything wrong  with it 
right off the bat so it may be something  to do with event  binding 
being handled differently in jQ 1.2.3.


Just hoping maybe somebody has also seen this and figured out  what's 
going on.


-- Josh












[jQuery] Re: Func outside of doc.ready cannot access function inside doc.ready? Why not?

2008-04-02 Thread Josh Nathanson
Andy - as you may have guessed, you have a scoping issue.  Everything inside 
the doc.ready call is in an anyonymous function.

Any functions inside doc.ready that you need to have access to from *outside* 
doc.ready, you'll need to scope accordingly.

You might want to create a variable outside doc.ready like "var global.fns = 
{}" and then inside doc.ready define your functions like "global.fns.myfunc = 
function()".  This will allow you to have access to the functions in that 
variable from anywhere.

-- Josh



  - Original Message - 
  From: Andy Matthews 
  To: [jQuery] 
  Sent: Wednesday, April 02, 2008 2:15 PM
  Subject: [jQuery] Func outside of doc.ready cannot access function inside 
doc.ready? Why not?


  As a follow up to my post on "Flex Ajax Bridge & jQuery"...

  I found that if I place the offending code OUTSIDE the doc.ready call, it 
works okay, and the doc.ready still fires correctly. However, the code which is 
outside of the doc.ready call cannot access functions INSIDE the doc.ready call.

  Why is this, and how might I be able to get around it?

  

  Andy Matthews
  Senior ColdFusion Developer

  Office:  615.627.9747
  Fax:  615.467.6249
  www.dealerskins.com

  Total customer satisfaction is my number 1 priority! If you are not 
completely satisfied with the service I have provided, please let me know right 
away so I can correct the problem, or notify my manager Aaron West at [EMAIL 
PROTECTED]
<<2008 Email NADA.jpg>>

[jQuery] Func outside of doc.ready cannot access function inside doc.ready? Why not?

2008-04-02 Thread Andy Matthews
As a follow up to my post on "Flex Ajax Bridge & jQuery"...
 
I found that if I place the offending code OUTSIDE the doc.ready call, it
works okay, and the doc.ready still fires correctly. However, the code which
is outside of the doc.ready call cannot access functions INSIDE the
doc.ready call.
 
Why is this, and how might I be able to get around it?
 

 
Andy Matthews
Senior ColdFusion Developer

Office:  615.627.9747
Fax:  615.467.6249
www.dealerskins.com  
 
Total customer satisfaction is my number 1 priority! If you are not
completely satisfied with the service I have provided, please let me know
right away so I can correct the problem, or notify my manager Aaron West at
[EMAIL PROTECTED]
 
<<2008 Email NADA.jpg>>

[jQuery] Re: unbind especific function not working

2008-04-02 Thread Ariel Flesler

The problem is that the function that you unbind, is not that same the
you bind, although they are equal.
Try this:

(function($) {

  $.fn.checkForm = function(action){
if (action == "add")
   return this.bind( 'submit', this.checkForm.handler );
if (action == "remove")
   return this.unbind('submit', this.checkForm.handler );
  };

  $.fn.checkForm.handler = function() {
  return false;
  };

})(jQuery);

Cheers

--
Ariel Flesler
http://flesler.blogspot.com


On 2 abr, 16:56, Marc R <[EMAIL PROTECTED]> wrote:
> I'm kinda of a begginer on JQuery and I'm writing my first plugin.
> The plugin should handle form validation, in which I want to be able to
> enable or disable validation.
>
> The simplified version is like this:
>
> (function($) {
>   $.fn.checkForm = function(action) {
>
>     function validateForm() {
>           return false; // dont submit form, just that simple for this
> example
>     };
>
>     return this.each( function() {
>       if (action == "add")
>             $(this).bind("submit", validateForm); // add validation for the
> form
>
>       if (action == "remove")
>             // here I want to remove the validation from the form
>             $(this).unbind("submit", validateForm); // This is NOT working
>     });
>   };
>
> })(jQuery);
>
> after calling $('#myForm').checkForm('add') it wont submit
> but
> after calling $('#myForm').checkForm('remove') it still wont submit
>
> If I use $(this).unbind("submit"), it works, but removes all behavior
> attached to the event, and there I only want to remove that given behavior.
> Appreciate any help.
> --
> View this message in 
> context:http://www.nabble.com/unbind-especific-function-not-working-tp1645002...
> Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: Incredibly Fast jQuery-Powered Search Tool

2008-04-02 Thread Ariel Flesler

Very nice.
I'm curious, where are you using ScrollTo ?

I wonder why do people always respect the header of jQuery, and throw
it away when it comes to plugins ?
Our work deserves some more respect :)

Great tool, good job.

--
Ariel Flesler
http://flesler.blogspot.com

On 2 abr, 16:38, jsandppr <[EMAIL PROTECTED]> wrote:
> I would like to hear more about the back-end of this -- its indexing
> (even for "contains" searches) is very fast and nice.
>
> Thanks!
>
> On Mar 16, 5:02 am, JohnForsythe <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi, I wanted to show you guys a tool I just built using jQuery andDrupal. 
> > It's called Module Finder.
>
> >http://drupalmodules.com/module-finder
>
> > Module Finder searches thought theDrupalModulesdatabase, showing
> > results as you type, highlighting keywords, and displaying ratings in
> > real time. The interface was built with jQuery v1.2.3, and a number of
> > plugins, including ScrollTo, Form, and a customized version of
> > typeWatch.
>
> > The back end is a custom designed search engine that's not yet
> > publicly available, although a release is planned in the near future.
>
> > Thanks for providing such a great tool to build sites with :)
>
> > --
> > John Forsythe- Ocultar texto de la cita -
>
> - Mostrar texto de la cita -


[jQuery] Re: $('').size() === 0 in IE??

2008-04-02 Thread Karl Rudd

Try making a full formed "a" element, $(''). IE is a bit fussy
sometimes about what it will create, it will fail when you specify an
"open" element.

Karl Rudd

On Thu, Apr 3, 2008 at 3:47 AM, Peter Bengtsson <[EMAIL PROTECTED]> wrote:
>
>  I'm going to explain my problem by code. Both of these work perfectly
>  fine in Firefox but only the *second one* works in IE 6.
>
>
>  ** THE ONE I WANTED TO WRITE **
>
>  function __duplicateToolbarButtons() {
>// Make "save" and "save and view" buttons appear in toolbar
>if ($('#CMSButtonBar').size() && $
>  ('input.duplicateintoolbar').size()) {
>   // Next, make  elements then put them into button bar
>   $('input.duplicateintoolbar').each(function() {
>  var btn = this;
>  var a = $("")
>.attr('href','#')
>  .addClass('ButtonAction')
>.click(function() {
>   btn.click(); return false
>})
>  .text(btn.value);
>
>  // insert it just before the last  in that area
>  $('div', $('#CMSButtonBar')).slice(-1).before(a);
>
>   });
>}
>  }
>
>
>  ** THE ONE I HAD TO WRITE **
>
>  function __duplicateToolbarButtons() {
>// Make "save" and "save and view" buttons appear in toolbar
>if ($('#CMSButtonBar').size() && $
>  ('input.duplicateintoolbar').size()) {
>   // Next, make  elements that put them into button bar
>   $('input.duplicateintoolbar').each(function() {
>  var btn = this;
>
>  var a = document.createElement('a');
>  a.setAttribute('href','#');
>  a.className='ButtonAction'; //
>  a.setAttribute('class','ButtonAction') doesn't work
>  a.onclick=function() {btn.click(); return false};
>  a.innerHTML=btn.value;
>
>  // insert it just before the last  in that area
>  $('div', $('#CMSButtonBar')).slice(-1).before(a);
>
>   });
>}
>  }
>
>
>  At first I thought it was something wrong with the way I appended the
>  created element into the DOM tree but then I added this code just
>  after the $('')... stuff::
>
>   alert(a.size());
>
>  In Firefox it said 1 (as expected) but in IE 6 it said 0!! Why?
>  Are there pitfalls I don't know about in creating elements in IE that
>  are FAQ?
>
>  PS. This is jquery-1.2.3.min.js and the piece of junk is IE 6.0 sp2.
>


[jQuery] Re: cluetips - dynamic data filtering

2008-04-02 Thread SterlingK

Hm.  The bottom paragraph of that didn't get formatted the way I had
hoped.  Hopefully my meaning is clear from the first three paragraphs.

On Apr 2, 9:08 am, SterlingK <[EMAIL PROTECTED]> wrote:
> Hi, Karl.
>
> No worries.  I'm just impressed that someone as busy as you gets back
> to us on these issues at all.  Thank you!
>
> Hm.  Perhaps I wasn't clear on what I was trying to accomplish.
> Probably either filter or find would be fine.  What I'm looking for is
> how to target the specific div on the ajax html page that matches the
> class on the cluetips link.  To be clear, I'd like to just have one
> page of ajax info, rather than a different page for each cluetip
> link.  Then cluetip would just find the info that matches the link's
> class.
>
> This (copied from the code in my first post) works just fine: data=$
> (data).filter('.tip_1');
> But I would have to do that for each cluetip link on the page (and
> there are several).  What I need is this: data=$(data).filter(' variable that finds the matching div on the ajax page before
> populating the cluetip>');
>
> So
> my_cluetip_page.html
> ajax_info_page.html
> ---
> 
> Here's my cluetip link 1      -->        
> Here's the cluetip info
>
> Here's my cluetip link 2      --
>
> >        Here's more cluetip info
>
> Does that make sense?
>
> On Apr 1, 4:51 pm, Karl Swedberg <[EMAIL PROTECTED]> wrote:
>
>
>
> > Hi Sterling,
>
> > Sorry for taking so long to get back to you on this.
>
> > It's tough for me to know which selector expression you should use  
> > without seeing the data that you're retrieving with the ajax call. I  
> > doubt that it's filter, though, unless it's a top-level element. You  
> > might want to try .find() instead.
>
> > --Karl
> > _
> > Karl Swedbergwww.englishrules.comwww.learningjquery.com
>
> > On Mar 28, 2008, at 12:51 PM, SterlingK wrote:
>
> > > First off, the hard work on cluetips. I'm a big fan and for a nub like
> > > me, it's been remarkably easy to integrate and customize for my sites.
>
> > > What I've been trying to do is have one html page that includes all
> > > the ajax content in various divs (essentially like xml), like such:
> > > content here
> > > more content here
>
> > > The tips would be able to filter according to matched class names. For
> > > instance, the following would display the above information, filtered
> > > by class name:
> > > Here's my cluetip link 1
> > > Here's my cluetip link 2
>
> > > I can do it manually, like this:
> > >     ajaxProcess : function (data) {
> > >                     data=$(data).filter('.tip_1');
> > >                                     return data;
> > >                                    }
>
> > > But I'm having a hard time getting it to work dynamically.  Using
> > > something like 'data=$(data).filter(this.class) doesn't work.  Again,
> > > I'm pretty new at this and it seems like this should be fairly simple
> > > to do with jquery, but I'm stuck after several hours of trying.
>
> > > I saw the great demo that applies a similar concept at
> > >http://test.learningjquery.com/clue/demo/danm.html, but have been
> > > unable to combine what I need with that local example.
>
> > > Many thanks in advance.
>
> > > - Sterling- Hide quoted text -
>
> > - Show quoted text -- Hide quoted text -
>
> - Show quoted text -


[jQuery] jQuery CharCounter Problem with limit reached

2008-04-02 Thread rsmolkin

Hi,

I'm using the jquery charcounter to count and limit characters in text
areas.  It's working well for the most part, except for the following
problem.  If I paste in text that exceeds the limit and it's truncated
to say 1000 characters that are allowed, and then I go in and select a
couple of words to delete and then click the delete key, it deletes
all the text inside the text area not just the selected text.  Very
strange.

Anyone has any idea?

-Roman


[jQuery] Re: disable select in FF?

2008-04-02 Thread alivemedia

Still not working, weird, here it is as it stands:

$('input[type=checkbox]').bind("click",function(){
var el=$(this).parent().next('td select')
if (this.checked) {
el.attr('disabled', false);
} else {
   el.attr('disabled', true);
}
}).each(function(){ var el=$(this).parent().next('td select');
if (this.checked) {
   el.attr('disabled', false);
} else {
 el.attr('disabled', true);
}
 });



[jQuery] Positioning ad

2008-04-02 Thread Dough Boy

We have articles on our site that are standard html (i.e. using p
tags).

We also use javascript to generate ad tags (i.e. doubleclick, adsense,
etc).

So I have a hidden div on the page that the ad is generated into (via
javascript).  I then want to append the "ad" to the 3rd paragraph.

Everything works, except that as soon as I use jQuery to "move" it, I
have 3-5 more ads show up "randomly" on the page.

Here is the exact code that I am using.  Is this a bug with
jQuery...or is it a limitation?  I have never had problems positioning
actual html on the page...but since this is javascript it doesn't want
to work.  To replicate just throw 5-10 paragraph tags on your page and
then place this code at the bottom.

Any workarounds?

Code:



advertisement

document.write('