[jQuery] Re: show/hide

2010-01-12 Thread bill
without the corresponding html, it is hard to tell if this answer is completely correct. however, think about trying this approach, where these few lines replace ALL of your code: $(function() { $('div').click(function() { $('div').hide(slow); // first, for

[jQuery] Re: show/hide

2010-01-12 Thread tabu
Thanks for your quick response, but this doesn't seem to work. I've pasted all the code in bellow, thanks for your help !DOCTYPE html PUBLIC -//W3C//DTD XHTML 1.0 Transitional//EN http:// www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd html xmlns=http://www.w3.org/1999/xhtml; head meta

[jQuery] Re: show/hide

2010-01-12 Thread bill
the jquery: script type=text/javascript $(function() { $('.sectionTitle').click(function() { $('.sectionBody').hide(slow); $(this).next(div).show(slow); }); }); the clickable parts: it is unclear what you want the visitors to click on to

[jQuery] Re: show/hide

2010-01-12 Thread tabu
Wow, thanks for your work on this. Sorry but it's a little confusing as to what is happening in the preview, I have uploaded the pages I've done before just so you can visualize what I'm going for. 1. http://www.democraticunionfordesign.com/test/index_refresh.html 2.

[jQuery] Re: show/hide div on select change

2009-11-20 Thread KeeganWatkins
also, just as a head's up... even when you store numbers as the value attribute on an option/ tag, they are interpreted as strings in javascript. so, from your example above, you might also consider switching your condition to: // Compare as string instead if ($(#id_status).val() === '6'){

[jQuery] Re: show/hide div on select change

2009-11-18 Thread mtuller
Thanks. On Nov 18, 1:50 pm, Charlie Griefer charlie.grie...@gmail.com wrote: You're missing a $ on this line: ('#id_status').change(function() { Change to: $('#id_status').change(function() { unsolicited word of advice... run firebug :) On Wed, Nov 18, 2009 at 11:44 AM, mtuller

[jQuery] Re: show/hide ui.tab?

2009-11-09 Thread MorningZ
Show/Hide works perfectly fine in this quick example http://jsbin.com/oyagi/edit recall that the tabs are actually li items that reference the tabs, which are div's to hide the tab itself, you need to hide the li On Nov 9, 10:23 am, Shawn sgro...@open2space.com wrote: I have a series of

Re: [jQuery] Re: show/hide ui.tab?

2009-11-09 Thread Shawn
Thanks. Your message got me looking in the right direction. Turns out my selector was wrong. Needed #jobtype, not div.jobtype. Once I changed that everything worked as expected. Shawn MorningZ wrote: Show/Hide works perfectly fine in this quick example http://jsbin.com/oyagi/edit

[jQuery] Re: show/hide problem

2009-10-25 Thread Jules
If a.more is a child of the div, use this code. $(document).ready(function() { $(div.featured-cell-padding).mouseenter(function(){ $(this).find(a.more).show(); }); $(div.featured-cell-padding).mouseleave(function(){

[jQuery] Re: show/hide problem

2009-10-24 Thread stilfx
We need more info, the structure of the page, etc. You can target selectors in many ways. On Oct 24, 10:13 am, Daniel Donaldson d8nieldonald...@gmail.com wrote: I am trying to have a image (link button) appear within a div on mousenter for the div, and disappear on mouseleave. I have this

[jQuery] Re: show/hide with embed

2009-10-18 Thread ngreenwood6
Yeah that is what I actually ended up doing. On Oct 17, 6:01 pm, Charlie charlie...@gmail.com wrote: instead of hide(0 which is basically display:none,   you could move it off screen. This sort of issue comes up a lot with tabshttp://jqueryui.com/demos/tabs/#Why_does...

[jQuery] Re: show/hide with embed

2009-10-17 Thread ngreenwood6
Anyone at all? On Oct 16, 6:34 pm, ngreenwood6 ngreenwo...@gmail.com wrote: I tried adding in return false at the end of my function, however that did not fix the issue. Any other suggestions? On Oct 16, 8:37 am, rupak mandal rupakn...@gmail.com wrote: if the problem is reload then add

[jQuery] Re: show/hide with embed

2009-10-17 Thread Charlie
instead of hide(0 which is basically display:none, you could move it off screen. This sort of issue comes up a lot with tabs http://jqueryui.com/demos/tabs/#Why_does... ngreenwood6 wrote: Anyone at all? On Oct 16, 6:34pm, ngreenwood6 ngreenwo...@gmail.com wrote: I tried

[jQuery] Re: show/hide with embed

2009-10-16 Thread Evgeny Bobovik
Try to use this method: script type=text/javascript function showEmbed(){ if($(#test).css('display') == 'block'){ $(#test).css('display','none'); } else { $(#test).css('display', 'block'); } } /script Gk___ 2009/10/16 ngreenwood6 ngreenwo...@gmail.com:

[jQuery] Re: show/hide with embed

2009-10-16 Thread ngreenwood6
I tried doing that as well and it still does the same thing. It must be changing the display that makes it reload. To test all you have to do is create a div with embed code and call show/hide on it and you will see. On Oct 16, 3:02 am, Evgeny Bobovik bobo...@gmail.com wrote: Try to use this

[jQuery] Re: show/hide with embed

2009-10-16 Thread rupak mandal
if the problem is reload then add return false at the end or the function On Fri, Oct 16, 2009 at 6:02 PM, ngreenwood6 ngreenwo...@gmail.com wrote: I tried doing that as well and it still does the same thing. It must be changing the display that makes it reload. To test all you have to do is

[jQuery] Re: show/hide with embed

2009-10-16 Thread Bi Jing
You should use *$(#test).is(:visible)* to confirm whether the div is shown or hidden. Best, BeCoDeR. On Fri, Oct 16, 2009 at 3:02 PM, Evgeny Bobovik bobo...@gmail.com wrote: Try to use this method: script type=text/javascript function showEmbed(){ if($(#test).css('display') ==

[jQuery] Re: show/hide with embed

2009-10-16 Thread ngreenwood6
So if I add return false it won't reload the data? On Oct 16, 8:37 am, rupak mandal rupakn...@gmail.com wrote: if the problem is reload then add return false at the end or the function On Fri, Oct 16, 2009 at 6:02 PM, ngreenwood6 ngreenwo...@gmail.com wrote: I tried doing that as well

[jQuery] Re: show/hide with embed

2009-10-16 Thread ngreenwood6
I tried adding in return false at the end of my function, however that did not fix the issue. Any other suggestions? On Oct 16, 8:37 am, rupak mandal rupakn...@gmail.com wrote: if the problem is reload then add return false at the end or the function On Fri, Oct 16, 2009 at 6:02 PM,

[jQuery] Re: Show/hide effect div on mouseover

2009-10-02 Thread Liam Byrne
Normally the hover function will cause the menu div to disappear in this scenario, as the mouse moves over the child elements. But if you use the hoverIntent plugin, it'll do the trick for you. Liam Mface wrote: Hi, I have a CSS menu that I created using div that current appears using the

[jQuery] Re: Show/Hide

2009-09-15 Thread Richard Walsh
I have figured this out, I replaced $('#add_link').click(function(){ $(this).parent().next('div').show('slow'); }); $('#remove_link').click(function(){ $(this).parent().hide('slow'); }); with

[jQuery] Re: Show/hide on radio button click

2009-08-05 Thread Magnificent
Hey Jules, thanks much, this works like a champ!

[jQuery] Re: show/hide positioned to its trigger

2009-06-24 Thread Mauricio (Maujor) Samy Silva
$('tr td:first-child').attr('align', 'value_here'); Maurício -Mensagem Original- De: roxstyle Para: jQuery (English) Enviada em: quarta-feira, 24 de junho de 2009 14:17 Assunto: [jQuery] show/hide positioned to its trigger i am trying to learn how to position a show/hide

[jQuery] Re: show hide random rows

2009-03-19 Thread Sean O
Scott, Ricardo, great thoughts and great code. It is an interesting issue with many attack vectors; I hope the OP is getting something out of all this... I will expect at least as much code and analysis for my next posted problem! ;) SEAN O _ http://www.sean-o.com

[jQuery] Re: show hide random rows

2009-03-18 Thread Sean O
Bob, Try this: http://jsbin.com/esoba Code: http://jsbin.com/esoba/edit It shouldn't matter how YUI is IDing your table rows, as you can pluck them out by index. HTH, SEAN O http://www.sean-o.com http://twitter.com/seanodotcom Bob O-2 wrote: I was wondering if anyone could point me

[jQuery] Re: show hide random rows

2009-03-18 Thread Scott Sauyet
Bob O wrote: Basically i have a YUI datatable and i want to use jQuery to hide all but a user generated number of rows that are random selected Something like this might be what you're looking for: http://jsbin.com/ozafa/edit The important part is this: var $rows = $(#myTable tbody

[jQuery] Re: show hide random rows

2009-03-18 Thread Sean O
Scott, Nice job. I like the logic, and the fading out of unselected rows. My solution was, admittedly, a quick one. It certainly wouldn't scale past 1,000 rows or so -- especially with the majority # selected -- but if the 10/50 number is firm, seemed to work OK. --SEAN O Scott Sauyet-3

[jQuery] Re: show hide random rows

2009-03-18 Thread Scott Sauyet
Sean O wrote: Nice job. I like the logic, and the fading out of unselected rows. My solution was, admittedly, a quick one. It certainly wouldn't scale past 1,000 rows or so -- especially with the majority # selected -- but if the 10/50 number is firm, seemed to work OK. Yours is probably

[jQuery] Re: show hide random rows

2009-03-18 Thread ricardobeat
If you need performance, this should be it: http://jsbin.com/uvuzi/edit It sorts the rows using the Fisher-Yates shuffling algorithm. Despite throwing elements around in an array, it's faster than the pure mathematical solution because you don't need to filter out duplicate random numbers. An

[jQuery] Re: show hide random rows

2009-03-18 Thread Scott Sauyet
ricardobeat wrote: If you need performance, this should be it: http://jsbin.com/uvuzi/edit It sorts the rows using the Fisher-Yates shuffling algorithm. Despite throwing elements around in an array, it's faster than the pure mathematical solution because you don't need to filter out duplicate

[jQuery] Re: Show/Hide element

2009-03-16 Thread Mat Schaffer
Tried something like this? $(legend).click(function() { $(fieldset ul).toggle(); }); On Mar 15, 2009, at 10:40 AM, shapper wrote: Hello, I have a list of fieldsets and each one has a legend. I am thinking in having something like: fieldset legendPersonal Data/legend ul lifirst

[jQuery] Re: Show/Hide element

2009-03-16 Thread James
Adding to Mat's solution to work for many fieldsets: $(legend).click(function() { $(this).next(ul).toggle(); }); On Mar 16, 4:05 pm, Mat Schaffer mat.schaf...@gmail.com wrote: Tried something like this? $(legend).click(function() { $(fieldset ul).toggle(); }); On Mar 15, 2009, at 10:40

[jQuery] Re: Show/hide multiple TDs with one function?

2009-03-08 Thread Mike Alsup
I have a table with multiple TDs (with different classes) that I want to toggle (show/hide) with one function, from checking different checkboxes that relate to the different TDs. I'm thinking I should pass a variable to the function (from each checkbox) which then show/hides the different

[jQuery] Re: Show/hide multiple TDs with one function?

2009-03-08 Thread deadbeatjam
Hi Mike, and thanks for the answer. The thing is that I want to show/hide the TDs and not the entire table itself. I have multiple rows, and want to toggle one TD for each row - not all the TDs in each row. On 8 Mar, 14:54, Mike Alsup mal...@gmail.com wrote: I have a table with multiple TDs

[jQuery] Re: Show/hide multiple TDs with one function?

2009-03-08 Thread Mike Alsup
The thing is that I want to show/hide the TDs and not the entire table itself. I have multiple rows, and want to toggle one TD for each row - not all the TDs in each row. I know. That's exactly what I was showing how to do. You add/remove a class on the table but put a style rule on the

[jQuery] Re: Show hide and print

2009-03-04 Thread Sean O
You're best served doing that simply with a CSS print stylesheet. Just add: link rel=stylesheet type=text/css media=print href=print.css / and set all elements you don't want to print to display: none. Here's an Oldie-but-Goodie guide to creating a nice one:

[jQuery] Re: Show hide and print

2009-03-04 Thread rayfidelity
Jquery show or fadein overrides the print stylesheet that's the whole problem. On Mar 4, 2:56 pm, Sean O seanodot...@yahoo.com wrote: You're best served doing that simply with a CSS print stylesheet. Just add: link rel=stylesheet type=text/css media=print href=print.css / and set all

[jQuery] Re: Show hide and print

2009-03-04 Thread Sean O
Have you tried overriding the override? i.e. #gototop { display:none !important; } SEAN O rayfidelity wrote: Jquery show or fadein overrides the print stylesheet that's the whole problem. On Mar 4, 2:56 pm, Sean O seanodot...@yahoo.com wrote: You're best served doing that simply

[jQuery] Re: Show/Hide Menu

2009-03-03 Thread Jack Killpatrick
You might want to try .hover(): http://docs.jquery.com/Events/hover#overout - Jack Nic Hubbard wrote: I have a menu that is activated on mouseover a link. The menu is a hidden div which appears. My problem now is how to remove/hide that div when a user move their mouse off of the menu. I

[jQuery] Re: Show/Hide Menu

2009-03-03 Thread Nic Hubbard
Thanks. This almost seems like it would work. But, since the element that the hover is added to, and the element that is shown are different, by the time you move your mouse from the hover element to the element that is shown, your mouse moves out of the first element, and the shown div

[jQuery] Re: Show/Hide Menu

2009-03-03 Thread Jack Killpatrick
Here's an example of a way to handle that: http://www.ihwy.com/Labs/demos/Current/image-hover-menu.aspx - Jack Nic Hubbard wrote: Thanks. This almost seems like it would work. But, since the element that the hover is added to, and the element that is shown are different, by the time you move

[jQuery] Re: Show/Hide Menu

2009-03-03 Thread Nic Hubbard
Yes! That is exactly what I was looking for! I have implemented it and it works perfectly, thank you! On Mar 3, 9:54 am, Jack Killpatrick j...@ihwy.com wrote: Here's an example of a way to handle that: http://www.ihwy.com/Labs/demos/Current/image-hover-menu.aspx - Jack Nic Hubbard

[jQuery] Re: Show/Hide Menu

2009-03-03 Thread Jack Killpatrick
great! but the important part: is it a nice or a bad puppy? g - Jack Nic Hubbard wrote: Yes! That is exactly what I was looking for! I have implemented it and it works perfectly, thank you! On Mar 3, 9:54 am, Jack Killpatrick j...@ihwy.com wrote: Here's an example of a way to handle

[jQuery] Re: Show/Hide Menu

2009-03-03 Thread Nic Hubbard
Hmm, it looks nice to me. :) On Mar 3, 3:20 pm, Jack Killpatrick j...@ihwy.com wrote: great! but the important part: is it a nice or a bad puppy? g - Jack Nic Hubbard wrote: Yes!  That is exactly what I was looking for!  I have implemented it and it works perfectly, thank you! On Mar

[jQuery] Re: show/hide on hover event (newbie question)

2009-02-26 Thread James
Use hover(). $(function() { $(#mainDiv).hover( function() { $(#myImage).show(); }, function() { $(#myImage).hide(); } ); }); div id=mainDiv style=width:100px; height:150px; img src=image.jpg id=myImage style=display:none / /div On Feb 26, 11:33 am, introvert

[jQuery] Re: show/hide on hover event (newbie question)

2009-02-26 Thread Dor
you mean this: http://www.learningjquery.com/2007/02/quick-tip-set-hover-class-for-anything ? On Feb 26, 11:33 pm, introvert aljaz.faj...@gmail.com wrote: Hello I have a simple div inside which I want to show an image on hover (rollover) and hide on mouseout of the div. I tried doing it

[jQuery] Re: show/hide opacity gets stuck sometimes

2008-12-09 Thread Leanan
I've never worked with the .stop function before, so I searched for it in google (jquery .stop) to read up on it to see if that might shed some light... One of the very first links I found was this: http://www.pengoworks.com/workshop/jquery/stop_bug.htm Glancing over it, I think this is what

[jQuery] Re: show/hide opacity gets stuck sometimes

2008-12-09 Thread Tijmen Smit
Thanks a lot :) The clearQueue option for the stop() did the trick, for some reason I completely missed it on docs.jquery.com On Dec 9, 6:04 pm, Leanan [EMAIL PROTECTED] wrote: I've never worked with the .stop function before, so I searched for it in google (jquery .stop) to read up on it to

[jQuery] Re: show/hide opacity gets stuck sometimes

2008-12-09 Thread Leanan
You're welcome. Glad it proved useful. On Dec 9, 1:22 pm, Tijmen Smit [EMAIL PROTECTED] wrote: Thanks a lot :) The clearQueue option for the stop() did the trick, for some reason I completely missed it on docs.jquery.com On Dec 9, 6:04 pm, Leanan [EMAIL PROTECTED] wrote: I've never

[jQuery] Re: show/hide opacity gets stuck sometimes

2008-12-09 Thread Karl Swedberg
On Dec 9, 2008, at 1:22 PM, Tijmen Smit wrote: The clearQueue option for the stop() did the trick, for some reason I completely missed it on docs.jquery.com Not your fault. The note about the .stop() options looked almost like a footnote. Quite easy to miss. I've just updated the page to

[jQuery] Re: show/hide/toggle: suggestion to reduce show/hide code

2008-11-19 Thread Hector Virgen
I ran into this same problem today and wrote up this quick plugin that accepts a boolean or function: $.fn.extend({ showIf: function(fn) { var result; switch (typeof fn) { case 'function': result = fn.call(this); break; default: result = fn; } if (result) { $(this.show()); } else {

[jQuery] Re: show/hide/toggle: suggestion to reduce show/hide code

2008-11-19 Thread Hector Virgen
Oops, fixed a typo: $.fn.extend({ showIf: function(fn) { var result; switch (typeof fn) { case 'function': result = fn.call(this); break; default: result = fn; } if (result) { $(this).show(); } else { $(this).hide(); } return $(this); } }); -Hector On Wed, Nov 19, 2008 at 9:29 AM, Hector

[jQuery] Re: show/hide/toggle: suggestion to reduce show/hide code

2008-11-18 Thread Karl Swedberg
On Nov 18, 2008, at 1:10 AM, Dylan Verheul wrote: I'm building a new version of an often used data entry form on our site Waarneming.nl (int'l version Observado.org). It struck me that I often have to write something like this: if (cond) $(this).show() else $(this).hide(); Since jQuery is

[jQuery] Re: show/hide/toggle: suggestion to reduce show/hide code

2008-11-18 Thread Dylan Verheul
On Tue, Nov 18, 2008 at 14:56, Karl Swedberg [EMAIL PROTECTED] wrote: It struck me that I often have to write something like this: if (cond) $(this).show() else $(this).hide(); Since jQuery is about reducing and chaining, wouldn't it be nice if I could write it like this:

[jQuery] Re: show/hide/toggle: suggestion to reduce show/hide code

2008-11-18 Thread MorningZ
How about something like (although i admit the function name could use some thinking, heh) (function($) { $.fn.showorhide = function(bool) { if (bool) { $(this).show(); } else { $(this).hide(); } return

[jQuery] Re: show/hide/toggle: suggestion to reduce show/hide code

2008-11-18 Thread Karl Swedberg
On Nov 18, 2008, at 9:02 AM, Dylan Verheul wrote: On Tue, Nov 18, 2008 at 14:56, Karl Swedberg [EMAIL PROTECTED] wrote: Not sure if toggle(cond) is the best choice, though. It's already pretty overloaded as it is, and it can already take a string or numeric argument for speed (e.g.

[jQuery] Re: show/hide/toggle: suggestion to reduce show/hide code

2008-11-18 Thread Dylan Verheul
On Tue, Nov 18, 2008 at 19:58, Karl Swedberg [EMAIL PROTECTED] wrote: On Nov 18, 2008, at 9:02 AM, Dylan Verheul wrote: Hmm, I actually checked the docs for that because that would make .toggle an unsuitable overloader. The docs said toggle doesn't take arguments: Hmmm, indeed. :) Not so

[jQuery] Re: Show/Hide. Could someone, please, help me with this?

2008-11-04 Thread pedalpete
Should be pretty simple Miguel. The first thing I would do is add an ID to each legend and/or image you want to trigger the show so you can tell which one has been clicked and add a common class to all the legends and images. Then put the id as a class of the fieldset you would like to show/

[jQuery] Re: Show/Hide items in unordered list

2008-09-30 Thread MorningZ
This help to get the idea of what could be done? http://paste.pocoo.org/show/86584/ On Sep 30, 1:19 am, Wayne Dyck [EMAIL PROTECTED] wrote: I have a unordered list of, say, ten items. I want to initially show five items and provide the user with a plus and minus key to either increase or

[jQuery] Re: Show/Hide items in unordered list

2008-09-30 Thread Wayne Dyck
MorningZ, thank you very much! That is perfect and will do nicely to get me started in the right direction. I wasn't sure if I needed to assign unique ids to the individual li items or not and your example shows me I can do it without them. Very cool. Thanks, again. Wayne On Sep 30, 6:03 am,

[jQuery] Re: show hide selected on page load (beginner)

2008-09-11 Thread tlob
I am so proud of me: $('#schuppen-wrapper,#kirche-wrapper,#openair-wrapper,#andererort- wrapper').hide(); var showit = $(#form1 #ort_id option:selected).attr(value); switch(showit) { case 1: $('#schuppen-wrapper').show();

[jQuery] Re: Show/Hide divs beginning with a specified string

2008-06-24 Thread WoolyNinja
I would use the [attribute^=value] selector. Then use substring to get the EngineerShortName. $(div[id^='showhide_']).click(function(){ if(this.idthis.id.length0){ var engName=this.id.substring('showhide_'.length); $(div#block_+engName+ div).toggle(); } }); On Jun 24,

[jQuery] Re: Show/Hide divs beginning with a specified string

2008-06-24 Thread DaveG
Since you're already using css to show/hide, then why not apply a class to the shown/hidden rows, and select on that instead? Thus, for hidden rows apply the class hide_row, which will include the css required to hide the row, and apply show_row on those rows you want displayed. ~ ~ Dave

[jQuery] Re: Show/Hide divs beginning with a specified string

2008-06-24 Thread Adam
The solution by WoolyNinja works great, with a change of the line: $(div[id^='showhide_']).click(function(){ to: $(img[id^='showhide_']).click(function(){ as it is the image that I wanted to capture the click event for. It could not be done by show/hide classes in a simple way as there will be

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

2008-05-24 Thread Wizzud
Ok. Couple of things. I put a 'return false;' at the end of the click handler (sorry - tends to be a reflex action!) when it doesn't actually need it. Either shift it up to be within the 'if...' statement block, or remove it altogether. It prevents focussing on the input element and activating

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

2008-05-24 Thread Ridge
Wizzud, Everything seems to work fine! Your fix did the trick, and the form (the Home one at least - I haven't set the rest up as yet) submits perfectly. Thanks so much! On May 24, 5:32 am, Wizzud [EMAIL PROTECTED] wrote: Ok. Couple of things. I put a 'return false;' at the end of the click

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

2008-05-23 Thread Ridge
Hm. Replaced my code with yours, and it's still toggling the form when its clicked. :( On May 22, 5:29 pm, Pyrolupus [EMAIL PROTECTED] wrote: You need to have your event handler handle things differently depending upon the specific child element that was clicked. For example:

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

2008-05-23 Thread Karl Swedberg
This line: if ($tgt.not('form')) { //don't toggle when clicking the form! should be : if (!$tgt.is('form')) { //don't toggle when clicking the form! The first always returns the jQuery object, so it's always truthy. The second returns a boolean. Will be true if the target

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

2008-05-23 Thread Ridge
Karl, thanks. I modifed your line slightly to give it the same specificity as the preceding declaration (it wasn't working at all when it was just 'form'), and now the form isn't appearing at all on click! Here's the whole section: // Show/hide forms $('div#homepage_boxes

[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: Show/hide toggle hides form too...bah!

2008-05-23 Thread Ridge
Oooh SO close Wizzud! Followed your instructions carefully, and set the height of the form equal to the height of div.col. The forms now toggle correctly, stay on when the user is inputting their zip, BUT (taking For Your Home, for example) doesn't submit when the Go button is clicked. It also

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

2008-05-22 Thread Pyrolupus
You need to have your event handler handle things differently depending upon the specific child element that was clicked. For example: $('div#homepage_boxes div.col').click(function(event) { var $tgt = $(event.target); if ($tgt.not('form')) { //don't toggle when clicking the

[jQuery] Re: show/hide nested divs?

2008-04-24 Thread thekman
Thanks Shawn, still not working though, i presume because .boxcontent is not a sibling of .closeimage_left but is a sibling of .box so would i need to find the parent div of .closeimage_left then toggle that sibling .boxcontent? If so, any idea how I would do it? On Apr 24, 2:07 am, Shawn

[jQuery] Re: show/hide nested divs?

2008-04-24 Thread thekman
Thanks Shawn, however it is still not working for me, I presume because .boxcontent is not a sibling of .closeimage_left but is a sibling of div id=box_1 class=box So, should I have to find the parent div then find the sibling .boxcontent? any idea how i would do this? On Apr 24, 2:07 am, Shawn

[jQuery] Re: show/hide nested divs?

2008-04-23 Thread Shawn
oops.. that should probably be a .toggle() instead of a .hide() Shawn Shawn wrote: $(.closeimage_left).click( function () { $(this).siblings(.boxcontent).hide(); }); That *should* do the trick. Shawn thekman wrote: Hi all, I have code something like: div id=box_1 class=box div

[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: Show/Hide Div with checkbox options providing same results

2007-12-07 Thread Dave Methvin
It is shorter, but it just doesn't seem quite as jQuery-ish. ;) I always figured that there was a good reason for the this object being a bare DOM object in callbacks, events, and .each loops. jQuery doesn't try to hide the DOM, but it's just a $(this) away when you really need it. If you

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

2007-12-07 Thread Dave Methvin
$(#+this.className).[(this.checked?show:hide)](); Belay that, try this: $(#+this.className)[this.checked?show:hide](); I'm always making code longer than it has to be. :)

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

2007-12-07 Thread Dave Methvin
I kept thinking, hmm, I think this should be shorter. Wouldn't this work? (I haven't tried it.) $(input:checkbox).click(function(){ $(#+this.className).[(this.checked?show:hide)](); }); I am pretty sure all the browsers support .className and .checked as properties.

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

2007-12-07 Thread Glen Lipka
It is shorter, but it just doesn't seem quite as jQuery-ish. ;) Glen On Dec 7, 2007 1:13 PM, Dave Methvin [EMAIL PROTECTED] wrote: $(#+this.className).[(this.checked?show:hide)](); Belay that, try this: $(#+this.className)[this.checked?show:hide](); I'm always making code longer than

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

2007-12-06 Thread Glen Lipka
I whipped a demo. Does this do what you want? http://www.commadot.com/jquery/checkBoxShow.php Couple of tips: 1. Try to avoid putting onclick handlers in your html. jQuery does this really easily and makes your html easier to read. 2. getElementByID can be expressed as

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

2007-12-06 Thread Ryan
Actually, what I need it to do is show one instance of Div 4, not two. I'm using the div for a text field, so I only need to show one version of it. The checkboxes showing the div are independent of each other in value, but have the same corresponding text field which should be filled out if

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

2007-12-06 Thread Glen Lipka
I dont get it. :) Say it again as a use case: 1. click on X 2. expect results: div Y does something. Glen On Dec 6, 2007 11:22 AM, Ryan [EMAIL PROTECTED] wrote: Actually, what I need it to do is show one instance of Div 4, not two. I'm using the div for a text field, so I only need to show

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

2007-12-06 Thread Ryan
This part works: Select X, get Div 1 or Select Y, get Div 1 or Select X and Y, get Div1 This part doesn't: When X and Y are selected, Div1 is showing If X is unselected and Y remains selected, Div1 is still showing Basically, if X and Y are selected and then X is unselected, I want Div1 to

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

2007-12-06 Thread Glen Lipka
Ahh, I think I get it. Input 1 and 2 both are controlling the first div. Input 3 controls div 2 input 4 controls div 3 input 5 controls div 4 Yes? I can modify the demo. Glen On Dec 6, 2007 2:46 PM, Ryan [EMAIL PROTECTED] wrote: This part works: Select X, get Div 1 or Select Y, get Div

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

2007-12-06 Thread Glen Lipka
Ok, I updated it. I made it Very jQuery. $(input[type=checkbox]).click(function(){ divClass = $(this).attr(class); if ($(this).is(:checked)) { $(# + divClass).show(); } else if($(this).not(:checked)) { $(# + divClass).hide(); } }); I refactored it three times. I kept

[jQuery] Re: Show/Hide divs depending on choice made in a select box

2007-10-26 Thread Adrian Lynch
Hey ioor, this sort of thing should be fairly straight forward, what are you having trouble with? To get you started: $(function() { $(#edit-taxonomy-3).change(editTaxonomyChanged); }); function editTaxonomyChanged() { var selectedOption = $([EMAIL PROTECTED]); alert(Do

[jQuery] Re: show/hide based on list selection

2007-10-18 Thread Belinda M. Giardine
Thanks Karl and Olaf. I got 2 methods to work so I feel ready to do the real code now. Just one question, in the tutorials I saw lines like q([EMAIL PROTECTED]'sweets']) where what works here is q('select[name=sweets]'). When should the @ and quotes be used and when shouldn't they? Belinda

[jQuery] Re: show/hide based on list selection

2007-10-18 Thread Karl Swedberg
Hi Belinda, As of jQuery 1.2, the @ symbol is deprecated (unless you're using the XPath plugin). So, pre-1.2, use the @, and 1.2+, do not use it. The quotes inside the square brackets are optional. --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com On Oct

[jQuery] Re: show/hide based on list selection

2007-10-17 Thread Olaf Bosch
Belinda M. Giardine schrieb: I have found this question in the archives and set up a test page based on the responses I have found. But for me it is not working, the section is hidden and doesn't reappear no matter what is selected. I have tried several different browsers. The real task is

[jQuery] Re: show/hide based on list selection

2007-10-17 Thread Olaf Bosch
Belinda M. Giardine schrieb: I have found this question in the archives and set up a test page based on the responses I have found. But for me it is not working, the section is hidden and doesn't reappear no matter what is selected. I have tried several different browsers. The real task is

[jQuery] Re: show/hide based on list selection

2007-10-17 Thread Karl Swedberg
Belinda, you can also use the .change() method on the select element if you want (the part you commented out was just fine). Then you can either get the selected option's value like this ... q(this).text() or its text like this ... q(':selected',this).text() As Olaf mentioned, the real

[jQuery] Re: show/hide FAQ - simplify my code?

2007-10-05 Thread Wizzud
Purely as an example ... $(document).ready(function(){ // close the offDiv content sections (no javascript = content is all visible) $('.offDiv .show-hide').hide(); // showLink/hideLink shows/hides the content; showAll/hideAll shows/hides all the content $.each(['.show', '.hide'],

[jQuery] Re: show/hide FAQ - simplify my code?

2007-10-05 Thread MichaelEvangelista
nice! the use of js variables must be further back in the book... ;-) I hadn't even thought of doing it that way - thanks very much. -- -- Michael Evangelista, Evangelista Design Web : www.mredesign.com Newsgroups: news://forums.mredesign.com Blog : www.miuaiga.com Wizzud [EMAIL PROTECTED]

[jQuery] Re: show hide div with menu

2007-09-10 Thread Wizzud
1. tabContent2 : holds the collection of DIVs that are immediate children of #tabcontent 2. filter(':visible') : reduces the collection from (1) to just those DIVs that are visible (ie probably the one that had previously had show() run on it) because it is not necessary to hide those that

[jQuery] Re: Show / hide options based on class

2007-07-12 Thread Marc Jansen
Michael Price schrieb: Hi all, I've got two select boxes side by side - initially the right hand side box has ALL options in it - and the left hand box can be used to filter the options displayed. Probably not the best way to do it (in fact, defintiely - it doesn't work in IE) but the

[jQuery] Re: Show / hide options based on class

2007-07-12 Thread Michael Price
Marc Jansen wrote: var $possibleOptsRight; $( document ).ready(function() { $possibleOptsRight = $('#rightselectlist option'); $( '#leftselectlist' ).bind('change', function() { $('#rightselectlist') .children().remove().end() .append( $possibleOptsRight ).children()

[jQuery] Re: Show hide div with cookie for remembering position -- possible solution

2007-06-11 Thread Matt Stith
Hi! Heres a couple things i might do $('a.show').hide(); $('a.hide').click(function(){ $('a.show').show(); $('h2.title,.view-header-latest').add(this).hide(); // Combine multiple $.cookie('hideShow,hide,{expires:365}); // Only need one

[jQuery] Re: show/hide revisited

2007-05-20 Thread Roger Roelofs
Schnuck, On May 18, 2007, at 11:21 AM, Schnuck wrote: i have this bit of code here (and god knows how old, unstylish and inefficient the code below might be) and all i am trying is to make one or two particular divs with set ids/classes to show and hide triggered by a remote image somewhere

[jQuery] Re: Show()/Hide() Bug?

2007-04-23 Thread Sean Catchpole
I ran you code in FireFox and in IE6 and recieved no such error. ~Sean

  1   2   >