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
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
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
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.
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'){
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
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
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
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(){
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
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...
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
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
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:
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
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
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') ==
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
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,
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
Hey Jules, thanks much, this works like a champ!
$('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
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
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
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
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
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
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
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
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
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
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
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
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
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 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 {
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
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
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:
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
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.
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
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/
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
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,
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();
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,
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
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
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
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
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:
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
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
$('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
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
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
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
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
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
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]
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
$(#+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.
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
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
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
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
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
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
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
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
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
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
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
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
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
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'],
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]
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
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
Marc Jansen wrote:
var $possibleOptsRight;
$( document ).ready(function() {
$possibleOptsRight = $('#rightselectlist option');
$( '#leftselectlist' ).bind('change', function() {
$('#rightselectlist')
.children().remove().end()
.append( $possibleOptsRight ).children()
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
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
I ran you code in FireFox and in IE6 and recieved no such error.
~Sean
1 - 100 of 104 matches
Mail list logo