Hi There. Yeah, just did. Thanks for that!

Why does my test using the same code not work???? :(

http://www.noosabiosphere.org.au/tester.htm

On Oct 9, 8:46 am, Charlie <charlie...@gmail.com> wrote:
> did you look at the working example on jsbin where the li is being hidden?
> Wacko Jacko wrote:Thanks Bohdan. Tried that first. No luck. As I said, it 
> will work if the parent is a div, but not if the parent of the div is an li. 
> Thanks again. Jack On Oct 8, 5:56 pm, Bohdan 
> Ganicky<bohdan.gani...@gmail.com>wrote:Hi, use .parent() instead of 
> .parents()http://jsbin.com/isasi/-- Bohdan On Oct 8, 6:17 am, Wacko 
> Jacko<jackson.be...@gmail.com>wrote:I am having a bit of trouble with this 
> one. Thanks for your help. I could get it working if the parent is a <div> 
> but not if it's an <li>.Here's my html:<ul class="member-table">         <li> 
>         <div><strong>Why I am involved:</strong></div>         <div 
> class="answer">{tag_why are you involved?}</div>     </li>         <li>       
>   <div><strong>Current projects & activities:</strong></div>         <div 
> class="answer">{tag_current projects}</div>     </li>         <li>         
> <div><strong>My relevant experience:</strong></div>         <div 
> class="answer">{tag_relevant experience}</div>     </li> </ul>Here's my 
> jQuery:$('.answer').each(function() {         if ($(this).text() == "") {     
>         $(this).parents().hide();         }});You said to add ('ul .answer') 
> but this does not seem to make any difference. I really appreciate your help 
> on this.JackOn Oct 1, 3:34 pm, Wacko 
> Jacko<jackson.be...@gmail.com>wrote:Brilliant! I will try this and get back 
> to you.Thanks for your time!On Oct 1, 3:21 pm, Charlie 
> Griefer<charlie.grie...@gmail.com>wrote:Assuming you can turn those id's into 
> classes (where you have id="database")... you can do the 
> following:$(document).ready(function(){     $('ul .database').each(function() 
> {         if ($(this).text() == "") {             $(this).parent().hide();    
>      }     });});On Wed, Sep 30, 2009 at 10:14 PM, Charlie Griefer 
> <charlie.grie...@gmail.comwrote: If you're working with server side data like 
> that, couldn't you just write a conditional in whatever language you're using 
> (PHP, CF, ASP, etc) to not display the <li> if no data?Also, do you really 
> mean to re-use "database" as an ID for multiple elements?  ID's ought to be 
> unique.On Wed, Sep 30, 2009 at 9:43 PM, Wacko 
> Jacko<jackson.be...@gmail.com>wrote:Hi All,If I had a list displaying data as 
> follows:<ul>     <li id="item"><div>Label Here</div><div 
> id="database">{content here if available from database}</div></li>     <li 
> id="item"><div>Label Here</div><div id="database">{content here if available 
> from database}</div></li> </ul>Could I hide the whole <li id="item"></li> if 
> their is nothing available to show from the database in <div id="database"> 
> ?...
>
> read more »

Reply via email to