Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Closing DIV's when another one opens

Featured Replies

Hello All at WDF!

 

I have seen this link:

 

http://www.brenz.net/snippets/open_close_div.asp

 

It show's opening and closing div's which is something that I am after for a website. However I want to know how I can make the divs close when another one opens?

 

Is is easy to do along with the code on that site, just a I'm a little weak in jquery.

  • Author

It sounds like you are after jQuery UI Accordion.

 

That is what I want! But can I make it so the links are external, instead of in the header's of each section?

  • Author

Right the code on the accordion Jquery is working but I want it to be displayed in different part's of the site. So Ideally have all the heading's inline, and then the div's below.

 

The format that has to be used is:

 

<h3>heading</h3>
<div>content</div>
<h3>heading</h3>
<div>content</div>
<h3>heading</h3>
<div>content</div>

 

but I want to do, so I can display all the heading's inline:

 

 

<h3>heading</h3>
<h3>heading</h3>
<h3>heading</h3>
<div>content</div>
<div>content</div>
<div>content</div>

 

 

Any Ideas?

  • 2 weeks later...

You could probably keep it semantic but fiddle around with the CSS to make it work the same way as the non-semantic method. Which would be much better for SEO. Think along the lines of absolute positioning for the content.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.