It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How do I indent a side menu using javascript

How do I indent a side menu as shown in the url's of http://www.fundimjanja.com/index.php?page_id=7&pcat=17, I am fetching information from a db, using the code

<td>
<select size="30" id = "cats" ONCHANGE="location = this.options[this.selectedIndex].value;">
<option value="0" disabled="disabled" >Fundi Category</option>
<?php
$i = 0;
foreach ( $category as $categories):
?>

<option value="<?php echo $categories->id; ?>" id= "category" ><?php echo $categories->name; ?></option>

<?php
foreach($subcategory as $subcategories):
if($subcategories->category_id == $categories->id):
?>
<option value="index.php?option=com_category&view=components&cartId=<?php echo $subcategories->id; ?>" id="subcategories" onload="Hide()"><?php echo $subcategories->name; ?></option>
<?php
endif;
endforeach;
?>
<?php
$i++;
endforeach;
?>
</select>
</td>

1 answer

1 accepted

0 votes
Answer accepted

Well you can use CSS instead of Java Script, either way is your choice.

If you want to use Java Script, You may create a function for it and call this function on the tags related to the menu.

A good method you can use is splice(). Here you have a complete example of that: http://stackoverflow.com/questions/1250639/indent-selected-text-with-javascript

Although if you decide to use CSS the text-indent can do the job: http://help.dottoro.com/ljxeqklb.php

Hope it helps!

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Jira Align

Best Practices in Jira Align

Hello Jira Align customers! In order to better serve you on your journey with Jira Align, the Community team has worked with the Jira Align team to curate the content in this collection to better s...

44 views 0 2
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you