Solved

Accordion js - Need expanded accordion to stay open as I click each <li> within the <ul>

Posted on 2013-02-04
12
358 Views
Last Modified: 2013-02-05
http://www.guestservices.com/ourplanet_DRAFT2.html

On the above page I'd like to be able to click in the Green Initiatives on Columbia Island Marina and the menu stay expanded until I click another area

As it stands it refreshes, making the Green Team expand - I want it to stay on the Green Initiatives expansion after I click any of the li's within that accordion
jquery-1.7.1.min.js
jquery-ui-1.8.17.custom.min.js
script.js
html5.js
style.css
0
Comment
Question by:RickardP_GSI
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5
12 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
ID: 38853246
Add the following code after creating the accordion :
$("a[href!='#']", "#pro_accordion").click(function(evt) { 
         evt.preventDefault();
         $.get($(this).attr("href"),function(data) {
                $(".extra-wrap:last").replaceWith($(".extra-wrap:last", data));
         });
});

Open in new window

0
 

Author Comment

by:RickardP_GSI
ID: 38855973
in which file?
0
 
LVL 82

Expert Comment

by:leakim971
ID: 38856091
in the file where you're creating the accordion
0
Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

 

Author Comment

by:RickardP_GSI
ID: 38856198
Perfect!!!!  That works great - thank you so much!

Now if you look at:
http://www.guestservices.com/ourplanet_DRAFT2.html

and click on Columbia Island Marina (under Green Initiatves)
works great

then move your mouse to the left side of the page (where the logo is) and the middle content disappears
0
 

Author Comment

by:RickardP_GSI
ID: 38857088
Should I make that a separate ticket?
0
 
LVL 82

Expert Comment

by:leakim971
ID: 38857100
Sorry I can reproduce the bug.
0
 

Author Comment

by:RickardP_GSI
ID: 38857184
of course it's only doing it in IE9 - I checked FF, chrome, opera and it works fine in all those browsers
0
 
LVL 82

Expert Comment

by:leakim971
ID: 38857200
and before adding the code it don't do that?
work fine on IE10...
0
 

Author Comment

by:RickardP_GSI
ID: 38857299
Honestly I dont know if it was doing that before adding the code - the code could have nothing to do with it - that's why I'm saying you can keep this ticket or I open a new one - because it most likely is a separate issue - thoughts?
0
 
LVL 82

Expert Comment

by:leakim971
ID: 38857314
yes create a new one, thanks
0
 

Author Comment

by:RickardP_GSI
ID: 38857327
ok i'm doing that now
0
 

Author Comment

by:RickardP_GSI
ID: 38857362
named:

Disappearing Text when Mouse moves over content
0

Featured Post

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Suggested Courses

617 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question