[jQuery] Re: having a hard time finding the parent...

2009-07-09 Thread Vaskerville

$('#' + obj.id).parent().find('.section-secondary').length;

Yes...that is what basically ended up going the trick. I needed to be
a bit more specific. What I realized was that I didn't need the
entired of the particular ul group because each subgroup indicates the
'section-secondary'. Confusing...now it works perfectly.

Above, I'm just checking to see if the result (length) is more than
zero...

Many thanks!


On Jul 8, 3:16 pm, BaBna thomas.na...@gmail.com wrote:
 What about $('li.active').parents(ul).find(.whatever)?

 On Jul 8, 2:10 pm, vaaaska vask...@gmail.com wrote:



  Haha...nice title? ;)

  I have this list structure and when the page loads I reveal the active
  page...all the other pieces are revealed when you click. Everything
  works great except this one detail.

  I need to run a check (a filter?) to see if the active list element
  exists in a 'secondary' list (nested ul). If it does, I need to
  activate another piece of code to display the secondary list titles
  (and this is working as well). Just need to run a check so I know when
  to run this extra code.

  I can get the parent of the active list element and even the html
  within it no problem...but I actually need to go up an additional
  parent or two (ul's) so I can get the code for the entire section and
  then filter to see if it is in fact it has the secondary pieces. This
  is the list...

  ul id='section-id-16' class='section-menu'
  li class='section-title section-primary'span class='blank-title'
  id='t2'// Editorial/span

  ul
  li class='section-title section-tag section-secondary'span
  class='blank-tag'Secondary List Title/span
  ul
  li class='section-page active'a href='/newby-layout/'Newby Layout/
  a/li
  li class='section-page'a href='/notes/'Notes/a/li
  li class='section-page'a href='/qs-for-dan/'Q's for Dan/a/li
  li class='section-page'a href='/project/print/testing-
  formats/'Testing Formats/a/li
  /ul
  /li
  /ul

  ul
  li class='section-title section-tag section-secondary'span
  class='blank-tag' id='Herewerare'Herewerare/span
  ul
  li class='section-page'a href='/newest-year/'
  class='herewerare'Newest Year/a/li
  /ul
  /li
  /ul

  Etc...

  I've tried $('li.active').parent() and $('li.active').parents() (and
  tons of variations) but I just can not get the html beyond the first
  parent. I'm not showing the full index here...it's quite long...but it
  does validate and check out just fine.

  Any ideas?

  Thanks


[jQuery] How does clone() work?

2008-11-28 Thread Vaskerville


I'm having the worst time working with clone(). It returns an object...still
can't access it.

What I'm doing is looping through a list of divs (same class) and trying to
clone each one. I want to clone them so that I can reorder them.

var html;

// in the loop
html += $('#myDiv-' + id).clone();

Is what I think should work...but I just get objects.

Any tips here on this one?

Thanks
-- 
View this message in context: 
http://www.nabble.com/How-does-clone%28%29-work--tp20731606s27240p20731606.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: How does clone() work?

2008-11-28 Thread Vaskerville


Yes, it didn't make sense...I found out the hard way after getting though
things that clone() was the wrong way to go. But, at least I learned how it
worked...another nice Jquery tool.

I ended up simply using the div id's and prependTo() to work things out.

Thanks



Vaskerville wrote:
 
 I'm having the worst time working with clone(). It returns an
 object...still can't access it.
 
 What I'm doing is looping through a list of divs (same class) and trying
 to clone each one. I want to clone them so that I can reorder them.
 
 var html;
 
 // in the loop
 html += $('#myDiv-' + id).clone();
 
 Is what I think should work...but I just get objects.
 
 Any tips here on this one?
 
 Thanks
 

-- 
View this message in context: 
http://www.nabble.com/How-does-clone%28%29-work--tp20731606s27240p20736536.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.