Jump to content

Search the Community

Showing results for tags 'appendto'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. I've been trying to append an element to the bottom of another using jquery; however, it does not work. Here is my code: <?php $currentPath = $this->getCurrentPath(); $currentCategory = Mage::registry('current_category'); ?> <script type="text/Javascript"> jQuery(document).ready(function(){ $(".childnav").appendTo(".catalognav"); }); </script> <ul class="catalognav"> <?php foreach ($this->getCategories() as $category): ?> <li> <a<?php if ($currentCategory->getId() == $category->getId()): ?> class="selected" <?php endif ?> href="<?php echo $category->getUrl() ?>"><?php echo $category->getName() ?></a> </li> <li><span>/</span></li> <?php if ($currentCategory->getId() == $category->getId() || in_array($category->getId(), $currentPath)): ?> <ul class="childnav"> <?php foreach ($this->getSubcategories($category->getId()) as $subcategory): ?> <li><a<?php if ($currentCategory->getId() == $subcategory->getId()): ?> class="selected" <?php endif ?> href="<?php echo $subcategory->getUrl() ?>"><?php echo $subcategory->getName() ?></a></li> <li><span>/</span></li> <?php endforeach ?> </ul> <?php endif ?> <?php endforeach ?> </ul> Basically nothing happens. What I get is this: <ul class="catalognav"> <li> <a class="selected" href="#">Tops /</a> </li> <ul class="childnav"> <li><a href="#">Shirts /</a></li> <li><a href="#">Sweaters /</a></li> <li><a href="#">Tees /</a></li> <li><a href="#">Hoodies and Sweatshirts /</a></li> </ul> <li> <a href="#">Denim /</a> </li> <li> <a href="#">Outerwear /</a> </li> </ul> What I want is: <ul class="catalognav"> <li> <a class="selected" href="#">Tops /</a> </li> <li> <a href="#">Denim /</a> </li> <li> <a href="#">Outerwear /</a> </li> <ul class="childnav"> <li><a href="#">Shirts /</a></li> <li><a href="#">Sweaters /</a></li> <li><a href="#">Tees /</a></li> <li><a href="#">Hoodies and Sweatshirts /</a></li> </ul> </ul> Hopefully that made sense. Thanks for any help in advanced!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.