We help IT Professionals succeed at work.

ASP.NET - Why is accordion not working?

Jhovyn Marcos
on
443 Views
Last Modified: 2017-03-29
I tried to make an accordion using Semantic UI in ASP.NET(MVC) but it is not working..Below is my code

@{
    ViewBag.Title = "Index";
}

<html>
<head>
    <title>MVC Semantic</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta http-equiv="Content-Style-Type" content="text/css" />

<script src="../../Scripts/jquery-3.1.1.min.js" type="text/javascript"></script>
<script src="../../semantic/minified/modules/accordion.js" type="text/javascript"></script>
<script src="../../semantic/packaged/javascript/semantic.min.js" type="text/javascript"></script>
<link href="../../semantic/minified/modules/accordion.min.css" rel="stylesheet" type="text/css" />

<script type="text/javascript" language='javascript'>
    $(document).ready(function () {

        $('.ui.accordion').accordion();
    });

</script>

</head>
<body>

<div class="ui accordion">
  <div class="active title">
    <i class="dropdown icon"></i>
    What is a dog?
  </div>
  <div class="active content">
    <p>A dog is a type of domesticated animal. Known for its loyalty and faithfulness, it can be found as a welcome guest in many households across the world.</p>
  </div>
  <div class="title">
    <i class="dropdown icon"></i>
    What kinds of dogs are there?
  </div>
  <div class="content">
    <p>There are many breeds of dogs. Each breed varies in size and temperament. Owners often select a breed of dog that they find to be compatible with their own lifestyle and desires from a companion.</p>
  </div>
  <div class="title">
    <i class="dropdown icon"></i>
    How do you acquire a dog?
  </div>
  <div class="content">
    <p>Three common ways for a prospective owner to acquire a dog is from pet shops, private owners, or shelters.</p>
    <p>A pet shop may be the most convenient way to buy a dog. Buying a dog from a private owner allows you to assess the pedigree and upbringing of your dog before choosing to take it home. Lastly, finding your dog from a shelter, helps give a good home to a dog who may not find one so readily.</p>
  </div>
</div>

</body>
</html>

Open in new window

Please help me :(
Comment
Watch Question

Prakash SamariyaIT Professional
CERTIFIED EXPERT
Top Expert 2015

Commented:
Please change the sequence of script like below and try:
 <script src="../../semantic/packaged/javascript/semantic.min.js" type="text/javascript"></script>
<script src="../../semantic/minified/modules/accordion.js" type="text/javascript"></script>

Author

Commented:
Thank you for the time @Prakash Samariya but it is not working.. See my code below

<script src="../../Scripts/jquery-3.1.1.min.js" type="text/javascript"></script>
<script src="../../semantic/packaged/javascript/semantic.min.js" type="text/javascript"></script>
<script src="../../semantic/minified/modules/accordion.js" type="text/javascript"></script>
<link href="../../semantic/minified/modules/accordion.min.css" rel="stylesheet" type="text/css" />

Open in new window

IT Professional
CERTIFIED EXPERT
Top Expert 2015
Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.