[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. http://www.democraticunionford

[jQuery] Re: show/hide

2010-01-12 Thread bill
the jquery: $(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 hide/show your sections, so i

[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 http://www.w3.org/1999/xhtml";> stripy divs @import"css/stripy_simple.css"; $(document).ready(function() { $('div.me').hide(); $('div.who').toggle(function()

[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 simpli

[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 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'){ $('div

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

2009-11-18 Thread mtuller
Thanks. On Nov 18, 1:50 pm, Charlie Griefer 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 wrote: > > I

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 re

[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 items that reference the tabs, which are 's to hide the tab itself, you need to hide the On Nov 9, 10:23 am, Shawn wrote: > I have a series of tabs using UI.  I need to hi

[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(){ $(this).find("a

[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 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 working in the following

[jQuery] Re: show/hide with embed

2009-10-17 Thread ngreenwood6
Yeah that is what I actually ended up doing. On Oct 17, 6:01 pm, Charlie 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 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:34 pm, ngreenwood6 wrote: I tried adding in return false at

[jQuery] Re: show/hide with embed

2009-10-17 Thread ngreenwood6
Anyone at all? On Oct 16, 6:34 pm, ngreenwood6 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 wrote: > > > if the problem is reload then add "return false" at the end or the fun

[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 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 wrote: > >

[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 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 wrote: > > > I tried doing that as well and it still does the same thing.

[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 wrote: > > Try to use this method: > > function showEmbed(){ > if($("#test").css('display') == 'block'){ > $("#test").css('displ

[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 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 create a div wi

[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 wrote: > Try to use this method: > > functi

[jQuery] Re: show/hide with embed

2009-10-16 Thread Evgeny Bobovik
Try to use this method: function showEmbed(){ if($("#test").css('display') == 'block'){ $("#test").css('display','none'); } else { $("#test").css('display', 'block'); } } Gk___ 2009/10/16 ngreenwood6 : > >

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

2009-10-04 Thread Flo
Hi, You can also do this using this plugin : http://plugins.jquery.com/files/jquery.event.hover.js.txt, which overloads the jQuery 'hover' event (just like hoverIntent, but it's smaller). Works fine, and you can tweak it. Flo

[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 $('a[id

[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 on radio button click

2009-08-04 Thread Jules
This should works not sure about the performance though $(function() { $('p').next('ul').hide(); //hide donation choice children $('input[name="donate_by"]').click(function() { //donation choice radio button click $(this).next().css('font-weight','

[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 m

[jQuery] Re: show hide random rows

2009-03-19 Thread Scott Sauyet
Sean O wrote: 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... Yeah, we've got to wonder... :-) I will expect at least as much code and analysis for my next posted problem! If I'm payi

[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 http://twitter.com/se

[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 duplicat

[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
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 more

[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 w

[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
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 m

[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 wrote: > Tried something like this? > > $("legend").click(function() { $("fieldset ul").toggle(); }); > > On Mar 15, 2009, at 10:40 AM, shapper

[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: Personal Data first element second element

[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 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 wrote: > > I have a table with multiple TDs (with different

[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 diffe

[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 wrote: >> You're best served doing that simply with a CSS pri

[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 wrote: > You're best served doing that simply with a CSS print stylesheet. > > Just add: > > and set all elements you don't want to print to "display: none". > > Here's an Oldie-but-Goodie g

[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: 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: http://www.alistapart.com/articles/goingtoprint/ HTH, SEAN O http://www.sean-o.com http://twit

[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 wrote: > great! but the important part: is it a nice or a bad puppy? > > - 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,

[jQuery] Re: Show/Hide Menu

2009-03-03 Thread Jack Killpatrick
great! but the important part: is it a nice or a bad puppy? - 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 wrote: Here's an example of a way to handle that: http://www.

[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 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 wrote: > > T

[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
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 disappear

[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 ha

[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 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 with toggle() but

[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(); } ); }); On Feb 26, 11:33 am, introvert wrote: > Hello > > I have a simple div inside which I want to show an image on hover > (rollov

[jQuery] Re: Show/Hide Toggle Table

2009-01-10 Thread seasoup
Also, instead of writing a different jQuery command for each thing you want to hide, if you write the html consistently, which it looks like you are doing through loops, then you can do something like: $('tr.task_header').next().click( function() { $(this).toggle(); } Which isn't the exact co

[jQuery] Re: Show/Hide Toggle Table

2009-01-10 Thread cherry.aus...@gmail.com
cool :) On Jan 10, 10:55 pm, mark wrote: > You were spot on. Thanks for your help! > > On Jan 11, 8:17 am, "cherry.aus...@gmail.com" > > wrote: > > Hi. I confess I didn't read your code very thoroughly, but it looks > > like it might be as simple as repeated IDs. You can only have one > > insta

[jQuery] Re: Show/Hide Toggle Table

2009-01-10 Thread nood
Have you checked this works in all browsers? I've tried something similar with hiding table cells before and it didn't work across the board. On Jan 10, 1:06 pm, mark wrote: > Hey Guys, I'm new to jquery, and haven't much experience with > javascript. I'm trying to toggle a few rows on a table w

[jQuery] Re: Show/Hide Toggle Table

2009-01-10 Thread mark
You were spot on. Thanks for your help! On Jan 11, 8:17 am, "cherry.aus...@gmail.com" wrote: > Hi. I confess I didn't read your code very thoroughly, but it looks > like it might be as simple as repeated IDs. You can only have one > instance of each ID per page. Try changing it to a class (or ad

[jQuery] Re: Show/Hide Toggle Table

2009-01-10 Thread cherry.aus...@gmail.com
Hi. I confess I didn't read your code very thoroughly, but it looks like it might be as simple as repeated IDs. You can only have one instance of each ID per page. Try changing it to a class (or adding an iterator to each ID). Sorry if this isn't the right answer? Cherry. On Jan 10, 1:06 pm, mar

[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 pla

[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'

[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

[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 is

[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 V

[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 { $(this.hide()

[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. :) No

[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. 'slo

[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 this

[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: > > $(this)

[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 abo

[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/ hide

[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 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, Mor

[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 o

[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 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

[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. ~ ~ D

[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.id&&this.id.length>0){ var engName=this.id.substring('showhide_'.length); $("div#block_"+engName+" > div").toggle(); } }); On

[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 c

[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 the

[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 do

[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 shoul

[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 form').hide();

[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 e

[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: > > $('div

[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 for

[jQuery] Re: show/hide nested divs?

2008-04-24 Thread thekman
Hi Shawn, got it with: $(this).parent().siblings(".boxcontent").hide(); thanks... On Apr 24, 1:54 pm, thekman <[EMAIL PROTECTED]> wrote: > 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 id="box_1

[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 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 <[EMAIL PROTECTED]> wr

[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 <[EMAI

[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: Box Title Box Title b

[jQuery] Re: show/hide nested divs?

2008-04-23 Thread Shawn
$(".closeimage_left").click( function () { $(this).siblings(".boxcontent").hide(); }); That *should* do the trick. Shawn thekman wrote: Hi all, I have code something like: Box Title Box Title box content... Box Title Box Title box content... All numbers are dynamical

[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]> wr

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

2007-12-11 Thread Ryan
Thanks for trying Glen, I really appreciate it. I'm still having the same difficulty with your solution as with mine. The problem isn't when selecting Input 1 or Input 2, the problem comes when deselecting just one of those. I'm looking to have div1 continue to appear when just one them are des

[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 p

[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 m

[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-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 time

[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, ge

[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 remai

[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

[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 eit

[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 $("#yourID").dos

[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

[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

[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

  1   2   >