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
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
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()
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
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
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
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
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
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
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
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...
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
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
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:
>
>
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.
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
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
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
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 :
>
>
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
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
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
Hey Jules, thanks much, this works like a champ!
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','
$('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
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
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
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
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
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
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
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
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
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
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
> 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
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
> 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
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 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
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
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,
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.
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
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
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
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
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
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
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
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
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
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
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
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
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'
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
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
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
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()
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
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
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
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)
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
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
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
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
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();
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
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
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
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
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
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
$('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
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();
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
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
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
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
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
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
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
$(".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
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
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
> 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
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
> $("#"+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. :)
> 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.
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
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
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
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
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
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
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
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
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 - 100 of 119 matches
Mail list logo