[jQuery] Re: bugs

2008-06-20 Thread Wizzud
I think you will find that you need to use what is commonly referred to as a 'preloader'. Take a look at Ariel's Preload plugin (Link mode, with onComplete) On Jun 20, 5:55 pm, Luke [EMAIL PROTECTED] wrote: I new to jquery. my first srcipt is a tab browsing galley for images. this script works

[jQuery] Re: Checkboxes, difference in browsers

2008-06-20 Thread Wizzud
Is the id createNewAccount unique within the page? On Jun 20, 9:02 pm, Ariel Flesler [EMAIL PROTECTED] wrote: Your code should work. You didn't close the input tag correctly but that shouldn't matter. Do you have a demo online ? -- Ariel Fleslerhttp://flesler.blogspot.com On 19 jun,

[jQuery] Re: Can jQuery compare 2 ul and remove li's that are duplicates?

2008-06-08 Thread Wizzud
Assuming that your list elements are simple text nodes... //list on screen... var listOnScreen = []; $('ul#listOnScreen li').each(function(){ listOnScreen.push($(this).text()); }); //function, returns true if text argument found in list on screen... var inListOnScreen = function(txt){ var

[jQuery] Re: Reflesh page after change DOM

2008-06-08 Thread Wizzud
If you add new elements (*any* new elements, not just LI's!) to a page using core jQuery, they will only have whatever properties/events/ whatever that you assign/attach to them once they have been added to the DOM. In other words, it's down to you to ensure that the new elements have the

[jQuery] Re: text box keeps focus when another element type is clicked ?

2008-06-08 Thread Wizzud
Try adding... $(':text').bind('focus', function(){ hasFocus = $(this); }); On Jun 5, 7:43 pm, paulj [EMAIL PROTECTED] wrote: Wizzud, thank you for your help. Your code worked perfectly if the user had entered the text box by *clicking* on it. But, if the user has *tabbed* to the text

[jQuery] Re: Thickbox on 1.2.6 or best alternative?

2008-06-08 Thread Wizzud
or http://mjijackson.com/shadowbox/ On Jun 6, 1:52 am, Rey Bango [EMAIL PROTECTED] wrote: Shane, Check out this one: http://leandrovieira.com/projects/jquery/lightbox/ Rey Shane Graber wrote: What are people using today to create effects like thickbox or lightbox on jQuery 1.2.6?

[jQuery] Re: Can Jquery Send variable value to external php

2008-06-08 Thread Wizzud
window.location.href = 'myprog.php?doctitle=' + myvar; [might need encoding - depends on title] On Jun 8, 11:36 am, Maddy [EMAIL PROTECTED] wrote: Is it possible to send a variable value to external php. how it can be done code: var myvar = document.title; how to send this

[jQuery] Re: text box keeps focus when another element type is clicked ?

2008-06-05 Thread Wizzud
Any good for you ... ? $(document).ready(function(){ var hasFocus = $(':text:first').focus(); $(document).bind('click', function(event){ var ev = $(event.target); if(ev != hasFocus){ if (ev.is(':text')){ hasFocus = ev; } hasFocus.focus(); } }); });

[jQuery] Re: Clicking on the whole div area.. not just the small icon image.

2008-06-02 Thread Wizzud
Try giving the div a background color. On Jun 2, 4:17 pm, Danjojo [EMAIL PROTECTED] wrote: I am trying to get a click event on the whole div area around the image that toggles a menu. In FireFox I can click on the whole div and my functionality works. In IE7 I have to click only on the tiny

[jQuery] Re: don't animate elements which are in progress of animation?

2008-06-01 Thread Wizzud
An alternative is to look at it the other way round and say whatever animation is in progress, stop it and do what is now required, eg... $(document).ready(function() { $(#control_panel li a).hover( function(){ $(this).stop().animate({paddingLeft:

[jQuery] Re: expand-refs

2008-06-01 Thread Wizzud
Untested... function expand_refs (context) { $(xref,context||document).each(function (i) { var rpl = defs[$(this).attr(ref)]||0; if(rpl){ var cntxt = $(rpl).insertAfter(this); $(this).remove(); expand_refs(cntxt); } }); } expand_refs(); On May

[jQuery] Re: Newbie Q: Insert last paragraph just before fourth paragraph?

2008-06-01 Thread Wizzud
Or $('p:eq(3)').before($('p:last')); On Jun 1, 6:49 pm, Jason Huck [EMAIL PROTECTED] wrote: Here's one way, no last class required, though it probably could be improved upon: $($('p').get(3)).before($('p:last')); - jason On Jun 1, 9:02 am, swortis [EMAIL PROTECTED] wrote: Hi all-

[jQuery] Re: Why report handler.apply is not a function

2008-05-30 Thread Wizzud
You're passing a string into mouseover() instead of function name $('a.Brand').mouseover(checkBrand); (assuming that the function checkBrand() does actually exist!) James Hang wrote: in html: script type=text/javascript src=/new/js/jquery-1.2.6.min.js/ script script

[jQuery] Re: trouble passing href

2008-05-30 Thread Wizzud
To get the href you either access the property of the element directly, or use the attr() function on the jQuery object. Eg. (note : I'm using $('a', this) instead of $(this).children()...) alert( $('a', this)[0].href ); //the [0] retrieves the actual element or alert( $('a',

[jQuery] Re: Opera IE Issue

2008-05-29 Thread Wizzud
Is fusionSlider.panelPositions an array or a string? If it's an array, then using indexOf() on it is wrong. If it's a string then I can't work out what it that statement is intended to achieve ... but indexOf() should take a string as its input, not a number! On May 29, 2:41 am, Keri Henare

[jQuery] Re: Do something, ONLY if parent has children

2008-05-29 Thread Wizzud
Can you be a bit more explicit about what it is that you want to do? eg. hide H1 where next element does not have class 'fred' or hide DIV, H1 and H6 where first child is not (DIV.dynamo) or hide P, H1 thru H6 where next element is not (P.kiev) or is (P.kiev having a child of A.hideme)

[jQuery] Re: beginner variable problem

2008-05-27 Thread Wizzud
$(document).ready(function(){ var parags = $(#contests ul li p); $(#contests ul li span a).each(function(i){ var parag_count = i; $(this).toggle( function(){ parags.eq(parag_count).css(background, yellow); return false; },

[jQuery] Re: How can I either clone just one class and children or append better html code

2008-05-27 Thread Wizzud
Not entirely clear what is required to be cloned - the code you have shouldn't really be cloned 'as is' because it has ids in it, which would require a fair amount of manipulation to make it valid. If you simply want to format it into a more readable/maintainable form then, as an example... var

[jQuery] Re: Loss of focus hotkey giving error

2008-05-25 Thread Wizzud
Have you tried simply setting focus to one of the divs? $('div:first')[0].focus(); On May 24, 4:40 pm, brassica [EMAIL PROTECTED] wrote: hi all, i seem to have a problem with using Hotkeys and intercept I would appreciate it very much if someone would explain why the error is occurring and

[jQuery] Re: Show/hide toggle hides form too...bah!

2008-05-24 Thread Wizzud
. Basically I can only see one click handler - the div.col one - for handling *any* click on *any* element within div.col, so if you want to catch the form submission you probably need to add some other handler somewhere. On May 24, 2:17 am, Ridge [EMAIL PROTECTED] wrote: Oooh SO close Wizzud! Followed

[jQuery] Re: Select attribute by checking more than one value

2008-05-24 Thread Wizzud
jQuery('.entry a:not(.download):has( img ) .filter(function(){ return /\.(jpg|gif|png)$/.test(this.ref); }).attr('rel','popupgallery').addClass('something'); On May 24, 12:55 am, leggo-my-eggo [EMAIL PROTECTED] wrote: Hi, I'm new here, so forgive me if I'm missing something obvious, or

[jQuery] Re: Select attribute by checking more than one value

2008-05-24 Thread Wizzud
hmph ... sorry about the typos! Must get into the habit of actually wearing my glasses! On May 24, 4:46 pm, leggo-my-eggo [EMAIL PROTECTED] wrote: Wizzud, So helpful, thank you! Just to have the record here complete, there were two small syntax things in that that I had to change

[jQuery] Re: Show/hide toggle hides form too...bah!

2008-05-23 Thread Wizzud
$('div#homepage_boxes div.col').click(function(event) { // only toggle if it was div.col or its H2 that was clicked... if ( this==event.target || $(event.target).is('h2') ){ $(this).siblings('.selected').andSelf().toggleClass('selected'); } return false; }); And you

[jQuery] Re: Digging through wrapper DIVs

2008-05-22 Thread Wizzud
$('span.bullet').parent().filter(function(){ return !$(this).parents('div:has(span.bullet)').length; }); On May 22, 9:54 pm, EdMartin [EMAIL PROTECTED] wrote: I have a setup like this div id=container div class=wrapper div class=wrapper divspan class=bulletBullet/span !--

[jQuery] Re: hiding a div when another div becomes empty?

2008-05-21 Thread Wizzud
$('#hiddenleft a').livequery('click', function() { var $this = $(this); $('#'+$this.attr('class')).show(); $this.remove(); if(!$('#hiddenleft a').length){ $('#hiddenleft,#hiddencontent').hide(); } }); On May 20, 3:52 pm, thekman [EMAIL PROTECTED] wrote: Hi all, I

[jQuery] Re: MooTools to Query

2008-05-21 Thread Wizzud
As with most things, there are different ways to achieve what you want. This is just one of them... Assumption: you have some styles defined along the lines of: style type='text/css' #demo-wrapper {height:250px; overflow:hidden;} .scrolling-content {height:250px;} /style (actual values are not

[jQuery] Re: selectors question

2008-05-21 Thread Wizzud
I, also, am not entirely sure what the end requirement is, but this might help ... $(document).ready(function() { var inputUpdate = $('input.listcomplete').next('ul').find('li') .bind('click', function(){ //this only works when a space is a valid separator, ie no LI //text contains

[jQuery] Re: hiding a div when another div becomes empty?

2008-05-21 Thread Wizzud
choose The only (very, very, very slight) advantage to my code is that it saves converting 'this' into a jQuery object twice - once to find the class, and then again to remove itself. On May 21, 9:52 am, thekman [EMAIL PROTECTED] wrote: Hi Wizzud, Just wondering if there is any performance

[jQuery] Re: .show() Question

2008-05-21 Thread Wizzud
If you put a background-color on #workContainer you will see that actually they both expand the same - one from the top-right corner, one from the top-left corner. It only appears to be different because of the different type of content. On May 21, 3:56 pm, Jason [EMAIL PROTECTED] wrote: Hey

[jQuery] Re: bind click event equal to mouseover

2008-05-21 Thread Wizzud
21, 7:06 pm, Ariel Flesler [EMAIL PROTECTED] wrote: Something like this ? $('li').mouseover(function(){ $(this).find('a').click(); }); -- Ariel Fleslerhttp://flesler.blogspot.com On 21 mayo, 12:07, paragasu [EMAIL PROTECTED] wrote: On Tue, May 20, 2008 at 6:13 AM, Wizzud [EMAIL

[jQuery] Re: jqDock can embed flash/video object?

2008-05-19 Thread Wizzud
Not at present ... and to be honest it hasn't been considered. On May 19, 4:53 am, Davis [EMAIL PROTECTED] wrote: Hi all, Beside img object, is it possible to embed a flash/video object? eg swf or youtube video ? Thanks/Davis.

[jQuery] Re: bind click event equal to mouseover

2008-05-19 Thread Wizzud
One way is to make the LI's mouseover add a class, the mouseout remove that class, then set css to do what you want to the A element... $('li').hover( function(){ $(this).addClass('x') } , function(){ $(this).removeClass('x') } ); style... li.x a {color:#ff9900;} On May 19, 1:34

[jQuery] Re: jqDock doesn't do anything?

2008-05-16 Thread Wizzud
Do you have a web-accessible example I can look at? On May 16, 3:40 am, Davis [EMAIL PROTECTED] wrote: wizzud, thanks for your help. now im using coefficient: 1 and #menu img {padding:0px 2px 0px 0px; } it is work fine in FF2, but still no luck from IE, so you quoted (a) be aware

[jQuery] Re: Expanding the clickable region of a checkbox

2008-05-16 Thread Wizzud
On May 16, 12:10 am, Wizzud [EMAIL PROTECTED] wrote: Eg. $('td').bind('click', function(e){ if(e.target===this){ cb = $(this).children(':checkbox').trigger('click'); return false; } }); On May 15, 4:16 pm, Richard D. Worth [EMAIL PROTECTED] wrote

[jQuery] Re: How do I write this jquery expression?

2008-05-15 Thread Wizzud
var visID = $('div.subNav:visible').attr('id'); On May 15, 10:28 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, I have a number of DIVs with class = subNav. How do I write a Jquery expression to tell me the ID of the DIV with class subNav whose display element is not none (i.e. block)?

[jQuery] Re: Expanding the clickable region of a checkbox

2008-05-15 Thread Wizzud
Eg. $('td').bind('click', function(e){ if(e.target===this){ cb = $(this).children(':checkbox').trigger('click'); return false; } }); On May 15, 4:16 pm, Richard D. Worth [EMAIL PROTECTED] wrote: The click callback gets the event object as the first parameter.

[jQuery] Re: jqDock doesn't do anything?

2008-05-15 Thread Wizzud
-weight:bold; padding:0px 4px; white-space:nowrap; } #menu div.jqDockLabelLink {cursor:pointer;} #menu div.jqDockLabelImage {cursor:default;} Appreicate your help. Thanks/Davis. On May 15, 7:20 am, Wizzud [EMAIL PROTECTED] wrote: Try placing your script inside the 'document

[jQuery] Re: jqDock doesn't do anything?

2008-05-15 Thread Wizzud
@JohnieKarr Yep, if it works, that correctPNG() script will definitely prevent jqDock() doing anything. On May 15, 3:22 pm, JohnieKarr [EMAIL PROTECTED] wrote: Wizzud, Thanks for the help. Once I inclosed the script inside the document ready function it worked great. It quit working

[jQuery] Re: jqDock doesn't do anything?

2008-05-14 Thread Wizzud
Try placing your script inside the 'document ready' function... jQuery(document).ready(function(){ // Your code here }); eg. script type=text/javascript jQuery(document).ready(function(){ var opts = { align: 'bottom' , size: 150 , distance:

[jQuery] Re: Why does this not preload an image correctly?

2008-05-12 Thread Wizzud
You could simply change it around a bit... - create the image - assign a load handler, with a callback to append the image to the div and show the div - set the image src eg $('img /').load(function(){ $(this).appendTo('#someDivId').parent(show); }) .attr('src', $('src[0]',

[jQuery] Re: Checkbox confusion

2008-05-12 Thread Wizzud
a week of playing with jquery I must have missed a key concept or 3. On Thu, May 8, 2008 at 1:43 AM, Wizzud [EMAIL PROTECTED] wrote: Try this... $(#bChecklist input:checkbox).click(function(event){ var item = $(this).parent().text(); alert ( (this.checked ? '' : 'Un') + 'Checked

[jQuery] Re: fastest way to edit a select

2008-05-10 Thread Wizzud
I suppose it just depends whether it's faster to find and hide all then filter some or all and show them, or to selectively hide/show each of a known set? Haven't tested so not sure. On May 10, 4:22 am, Dave Methvin [EMAIL PROTECTED] wrote: How about this? $('#hotel_paese').change(function(){

[jQuery] Re: fastest way to edit a select

2008-05-10 Thread Wizzud
PROTECTED] wrote: thank you very much to the both of you! I'll try and let you know :) just a question for Wizzud: what is this? O_o me[sel_val=='' || me.is('.'+sel_val) ? 'show' : 'hide'](); if I get it, writing me.show(); or me['show'](); is the same? I didn't know. thanks andrea

[jQuery] Re: Does a control like this exist?

2008-05-10 Thread Wizzud
Something along these lines? ... $(document).ready(function() { var maxPt = 20 , curPt = 0 , trgts = $('input') ; trgts.attr({readonly:'readonly'}).val(0).each(function(i){ var me = this, x = i, pv = trgts[i-1], nx = trgts[i+1];

[jQuery] Re: New object based on existing / Or understanding $.extend

2008-05-09 Thread Wizzud
There's a bit of an oddity here (actually I think it's a bug, but still...). Starting with what you need to do - specifically, to be able to add items to dupe.list): var dupe = $.extend(true, {list:[]}, $.fn.test.orig); Then dupe.list.push(...) will not change $.fn.test.orig. Why? Setting the

[jQuery] Re: Getting Parent Element using this

2008-05-09 Thread Wizzud
If there is as little control over the markup as is implied then a more generic solution might be applicable (untested!)? function updateQuote(el){ //$('form') could be cached, and may not need to store parentForm... var parentForm = $('form').filter(function(){ var i =

[jQuery] Re: fastest way to edit a select

2008-05-09 Thread Wizzud
An alternative... var destOpts = $('#hotel_destinazione option'); $('#hotel_paese').change(function(){ var sel_val = $(this).val() || ''; destOpts.each(function(){ var me = $(this); me[sel_val=='' || me.is('.'+sel_val) ? 'show' : 'hide'] ();

[jQuery] Re: beginner question on show/hide and reusing functions

2008-05-08 Thread Wizzud
Something like this?... $(document).ready(function() { var sp = $('.searchpanel').hide() //hide boxes initially , so = $('#searchoptions') , anim = false //prevents fast clicking of second option ; // shows all $('a.showall', sp).click(function() { anim = true; //hide

[jQuery] Re: Checkbox confusion

2008-05-08 Thread Wizzud
Try this... $(#bChecklist input:checkbox).click(function(event){ var item = $(this).parent().text(); alert ( (this.checked ? '' : 'Un') + 'Checked = ' + item); }); On May 8, 1:38 am, mr4d [EMAIL PROTECTED] wrote: Hi all, Can't quite get the the following functionality to

[jQuery] Re: Expression/Selector question...

2008-05-08 Thread Wizzud
In the docs, where 'expr' as stated as being either a 'string' or an 'expression' it means that it is a selector expression, ie. a string that would be acceptable as a selector in $(selector). In all the examples you have given - filter, find, parent, etc - the expected argument is a selector

[jQuery] Re: Best way to do Lightbox-like modal windows?

2008-05-07 Thread Wizzud
There's Shadowbox too (http://mjijackson.com/shadowbox/). On May 8, 12:06 am, Adwin Wijaya [EMAIL PROTECTED] wrote: I use JQuery UI Dialog ...easy and elegant :) enough for simple to complex dialog box. for displaying error/warning/info I use jqalert() as replacement of alert box by

[jQuery] Re: Dynamically Filter List

2008-05-05 Thread Wizzud
Depends what you want the list to finally contain (as opposed to being visible, that is). Here's an alternative... $(document).ready(function() { var arr = ['C+ +','D','HTML','CSS','C#','PHP','Python','XML','JavaScript','Photoshop'] , alc = [] , list = $('#list'); $.each(arr,

[jQuery] Re: strange behaviour: multiple selectors responding

2008-05-05 Thread Wizzud
The problem is the context of 'this' within the ajaxStart() and ajaxStop() functions. try this instead... $(#contests ul li span a).toggle( function(){ //store ref to toggling element for use in ajax callbacks... var lnk = $(this); var url_title = lnk.html();

[jQuery] Re: JQuery Selector

2008-04-10 Thread Wizzud
should be indented progressively based on how deep it is (infinitely deep is possible). On Apr 9, 6:53 pm, Wizzud [EMAIL PROTECTED] wrote: Actually, no I can't see. Every DIV with #survey contains just one text node - nothing else. On Apr 9, 10:27 pm, JB [EMAIL PROTECTED] wrote: I've

[jQuery] Re: Event Binding Problem

2008-04-10 Thread Wizzud
;-)) *Wizzud*, Many thanks for the great explanation and yep, I see the problem and it makes sense that I am giving away click events too freely (I am generous ike that). So I need to target my new dynamic DIV rather than all divs of the same class. How to do that though? I tried adding

[jQuery] Re: HTML Partial Element Does Not Exist?!

2008-04-10 Thread Wizzud
is is div, a scrubber runs and replaces links. !-- this works 4) Last a second scrubber tries to replace specific links with redirect links. !-- this fails with undefined On Apr 10, 11:56 am, Wizzud [EMAIL PROTECTED] wrote: Um, I realise this is probably a stupid question but has the named DIV

[jQuery] Re: assign event click to dynamic create div (via php)

2008-04-09 Thread Wizzud
An alternative view of the problem If you have a PHP while() loop that outputs multiple anchors with the same id, this results in invalid HTML. For example... ?php $i = 0; while( !empty($fish[$i]) ){ $cod = $fish[$i++]; ? a id='fish' href='prog.php?status=?php echo

[jQuery] Re: HTML Partial Element Does Not Exist?!

2008-04-09 Thread Wizzud
Your div does not actually contain any HTML, just text. Try ... alert($(#MyDiv).text()); On Apr 9, 8:39 pm, OhNoMrBill [EMAIL PROTECTED] wrote: I have an HTML partial coming back from a server that includes a named div (ex: div id=MyDivblah/div) When I try to run the following on it, it

[jQuery] Re: what wrong in code?

2008-04-09 Thread Wizzud
You seem to be missing some script... $.get('savesite.cgi', {sname: sitename, surl: siteurl, uname: uname, uemail: //missing something? Presumably there is another, initial, call to getready() somewhere else in the script? Presumably #add lies somewhere within #siteinfo? Presumably

[jQuery] Re: iframe and menu overlap/float

2008-04-09 Thread Wizzud
Sorry, slightly confused. Page A contains an iframe. That iframe is used to display Page B - the result information which is dependent on a menu option. But is the menu part of Page A (the one that contains the iframe), or Page B (the one within the iframe)? On Apr 9, 9:23 am, tfat [EMAIL

[jQuery] Re: JQuery Selector

2008-04-09 Thread Wizzud
Actually, no I can't see. Every DIV with #survey contains just one text node - nothing else. On Apr 9, 10:27 pm, JB [EMAIL PROTECTED] wrote: I've got the following html div id=survey br / div class=sectionstart start /div div class=sectionstart

[jQuery] Re: Event Binding Problem

2008-04-09 Thread Wizzud
This line... $(#column).append(html).find('.portHeader').bind('click',setQRX); might be causing you a problem. Breakdown... $(#column) //select #column .append(html) //append some HTML to #column .find('.portHeader') //find anything in #column with class portHeader

[jQuery] Re: Having trouble with += and toFixed for some reason

2008-04-04 Thread Wizzud
Initialise as numbers instead of strings?... var bagqty = 0; var bagtotal = 0; On Apr 4, 9:35 pm, Chuck Cheeze [EMAIL PROTECTED] wrote: Here is my code: pre script type=text/javascript //on page load $(document).ready(function() {

[jQuery] Re: selectors return type

2008-04-04 Thread Wizzud
The Selector will always return an array of zero, one, or more elements. I'm not sure why the distinction has been made between Element and Array of Elements - the only reason I could come up with was that someone wanted to indicate that certain Selectors will/should return only one element,

[jQuery] jqDock Plugin

2008-03-31 Thread Wizzud
Transform a set of images into a Mac-like Dock menu, horizontal or vertical, with icons that expand on rollover, and optional labels. (Not particularly new, but I needed it.) demo : http://www.wizzud.com/jqDock/ Feedback welcome.

[jQuery] Re: Custom element attributes generated by a plugin

2008-03-31 Thread Wizzud
I, too, would have to be counted on the 'not in favour' side. Can you not use a class, or $.data, or $.metadata, or some such? On Mar 30, 3:24 pm, Eric Martin [EMAIL PROTECTED] wrote: I'm *considering* adding a custom attribute for elements created in a plugin and wanted to know what the

[jQuery] Re: Changing the click trigger inside itself is causing undesired results.

2008-03-31 Thread Wizzud
I think you may be under the misconception that an event ('click' in this case) can only have one function bound to it at a time - not true. When you bind a function to an event, it stays bound until removed, and will run whenever the event is triggered. If you bind another function (same or

[jQuery] Re: Issue with next()/prev() traversal

2008-01-31 Thread Wizzud
One way (assuming there is only one a.boldFont, and its position is unknown and may change): // store a list of all anchors in the target div... var anchors = $('#eventlist a'); // then when(ever) you need to... // ...find the position of the boldFont anchor within the stored list var bf =

[jQuery] Re: Problem in creating Dynamic tables

2008-01-31 Thread Wizzud
So what is the problem exactly? What have you tried that didn't work, and in what way did it not work? On Jan 31, 4:11 am, Anand [EMAIL PROTECTED] wrote: John please help On Jan 30, 1:21 pm, Anand [EMAIL PROTECTED] wrote: Hi All, I am trying to create a dynamic table. It is to be

[jQuery] Re: creating a table from an array

2008-01-19 Thread Wizzud
You have 2 very basic problems with your code: 1. Usage of append() The content you append() should be valid html in its own right. For example, your first append does $(this).append('table'), when it should really be $(this).append('table/table') which would insert a TABLE element as the last

[jQuery] Re: Trying to set the id of a 2nd level div and failing

2008-01-15 Thread Wizzud
Use find()? The children() function (should) return unique immediate children which won't get you your second level divs in a single call from the #obj level, no matter what selector you use. eg... var obj = $(#obj); obj.find(.obj_level1.obj_level2).attr( id, Bob ); On Jan 15, 6:03 am, Mark

[jQuery] Re: how can a text field be hidden based on condition

2008-01-15 Thread Wizzud
var txt = $('theSelect :selected').text(); if(txt == 'cat' || txt.indexOf('c')==0 || ...test after test after test...){ $('selector_fieldToHide').hide(); } On Jan 15, 1:16 pm, Bhaarat Sharma [EMAIL PROTECTED] wrote: Thanks! but the values of this drop down box are dynamic and are coming

[jQuery] Re: a way to convert jquery object to text for dom injection

2008-01-14 Thread Wizzud
Try... $('#d').clone().appendTo('div').before('text blab bla').after('ok nana'); On Jan 14, 5:11 am, Equand [EMAIL PROTECTED] wrote: i need to insert a clone of one dom object i do var hex = $(#d).clone(); $(div).append(text blab bla+hex+ok nana); and it's not working... how do i do this?

[jQuery] Re: using animate() with duration/queue object and callback doesn't work

2008-01-04 Thread Wizzud
On Jan 3, 4:17 pm, chrismarx [EMAIL PROTECTED] wrote: hi, this works fine $elem.animate( {opacity:0}, 600, callback) .animate( {height:hide}, 700); but this doesn't $elem.animate( {opacity:0}, {queue:false, duration:600}, callback) .animate( {height:hide}, 700);

[jQuery] Re: Serialize unchecked checkboxes?

2008-01-04 Thread Wizzud
var fm = $('form'); var uc = []; $(':checkbox:not(:checked)', fm).each(function(){ uc.push(encodeURIComponent(this.name) + '='); }); var serial = fm.serialize() + (uc.length ? ''+uc.join('').replace(/%20/g, +) : ''); On Jan 4, 3:47 pm, badtant [EMAIL PROTECTED] wrote: Hi! I thinkt

[jQuery] Re: adding conditional to $(x)

2008-01-01 Thread Wizzud
$(function(){ $('[EMAIL PROTECTED]').each(function() { var len = this.value.length; $(this).addClass(len5?'S':len10?'L':'M'); }); }); Change the 5 and/or 10 to the appropriate limits. On Dec 31 2007, 11:52 am, Dug Falby [EMAIL PROTECTED] wrote: Hi all, I'd like to do the

[jQuery] Re: Avoid double submit by disabling submit button causes problem in IE

2007-12-22 Thread Wizzud
You could change the submit to a button and use one() ... For example... jQuery(function($){ $('input.submitbutton').one('click', function(){ $(this).parents('form')[0].submit(); return false; }); }); form input type='button' class='submitbutton' / /form

[jQuery] Re: Just can't seem to figure way...

2007-12-22 Thread Wizzud
Nothing wrong with the code in its own right ... BUT you have the exact same script included on your page twice so there are 2 click handlers bound to each 'dt a', which results in the double bounce! On Dec 22, 2:55 pm, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Can someone look at this code..

[jQuery] Re: How to get all CSS values from Attributes

2007-12-21 Thread Wizzud
var foo =$('#divname').css('top'); var bar = $('#divname').css('marginTop'); Be careful with padding though, because I think different browsers report it in different ways because it is a sort of shorthand for padding-top + padding-right + ...etc. As such, just asking for $

[jQuery] Re: jQuery assistance w/ moving nearby elements

2007-12-21 Thread Wizzud
Lets break it down step by step... On Dec 21, 4:15 am, soupenvy [EMAIL PROTECTED] wrote: I've now got it doing what I want, thanks to the .prevAll() selector. However, the closing portion of my JS doesn't seem to work: $(document).ready(function() { $(#tabs li).addClass(closed)

[jQuery] Re: internet explorer debugging

2007-12-21 Thread Wizzud
It appears to be choking on ... $thisMenu.animate({ left: $newLeft + 'px' }); You might need to ensure that 'left' is set to a value for anything you wish to animate. At the moment, IE7 is giving a start point of NaN for a left animation. PS. You don't need to supply

[jQuery] Re: internet explorer debugging

2007-12-21 Thread Wizzud
the chain if the selector finds the element. $('#strata3').html(''); You can just use $('#strata3').empty(); html() does an empty() before applying the new content, and seeing as you don't have any replacement content, a simple empty() should suffice. On Dec 21, 10:28 am, Wizzud [EMAIL PROTECTED

[jQuery] Re: jQuery LightBox issue in IE7

2007-12-21 Thread Wizzud
Have you tried either completing your doctype with a dtd, and/or removing the doctype altogether? On Dec 21, 2:51 pm, Rey Bango [EMAIL PROTECTED] wrote: Hey Su, thanks for the feedback. Replies below: Following from that, the first thing I'd do is just put back the original styling from

[jQuery] Re: tr not applying CSS

2007-12-20 Thread Wizzud
Have you tried giving your row a specific class instead of using name? eg. $('tr.myRowClass').hover( function() { $(this).addClass(newClass); }, function() { $(this).removeClass(newClass); } ); On Dec 20, 4:31 am, JQueryProgrammer [EMAIL

[jQuery] Re: recognizing a new class appended

2007-12-18 Thread Wizzud
$(#commenting).append(span class='commentTag'+fill+/spanspan class='deleteTag'x/span) .find('.deleteTag').bind('click', function(){ // perform removal }); On Dec 18, 7:09 am, Kyle [EMAIL PROTECTED] wrote: Hi, This is frustrating! First, because I'm having a problem I can't solve.

[jQuery] Re: tricky traversing question

2007-12-18 Thread Wizzud
var cols = $('#dsViewport').find('div.column'); $('#dsViewport h3').each(function(){ // assuming you want the h3? var numPrecedingColumns = cols.index( $('div.column:first', this)get(0) ); // . do whatever . }); You can tighten or loosen the selectors to fit your actual

[jQuery] Re: fadeTo refiering/flickering when hovering div's element

2007-12-18 Thread Wizzud
Try using hover() instead. Hover() has built-in code for testing whether the element under the mouse has the target element as an ancestor. On Dec 18, 9:23 am, don Jao [EMAIL PROTECTED] wrote: Hi Everyone, I'm pretty new to jQuery, and my JavaScript sills aren't very good to0, but they're

[jQuery] Re: tricky traversing question

2007-12-18 Thread Wizzud
= cols.index( $(this).next().get(0) ); // . do whatever . }); If you can have something other than a div.column following an h3 then you'll need to change the next(). On Dec 18, 5:19 pm, Chris [EMAIL PROTECTED] wrote: On Dec 18, 12:05 pm, Wizzud [EMAIL PROTECTED] wrote: var cols

[jQuery] Re: Splitting long lists

2007-12-18 Thread Wizzud
A possible alternative (untested!) to ponder upon... function balance(list,cssClass){ // new second 'half' of list... var to = jQuery('ul/ul'),attr({id:list+'-b',class:cssClass}) // original list, with new id and class, and new list placed after... , from =

[jQuery] Re: help using selectors to set a hidden field value

2007-12-17 Thread Wizzud
You're nearly there, but what you need to do is *append* to the #updstr field, whereas you are currently overwriting its value with each iteration of each! Personally, I would probably do it slightly differently, eg... $(document).ready(function(){ var upd = []; $(

[jQuery] Re: using :contains() selector with $(this)

2007-12-13 Thread Wizzud
As with anything else there are a number of ways of going about this, and which one you use depends a lot on what you want to do with the result. One thing to point out with your $(this:contains(...)) example is that 'this' is usually an object variable and ':contains(...)' is a string and you

[jQuery] Re: Returning a new collection from a method

2007-12-13 Thread Wizzud
individual jQuery objects from inside my loop. Surely, there is a more elegant way to create an empty jQuery collection. The pushStack suggestion is great, btw. Thanks again, Larry On Dec 12, 4:42 am, Wizzud [EMAIL PROTECTED] wrote: Simply return your new collection. How you get your new

[jQuery] Re: find and replace text in a variable

2007-12-13 Thread Wizzud
for(var i = 1; i = materias_num; i++){ $(#fd_opcoes).append(loop.replace(/1/g,''+i)); } On Dec 13, 7:18 pm, Marcelo Wolfgang [EMAIL PROTECTED] wrote: Hi all, I've a form with a numeric drop down ( from 1 to 10 ) and when the user select a number from it, I

[jQuery] Re: Returning a new collection from a method

2007-12-12 Thread Wizzud
Simply return your new collection. How you get your new collection from the current object may well involve map(), but however you do it, all you need to do is return whatever collection you want to continue the chain with. It is probably advisable to use pushStack(), so that your original

[jQuery] Re: Show/Hide Div with checkbox options providing same results

2007-12-11 Thread Wizzud
Using the html as in Glen's mock-up ... var chks = $('input:checkbox').click(function(){ $('#'+this.className) [chks.filter('.'+this.className).map(function(){ return this.checked ? this : null; }).length ? 'show' : 'hide'](); }); On Dec 11, 8:22 pm, Ryan [EMAIL PROTECTED]

[jQuery] Re: .click() issue

2007-12-11 Thread Wizzud
On Dec 10, 7:53 pm, SyLon [EMAIL PROTECTED] wrote: Hello everyone! Could someone please explain me how could this be?? Let's see if I've got this straight ... ... $(.flag).hide(); Everything with a class of 'flag' is now hidden... ... $(.flag).click(function (){ alert(hello); }); A

[jQuery] Re: framing

2007-12-08 Thread Wizzud
google for 'frame breaker' or 'frame buster' On Dec 8, 12:06 am, mokeur [EMAIL PROTECTED] wrote: I would like to know if it is possible to protect one of my framed website page for being framed by another site. Thanks

[jQuery] Re: Code feedback... Callbacks for timing...

2007-12-07 Thread Wizzud
There's a difference in the origin of your href between the initial code that 'worked' and the first posted re-try that didn't. In the first one - the working code, as was - // 'this' must be referring to some element, say X $('#' + this.rel) // select some other element, say Y

[jQuery] Re: redundancy - dimensions plugin and toggle?

2007-12-07 Thread Wizzud
Your 2 toggles are simply swapping 'right' and 'down' classes around, otherwise they are the same. So you could just use a click handler, and toggleClass on 'right' and 'down'. Eg. $('.container').click(function(){ $(this).toggleClass('right').toggleClass('down'); // check height of

[jQuery] Re: Problem with radio/checkboxes on ajax post

2007-12-04 Thread Wizzud
way please tell me. On Dec 4, 1:20 am, Wizzud [EMAIL PROTECTED] wrote: That would be because your $(':input', this) selector is selecting *every* input field in your form and adding it to your inputs array. One solution is to put a test in your each() function to see if the field

  1   2   3   4   >